
    /* ===== SHARED THEME VARIABLES (dark mode) ===== */
    :root {
        --dark-bg: var(--navy-900,#0d1b2a);
        --accent: var(--brand-400,#00d084);
        --accent-dark: var(--brand-700,#00b070);
        --accent-light: rgba(0, 208, 132, 0.12);
        --card-radius: 16px;
        --transition: all 0.3s ease;

        --page-bg: #f8f9fa;
        --surface: #ffffff;
        --surface-alt: #f8fafb;
        --surface-hover: #f1f5f9;
        --text-primary: var(--navy-900,#0d1b2a);
        --text-secondary: #475569;
        --text-tertiary: #64748b;
        --text-faint: #6b7a90;
        --border-color: #e8ecf0;
        --border-color-alt: #e0e6ed;
        --text: var(--text-primary);
        --border: var(--border-color);
    }

    :root[data-theme="dark"] {
        --page-bg: #0a1420;
        --surface: #101c2c;
        --surface-alt: #0d1826;
        --surface-hover: #17263a;
        --text-primary: #eef2f7;
        --text-secondary: #c3ceda;
        --text-tertiary: #9fadbd;
        --text-faint: #7c8ba0;
        --border-color: #223349;
        --border-color-alt: #1b293c;
        --accent-light: rgba(0, 208, 132, 0.16);
    }

    :root[data-theme="dark"] .bg-white {
        background-color: var(--surface) !important;
    }

    :root[data-theme="dark"] .text-muted {
        color: var(--text-tertiary) !important;
    }

    :root[data-theme="dark"] hr {
        border-color: var(--border-color);
    }

    /* ===== TOP NAVBAR ===== */
    .cc-top-navbar {
        background-color: var(--dark-bg) !important;
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 4000;
        box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    }

    .cc-top-navbar .navbar-brand {
        color: white;
        font-weight: 800;
        font-size: 1.4rem;
        letter-spacing: -0.5px;
    }

    .cc-top-navbar .search-wrapper { position: relative; max-width: 420px; width: 100%; }
    .cc-top-navbar .search-input {
        background-color: rgba(255, 255, 255, 0.1);
        border: 1.5px solid rgba(255, 255, 255, 0.15);
        color: white;
        border-radius: var(--radius-pill,999px);
        padding: 0.6rem 3rem 0.6rem 1.25rem;
        width: 100%;
        font-family: 'Inter', sans-serif;
        font-size: 0.9rem;
        transition: var(--transition);
    }
    .cc-top-navbar .search-input::placeholder { color: rgba(255, 255, 255, 0.5); }
    .cc-top-navbar .search-input:focus {
        outline: none; border-color: var(--accent);
        background-color: rgba(255, 255, 255, 0.15); color: white;
    }
    .cc-top-navbar .search-btn {
        position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
        background: none; border: none; color: rgba(255, 255, 255, 0.7);
        font-size: 1.1rem; cursor: pointer; transition: var(--transition); padding: 0;
    }
    .cc-top-navbar .search-btn:hover { color: var(--accent); }

    .action-icon {
        color: white !important;
        font-size: 1.3rem;
        position: relative;
        margin-left: 1rem;
        text-decoration: none;
        transition: var(--transition);
    }
    .action-icon:hover { color: var(--accent) !important; }

    /* ===== THEME TOGGLE BUTTON ===== */
    .theme-toggle-btn {
        width: 36px; height: 36px; border-radius: 50%;
        border: 1.5px solid rgba(255, 255, 255, 0.15);
        background: rgba(255, 255, 255, 0.06);
        color: white; display: flex; align-items: center; justify-content: center;
        cursor: pointer; transition: var(--transition); font-size: 0.95rem; flex-shrink: 0;
    }
    .theme-toggle-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--dark-bg); }

    /* ===== USER ACCOUNT / NOTIFICATIONS DROPDOWN ===== */
    .user-menu {
        background: linear-gradient(165deg, #142a3d 0%, var(--navy-900,#0d1b2a) 55%, var(--navy-900,#0d1b2a) 100%) !important;
        border-radius: var(--radius-lg,16px) !important;
        overflow: hidden;
        padding: 0 !important;
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
    }
    .user-menu-header {
        padding: 18px 18px 16px;
        background: linear-gradient(135deg, rgba(0, 208, 132, 0.14), rgba(0, 208, 132, 0.02));
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        display: flex; align-items: center; gap: 12px;
    }
    .user-menu-avatar {
        width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
        object-fit: cover; border: 2px solid rgba(0, 208, 132, 0.5);
    }
    .user-menu-avatar-fallback {
        width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
        background: var(--brand-600,#00a86b);
        display: flex; align-items: center; justify-content: center;
        font-weight: 800; font-size: 1.05rem; color: var(--navy-900,#0d1b2a);
        border: 2px solid rgba(0, 208, 132, 0.5);
    }
    .user-menu-name {
        font-size: 0.92rem; font-weight: 700; color: white; line-height: 1.3;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .user-menu-email {
        font-size: 0.7rem; color: rgba(255, 255, 255, 0.45);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    /* Tall menus stay inside the screen and scroll on their own instead of
       letting the page behind scroll. */
    .user-menu.show { display: flex; flex-direction: column; max-height: calc(100vh - 160px); }
    .user-menu-header { flex-shrink: 0; }
    .user-menu-body { padding: 8px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
    .user-menu-item {
        display: flex; align-items: center; gap: 12px; padding: 9px 10px;
        border-radius: var(--radius,10px); text-decoration: none;
        transition: background 0.18s ease, transform 0.18s ease;
        border: none; background: transparent; width: 100%; text-align: left;
    }
    .user-menu-item:hover { background: rgba(255, 255, 255, 0.06); transform: translateX(2px); }
    .user-menu-icon {
        width: 36px; height: 36px; border-radius: var(--radius,10px);
        display: flex; align-items: center; justify-content: center;
        flex-shrink: 0; font-size: 0.95rem;
    }
    .user-menu-item-title { font-size: 0.83rem; font-weight: 600; color: white; line-height: 1.3; }
    .user-menu-item-sub { font-size: 0.68rem; color: rgba(255, 255, 255, 0.4); }
    .user-menu-divider { margin: 6px 10px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
    .user-menu-item.logout:hover { background: rgba(239, 68, 68, 0.12); }
    .user-menu-item.logout .user-menu-item-title { color: #f87171; }

    .user-dropdown-menu { z-index: 4001 !important; }

    /* ===== AUTH MODAL FIXES ===== */
    /* The auth modal body stays a light surface regardless of site theme
       (compact overlay, not page content) — pin its Bootstrap utility
       classes so the dark-mode overrides above don't wash it out. */
    .modal-content { background-color: #ffffff !important; }
    .modal .text-muted, .modal .text-dark, .modal label { color: #495057 !important; }
    .modal label.text-dark { color: #212529 !important; }
    .modal .form-control {
        background-color: #ffffff !important; color: #000000 !important;
        border: 1.5px solid #dee2e6 !important; border-left: none !important;
        padding-left: 0.5rem; font-family: 'Inter', sans-serif;
    }
    .modal .form-control:focus {
        border-color: var(--brand-400,#00d084) !important; box-shadow: none !important;
        color: #000000 !important; background-color: #ffffff !important;
    }
    .modal .input-group-text {
        background-color: #f8f9fa !important; border: 1.5px solid #dee2e6 !important; border-right: none !important;
    }
    .modal .input-group:focus-within .input-group-text,
    .modal .input-group:focus-within .form-control { border-color: var(--brand-400,#00d084) !important; }
    .modal .input-group-text:last-child { border-left: none !important; border-right: 1.5px solid #dee2e6 !important; }
    .modal .input-group:focus-within .input-group-text:last-child { border-color: var(--brand-400,#00d084) !important; }

    @media (max-width: 767px) {
        .cc-top-navbar .search-wrapper { display: none; }
    }

    /* ===== MOBILE NAV ICON ROW (theme / notifications / hamburger) =====
       Below the lg breakpoint the brand and this icon group wrap onto their
       own line (Bootstrap's .navbar sets flex-wrap: wrap, inherited by the
       .container-fluid row). Stretch that wrapped row to full width so the
       hamburger can be pushed to the far right while theme+notifications
       stay put on the left, and give it breathing room above the search bar. */
    @media (max-width: 991.98px) {
        .cc-top-navbar .nav-icon-group {
            width: 100%;
            margin-bottom: 0.6rem;
        }
        .cc-top-navbar .nav-hamburger-btn {
            margin-left: auto !important;
        }
        /* The notifications toggle sits near the left edge on mobile (theme
           + bell are left-aligned); anchoring the menu from the right pushes
           most of its 320px width off-screen to the left. Anchor from the
           left instead, where the free space actually is. */
        .cc-top-navbar .nav-notif-menu {
            position: fixed !important;
                left: 12px !important;
                right: 12px !important;
                width: auto !important;
                max-width: none !important;
                transform: none !important;
                inset-block-start: auto;
        }
    }

/* Keep the navbar search from overflowing its row on narrow screens */
.cc-top-navbar .search-input, .top-navbar .search-input { min-width: 0; box-sizing: border-box; }
