:root {
    /* Sidebar Dark */
    --sidebar-bg: #1e2530;
    --sidebar-bg-hover: #2a3441;
    --sidebar-border: #2d3848;
    --sidebar-text: #8b95a5;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(9, 122, 166, 0.15);

    /* Light Theme */
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;

    /* Text Colors - Shorthand aliases */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* ================================================================
   APP LAYOUT
   ================================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ================================================================
   SIDEBAR - Premium Dark Theme
   ================================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: #1e2530;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 20px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--color-primary-500);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #4A5568;
    border-radius: 0;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #718096;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 16px;
    opacity: 0.6;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    margin-bottom: 4px;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-bg-hover);
    color: var(--sidebar-text-hover);
    text-decoration: none;
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--color-primary-400);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--color-primary-500);
}

.nav-item i {
    font-size: 18px;
    width: 22px;
    display: flex;
    justify-content: center;
}

.nav-badge {
    margin-left: auto;
    background: var(--color-primary-500);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 0;
    min-width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.page-content {
    padding: 28px 32px;
}

@media (max-width: 768px) {
    .page-content {
        padding: 20px 16px;
    }
}

/* ================================================================
   TOP HEADER - Premium Style
   ================================================================ */
.top-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 0;
    cursor: pointer;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-search {
    position: relative;
    width: 280px;
}

.header-search input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 44px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.header-search input:focus {
    outline: none;
    background: var(--bg-card);
    border-color: var(--color-primary-500);
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.header-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-btn:hover {
    background: var(--bg-main);
    border-color: var(--color-primary-300);
    color: var(--color-primary-600);
}

.header-btn i {
    font-size: 18px;
}

.notification-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 0;
    border: 2px solid var(--bg-card);
}

/* Language Switcher Button */
.language-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 0 12px;
}

.language-btn .lang-flag {
    font-size: 16px;
    line-height: 1;
}

.language-btn .lang-code {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.dropdown-item.active {
    background: var(--color-primary-50);
    color: var(--color-primary-600);
}

.dropdown-item .lang-flag {
    font-size: 18px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 6px;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid transparent;
}

.user-menu:hover {
    background: var(--bg-main);
    border-color: var(--border-color);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 0;
    background: var(--color-primary-500);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.user-menu-chevron {
    color: var(--text-muted);
    font-size: 12px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    padding: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0;
    display: block;
    /* Override Bootstrap's display: none */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1050;
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.dropdown-item i {
    font-size: 16px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1025;
}

.sidebar-overlay.show {
    display: block;
}

/* RESPONSIVE LAYOUT */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-search {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }
}

@media (max-width: 576px) {
    .user-info {
        display: none;
    }

    .user-menu-chevron {
        display: none;
    }
}