/* Student Portal v2.0 - Semantic Design System */
:root {
    /* Brand Colors - University Green */
    --brand-primary: #198754;
    /* Deep professional green to match logo */
    --brand-secondary: #0d6efd;
    /* Standard Blue */
    --brand-gradient: linear-gradient(135deg, var(--brand-primary), #20c997);

    /* Typography */
    --font-sans: 'Inter', 'Plus Jakarta Sans', sans-serif;

    /* Light Mode (High Contrast Professional) */
    --surface-1: #ffffff;
    --surface-2: #f4f6f8;
    /* Slightly deeper tone */
    --surface-glass: rgba(255, 255, 255, 0.7);
    /* More translucent */

    /* Request: Deep Charcoal & Slate Gray */
    --text-primary: #2D3436;
    --text-secondary: #636E72;

    --border-subtle: rgba(45, 52, 54, 0.1);
    /* Darker border for visibility */

    /* Soft Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);

    /* Status Colors */
    --success: #198754;
    --warning: #ffc107;
    --error: #dc3545;

    /* Compatibility with base.html legacy variables */
    --primary-color: var(--brand-primary);
    --bg-color: var(--surface-2);
    --text-color: var(--text-primary);
    --dark-text: #000000;
    --text-muted: var(--text-secondary);
    --card-bg: var(--surface-1);
    --border-color: var(--border-subtle);
    --subtle-bg: #e9ecef;
    --white: #ffffff;
    --footer-bg: #1a202c;

    /* --- NEW Dynamic Theming Variables (User Requested) --- */
    --bg-primary: #f8f9fa;
    /* Light main background */
    --bg-card: #ffffff;
    /* White card background for Light Mode */
    --text-main: #1a1a1a;
    /* Dark text for Light Mode */
    /* --text-muted is already defined above, but ensuring consistency */
    --card-border: 1px solid #dddddd;
    /* Visible border for Light Mode cards */
    --shadow-style: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Soft shadow for Light Mode */

    /* --- Chat Interface Variables (Light Mode) --- */
    --chat-bg: rgba(255, 255, 255, 0.95);
    --chat-header-bg: #ffffff;
    --chat-border: 1px solid #dddddd;
    --chat-incoming-bg: #e9ecef;
    --chat-incoming-text: #1a1a1a;
    --chat-outgoing-bg: #d1e7dd;
    --chat-outgoing-text: #0f5132;
    --chat-outgoing-text: #0f5132;
    --chat-input-bg: #ffffff;
    --chat-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* --- Landing Page Icon Variables (Light Mode) --- */
    --icon-bg-blue: #0d6efd;
    --icon-bg-orange: #fd7e14;
    --icon-bg-green: #198754;
    --icon-bg-purple: #6f42c1;
    --icon-fg: #ffffff;
    --action-card-text: #4b5563;

    /* --- MOBILE REFRESH VARIABLES --- */
    --mobile-nav-height: 70px;
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
    --card-radius: 15px;
    --font-size-base: clamp(0.9rem, 2.5vw, 1rem);
    --font-size-h1: clamp(1.5rem, 5vw, 2.2rem);
    --font-size-h2: clamp(1.25rem, 4vw, 1.8rem);
    --font-size-h3: clamp(1.1rem, 3.5vw, 1.5rem);
}

[data-theme="dark"] {
    /* Dark Mode (True Black) */
    --surface-1: #000000;
    /* True Black */
    --surface-2: #121212;
    /* Dark Gray Surface */
    --surface-glass: rgba(18, 18, 18, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-subtle: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.8);

    /* Compatibility Overrides for Dark Mode */
    --bg-color: var(--surface-2);
    --text-color: var(--text-primary);
    --dark-text: #ffffff;
    --text-muted: var(--text-secondary);
    --card-bg: #1e1e1e;
    /* Slightly lighter than surface-2 for cards */
    --subtle-bg: #181818;
    --border-color: var(--border-subtle);
    --footer-bg: #000000;

    /* --- NEW Dynamic Theming Overrides --- */
    --bg-primary: #121212;
    /* Dark main background */
    --bg-card: #1e1e1e;
    /* Dark card background */
    --text-main: #ffffff;
    /* White text for Dark Mode */
    --card-border: none;
    /* No border needed for Dark Mode cards usually, or keep subtle */
    --shadow-style: none;
    /* Deep or no shadow for Dark Mode */

    /* --- Chat Interface Variables (Dark Mode) --- */
    --chat-bg: rgba(255, 255, 255, 0.03);
    --chat-header-bg: rgba(0, 0, 0, 0.2);
    --chat-border: 1px solid rgba(255, 255, 255, 0.1);
    --chat-incoming-bg: rgba(255, 255, 255, 0.05);
    --chat-incoming-text: #ddd;
    --chat-outgoing-bg: rgba(40, 167, 69, 0.2);
    --chat-outgoing-text: #fff;
    --chat-input-bg: rgba(0, 0, 0, 0.2);
    --chat-shadow: none;

    /* --- Landing Page Icon Variables (Dark Mode) --- */
    --icon-bg-blue: rgba(13, 110, 253, 0.2);
    --icon-bg-orange: rgba(253, 126, 20, 0.2);
    --icon-bg-green: rgba(25, 135, 84, 0.2);
    --icon-bg-purple: rgba(111, 66, 193, 0.2);
    --icon-fg: #ffffff;
    --action-card-text: #a0a0a0;
}

/* Base Reset & Typography */
body {
    background-color: var(--surface-2);
    background-image:
        radial-gradient(at 0% 0%, rgba(25, 135, 84, 0.08) 0px, transparent 55%),
        radial-gradient(at 100% 0%, rgba(25, 135, 84, 0.08) 0px, transparent 55%),
        radial-gradient(at 50% 50%, rgba(25, 135, 84, 0.03) 0px, transparent 80%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100%;
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

/* --- QUICK ACTIONS PREMIUM --- */
.quick-actions-grid-premium {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    /* Force 4 columns */
    gap: 0.75rem;
    width: 100%;
}

.action-card-square {
    background: var(--surface-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    padding: 0.5rem;
}

.action-card-square .icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(25, 135, 84, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.action-card-square span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.action-card-square:hover {
    transform: translateY(-5px);
    border-color: var(--brand-primary);
    background: var(--surface-1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.action-card-square:hover .icon-box {
    transform: scale(1.1);
    background: var(--brand-primary);
    color: white;
}

@media (max-width: 900px) {
    .quick-actions-grid-premium {
        gap: 0.5rem;
    }

    .action-card-square {
        border-radius: 16px;
    }
}

/* Desktop Specific: Simpler and Small Action Cards */
@media (min-width: 901px) {
    .quick-actions-grid-premium {
        grid-template-columns: repeat(4, 200px) !important;
        justify-content: center;
        gap: 1.5rem;
    }

    .action-card-square {
        aspect-ratio: auto;
        padding: 1.5rem;
        border-radius: 16px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        background: var(--surface-1);
    }

    .action-card-square .icon-box {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 10px;
    }

    .action-card-square span {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-primary);
    }
}

/* --- PREMIUM SIDEBAR --- */
.sidebar-header-premium {
    padding: 2.5rem 1.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(25, 135, 84, 0.1), transparent);
}

.user-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-glow {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    overflow: hidden;
    padding: 2px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    box-shadow: 0 0 15px rgba(25, 135, 84, 0.3);
}

.user-avatar-glow img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13px;
    background: white;
}

.user-avatar-glow.guest {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.user-info-text {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.2;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.close-btn-glass {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface-glass);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-content-premium {
    padding: 1rem 1.5rem;
}

.menu-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
    margin-top: 1rem;
}

.premium-links {
    list-style: none;
    padding: 0;
}

.premium-links li {
    margin-bottom: 8px;
}

.premium-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s;
}

.premium-links a i {
    width: 24px;
    font-size: 1.2rem;
    text-align: center;
    opacity: 0.7;
}

.premium-links a:hover,
.premium-links a.active {
    background: var(--surface-1);
    color: var(--brand-primary);
}

.premium-links a.active i {
    opacity: 1;
}

.premium-links a.logout-link {
    color: var(--error);
}

.premium-links a.logout-link:hover {
    background: rgba(220, 53, 69, 0.05);
}

/* --- MOBILE BOTTOM NAV --- */
.mobile-bottom-nav,
.bottom-nav {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    right: 20px !important;
    height: 70px !important;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 40px !important;
    z-index: 2000 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12) !important;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    overflow: hidden !important;
}

.mobile-bottom-nav.nav-hidden,
.bottom-nav.nav-hidden {
    transform: translateY(130px) !important;
}

/* Hide Bottom Nav on Desktop */
@media (min-width: 901px) {
    .bottom-nav {
        display: none !important;
    }

    .chatbot-toggle-btn {
        display: flex !important;
        /* Ensure chatbot is visible on desktop */
    }
}

[data-theme="dark"] .mobile-bottom-nav,
[data-theme="dark"] .bottom-nav {
    background: rgba(18, 18, 18, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

@media (max-width: 900px) {
    main {
        padding-bottom: calc(var(--mobile-nav-height) + 3rem) !important;
    }
}

.nav-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    gap: 4px;
    flex: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 0;
    position: relative;
}

.nav-item-mobile i {
    font-size: 1.25rem;
    transition: transform 0.3s ease;
}

.nav-item-mobile:hover i {
    transform: scale(1.1);
}

/* Premium Center Dashboard Button */
.nav-item-mobile.center-fab {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.15), rgba(25, 135, 84, 0.08)) !important;
    border-radius: 16px;
    height: 52px;
    width: 60px;
    max-width: 60px;
    flex: 0 0 60px;
    margin-top: 0 !important;
    border: 1px solid rgba(25, 135, 84, 0.2) !important;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.15) !important;
    color: var(--brand-primary);
}

[data-theme="dark"] .nav-item-mobile.center-fab {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.25), rgba(25, 135, 84, 0.12)) !important;
    border: 1px solid rgba(25, 135, 84, 0.3) !important;
}

.nav-item-mobile.center-fab i {
    font-size: 1.4rem;
    margin: 0;
}

.nav-item-mobile.active:not(.center-fab) {
    color: var(--brand-primary);
}

.nav-item-mobile.active:not(.center-fab) i {
    transform: scale(1.1);
}

.nav-item-mobile.active:not(.center-fab)::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 5px;
    height: 5px;
    background: var(--brand-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--brand-primary);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* --- MOBILE APP-LIKE REFINEMENTS --- */
@media (max-width: 900px) {
    header {
        position: absolute !important;
        /* Scrolls away, doesn't stay stuck */
        height: 65px !important;
        padding: 0 5% !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .brand-subtitle {
        display: none !important;
        /* Less clutter */
    }

    .brand-text {
        font-size: 1rem !important;
    }

    header .btn-hero {
        display: none !important;
        /* Move logout to sidebar only */
    }

    nav.desktop-nav {
        display: none !important;
    }

    main {
        margin-top: 20px !important;
        /* Header is absolute, so less margin needed */
        padding: 1rem !important;
    }

    .header-actions {
        gap: 0.5rem !important;
    }

    .icon-btn,
    .hamburger-btn {
        width: 46px !important;
        height: 46px !important;
        font-size: 1.3rem !important;
        background: rgba(255, 255, 255, 0.35) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: var(--text-primary) !important;
    }

    [data-theme="dark"] .icon-btn,
    [data-theme="dark"] .hamburger-btn {
        background: rgba(30, 30, 30, 0.4) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }
}

/* --- APP-LIKE BUTTONS --- */
@media (max-width: 600px) {
    .btn-block-mobile {
        width: 100% !important;
        min-height: 48px !important;
        margin-bottom: 0.75rem;
    }
}

/* --- RESPONSIVE TABLES TO CARDS --- */
@media (max-width: 768px) {
    .responsive-table-stack thead {
        display: none;
    }

    .responsive-table-stack tr {
        display: block;
        background: var(--surface-1);
        border-radius: var(--card-radius);
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow-sm);
        border: 1px solid var(--border-subtle);
    }

    .responsive-table-stack td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    .responsive-table-stack td:last-child {
        border-bottom: none;
    }

    .responsive-table-stack td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-secondary);
    }
}

/* --- HORIZONTAL SCROLL WRAPPER --- */
.scroll-x-wrapper {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.scroll-x-wrapper::-webkit-scrollbar {
    height: 4px;
}

/* --- SKELETON LOADING --- */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--subtle-bg) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    display: inline-block;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* --- OFF-CANVAS SIDEBAR --- */
.offcanvas-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.offcanvas-sidebar.active {
    transform: translateX(280px);
}

/* Header Actions & Notifications */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--brand-primary);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface-1);
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    margin-top: 1rem;
    border-radius: 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
}

.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: 1rem;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--surface-2);
}

.notification-item.unread {
    background: rgba(16, 185, 129, 0.05);
    /* brand-primary with opacity */
}

.glass-panel {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
}

/* Contrast Enforcers */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

a:hover {
    color: var(--brand-secondary);
}

/* --- Global Form Input Styling (Visibility Fix) --- */
input[type='text'],
input[type='password'],
input[type='email'],
input[type='number'],
input[type='date'],
input[type='datetime-local'],
input[type='search'],
input[type='file'],
select,
textarea {
    color: var(--text-main) !important;
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    /* Consistent rounding */
    padding: 0.5rem 0.75rem;
    /* Consistent padding */
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
    /* Brand primary fade */
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

/* Ensure options in select dropdowns are visible */
option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

/* --- Global Hover & Selection States (Contrast Fix) --- */
select option:checked,
select option:hover,
.dropdown-item:hover,
.dropdown-item:focus,
.list-group-item:hover,
.list-group-item:focus {
    background-color: var(--subtle-bg) !important;
    color: var(--text-main) !important;
    cursor: pointer;
}



.offcanvas-sidebar.active {
    transform: translateX(280px);
}

/* Header Actions & Notifications */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--brand-primary);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--error);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface-1);
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    margin-top: 1rem;
    border-radius: 16px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notification-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
}

.notification-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    gap: 1rem;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--surface-2);
}

.notification-item.unread {
    background: rgba(16, 185, 129, 0.05);
    /* brand-primary with opacity */
}

.glass-panel {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-lg);
}

/* Contrast Enforcers */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.025em;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

a:hover {
    color: var(--brand-secondary);
}

/* --- Global Form Input Styling (Visibility Fix) --- */
input[type='text'],
input[type='password'],
input[type='email'],
input[type='number'],
input[type='date'],
input[type='datetime-local'],
input[type='search'],
input[type='file'],
select,
textarea {
    color: var(--text-main) !important;
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    /* Consistent rounding */
    padding: 0.5rem 0.75rem;
    /* Consistent padding */
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
    /* Brand primary fade */
    background-color: var(--bg-card) !important;
    color: var(--text-main) !important;
}

/* Ensure options in select dropdowns are visible */
option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

/* --- Global Hover & Selection States (Contrast Fix) --- */
select option:checked,
select option:hover,
.dropdown-item:hover,
.dropdown-item:focus,
.list-group-item:hover,
.list-group-item:focus {
    background-color: var(--subtle-bg) !important;
    color: var(--text-main) !important;
    cursor: pointer;
}

/* Ensure links in dropdowns don't disappear */
.dropdown-menu a:hover {
    background-color: var(--subtle-bg) !important;
    color: var(--brand-primary) !important;
}

/* --- Driver.js (Tour) Premium Theme Overrides --- */
.driver-popover {
    background: var(--surface-glass) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2) !important;
    color: var(--text-primary) !important;
    padding: 1.5rem !important;
    font-family: var(--font-sans) !important;
}

.driver-popover-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.75rem !important;
    color: var(--brand-primary) !important;
    font-family: var(--font-sans) !important;
}

.driver-popover-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: var(--text-secondary) !important;
    margin-bottom: 1.5rem !important;
    font-family: var(--font-sans) !important;
}

.driver-popover-footer {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.75rem !important;
    margin-top: 1rem !important;
}

.driver-popover-btn {
    background: var(--surface-2) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 10px !important;
    padding: 0.6rem 1.2rem !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-shadow: none !important;
}

.driver-popover-btn:hover {
    background: var(--brand-primary) !important;
    color: white !important;
    border-color: var(--brand-primary) !important;
    transform: translateY(-2px) !important;
}

.driver-popover-next-btn {
    background: var(--brand-gradient) !important;
    color: white !important;
    border: none !important;
}

.driver-popover-next-btn:hover {
    background: var(--brand-secondary) !important;
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3) !important;
}

.driver-popover-close-btn {
    color: var(--text-secondary) !important;
    top: 10px !important;
    right: 10px !important;
    font-size: 1.2rem !important;
    opacity: 0.6 !important;
    transition: opacity 0.2s !important;
}

.driver-popover-close-btn:hover {
    color: var(--error) !important;
    opacity: 1 !important;
}

.driver-popover-arrow-side-left.driver-popover-arrow {
    border-left-color: var(--surface-glass) !important;
}

.driver-popover-arrow-side-right.driver-popover-arrow {
    border-right-color: var(--surface-glass) !important;
}

.driver-popover-arrow-side-top.driver-popover-arrow {
    border-top-color: var(--surface-glass) !important;
}

.driver-popover-arrow-side-bottom.driver-popover-arrow {
    border-bottom-color: var(--surface-glass) !important;
}

/* Steps Highlight */
.driver-highlighted-element {
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.4) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
}