:root {
    --sb-green: #2271b1;
    --sb-green-dark: #135e96;
    --sb-yellow: #f0c419;
    --sb-dark: #1d2327;
    --sb-surface: #ffffff;
    --sb-bg: #f0f0f1;
    --sb-border: #dcdcde;
    --sb-sidebar: #1d2327;
    --sb-sidebar-hover: #2c3338;
    --sb-sidebar-active: #2271b1;
    --sb-text-muted: #646970;
}

.app-body {
    background-color: var(--sb-bg);
    background-image: none;
    min-height: 100vh;
    color: #1d2327;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#appShell {
    min-height: 100vh;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    max-width: 460px;
    width: 100%;
    border-radius: 1.5rem;
}

.auth-kicker,
.hero-kicker,
.brand-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--sb-sidebar-active);
}

.sidebar {
    flex: 0 0 320px;
    width: 320px;
    max-width: 320px;
    background: var(--sb-sidebar);
    border-right: 1px solid #101517;
    overflow: hidden;
    min-height: 100vh;
    color: #f0f0f1;
}

.brand-strip {
    padding: 1.5rem 1.5rem 1.35rem;
    background: #151b1f;
    color: #fff;
    border-bottom: 1px solid #2c3338;
}

.sidebar .offcanvas-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
    background: var(--sb-sidebar);
}

.admin-logo {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: #000;
}

.sidebar-nav .nav-link {
    display: block;
    color: #f0f0f1;
    padding: 0.8rem 1.25rem;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.92rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1 1 auto;
    padding: 0.55rem 0 0;
    background: var(--sb-sidebar);
}

.sidebar-group {
    padding: 0.2rem 0 0.35rem;
    background: var(--sb-sidebar);
}

.sidebar-group-label {
    color: #8c8f94;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.7rem 1.25rem 0.35rem;
    text-transform: uppercase;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: 0;
    text-align: left;
}

.sidebar-group-label.is-active {
    color: #f0f0f1;
}

.sidebar-nav .nav-sublink {
    font-size: 0.88rem;
    padding-left: 1.8rem;
    color: #c3c4c7;
}

.sidebar-group-caret {
    font-size: 0.85rem;
    transition: transform 160ms ease;
}

.sidebar-group.is-collapsed .sidebar-group-caret {
    transform: rotate(-90deg);
}

.sidebar-group.is-collapsed .sidebar-group-links {
    display: none;
}

.sidebar-nav .nav-sublink.is-active {
    color: #fff;
    background: var(--sb-sidebar-active);
}

.sidebar-nav .nav-link.is-active {
    color: #fff;
    background: var(--sb-sidebar-active);
    box-shadow: inset 4px 0 0 #72aee6;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link:focus {
    color: #fff;
    background: var(--sb-sidebar-hover);
}

.sidebar-logout {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logout-form {
    margin-top: auto;
}

.sidebar-logout-button {
    width: 100%;
    background: transparent;
    border-right: 0;
    border-left: 0;
    border-bottom: 0;
    text-align: left;
    cursor: pointer;
    color: #f0f0f1 !important;
}

.sidebar-nav .nav-link[href$="logout.php"] {
    color: #f0f0f1 !important;
}

.main-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: #fff;
    min-height: 60px;
    border-bottom: 1px solid var(--sb-border);
}

.content-wrap {
    background: var(--sb-bg);
    min-height: calc(100vh - 72px);
    padding: 1.15rem 1.5rem 1.5rem !important;
}

.hero-panel {
    background: #fff;
    color: #1d2327;
    padding: 1.35rem 1.5rem;
    border: 1px solid var(--sb-border);
    border-left: 4px solid var(--sb-sidebar-active);
    border-radius: 0;
    box-shadow: none;
}

.stat-card {
    background: var(--sb-surface);
    border-radius: 0;
    padding: 1.25rem 1.35rem;
    box-shadow: none;
    border: 1px solid var(--sb-border);
    border-top: 0;
}

.stat-card.muted {
    border-top: 0;
}

.stat-card span {
    display: block;
    color: var(--sb-text-muted);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.stat-card h2 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 600;
}

.btn-brand {
    background: var(--sb-sidebar-active);
    border: 1px solid var(--sb-sidebar-active);
    color: #fff;
    font-weight: 600;
    border-radius: 3px;
}

.btn-brand:hover {
    color: #fff;
    background: #135e96;
    border-color: #135e96;
}

.avatar-sm {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.topbar-logo {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #dcdcde;
    background: #000;
}

.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sb-sidebar-active);
    color: #fff;
    font-weight: 700;
}

.table thead th {
    color: var(--sb-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f6f7f7;
    border-bottom-width: 1px;
}

.wp-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.wp-status-tabs a {
    color: #6b7280;
    font-weight: 600;
    text-decoration: none;
}

.wp-status-tabs a.active {
    color: var(--sb-sidebar-active);
}

.wp-status-tabs span {
    color: #9ca3af;
}

.wp-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.wp-row-actions a,
.wp-row-actions .btn-link {
    text-decoration: none;
}

.wp-editor-area {
    min-height: 420px;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.65;
}

.dashboard-list li + li {
    margin-top: 0.95rem;
}

.advert-thumb {
    width: 96px;
    height: 64px;
    object-fit: cover;
    flex: 0 0 auto;
}

.role-permission-card {
    display: block;
    border: 1px solid #dbe4ee;
    border-radius: 0.9rem;
    padding: 0.9rem 1rem;
    background: #fff;
    cursor: pointer;
    height: 100%;
}

.role-permission-card input {
    margin-right: 0.55rem;
}

.wp-editor-shell {
    border: 1px solid #d7dee7;
    border-radius: 0;
    overflow: hidden;
}

.wp-editor-mode-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid #d7dee7;
    background: #f6f7f7;
}

.wp-editor-mode {
    border: 0;
    background: transparent;
    padding: 0.7rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #50575e;
}

.wp-editor-mode.is-active {
    background: #fff;
    color: #1d2327;
    box-shadow: inset 0 -2px 0 var(--sb-sidebar-active);
}

.wp-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.85rem;
    background: #f8fafc;
    border-bottom: 1px solid #d7dee7;
}

.wp-editor-shell .wp-editor-area {
    border: 0;
    border-radius: 0;
}

.wp-editor-visual {
    min-height: 420px;
    padding: 1rem;
    background: #fff;
    line-height: 1.65;
    outline: none;
}

.card {
    border-radius: 0 !important;
    border: 1px solid var(--sb-border) !important;
    box-shadow: none !important;
}

.card-header,
.card-body {
    background: #fff;
}

.text-white-50 {
    color: #646970 !important;
}

.topbar .text-white,
.topbar .fw-semibold {
    color: #1d2327 !important;
}

.wp-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f6f7f7;
    border-bottom: 1px solid var(--sb-border);
}

.wp-bulk-bar-bottom {
    border-top: 1px solid var(--sb-border);
    border-bottom: 0;
}

.wp-bulk-select {
    min-width: 160px;
    border-radius: 3px;
}

.wp-list-table td,
.wp-list-table th {
    vertical-align: top;
}

.check-column {
    width: 40px;
    text-align: center;
    padding-left: 0.75rem !important;
    padding-right: 0.25rem !important;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.media-card {
    overflow: hidden;
}

.media-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f6f7f7;
    border-bottom: 1px solid var(--sb-border);
}

.media-usage {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.topbar + .content-wrap > .card:first-child,
.topbar + .content-wrap > .hero-panel:first-child,
.topbar + .content-wrap > .row:first-child .hero-panel:first-child {
    margin-top: 0;
}

.content-wrap .card,
.content-wrap .hero-panel,
.content-wrap .table-responsive,
.content-wrap .wp-bulk-bar {
    border-radius: 0;
}

@media (max-width: 991.98px) {
    .sidebar {
        width: 290px;
        max-width: 290px;
        flex-basis: 290px;
        min-height: 100%;
    }

    .content-wrap {
        padding: 1rem !important;
    }

    .sidebar .offcanvas-body {
        min-height: 100%;
    }
}
