@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    --accent-primary: #3b5998;
    --accent-secondary: #0ea5e9;
    --accent-success: #10b981;
    --accent-error: #f43f5e;
    --accent-warning: #f59e0b;
    
    --text-high: #1a1a1a;
    --text-mid: #4a4a4a;
    --text-low: #718096;
    
    --glass-blur: blur(0px);
    --radius-xl: 12px;
    --radius-lg: 8px;
    --radius-md: 6px;
    
    --shadow-premium: 0 1px 3px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

[data-theme="light"] {
    --bg-main: #f0f2f5;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    --text-high: #1a1a1a;
    --text-mid: #4a4a4a;
    --text-low: #718096;
    
    --shadow-premium: 0 1px 3px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-surface: #111827;
    --bg-card: #1f2937;
    --border-color: #374151;
    
    --text-high: #f9fafb;
    --text-mid: #d1d5db;
    --text-low: #9ca3af;
    
    --shadow-premium: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] {
    /* Student portal variables overrides */
    --sp-bg-light: #0b0f19;
    --sp-white: #111827;
    --sp-text-dark: #f9fafb;
    --sp-text-muted: #9ca3af;
    --sp-purple-light: rgba(92, 60, 243, 0.15);
    --sp-pink-light: rgba(255, 77, 109, 0.15);
    --sp-orange-light: rgba(255, 136, 0, 0.15);
    --sp-green-light: rgba(0, 176, 80, 0.15);
    --sp-blue-light: rgba(2, 132, 199, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-main);
    color: var(--text-high);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.1) 0%, transparent 40%);
    transition: background-color 0.4s ease, color 0.4s ease;
}

[data-theme="light"] body {
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.05) 0%, transparent 40%);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Layout Blocks */
.dashboard {
    width: 100%;
    margin: 0;
    padding: 0;
    animation: fadeIn 0.8s ease-out;
}

@media (max-width: 768px) {
    .dashboard { padding-top: 0; }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 1rem 2rem;
    background: var(--accent-primary);
    color: white;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    color: white;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header p {
    color: rgba(255, 255, 255, 0.8) !important;
}

.header p span {
    color: white !important;
}

/* Cards & Containers */
.glow-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-premium);
}

/* Auth Pages */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 3rem;
    animation: fadeIn 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-card h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-card p {
    color: var(--text-mid);
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-mid);
    letter-spacing: 0.3px;
}

.input-group input, .input-group select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    color: var(--text-high);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus, .input-group select:focus {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn-neon {
    position: relative;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #ff007a 0%, #7928ca 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(121, 40, 202, 0.3);
}

.btn-neon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff4d4d 0%, #f9cb28 100%);
    z-index: -1;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.btn-neon:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(255, 0, 122, 0.5);
}

.btn-neon:hover::after {
    opacity: 1;
}

.btn-alt {
    position: relative;
    padding: 0.8rem 1.2rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-mid);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    z-index: 1;
}

.btn-alt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(59, 130, 246, 0.15) 100%);
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.btn-alt:hover {
    border-color: var(--accent-secondary);
    color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.btn-alt:hover::after {
    opacity: 1;
}

.btn-alt.active {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    border-color: transparent;
    color: white !important;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
}

/* Dashboard Grid & Nav Blocks */
.nav-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    margin-bottom: 2rem;
}
.nav-block-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-high);
    box-shadow: var(--shadow-premium);
}
.nav-block-btn:hover, .nav-block-btn.active {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}
.nav-block-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(14, 165, 233, 0.1));
}
.nav-block-icon {
    font-size: 2.2rem;
    line-height: 1;
}
.nav-block-title {
    font-size: 0.85rem;
    font-weight: 700;
}

.grid-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

aside {
    width: 250px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    flex-shrink: 0;
}

aside .class-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

aside .class-list li {
    margin-bottom: 0.5rem;
}

aside .class-list .btn-alt {
    width: 100%;
    justify-content: flex-start;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
}

aside .class-list .btn-alt:hover {
    background: rgba(59, 89, 152, 0.1);
    color: var(--accent-primary);
    box-shadow: none;
    transform: none;
}

aside .class-list .btn-alt.active {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-primary) 100%);
    color: white !important;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    transform: none;
    border: none;
}

.content {
    flex-grow: 1;
    padding: 2rem;
    background: var(--bg-main);
    overflow-x: hidden;
}

@media (max-width: 1024px) {
    .grid-layout { flex-direction: column; }
    aside { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); padding: 1rem; }
    aside .class-list { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 10px; margin-bottom: 0; scrollbar-width: none; }
    aside .class-list::-webkit-scrollbar { display: none; }
    aside .class-list li { margin-bottom: 0; flex-shrink: 0; }
    aside .class-list .btn-alt { padding: 0.5rem 1rem; width: auto; white-space: nowrap; justify-content: center; }
}

/* Responsive Grid Utilities */
.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-2-col, .grid-3-col {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 1024px) {
    .grid-with-sidebar {
        grid-template-columns: 1fr;
    }
}

.status-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.status {
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-mid);
}

.status .number {
    font-family: 'Outfit', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
}

.status.available .number { color: var(--accent-success); }
.status.alerts .number { color: var(--accent-error); }

/* Table System */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-low);
}

td {
    padding: 1.2rem 1.5rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

td:first-child {
    border-left: 1px solid var(--border-color);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

td:last-child {
    border-right: 1px solid var(--border-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

tr:hover td {
    background: var(--bg-main);
    border-color: var(--accent-primary);
}

/* Status Badges */
.badge {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.badge-error { background: rgba(244, 63, 94, 0.1); color: var(--accent-error); }

/* Theme Toggle */
.theme-toggle {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-premium);
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    border-color: var(--accent-primary);
}

/* Saved Account UI */
.saved-accounts {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.saved-account-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.saved-account-chip:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
}

/* Landing Page Specifics */
.landing-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.nav-tab {
    color: var(--text-mid);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
}

.nav-tab:hover, .nav-tab.active {
    color: var(--accent-primary);
}

.hero {
    text-align: center;
    padding: 100px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 4rem;
    font-family: 'Outfit';
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Chat UI */
.chat-trigger {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 99px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    z-index: 2000;
}

.chat-panel {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 350px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
    display: none;
    z-index: 2000;
}

.chat-option {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.chat-option:hover {
    border-color: var(--accent-primary);
    transform: translateX(5px);
}

/* Demo Overlay */
#demoOverlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-main);
    z-index: 9999;
    padding: 50px;
    display: none;
}

@media (max-width: 768px) {
    .chat-panel {
        width: 90vw;
        right: 5vw;
        bottom: 5rem;
        z-index: 9999;
    }
    .chat-trigger {
        right: 1rem;
        bottom: 1rem;
    }
    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .header {
        flex-direction: column;
        gap: 1.5rem;
        padding: 1.5rem;
        text-align: center;
    }

    .header div {
        width: 100%;
    }

    /* Stack buttons nicely on mobile */
    .header [style*="display: flex"] {
        flex-direction: column;
        width: 100%;
        gap: 8px !important;
    }

    .btn-neon, .btn-alt {
        width: 100% !important;
        justify-content: center;
        opacity: 1 !important;
    }
    
    .btn-alt {
        background: rgba(0, 0, 0, 0.03) !important;
        border-color: var(--accent-primary) !important;
        color: var(--text-high) !important;
        font-weight: bold;
    }
    
    .status-panel {
        grid-template-columns: 1fr;
    }
    
    .auth-card {
        padding: 1.5rem;
        border-radius: var(--radius-xl);
    }

    /* TABLE TO CARD CONVERSION */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        background: var(--bg-card);
        overflow: hidden;
    }

    td {
        border: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        position: relative;
        padding-left: 50% !important;
        text-align: right !important;
        border-radius: 0 !important;
    }

    td:last-child {
        border-bottom: none !important;
    }

    td:before {
        position: absolute;
        top: 6px;
        left: 20px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        font-size: 0.75rem;
        color: var(--text-low);
        content: attr(data-label);
        line-height: 2.5rem;
    }
    
    .modal-content {
        width: 95% !important;
        margin: 0 auto;
        max-height: 85vh;
        overflow-y: auto;
        padding: 1.5rem !important;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-high);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-premium);
    backdrop-filter: var(--glass-blur);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastEnter 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    pointer-events: auto;
}

@keyframes toastEnter {
    from { opacity: 0; transform: translateY(20px) translateX(-50%); left: 50%; }
    to { opacity: 1; transform: translateY(0) translateX(-50%); left: 50%; }
}

@keyframes toastExit {
    from { opacity: 1; transform: translateY(0) translateX(-50%); left: 50%; }
    to { opacity: 0; transform: translateY(-20px) translateX(-50%); left: 50%; }
}

.toast.toast-success { border-left: 4px solid var(--accent-success); }
.toast.toast-error { border-left: 4px solid var(--accent-error); }
.toast.toast-info { border-left: 4px solid var(--accent-primary); }

/* Search Inputs */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}
.search-wrapper input {
    width: 100%;
    padding: 0.8rem 1.5rem 0.8rem 2.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    color: var(--text-high);
    font-size: 0.95rem;
    transition: var(--transition);
}
.search-wrapper input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    outline: none;
}
.search-wrapper::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.5;
}

/* ==========================================================================
   Universal Dashboard Sidebar Layout (Shared by Student & Admin)
   ========================================================================== */

:root {
    --sb-purple: #5c3cf3;
    --sb-purple-light: rgba(92, 60, 243, 0.08);
    --sb-bg-light: var(--bg-main);
    --sb-surface: var(--bg-surface);
    --sb-text-dark: var(--text-high);
    --sb-text-muted: var(--text-mid);
}

[data-theme="light"] {
    --sb-purple-light: rgba(92, 60, 243, 0.08);
}

.portal-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--sb-bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    overflow-x: hidden;
}

.desktop-sidebar {
    display: none;
}

@media (min-width: 768px) {
    .portal-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        height: auto !important;
        min-height: 100vh !important;
        flex-direction: row !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .portal-main {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        width: calc(100% - 260px) !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 100vh !important;
        background-color: var(--sb-bg-light);
        overflow-y: auto;
    }

    .desktop-sidebar {
        display: flex !important;
        flex-direction: column;
        width: 260px;
        background: var(--sb-surface);
        border-right: 1px solid var(--border-color);
        padding: 2rem 1.5rem;
        box-sizing: border-box;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        z-index: 100;
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 2.5rem;
    }

    .brand-icon {
        font-size: 2rem;
    }

    .brand-info h4 {
        margin: 0;
        font-family: 'Outfit', sans-serif;
        font-size: 1rem;
        font-weight: 800;
        color: var(--sb-text-dark);
    }

    .brand-info p {
        margin: 2px 0 0 0;
        font-size: 0.75rem;
        color: var(--sb-text-muted);
        font-weight: 600;
    }

    .sidebar-menu {
        display: flex;
        flex-direction: column;
        gap: 6px;
        flex-grow: 1;
    }

    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        border-radius: 12px;
        color: var(--sb-text-dark);
        text-decoration: none;
        font-size: 0.88rem;
        font-weight: 700;
        transition: all 0.2s;
        border: none;
        background: transparent;
        text-align: left;
        cursor: pointer;
    }

    .sidebar-link:hover {
        background-color: var(--sb-purple-light);
        color: var(--sb-purple);
    }

    .sidebar-link.active {
        background-color: var(--sb-purple-light);
        color: var(--sb-purple);
    }

    .sidebar-divider {
        border: none;
        border-top: 1px solid var(--border-color);
        margin: 1rem 0;
    }

    .logout-link {
        color: var(--accent-error) !important;
        margin-top: auto;
    }

    .logout-link:hover {
        background-color: rgba(244, 63, 94, 0.1) !important;
        color: var(--accent-error) !important;
    }

    .sidebar-profile-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        background: rgba(0, 0, 0, 0.02);
        border-radius: 16px;
        margin-top: 1.5rem;
    }

    [data-theme="dark"] .sidebar-profile-card {
        background: rgba(255, 255, 255, 0.02);
    }

    .profile-card-avatar {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: var(--sb-purple);
        color: white;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.95rem;
    }

    .profile-card-info h5 {
        margin: 0;
        font-size: 0.8rem;
        font-weight: 800;
        color: var(--sb-text-dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 130px;
    }

    .profile-card-info p {
        margin: 2px 0 0 0;
        font-size: 0.7rem;
        color: var(--sb-text-muted);
        font-weight: 600;
    }

    /* Hide hamburger icon in header on desktop */
    .portal-header-top .header-btn:first-child {
        display: none !important;
    }
}

/* Dynamic Scrollable Bottom Navigation Bar on Mobile devices (All Roles) */
@media (max-width: 1024px) {
    nav.bottom-nav, 
    nav.sa-bottom-nav, 
    nav.ld-bottom-nav {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 1.5rem !important;
        padding: 0 1.5rem !important;
        align-items: center !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        height: 75px !important;
        background: var(--bg-surface, #ffffff) !important;
        border-top: 1px solid var(--border-color, #e2e8f0) !important;
    }
    
    nav.bottom-nav::-webkit-scrollbar, 
    nav.sa-bottom-nav::-webkit-scrollbar, 
    nav.ld-bottom-nav::-webkit-scrollbar {
        display: none !important;
    }

    nav.bottom-nav a, 
    nav.sa-bottom-nav a, 
    nav.ld-bottom-nav a,
    nav.sa-bottom-nav button,
    nav.bottom-nav button,
    nav.ld-bottom-nav button,
    .bottom-nav-item,
    .sa-nav-item,
    .sa-bnav-item,
    .ld-bnav-item {
        flex-shrink: 0 !important;
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        min-width: 70px !important;
        color: var(--text-mid, #64748b) !important;
        text-decoration: none !important;
    }

    nav.bottom-nav a.active,
    nav.sa-bottom-nav a.active,
    nav.ld-bottom-nav a.active,
    nav.sa-bottom-nav button.active,
    nav.bottom-nav button.active,
    nav.ld-bottom-nav button.active,
    .bottom-nav-item.active,
    .sa-nav-item.active,
    .sa-bnav-item.active,
    .ld-bnav-item.active {
        color: var(--accent-primary, #5c3cf3) !important;
        font-weight: 700 !important;
    }
}


