:root {
    --primary-color: #003399;
    /* Royal Blue from logo */
    --accent-color: #0055ff;
    /* Vibrant Blue */
    --bg-color: #f0f4f8;
    /* Soft cool background */
    --card-bg: rgba(255, 255, 255, 0.68);
    --text-main: #1e293b;
    --sidebar-bg: #ffffff;
    --sidebar-bg-gradient: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --sidebar-hover: #f1f5f9;
    --sidebar-border: #e2e8f0;
    --sidebar-heading: #64748b;
    --sidebar-heading-icon: #2563eb;
    --sidebar-link: #334155;
    --sidebar-icon: #64748b;
    --sidebar-link-hover: #0f172a;
    --sidebar-icon-hover: #2563eb;
    --sidebar-link-active: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --sidebar-brand-title: #0f172a;
    --sidebar-brand-subtitle: #2563eb;
    --sidebar-collapse-color: #64748b;
    --sidebar-scroll-thumb: rgba(0, 0, 0, 0.12);
    --sidebar-scroll-thumb-hover: rgba(0, 0, 0, 0.22);
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 76px;

    /* Glassmorphism Design System Tokens */
    --glass-blur-sm: 12px;
    --glass-blur-md: 16px;
    --glass-blur-lg: 20px;
    --glass-blur-xl: 24px;
    --glass-bg: rgba(255, 255, 255, 0.68);
    --glass-bg-subtle: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-border-subtle: rgba(226, 232, 240, 0.55);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --glass-shadow-elevated: 0 20px 48px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* =========================================
   LUCIDE ICONS UNIVERSAL INTEGRATION & REFINED SPACING
   ========================================= */
.lucide,
svg.lucide,
[data-lucide] {
    display: inline-block;
    vertical-align: -0.15em;
    width: 1.15em;
    height: 1.15em;
    stroke-width: 2px;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
    transition: transform 0.2s ease, stroke 0.2s ease;
}

/* 1. Global Natural Text-to-Icon Spacing */
/* When icon is followed by sibling text or sibling elements */
.lucide:not(:last-child),
svg.lucide:not(:last-child),
[data-lucide]:not(:last-child) {
    margin-right: 0.5rem;
}

/* When icon is preceded by text or sibling elements (e.g. arrow-right, chevron-down, badges) */
.lucide:not(:first-child),
svg.lucide:not(:first-child),
[data-lucide]:not(:first-child) {
    margin-left: 0.5rem;
}

/* Solo icons inside icon-only buttons, avatars, badges, or stat wraps (Strictly zero margin to maintain perfect centering) */
.lucide:only-child,
svg.lucide:only-child,
[data-lucide]:only-child,
.btn-icon .lucide,
.btn-icon svg.lucide,
.btn-icon [data-lucide],
.icon-only .lucide,
.icon-only svg.lucide,
.icon-only [data-lucide],
.stat-icon-wrap .lucide,
.stat-icon-wrap svg.lucide,
.stat-icon-wrap [data-lucide] {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

/* 2. Enhanced Utility Classes Override on Icons */
/* Prevent cramped 4px (0.25rem) spacing from default Bootstrap .me-1 on icons */
.lucide.me-1,
svg.lucide.me-1,
[data-lucide].me-1,
i[data-lucide].me-1 {
    margin-right: 0.45rem !important;
}

.lucide.me-1\.5,
svg.lucide.me-1\.5,
[data-lucide].me-1\.5,
i[data-lucide].me-1\.5 {
    margin-right: 0.55rem !important;
}

.lucide.me-2,
svg.lucide.me-2,
[data-lucide].me-2,
i[data-lucide].me-2 {
    margin-right: 0.65rem !important;
}

.lucide.ms-1,
svg.lucide.ms-1,
[data-lucide].ms-1,
i[data-lucide].ms-1 {
    margin-left: 0.45rem !important;
}

.lucide.ms-1\.5,
svg.lucide.ms-1\.5,
[data-lucide].ms-1\.5,
i[data-lucide].ms-1\.5 {
    margin-left: 0.55rem !important;
}

.lucide.ms-2,
svg.lucide.ms-2,
[data-lucide].ms-2,
i[data-lucide].ms-2 {
    margin-left: 0.65rem !important;
}

/* 3. Container Gap Utilities Polyfill & Normalization */
/* Enable fractional flex gaps used across Nexus components */
.gap-0\.5, .gap-0-5 { gap: 0.25rem !important; }
.gap-1 { gap: 0.38rem !important; }
.gap-1\.5, .gap-1-5 { gap: 0.5rem !important; }
.gap-2 { gap: 0.65rem !important; }
.gap-2\.5, .gap-2-5 { gap: 0.85rem !important; }

/* When parent explicitly handles spacing via flex gap, avoid double-margin */
[class*="gap-"] > .lucide:not(:only-child),
[class*="gap-"] > svg.lucide:not(:only-child),
[class*="gap-"] > [data-lucide]:not(:only-child) {
    margin-right: 0;
    margin-left: 0;
}

/* 4. Component-Specific Icon Micro-Styling */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}
.btn .lucide,
.btn svg.lucide,
.btn [data-lucide] {
    width: 1.1em;
    height: 1.1em;
    vertical-align: middle;
}
.btn .lucide:not(:only-child):not(:last-child),
.btn svg.lucide:not(:only-child):not(:last-child),
.btn [data-lucide]:not(:only-child):not(:last-child) {
    margin-right: 0.45rem;
}
.btn .lucide:not(:only-child):not(:first-child),
.btn svg.lucide:not(:only-child):not(:first-child),
.btn [data-lucide]:not(:only-child):not(:first-child) {
    margin-left: 0.45rem;
}

/* Small Buttons */
.btn-sm .lucide,
.btn-sm svg.lucide,
.btn-sm [data-lucide] {
    width: 0.95em;
    height: 0.95em;
}
.btn-sm .lucide:not(:only-child):not(:last-child),
.btn-sm svg.lucide:not(:only-child):not(:last-child),
.btn-sm [data-lucide]:not(:only-child):not(:last-child) {
    margin-right: 0.35rem;
}

/* Large Buttons */
.btn-lg .lucide,
.btn-lg svg.lucide,
.btn-lg [data-lucide] {
    width: 1.25em;
    height: 1.25em;
}
.btn-lg .lucide:not(:only-child):not(:last-child),
.btn-lg svg.lucide:not(:only-child):not(:last-child),
.btn-lg [data-lucide]:not(:only-child):not(:last-child) {
    margin-right: 0.55rem;
}

/* Badges & Pills */
.badge {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}
.badge .lucide,
.badge svg.lucide,
.badge [data-lucide] {
    width: 1.05em;
    height: 1.05em;
    vertical-align: -0.1em;
}
.badge .lucide:not(:only-child):not(:last-child),
.badge svg.lucide:not(:only-child):not(:last-child),
.badge [data-lucide]:not(:only-child):not(:last-child) {
    margin-right: 0.38rem;
}
.badge .lucide:not(:only-child):not(:first-child),
.badge svg.lucide:not(:only-child):not(:first-child),
.badge [data-lucide]:not(:only-child):not(:first-child) {
    margin-left: 0.38rem;
}

/* Dropdown Menu Items */
.dropdown-item {
    display: flex;
    align-items: center;
}
.dropdown-item .lucide,
.dropdown-item svg.lucide,
.dropdown-item [data-lucide] {
    width: 1.15em;
    height: 1.15em;
    margin-right: 0.65rem !important;
    vertical-align: middle;
}

/* Form Labels */
label,
.form-label {
    display: inline-flex;
    align-items: center;
}
label .lucide,
label svg.lucide,
label [data-lucide],
.form-label .lucide,
.form-label svg.lucide,
.form-label [data-lucide] {
    width: 1.05em;
    height: 1.05em;
    margin-right: 0.45rem;
    vertical-align: -0.12em;
}

/* Input Groups */
.input-group-text .lucide,
.input-group-text svg.lucide,
.input-group-text [data-lucide] {
    width: 1.1em;
    height: 1.1em;
    margin: 0 !important;
}

/* Alerts */
.alert > .lucide:first-child,
.alert > svg.lucide:first-child,
.alert > [data-lucide]:first-child {
    margin-right: 0.65rem;
    vertical-align: -0.15em;
}

/* Headings (h1 - h6) */
h1 .lucide:not(:only-child):not(:last-child), h1 svg.lucide:not(:only-child):not(:last-child),
h2 .lucide:not(:only-child):not(:last-child), h2 svg.lucide:not(:only-child):not(:last-child),
h3 .lucide:not(:only-child):not(:last-child), h3 svg.lucide:not(:only-child):not(:last-child),
h4 .lucide:not(:only-child):not(:last-child), h4 svg.lucide:not(:only-child):not(:last-child),
h5 .lucide:not(:only-child):not(:last-child), h5 svg.lucide:not(:only-child):not(:last-child),
h6 .lucide:not(:only-child):not(:last-child), h6 svg.lucide:not(:only-child):not(:last-child) {
    margin-right: 0.5rem;
    vertical-align: -0.12em;
}

/* Nav Links & Tab Links */
.nav-link {
    display: inline-flex;
    align-items: center;
}
.nav-link .lucide:not(:only-child):not(:last-child),
.nav-link svg.lucide:not(:only-child):not(:last-child),
.nav-link [data-lucide]:not(:only-child):not(:last-child) {
    margin-right: 0.5rem;
}

/* Table Cells */
.table td .lucide:not(:only-child):not(:last-child),
.table td svg.lucide:not(:only-child):not(:last-child),
.table td [data-lucide]:not(:only-child):not(:last-child),
.table th .lucide:not(:only-child):not(:last-child),
.table th svg.lucide:not(:only-child):not(:last-child),
.table th [data-lucide]:not(:only-child):not(:last-child) {
    margin-right: 0.45rem;
}

/* =========================================
   GLASSMORPHISM CORE UTILITY CLASSES
   ========================================= */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.glass-light {
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.glass-elevated {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.glass-pill {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.glass-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 51, 153, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.glass-card:hover {
    box-shadow: 0 14px 36px rgba(0, 51, 153, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    border-color: rgba(37, 99, 235, 0.35);
}

/* =========================================
   DASHBOARD AESTHETIC ICON WRAPPERS & HOVER
   ========================================= */
.stat-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-icon-wrap svg,
.stat-icon-wrap i,
.stat-icon-wrap .lucide {
    width: 26px;
    height: 26px;
    stroke-width: 2.2px;
}

.stat-icon-wrap.primary {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.22);
}

.stat-icon-wrap.indigo {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.22);
}

.stat-icon-wrap.info {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
    border: 1px solid rgba(14, 165, 233, 0.22);
}

.stat-icon-wrap.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.22);
}

.stat-icon-wrap.success {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.22);
}

.stat-icon-wrap.danger {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.22);
}

.stat-icon-wrap.purple {
    background: rgba(168, 85, 247, 0.12);
    color: #9333ea;
    border: 1px solid rgba(168, 85, 247, 0.22);
}

/* Dark mode adjustments for icon wraps */
[data-theme="dark"] .stat-icon-wrap.primary,
[data-bs-theme="dark"] .stat-icon-wrap.primary,
body.dark-mode .stat-icon-wrap.primary {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #60a5fa !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
}

[data-theme="dark"] .stat-icon-wrap.indigo,
[data-bs-theme="dark"] .stat-icon-wrap.indigo,
body.dark-mode .stat-icon-wrap.indigo {
    background: rgba(129, 140, 248, 0.2) !important;
    color: #a5b4fc !important;
    border-color: rgba(129, 140, 248, 0.35) !important;
}

[data-theme="dark"] .stat-icon-wrap.info,
[data-bs-theme="dark"] .stat-icon-wrap.info,
body.dark-mode .stat-icon-wrap.info {
    background: rgba(56, 189, 248, 0.2) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
}

[data-theme="dark"] .stat-icon-wrap.warning,
[data-bs-theme="dark"] .stat-icon-wrap.warning,
body.dark-mode .stat-icon-wrap.warning {
    background: rgba(251, 191, 36, 0.2) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
}

[data-theme="dark"] .stat-icon-wrap.success,
[data-bs-theme="dark"] .stat-icon-wrap.success,
body.dark-mode .stat-icon-wrap.success {
    background: rgba(52, 211, 153, 0.2) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.35) !important;
}

[data-theme="dark"] .stat-icon-wrap.danger,
[data-bs-theme="dark"] .stat-icon-wrap.danger,
body.dark-mode .stat-icon-wrap.danger {
    background: rgba(248, 113, 113, 0.2) !important;
    color: #f87171 !important;
    border-color: rgba(248, 113, 113, 0.35) !important;
}

.hover-lift {
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hover-lift:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 30px rgba(0, 51, 153, 0.12) !important;
}

.hover-lift:hover .stat-icon-wrap {
    transform: scale(1.08);
}

/* =========================================
   GLOBAL TYPOGRAPHY & HIGH-DENSITY SCALING
   ========================================= */
:root {
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

html {
    font-size: 14.5px; /* Decreased base size for refined, high-density dashboard elegance */
    overflow-x: hidden;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.9375rem; /* ~13.6px - crisp, readable, modern compact typography */
    line-height: 1.55;
    letter-spacing: -0.012em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    overflow-x: hidden;
    max-width: 100vw;
}

/* Polished Typography Scale for Headings */
h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

h1, .h1 {
    font-size: 1.625rem; /* ~23.5px */
    letter-spacing: -0.03em;
}

h2, .h2 {
    font-size: 1.375rem; /* ~20px */
    letter-spacing: -0.025em;
}

h3, .h3 {
    font-size: 1.1875rem; /* ~17.2px */
    letter-spacing: -0.02em;
}

h4, .h4 {
    font-size: 1.05rem; /* ~15.2px */
    letter-spacing: -0.015em;
}

h5, .h5 {
    font-size: 0.95rem; /* ~13.8px */
    letter-spacing: -0.01em;
}

h6, .h6 {
    font-size: 0.85rem; /* ~12.3px */
    letter-spacing: -0.005em;
}

p {
    margin-bottom: 0.75rem;
    line-height: 1.55;
}

small, .small {
    font-size: 0.8125rem; /* ~11.8px */
    line-height: 1.4;
    letter-spacing: -0.005em;
}

/* Micro-labels, Uppercase Headers & Badges */
.text-uppercase,
.badge,
.label-tracking {
    letter-spacing: 0.04em;
}

/* UI Controls Consistency */
input,
button,
select,
textarea,
.form-control,
.form-select,
.btn,
.nav-link,
.dropdown-item {
    font-family: var(--font-sans);
}

.btn {
    font-size: 0.84rem; /* Crisp, aesthetic action buttons */
    font-weight: 600;
    letter-spacing: -0.005em;
}

.btn-sm {
    font-size: 0.775rem;
    padding: 0.35rem 0.65rem;
}

.btn-lg {
    font-size: 0.95rem;
    padding: 0.65rem 1.25rem;
}

.form-control,
.form-select {
    font-size: 0.875rem;
    letter-spacing: -0.005em;
}

.form-label {
    font-size: 0.825rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin-bottom: 0.35rem;
}

/* Tables Typography */
.table {
    font-size: 0.84rem;
}
.table th {
    font-size: 0.775rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Glassmorphism Card System */
.card {
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0, 51, 153, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(37, 99, 235, 0.3);
}

/* =========================================
   CARD-FORMAT AUTH LAYOUT (shadcn/ui & WCAG)
   ========================================= */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #09122C;
    background-image: 
        linear-gradient(135deg, rgba(9, 18, 44, 0.85) 0%, rgba(23, 59, 126, 0.85) 100%),
        url('../images/school_bg.jpg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding: 36px 16px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Subtle animated background glow */
.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.35) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    border-radius: 50%;
    pointer-events: none;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    border-radius: 50%;
    pointer-events: none;
}

/* 1. Container & Sizing */
.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    /* Standard Auth/Login: 380px-420px */
    border-radius: 12px;
    /* Standard 8px-12px (rounded-xl) */
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    padding: 32px;
    /* Desktop: 24px-32px (p-8) */
    position: relative;
    z-index: 10;
}

/* Multi-field/Settings form container */
.auth-card.auth-card-wide {
    max-width: 600px;
    /* 560px-640px (max-w-xl to max-w-2xl) */
}

.auth-logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    padding: 2px;
    margin-bottom: 12px;
    object-fit: cover;
}

/* 3. Typography & Spacing */
.auth-title {
    font-size: 1.625rem;
    /* 26px (24px-28px) */
    font-weight: 700;
    /* Bold/semibold */
    color: #0f172a;
    letter-spacing: -0.025em;
    margin-bottom: 4px;
    line-height: 1.25;
    text-align: center;
}

.auth-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    /* 14px */
    text-align: center;
    margin-bottom: 20px;
}

.auth-form-group {
    margin-bottom: 18px;
    /* Field spacing: 16px to 20px */
    position: relative;
}

.auth-label {
    display: block;
    font-size: 0.875rem;
    /* 14px (13px-14px) */
    font-weight: 500;
    /* medium weight */
    color: #0f172a;
    margin-bottom: 6px;
    /* 6px margin below label */
    line-height: 1.25;
}

.auth-label .required-star {
    color: #ef4444;
    font-weight: 600;
}

/* Helper / Error Text: 12px-13px placed 4px beneath input */
.form-helper-text {
    font-size: 0.75rem;
    /* 12px */
    color: #64748b;
    margin-top: 4px;
    line-height: 1.3;
}

.form-error-text {
    font-size: 0.75rem;
    /* 12px */
    color: #ef4444;
    margin-top: 4px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 2. Input Fields & Selects */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* Leading Icon inside the input box */
.input-icon-wrapper > .leading-icon,
.input-icon-wrapper > i.leading-icon,
.input-icon-wrapper > svg.leading-icon,
.input-icon-wrapper > i:first-child,
.input-icon-wrapper > svg:first-child,
.input-icon-wrapper > span#schoolIdIconWrap,
.input-icon-wrapper > span.leading-icon-wrap {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 18px !important;
    height: 18px !important;
    color: #94a3b8;
    pointer-events: none !important;
    transition: color 0.15s ease;
    z-index: 5 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.input-icon-wrapper .leading-icon svg,
.input-icon-wrapper span#schoolIdIconWrap i,
.input-icon-wrapper span#schoolIdIconWrap svg {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 18px !important;
    height: 18px !important;
    display: block !important;
}

.input-icon-wrapper:focus-within .leading-icon,
.input-icon-wrapper:focus-within i.leading-icon,
.input-icon-wrapper:focus-within svg.leading-icon,
.input-icon-wrapper:focus-within > i:first-child,
.input-icon-wrapper:focus-within > svg:first-child,
.input-icon-wrapper:focus-within > span#schoolIdIconWrap svg {
    color: #2563eb !important;
}

/* Password Toggle Button (WCAG Accessible Touch Target) */
.password-toggle-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    padding: 0 !important;
    transition: color 0.15s ease, background-color 0.15s ease !important;
    z-index: 5 !important;
    flex-shrink: 0 !important;
}

.password-toggle-btn svg,
.password-toggle-btn i {
    width: 18px !important;
    height: 18px !important;
    display: block !important;
}

.password-toggle-btn:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

.password-toggle-btn:focus-visible {
    outline: 2px solid #2563eb !important;
    outline-offset: 1px !important;
}

.auth-input,
select.auth-input {
    width: 100%;
    height: 42px;
    /* Exactly 40px-44px standard height */
    background: #ffffff;
    border: 1px solid #cbd5e1;
    /* 1px border */
    border-radius: 8px;
    /* subtle 6px-8px radius (rounded-md) */
    padding: 0 14px;
    /* Horizontal padding: 12px to 14px */
    font-size: 16px;
    /* Exactly 16px (1rem) prevents iOS Safari zoom */
    color: #0f172a;
    font-family: inherit;
    line-height: normal;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-icon-wrapper .auth-input {
    width: 100% !important;
    padding-left: 50px !important;
    /* Clear leading icon with 14px offset */
}

.input-icon-wrapper .auth-input.has-trailing-btn {
    padding-right: 44px !important;
    /* Clear trailing toggle button */
}

/* Hover state */
.auth-input:hover {
    border-color: #94a3b8;
    /* Clear hover border */
}

/* Distinct focus ring: 2px outline/ring with 2px offset */
.auth-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(37, 99, 235, 0.25);
}

/* Error state: red border with distinct ring */
.auth-input.is-invalid,
.auth-input:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #ef4444;
}

.auth-input.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(239, 68, 68, 0.25);
}

/* Select specific styling */
select.auth-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 10px;
    padding-right: 36px;
}

/* 4. Buttons & Actions */
.auth-btn {
    width: 100%;
    /* Full-width for login/auth */
    height: 42px;
    /* Match input height: 40px-44px desktop */
    background: #2563eb;
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 8px;
    /* subtle 8px radius */
    font-size: 0.875rem;
    /* 14px (14px-15px) */
    font-weight: 600;
    /* semi-bold */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    text-decoration: none;
    user-select: none;
}

.auth-btn:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.auth-btn:active {
    transform: scale(0.99);
}

.auth-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Secondary / Outline Button */
.auth-btn-secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.auth-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.auth-btn-secondary:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

/* OAuth Button (Google) */
.oauth-btn-google {
    background: #ffffff;
    color: #374151;
    border: 1px solid #cbd5e1;
    font-weight: 500;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.oauth-btn-google:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.oauth-btn-google:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Back navigation button */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    right: auto;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.15s ease;
    border: 1px solid #e2e8f0;
}

.back-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.back-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Password Strength Meter */
.password-meter-bar {
    height: 4px;
    width: 100%;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.password-meter-fill {
    height: 100%;
    width: 0%;
    background: #f59e0b;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-meter-text {
    font-size: 0.75rem;
    /* 12px */
    font-weight: 500;
    color: #64748b;
    margin-top: 4px;
}

/* Mobile Responsiveness & WCAG touch targets */
.auth-btn, 
.password-toggle-btn, 
.oauth-btn-google, 
.auth-theme-toggle,
.back-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.auth-btn:active,
.oauth-btn-google:active,
.auth-btn-secondary:active {
    transform: scale(0.97) !important;
}

@media (max-width: 576px) {
    .auth-wrapper {
        padding: max(16px, env(safe-area-inset-top, 16px)) 12px max(24px, env(safe-area-inset-bottom, 24px)) !important;
        background-attachment: scroll !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .auth-card {
        padding: 24px 18px !important;
        border-radius: 16px !important;
        width: 100% !important;
        max-width: min(420px, calc(100vw - 24px)) !important;
        margin: auto !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .auth-card.auth-card-wide {
        padding: 24px 18px !important;
        max-width: min(600px, calc(100vw - 24px)) !important;
    }

    .auth-title {
        font-size: 1.45rem !important;
        line-height: 1.2 !important;
    }

    .auth-subtitle {
        font-size: 0.825rem !important;
        margin-bottom: 16px !important;
    }

    .auth-logo {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 8px !important;
    }

    .auth-form-group {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .input-icon-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .auth-input,
    select.auth-input {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        height: 46px !important;
        font-size: 16px !important; /* Critical: Prevents auto-zoom in iOS Safari */
    }

    .auth-btn {
        height: 46px !important;
        font-size: 0.9rem !important;
    }

    .password-toggle-btn {
        width: 38px !important;
        height: 38px !important;
        right: 6px !important;
    }

    .auth-theme-toggle {
        top: max(12px, env(safe-area-inset-top, 12px)) !important;
        right: max(12px, env(safe-area-inset-right, 12px)) !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    .back-btn {
        top: 14px !important;
        left: 14px !important;
        right: auto !important;
        width: 32px !important;
        height: 32px !important;
    }

    .oauth-btn-google {
        font-size: 0.85rem !important;
        gap: 8px !important;
    }

    .auth-btn-secondary {
        font-size: 0.825rem !important;
        padding: 0 8px !important;
        gap: 6px !important;
    }
}

@media (max-width: 375px) {
    .auth-card {
        padding: 20px 14px !important;
        border-radius: 14px !important;
    }

    .auth-card .row.g-2 {
        --bs-gutter-x: 0.35rem;
    }

    .auth-btn-secondary {
        font-size: 0.78rem !important;
        padding: 0 4px !important;
        gap: 4px !important;
    }

    .auth-btn-secondary span {
        font-size: 0.78rem !important;
    }

    .oauth-btn-google {
        font-size: 0.8rem !important;
        gap: 6px !important;
    }
}

.form-control {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #1e293b;
}

/* Dashboard Layout */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.sidebar {
    min-width: var(--sidebar-width, 280px);
    max-width: var(--sidebar-width, 280px);
    width: var(--sidebar-width, 280px);
    background: var(--sidebar-bg, #ffffff) !important;
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    color: var(--sidebar-link, #334155);
    min-height: 100vh;
    height: 100vh;
    transition: width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), 
                min-width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), 
                max-width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: width, min-width, max-width, backdrop-filter;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-right: 1px solid var(--sidebar-border, #e2e8f0) !important;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.04);
    overflow-x: hidden;
    transform: translateZ(0);
}

.sidebar-header {
    height: 70px;
    min-height: 70px;
    padding: 0 18px;
    border-bottom: 1px solid var(--sidebar-border, #e2e8f0);
    background: var(--sidebar-header-bg, #ffffff);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: height 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), padding 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--sidebar-brand-title, #0f172a) !important;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.25s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-brand-link:hover {
    opacity: 0.95;
    color: var(--sidebar-brand-title, #0f172a) !important;
}

.sidebar-logo-wrapper {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-radius: 50%;
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo-img {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    object-fit: contain;
    display: block;
    border-radius: 50%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.sidebar-logo-fallback {
    width: 40px !important;
    height: 40px !important;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    border-radius: 50%;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.sidebar-brand-title {
    margin: 0;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 1.2px;
    color: var(--sidebar-brand-title, #0f172a) !important;
}

.sidebar-brand-subtitle {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--sidebar-brand-subtitle, #2563eb) !important;
    opacity: 0.95;
    margin-top: 2px;
}

.sidebar ul.components {
    padding: 12px 10px;
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Elegant sleek scrollbar */
.sidebar ul.components::-webkit-scrollbar {
    width: 4px;
}
.sidebar ul.components::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar ul.components::-webkit-scrollbar-thumb {
    background: var(--sidebar-scroll-thumb, rgba(0, 0, 0, 0.12));
    border-radius: 4px;
}
.sidebar ul.components::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-scroll-thumb-hover, rgba(0, 0, 0, 0.22));
}

/* Category Section Headings */
.sidebar-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 12px 6px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--sidebar-heading, #64748b) !important;
    opacity: 0.9;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    transition: padding 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-heading span {
    display: inline-block;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-heading i,
.sidebar-heading svg,
.sidebar-heading .lucide {
    font-size: 0.8rem;
    width: 14px;
    height: 14px;
    color: var(--sidebar-heading-icon, #2563eb);
    flex-shrink: 0;
}

/* Nav Item Link - Standard, accessible 42px touch target & 15px font */
.sidebar ul li a {
    padding: 10px 14px;
    margin: 2px 0;
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    color: var(--sidebar-link, #334155);
    text-decoration: none;
    border-radius: 9px;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), padding 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    position: relative;
    border-left: none;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar ul li a i,
.sidebar ul li a svg,
.sidebar ul li a .lucide {
    margin-right: 12px;
    font-size: 1.18rem;
    width: 20px;
    height: 20px;
    color: var(--sidebar-icon, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: margin-right 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), font-size 0.2s ease, color 0.15s ease;
}

.sidebar ul li a span.nav-text {
    display: inline-block;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.2s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Hover State */
.sidebar ul li a:hover {
    color: var(--sidebar-link-hover, #0f172a);
    background: var(--sidebar-hover, #f1f5f9);
}

.sidebar ul li a:hover i,
.sidebar ul li a:hover svg,
.sidebar ul li a:hover .lucide {
    color: var(--sidebar-icon-hover, #2563eb);
}

/* Active State */
.sidebar ul li.active > a {
    color: #ffffff !important;
    background: var(--sidebar-link-active, linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%)) !important;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}

.sidebar ul li.active > a i,
.sidebar ul li.active > a svg,
.sidebar ul li.active > a .lucide {
    color: #ffffff !important;
}

.sidebar ul li.active > a::after {
    content: '';
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    transition: right 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), top 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    height: 38px;
    border-radius: 8px;
    background: #dc2626;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.15s ease-in-out;
}

.sidebar-logout-btn:hover {
    background: #b91c1c;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(185, 28, 28, 0.4);
}

.sidebar-logout-btn i,
.sidebar-logout-btn svg,
.sidebar-logout-btn .lucide {
    font-size: 1rem;
    width: 16px;
    height: 16px;
}

.main-content {
    width: calc(100% - var(--sidebar-width, 280px));
    margin-left: var(--sidebar-width, 280px);
    min-height: 100vh;
    transition: width 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), 
                margin-left 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: width, margin-left;
}

.top-navbar {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 0.875rem 1.75rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    position: sticky;
    top: 0;
    z-index: 990;
    will-change: backdrop-filter;
    transform: translateZ(0);
}

.content-body {
    padding: 1.25rem 1.5rem;
    max-width: 100%;
}

.page-title {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    font-size: 1.625rem;
    letter-spacing: -0.02em;
}

/* Sidebar Backdrop Overlay for Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Close & Collapse Button */
.sidebar-close-btn,
.sidebar-collapse-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.15rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover,
.sidebar-collapse-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

/* Top Navbar Toggle Button (Small button with icon) */
.sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: #ffffff;
    color: #334155;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.sidebar-toggle-btn:active {
    transform: translateY(0);
}

.sidebar-toggle-btn i {
    transition: transform 0.2s ease;
}

/* Desktop Collapsed Sidebar State (>= 769px) - Straight Right-to-Left Collapse / Left-to-Right Expand */
@media (min-width: 769px) {
    /* Hide redundant topbar toggle button on desktop */
    .sidebar-toggle-btn {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar {
        min-width: var(--sidebar-collapsed-width, 76px);
        max-width: var(--sidebar-collapsed-width, 76px);
        width: var(--sidebar-collapsed-width, 76px);
        margin-left: 0;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.22);
    }

    body.sidebar-collapsed .main-content {
        width: calc(100% - var(--sidebar-collapsed-width, 76px));
        margin-left: var(--sidebar-collapsed-width, 76px);
    }

    /* Logo and brand slide smoothly straight to the left and fade out when collapsing */
    body.sidebar-collapsed .sidebar-brand-link {
        opacity: 0;
        transform: translateX(-30px);
        pointer-events: none;
        position: absolute;
        visibility: hidden;
    }

    body.sidebar-collapsed .sidebar-header {
        padding: 0;
        height: 64px;
        min-height: 64px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-bottom: 1px solid var(--sidebar-border);
    }

    body.sidebar-collapsed .sidebar-collapse-btn {
        margin: 0 auto !important;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #93c5fd;
        font-size: 1.25rem;
        transition: all 0.2s ease;
    }

    body.sidebar-collapsed .sidebar-collapse-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
        transform: scale(1.08);
    }

    body.sidebar-collapsed .sidebar ul.components {
        padding: 10px 6px;
        align-items: center;
        transition: padding 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    body.sidebar-collapsed .sidebar-heading {
        padding: 10px 0 4px 0;
        justify-content: center;
        text-align: center;
        width: 100%;
        margin-top: 8px !important;
    }

    /* Heading text slides straight left and fades out */
    body.sidebar-collapsed .sidebar-heading span {
        opacity: 0;
        transform: translateX(-20px);
        pointer-events: none;
        position: absolute;
        visibility: hidden;
    }

    body.sidebar-collapsed .sidebar-heading i,
    body.sidebar-collapsed .sidebar-heading svg,
    body.sidebar-collapsed .sidebar-heading .lucide {
        font-size: 0.85rem;
        color: var(--sidebar-heading-icon, #2563eb);
        margin: 0 auto;
    }

    body.sidebar-collapsed .sidebar ul li {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar ul li a {
        padding: 0;
        width: 48px;
        height: 48px;
        margin: 3px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        position: relative;
        text-align: center;
    }

    /* Navigation text slides straight to the left and fades out */
    body.sidebar-collapsed .sidebar ul li a span.nav-text,
    body.sidebar-collapsed .sidebar ul li a span:not(.badge) {
        opacity: 0;
        transform: translateX(-20px);
        pointer-events: none;
        position: absolute;
        visibility: hidden;
    }

    body.sidebar-collapsed .sidebar ul li a i,
    body.sidebar-collapsed .sidebar ul li a svg,
    body.sidebar-collapsed .sidebar ul li a .lucide {
        margin-right: 0 !important;
        font-size: 1.25rem;
        width: auto;
        color: var(--sidebar-icon, #64748b);
    }

    body.sidebar-collapsed .sidebar ul li a:hover {
        background: var(--sidebar-hover, #f1f5f9);
        transform: scale(1.05);
    }

    body.sidebar-collapsed .sidebar ul li a:hover i,
    body.sidebar-collapsed .sidebar ul li a:hover svg,
    body.sidebar-collapsed .sidebar ul li a:hover .lucide {
        color: var(--sidebar-icon-hover, #2563eb);
    }

    body.sidebar-collapsed .sidebar ul li.active > a {
        background: var(--sidebar-link-active);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
    }

    body.sidebar-collapsed .sidebar ul li.active > a::after {
        content: '';
        position: absolute;
        top: 6px;
        right: 6px;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
    }
}

/* Smooth Table Touch Inertia Scrolling */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    border-radius: inherit;
    width: 100%;
}

/* Responsive Breakpoints */

/* Tablet & Mobile Screens (<= 992px) */
@media (max-width: 992px) {
    .content-body {
        padding: 1rem 1.25rem;
    }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width, 280px));
        box-shadow: none;
        z-index: 1050;
    }

    .sidebar.active {
        margin-left: 0;
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.65);
    }

    .sidebar-close-btn {
        display: flex;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .top-navbar {
        padding: 0.75rem 1rem;
    }

    .top-navbar .dropdown-menu {
        max-width: calc(100vw - 24px) !important;
        position: absolute !important;
    }

    .content-body {
        padding: 0.85rem 0.75rem;
    }

    .page-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    /* Hero Banners Responsive Scaling */
    .repo-hero,
    .trend-hero,
    .archive-hero,
    .analytics-hero {
        padding: 1.5rem 1.25rem !important;
        margin-bottom: 1.5rem !important;
        border-radius: 14px !important;
    }

    .repo-hero h1,
    .trend-hero h1,
    .archive-hero h1,
    .analytics-hero h1,
    .display-5 {
        font-size: 1.6rem !important;
        line-height: 1.25 !important;
    }

    .repo-hero p.lead,
    .trend-hero p.lead,
    .archive-hero p.lead,
    .analytics-hero p.lead {
        font-size: 0.95rem !important;
    }
}

/* Small Phones (<= 576px) */
@media (max-width: 576px) {
    .content-body {
        padding: 0.65rem 0.5rem;
    }

    .card {
        border-radius: 10px;
    }

    /* Responsive adjustments for header actions & cards */
    .repo-hero a.btn,
    .trend-hero a.btn,
    .archive-hero a.btn,
    .analytics-hero a.btn {
        width: 100%;
        text-align: center;
        margin-top: 0.75rem;
    }

    /* Fullscreen editor adjustments */
    .editor-iframe {
        height: 65vh;
    }

    /* Modal adjustments on mobile */
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* ==========================================================================
   NEXUS DARK MODE DESIGN SYSTEM (WCAG High-Contrast, Visually Appealing)
   ========================================================================== */

/* 1. Ultra-Smooth Theme Transition */
html.theme-transition,
html.theme-transition *,
html.theme-transition *:before,
html.theme-transition *:after {
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transition-delay: 0s !important;
}

/* 2. Topbar Quick-Action Theme Toggle Button */
.theme-toggle-btn {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 6px 14px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle-btn:active {
    transform: translateY(0);
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.theme-toggle-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.theme-icon-dark {
    color: #4f46e5; /* Vibrant indigo crescent */
}

.theme-icon-light {
    color: #f59e0b; /* Golden radiant sun */
}

/* User Dropdown Theme Item */
.theme-dropdown-btn {
    width: 100%;
    cursor: pointer;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    text-align: left;
    transition: background 0.15s ease;
}

.theme-dropdown-btn:hover {
    background-color: #f1f5f9;
}

/* 3. Dark Theme Variables & Base Elements */
[data-theme="dark"],
[data-bs-theme="dark"],
body.dark-mode {
    --primary-color: #3b82f6;
    --accent-color: #60a5fa;
    --bg-color: #081226;
    --card-bg: #0f213d;
    --card-gradient: linear-gradient(145deg, #112646 0%, #0d1e38 100%);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --topbar-bg: #0b1a32;
    --border-color: #1e3a5f;
    --border-color-subtle: rgba(255, 255, 255, 0.08);
    --input-bg: #071326;
    --input-border: #1e3a5f;
    --sidebar-bg: #0c1a30;
    --sidebar-bg-gradient: linear-gradient(180deg, #0d1e38 0%, #081426 100%);
    --sidebar-border: rgba(125, 211, 252, 0.08);
    --sidebar-header-bg: rgba(255, 255, 255, 0.03);
    --sidebar-brand-title: #ffffff;
    --sidebar-brand-subtitle: #93c5fd;
    --sidebar-collapse-color: rgba(255, 255, 255, 0.75);
    --sidebar-heading: #7dd3fc;
    --sidebar-heading-icon: #38bdf8;
    --sidebar-link: rgba(241, 245, 249, 0.88);
    --sidebar-icon: #93c5fd;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-link-hover: #ffffff;
    --sidebar-icon-hover: #ffffff;
    --sidebar-link-active: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    --sidebar-scroll-thumb: rgba(255, 255, 255, 0.12);
    --sidebar-scroll-thumb-hover: rgba(255, 255, 255, 0.25);
    
    background-color: var(--bg-color) !important;
    color: var(--text-main);
}

/* Sidebar in Dark Mode */
[data-theme="dark"] .sidebar,
[data-bs-theme="dark"] .sidebar,
body.dark-mode .sidebar {
    background: #0c1a30 !important;
    border-right-color: rgba(125, 211, 252, 0.08) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35) !important;
    color: rgba(241, 245, 249, 0.88) !important;
}

[data-theme="dark"] .sidebar-header,
[data-bs-theme="dark"] .sidebar-header,
body.dark-mode .sidebar-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="dark"] .sidebar-brand-title,
[data-bs-theme="dark"] .sidebar-brand-title,
body.dark-mode .sidebar-brand-title {
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar-brand-subtitle,
[data-bs-theme="dark"] .sidebar-brand-subtitle,
body.dark-mode .sidebar-brand-subtitle {
    color: #93c5fd !important;
}

[data-theme="dark"] .sidebar-collapse-btn,
[data-theme="dark"] .sidebar-close-btn,
[data-bs-theme="dark"] .sidebar-collapse-btn,
[data-bs-theme="dark"] .sidebar-close-btn,
body.dark-mode .sidebar-collapse-btn,
body.dark-mode .sidebar-close-btn {
    color: rgba(255, 255, 255, 0.75) !important;
}

[data-theme="dark"] .sidebar-collapse-btn:hover,
[data-theme="dark"] .sidebar-close-btn:hover,
[data-bs-theme="dark"] .sidebar-collapse-btn:hover,
[data-bs-theme="dark"] .sidebar-close-btn:hover,
body.dark-mode .sidebar-collapse-btn:hover,
body.dark-mode .sidebar-close-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .sidebar-heading,
[data-bs-theme="dark"] .sidebar-heading,
body.dark-mode .sidebar-heading {
    color: #7dd3fc !important;
}

[data-theme="dark"] .sidebar-heading i,
[data-theme="dark"] .sidebar-heading svg,
[data-theme="dark"] .sidebar-heading .lucide,
[data-bs-theme="dark"] .sidebar-heading i,
[data-bs-theme="dark"] .sidebar-heading svg,
[data-bs-theme="dark"] .sidebar-heading .lucide,
body.dark-mode .sidebar-heading i,
body.dark-mode .sidebar-heading svg,
body.dark-mode .sidebar-heading .lucide {
    color: #38bdf8 !important;
}

[data-theme="dark"] .sidebar ul li a,
[data-bs-theme="dark"] .sidebar ul li a,
body.dark-mode .sidebar ul li a {
    color: rgba(241, 245, 249, 0.88) !important;
}

[data-theme="dark"] .sidebar ul li a i,
[data-theme="dark"] .sidebar ul li a svg,
[data-theme="dark"] .sidebar ul li a .lucide,
[data-bs-theme="dark"] .sidebar ul li a i,
[data-bs-theme="dark"] .sidebar ul li a svg,
[data-bs-theme="dark"] .sidebar ul li a .lucide,
body.dark-mode .sidebar ul li a i,
body.dark-mode .sidebar ul li a svg,
body.dark-mode .sidebar ul li a .lucide {
    color: #93c5fd !important;
}

[data-theme="dark"] .sidebar ul li a:hover,
[data-bs-theme="dark"] .sidebar ul li a:hover,
body.dark-mode .sidebar ul li a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar ul li a:hover i,
[data-theme="dark"] .sidebar ul li a:hover svg,
[data-theme="dark"] .sidebar ul li a:hover .lucide,
[data-bs-theme="dark"] .sidebar ul li a:hover i,
[data-bs-theme="dark"] .sidebar ul li a:hover svg,
[data-bs-theme="dark"] .sidebar ul li a:hover .lucide,
body.dark-mode .sidebar ul li a:hover i,
body.dark-mode .sidebar ul li a:hover svg,
body.dark-mode .sidebar ul li a:hover .lucide {
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar ul li.active > a,
[data-bs-theme="dark"] .sidebar ul li.active > a,
body.dark-mode .sidebar ul li.active > a {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.35) !important;
}

[data-theme="dark"] .sidebar ul li.active > a i,
[data-theme="dark"] .sidebar ul li.active > a svg,
[data-theme="dark"] .sidebar ul li.active > a .lucide,
[data-bs-theme="dark"] .sidebar ul li.active > a i,
[data-bs-theme="dark"] .sidebar ul li.active > a svg,
[data-bs-theme="dark"] .sidebar ul li.active > a .lucide,
body.dark-mode .sidebar ul li.active > a i,
body.dark-mode .sidebar ul li.active > a svg,
body.dark-mode .sidebar ul li.active > a .lucide {
    color: #ffffff !important;
}

[data-theme="dark"] .sidebar ul.components::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] .sidebar ul.components::-webkit-scrollbar-thumb,
body.dark-mode .sidebar ul.components::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Scrollbar in Dark Mode */
[data-theme="dark"] ::-webkit-scrollbar-thumb,
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb,
body.dark-mode ::-webkit-scrollbar-thumb {
    background: #1e3a5f;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover,
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover,
body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #2b5285;
}

/* 4. Topbar & Header in Dark Mode */
[data-theme="dark"] .top-navbar,
[data-bs-theme="dark"] .top-navbar,
body.dark-mode .top-navbar {
    background: #0b1a32 !important;
    border-bottom: 1px solid #1a3456 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .top-navbar h4,
[data-theme="dark"] .top-navbar h6,
[data-theme="dark"] .top-navbar strong,
[data-bs-theme="dark"] .top-navbar h4,
[data-bs-theme="dark"] .top-navbar h6,
[data-bs-theme="dark"] .top-navbar strong,
body.dark-mode .top-navbar h4,
body.dark-mode .top-navbar h6,
body.dark-mode .top-navbar strong {
    color: #f8fafc !important;
}

[data-theme="dark"] #notifDropdown i,
[data-bs-theme="dark"] #notifDropdown i,
body.dark-mode #notifDropdown i {
    color: #93c5fd !important;
}

[data-theme="dark"] .sidebar-toggle-btn,
[data-bs-theme="dark"] .sidebar-toggle-btn,
body.dark-mode .sidebar-toggle-btn {
    background: #0e2242 !important;
    border-color: #1e3a5f !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .sidebar-toggle-btn:hover,
[data-bs-theme="dark"] .sidebar-toggle-btn:hover,
body.dark-mode .sidebar-toggle-btn:hover {
    background: #183764 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Toggle Button Appearance in Dark Mode */
[data-theme="dark"] .theme-toggle-btn,
[data-bs-theme="dark"] .theme-toggle-btn,
body.dark-mode .theme-toggle-btn {
    background: #122849 !important;
    color: #f8fafc !important;
    border-color: #2b5387 !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25) !important;
}

[data-theme="dark"] .theme-toggle-btn:hover,
[data-bs-theme="dark"] .theme-toggle-btn:hover,
body.dark-mode .theme-toggle-btn:hover {
    background: #1a3866 !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.45) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .theme-dropdown-btn:hover,
[data-bs-theme="dark"] .theme-dropdown-btn:hover,
body.dark-mode .theme-dropdown-btn:hover {
    background-color: #172d50 !important;
    color: #60a5fa !important;
}

/* 5. Cards, Stat Cards & Metric Containers in Dark Mode */
[data-theme="dark"] .card,
[data-theme="dark"] .glass-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .chart-box,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .archive-card,
[data-theme="dark"] .action-box,
[data-theme="dark"] .filter-card,
[data-theme="dark"] .project-card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] div[class*="stat-"],
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .glass-card,
[data-bs-theme="dark"] .stat-card,
[data-bs-theme="dark"] .chart-box,
[data-bs-theme="dark"] .chart-card,
[data-bs-theme="dark"] .kpi-card,
[data-bs-theme="dark"] .archive-card,
[data-bs-theme="dark"] .action-box,
[data-bs-theme="dark"] .filter-card,
[data-bs-theme="dark"] .project-card,
[data-bs-theme="dark"] .metric-card,
[data-bs-theme="dark"] div[class*="stat-"],
body.dark-mode .card,
body.dark-mode .glass-card,
body.dark-mode .stat-card,
body.dark-mode .chart-box,
body.dark-mode .chart-card,
body.dark-mode .kpi-card,
body.dark-mode .archive-card,
body.dark-mode .action-box,
body.dark-mode .filter-card,
body.dark-mode .project-card,
body.dark-mode .metric-card,
body.dark-mode div[class*="stat-"] {
    background: rgba(15, 33, 61, 0.58) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    border-radius: 14px;
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .kpi-card:hover,
[data-bs-theme="dark"] .card:hover,
[data-bs-theme="dark"] .stat-card:hover,
[data-bs-theme="dark"] .kpi-card:hover,
body.dark-mode .card:hover,
body.dark-mode .stat-card:hover,
body.dark-mode .kpi-card:hover {
    border-color: rgba(96, 165, 250, 0.35) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 20px rgba(37, 99, 235, 0.25) !important;
    transform: translateY(-2px);
}

[data-theme="dark"] .chart-header,
[data-bs-theme="dark"] .chart-header,
body.dark-mode .chart-header {
    border-bottom-color: #1a3456 !important;
}

[data-theme="dark"] .chart-title,
[data-bs-theme="dark"] .chart-title,
body.dark-mode .chart-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .stat-icon,
[data-theme="dark"] .kpi-icon,
[data-bs-theme="dark"] .stat-icon,
[data-bs-theme="dark"] .kpi-icon,
body.dark-mode .stat-icon,
body.dark-mode .kpi-icon {
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Data Numbers, Metric Values & Counters in Dark Mode */
[data-theme="dark"] .stat-card h2,
[data-theme="dark"] .kpi-card h2,
[data-theme="dark"] .chart-box h2,
[data-theme="dark"] .chart-card h2,
[data-theme="dark"] .stat-card .display-6,
[data-theme="dark"] .kpi-card .display-6,
[data-theme="dark"] .card h2,
[data-theme="dark"] .card .display-6,
[data-theme="dark"] .card .display-5,
[data-theme="dark"] .card .display-4,
[data-bs-theme="dark"] .stat-card h2,
[data-bs-theme="dark"] .kpi-card h2,
[data-bs-theme="dark"] .chart-box h2,
[data-bs-theme="dark"] .chart-card h2,
[data-bs-theme="dark"] .stat-card .display-6,
[data-bs-theme="dark"] .kpi-card .display-6,
[data-bs-theme="dark"] .card h2,
[data-bs-theme="dark"] .card .display-6,
[data-bs-theme="dark"] .card .display-5,
[data-bs-theme="dark"] .card .display-4,
body.dark-mode .stat-card h2,
body.dark-mode .kpi-card h2,
body.dark-mode .chart-box h2,
body.dark-mode .chart-card h2,
body.dark-mode .stat-card .display-6,
body.dark-mode .kpi-card .display-6,
body.dark-mode .card h2,
body.dark-mode .card .display-6,
body.dark-mode .card .display-5,
body.dark-mode .card .display-4 {
    color: #f8fafc !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer,
[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer,
body.dark-mode .card-header,
body.dark-mode .card-footer {
    background: rgba(11, 26, 50, 0.6) !important;
    border-color: #1a3456 !important;
    color: #f1f5f9 !important;
}

/* 6. Typography & Text Hierarchy in Dark Mode */
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6,
[data-theme="dark"] .card-title,
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .card-title,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6,
body.dark-mode .card-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .page-title,
[data-bs-theme="dark"] .page-title,
body.dark-mode .page-title {
    color: #60a5fa !important;
}

/* Override Bootstrap .text-dark so labels & headings stay crisp */
[data-theme="dark"] .text-dark,
[data-bs-theme="dark"] .text-dark,
body.dark-mode .text-dark {
    color: #f8fafc !important;
}

[data-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-muted,
body.dark-mode .text-muted {
    color: #94a3b8 !important;
}

[data-theme="dark"] .text-secondary,
[data-bs-theme="dark"] .text-secondary,
body.dark-mode .text-secondary {
    color: #cbd5e1 !important;
}

/* Override Bootstrap light and white utility containers */
[data-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-light,
body.dark-mode .bg-light {
    background-color: #0b1a32 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-white,
body.dark-mode .bg-white {
    background-color: #0f213d !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end,
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end,
body.dark-mode .border,
body.dark-mode .border-top,
body.dark-mode .border-bottom,
body.dark-mode .border-start,
body.dark-mode .border-end {
    border-color: #1a3456 !important;
}

/* 7. ALL BUTTONS - HIGH CONTRAST, DISTINCTIVE & EASY TO UNDERSTAND */

/* --- Primary Button --- */
[data-theme="dark"] .btn-primary,
[data-bs-theme="dark"] .btn-primary,
body.dark-mode .btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: 1px solid #3b82f6 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    letter-spacing: 0.2px;
}

[data-theme="dark"] .btn-primary:hover,
[data-bs-theme="dark"] .btn-primary:hover,
body.dark-mode .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.6), 0 0 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
    color: #ffffff !important;
}

[data-theme="dark"] .btn-primary:active,
[data-bs-theme="dark"] .btn-primary:active,
body.dark-mode .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.45);
}

[data-theme="dark"] .btn-primary:focus-visible,
[data-bs-theme="dark"] .btn-primary:focus-visible,
body.dark-mode .btn-primary:focus-visible {
    outline: 2px solid #60a5fa !important;
    outline-offset: 2px !important;
}

/* --- Outline Primary Button --- */
[data-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .btn-outline-primary,
body.dark-mode .btn-outline-primary {
    background: rgba(37, 99, 235, 0.15) !important;
    border: 1.5px solid #3b82f6 !important;
    color: #93c5fd !important;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .btn-outline-primary:hover,
[data-bs-theme="dark"] .btn-outline-primary:hover,
body.dark-mode .btn-outline-primary:hover {
    background: #2563eb !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

/* --- Secondary Button --- */
[data-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-secondary,
body.dark-mode .btn-secondary {
    background: #162a45 !important;
    border: 1px solid #284c79 !important;
    color: #e2e8f0 !important;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .btn-secondary:hover,
[data-bs-theme="dark"] .btn-secondary:hover,
body.dark-mode .btn-secondary:hover {
    background: #1f3b61 !important;
    border-color: #3b6ba8 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* --- Outline Secondary Button --- */
[data-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-secondary,
body.dark-mode .btn-outline-secondary {
    background: rgba(148, 163, 184, 0.08) !important;
    border: 1.5px solid #475569 !important;
    color: #cbd5e1 !important;
    font-weight: 500;
}

[data-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:hover,
body.dark-mode .btn-outline-secondary:hover {
    background: #243854 !important;
    border-color: #94a3b8 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* --- Success Button --- */
[data-theme="dark"] .btn-success,
[data-bs-theme="dark"] .btn-success,
body.dark-mode .btn-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border: 1px solid #10b981 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .btn-success:hover,
[data-bs-theme="dark"] .btn-success:hover,
body.dark-mode .btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%) !important;
    border-color: #34d399 !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5), 0 0 10px rgba(52, 211, 153, 0.3);
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* --- Outline Success Button --- */
[data-theme="dark"] .btn-outline-success,
[data-bs-theme="dark"] .btn-outline-success,
body.dark-mode .btn-outline-success {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1.5px solid #10b981 !important;
    color: #6ee7b7 !important;
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-success:hover,
[data-bs-theme="dark"] .btn-outline-success:hover,
body.dark-mode .btn-outline-success:hover {
    background: #059669 !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* --- Danger Button --- */
[data-theme="dark"] .btn-danger,
[data-bs-theme="dark"] .btn-danger,
body.dark-mode .btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    border: 1px solid #ef4444 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

[data-theme="dark"] .btn-danger:hover,
[data-bs-theme="dark"] .btn-danger:hover,
body.dark-mode .btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%) !important;
    border-color: #f87171 !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5), 0 0 10px rgba(248, 113, 113, 0.3);
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* --- Outline Danger Button --- */
[data-theme="dark"] .btn-outline-danger,
[data-bs-theme="dark"] .btn-outline-danger,
body.dark-mode .btn-outline-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1.5px solid #ef4444 !important;
    color: #fca5a5 !important;
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-danger:hover,
[data-bs-theme="dark"] .btn-outline-danger:hover,
body.dark-mode .btn-outline-danger:hover {
    background: #dc2626 !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* --- Warning Button --- */
[data-theme="dark"] .btn-warning,
[data-bs-theme="dark"] .btn-warning,
body.dark-mode .btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    border: 1px solid #f59e0b !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .btn-warning:hover,
[data-bs-theme="dark"] .btn-warning:hover,
body.dark-mode .btn-warning:hover {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%) !important;
    border-color: #fbbf24 !important;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* --- Outline Warning Button --- */
[data-theme="dark"] .btn-outline-warning,
[data-bs-theme="dark"] .btn-outline-warning,
body.dark-mode .btn-outline-warning {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1.5px solid #f59e0b !important;
    color: #fcd34d !important;
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-warning:hover,
[data-bs-theme="dark"] .btn-outline-warning:hover,
body.dark-mode .btn-outline-warning:hover {
    background: #d97706 !important;
    border-color: #fbbf24 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

/* --- Info Button --- */
[data-theme="dark"] .btn-info,
[data-bs-theme="dark"] .btn-info,
body.dark-mode .btn-info {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

[data-theme="dark"] .btn-outline-info,
[data-bs-theme="dark"] .btn-outline-info,
body.dark-mode .btn-outline-info {
    background: rgba(14, 165, 233, 0.15) !important;
    border: 1.5px solid #0ea5e9 !important;
    color: #7dd3fc !important;
    font-weight: 600;
}

[data-theme="dark"] .btn-outline-info:hover,
[data-bs-theme="dark"] .btn-outline-info:hover,
body.dark-mode .btn-outline-info:hover {
    background: #0284c7 !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

/* --- Light & White Buttons (Converted into Sleek Elevated Dark Controls) --- */
[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-white,
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-white,
body.dark-mode .btn-light,
body.dark-mode .btn-white {
    background: #142845 !important;
    border: 1px solid #244b7a !important;
    color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-light:hover,
[data-theme="dark"] .btn-white:hover,
[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .btn-white:hover,
body.dark-mode .btn-light:hover,
body.dark-mode .btn-white:hover {
    background: #1d3962 !important;
    border-color: #3b6ea8 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* 8. Forms & Inputs in Dark Mode */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: rgba(7, 19, 38, 0.65) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-color: rgba(30, 58, 95, 0.8) !important;
    color: #f1f5f9 !important;
    border-radius: 10px;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus,
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background-color: rgba(10, 24, 50, 0.85) !important;
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25), 0 0 16px rgba(59, 130, 246, 0.2) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .input-group-text,
[data-bs-theme="dark"] .input-group-text,
body.dark-mode .input-group-text {
    background-color: rgba(13, 30, 56, 0.75) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-color: rgba(30, 58, 95, 0.8) !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .form-control::placeholder,
[data-bs-theme="dark"] .form-control::placeholder,
body.dark-mode .form-control::placeholder {
    color: #64748b !important;
    opacity: 1;
}

[data-theme="dark"] .form-check-input,
[data-bs-theme="dark"] .form-check-input,
body.dark-mode .form-check-input {
    background-color: #09172e !important;
    border-color: #244b7a !important;
}

[data-theme="dark"] .form-check-input:checked,
[data-bs-theme="dark"] .form-check-input:checked,
body.dark-mode .form-check-input:checked {
    background-color: #2563eb !important;
    border-color: #3b82f6 !important;
}

/* 9. Tables in Dark Mode */
[data-theme="dark"] .table,
[data-bs-theme="dark"] .table,
body.dark-mode .table {
    --bs-table-bg: transparent;
    --bs-table-color: #f1f5f9;
    --bs-table-hover-bg: rgba(59, 130, 246, 0.08);
    --bs-table-hover-color: #ffffff;
    border-color: rgba(30, 58, 95, 0.6) !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .table thead th,
[data-bs-theme="dark"] .table thead th,
body.dark-mode .table thead th {
    background-color: rgba(9, 23, 46, 0.8) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: #93c5fd !important;
    border-bottom: 2px solid rgba(30, 58, 95, 0.8) !important;
    font-weight: 600;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .table tbody td,
[data-bs-theme="dark"] .table tbody td,
body.dark-mode .table tbody td {
    border-bottom: 1px solid rgba(20, 39, 66, 0.7) !important;
    color: #f1f5f9;
}

[data-theme="dark"] .table-hover tbody tr:hover td,
[data-bs-theme="dark"] .table-hover tbody tr:hover td,
body.dark-mode .table-hover tbody tr:hover td {
    background-color: rgba(37, 99, 235, 0.1) !important;
}

/* 10. Dropdowns & Modals in Dark Mode */
[data-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .dropdown-menu,
body.dark-mode .dropdown-menu {
    background-color: rgba(11, 26, 50, 0.85) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    border-radius: 14px;
}

[data-theme="dark"] .dropdown-item,
[data-bs-theme="dark"] .dropdown-item,
body.dark-mode .dropdown-item {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus,
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus,
body.dark-mode .dropdown-item:hover,
body.dark-mode .dropdown-item:focus {
    background-color: rgba(37, 99, 235, 0.15) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .dropdown-divider,
[data-bs-theme="dark"] .dropdown-divider,
body.dark-mode .dropdown-divider {
    border-top-color: rgba(30, 58, 95, 0.7) !important;
}

[data-theme="dark"] .dropdown-header,
[data-bs-theme="dark"] .dropdown-header,
body.dark-mode .dropdown-header {
    color: #93c5fd !important;
}

[data-theme="dark"] .modal-content,
[data-bs-theme="dark"] .modal-content,
body.dark-mode .modal-content {
    background-color: rgba(11, 26, 50, 0.88) !important;
    backdrop-filter: blur(24px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    color: #f1f5f9 !important;
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.6) !important;
    border-radius: 16px;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer,
body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: rgba(30, 58, 95, 0.7) !important;
}

[data-theme="dark"] .btn-close,
[data-bs-theme="dark"] .btn-close,
body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* 11. Badges, Progress, & List Groups */
[data-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-light,
body.dark-mode .badge.bg-light {
    background-color: #142845 !important;
    color: #93c5fd !important;
    border: 1px solid #234773 !important;
}

[data-theme="dark"] .list-group-item,
[data-bs-theme="dark"] .list-group-item,
body.dark-mode .list-group-item {
    background-color: transparent !important;
    border-color: #1a3456 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .progress,
[data-bs-theme="dark"] .progress,
body.dark-mode .progress {
    background-color: #071326 !important;
    border: 1px solid #1a3456 !important;
}

/* 12. Alerts & Notifications */
[data-theme="dark"] .alert-info,
[data-bs-theme="dark"] .alert-info,
body.dark-mode .alert-info {
    background-color: rgba(14, 165, 233, 0.15) !important;
    border-color: #0284c7 !important;
    color: #7dd3fc !important;
}

[data-theme="dark"] .alert-success,
[data-bs-theme="dark"] .alert-success,
body.dark-mode .alert-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: #059669 !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .alert-warning,
[data-bs-theme="dark"] .alert-warning,
body.dark-mode .alert-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border-color: #d97706 !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .alert-danger,
[data-bs-theme="dark"] .alert-danger,
body.dark-mode .alert-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border-color: #dc2626 !important;
    color: #fca5a5 !important;
}

/* Topbar Notification Dropdown Styles */
.topbar-notif-dropdown {
    width: 360px;
    max-width: calc(100vw - 24px);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.notif-item {
    transition: background 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.notif-item:hover {
    background-color: rgba(37, 99, 235, 0.06);
}

.notif-item.is-unread {
    background-color: rgba(37, 99, 235, 0.04);
}

[data-theme="dark"] .notif-item:hover,
[data-bs-theme="dark"] .notif-item:hover,
body.dark-mode .notif-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .notif-item.is-unread,
[data-bs-theme="dark"] .notif-item.is-unread,
body.dark-mode .notif-item.is-unread {
    background-color: rgba(37, 99, 235, 0.18);
}

/* 13. Chat Widget in Dark Mode */
[data-theme="dark"] #chatWidgetContainer,
[data-bs-theme="dark"] #chatWidgetContainer,
body.dark-mode #chatWidgetContainer {
    background: #0c1a32 !important;
    border: 1px solid #1e3a5f !important;
    border-bottom: none !important;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #chatWidgetBody,
[data-bs-theme="dark"] #chatWidgetBody,
body.dark-mode #chatWidgetBody {
    background: #071326 !important;
}

[data-theme="dark"] #chatWidgetFooter,
[data-bs-theme="dark"] #chatWidgetFooter,
body.dark-mode #chatWidgetFooter {
    background: #0c1a32 !important;
    border-top: 1px solid #1e3a5f !important;
}

[data-theme="dark"] #chatWidgetFooter input,
[data-bs-theme="dark"] #chatWidgetFooter input,
body.dark-mode #chatWidgetFooter input {
    background: #071326 !important;
    border-color: #1e3a5f !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .chat-bubble-received,
[data-bs-theme="dark"] .chat-bubble-received,
body.dark-mode .chat-bubble-received {
    background: #142845 !important;
    color: #f1f5f9 !important;
    border: 1px solid #1e3a5f !important;
}

/* 14. Pagination in Dark Mode */
[data-theme="dark"] .page-link,
[data-bs-theme="dark"] .page-link,
body.dark-mode .page-link {
    background-color: #0d1e38 !important;
    border-color: #1e3a5f !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .page-item.active .page-link,
[data-bs-theme="dark"] .page-item.active .page-link,
body.dark-mode .page-item.active .page-link {
    background-color: #2563eb !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .page-link:hover,
[data-bs-theme="dark"] .page-link:hover,
body.dark-mode .page-link:hover {
    background-color: #172d50 !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

/* =========================================
   15. Auth Pages (Login, Register & Password Forms) Theme Harmony
   ========================================= */

/* Floating Theme Toggle on Auth Pages */
.auth-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

/* Auth Theme Toggle Button */
.auth-theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.auth-theme-toggle:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: scale(1.08);
    color: #2563eb;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
}

[data-theme="dark"] .auth-theme-toggle,
[data-bs-theme="dark"] .auth-theme-toggle,
body.dark-mode .auth-theme-toggle {
    background: rgba(13, 30, 56, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #f1f5f9 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .auth-theme-toggle:hover,
[data-bs-theme="dark"] .auth-theme-toggle:hover,
body.dark-mode .auth-theme-toggle:hover {
    background: rgba(20, 45, 82, 0.95) !important;
    border-color: rgba(96, 165, 250, 0.6) !important;
    color: #fbbf24 !important;
}

/* =========================================
   AUTH PAGES THEMING SYSTEM (LIGHT & DARK)
   ========================================= */

/* Light Mode: Truly White Design Form */
.auth-card {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45), 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    border-radius: 16px !important;
    color: #0f172a !important;
}

/* Dark Mode Scoped Auth Card */
[data-theme="dark"] .auth-card,
[data-bs-theme="dark"] .auth-card,
body.dark-mode .auth-card {
    background: rgba(13, 30, 56, 0.85) !important;
    backdrop-filter: blur(24px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
}

/* Auth Typography */
.auth-title {
    color: #0f172a !important;
    text-shadow: none !important;
    font-weight: 700 !important;
}

.auth-subtitle {
    color: #64748b !important;
    text-shadow: none !important;
}

.auth-label {
    color: #1e293b !important;
    font-weight: 600 !important;
}

.auth-label .required-star {
    color: #ef4444 !important;
}

[data-theme="dark"] .auth-title,
[data-bs-theme="dark"] .auth-title,
body.dark-mode .auth-title {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
}

/* Light Mode Clean White Auth Inputs */
.auth-input,
select.auth-input {
    background: #f8fafc !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    border-radius: 8px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.auth-input:hover,
select.auth-input:hover {
    background: #ffffff !important;
    border-color: #94a3b8 !important;
}

.auth-input:focus,
select.auth-input:focus {
    background: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    outline: none !important;
}

.auth-input::placeholder {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a !important;
}

select.auth-input option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* Leading Icons & Password Toggle in Light Mode */
.input-icon-wrapper > .leading-icon,
.input-icon-wrapper > svg.leading-icon,
.input-icon-wrapper > i:first-child,
.input-icon-wrapper > svg:first-child,
.input-icon-wrapper > span#schoolIdIconWrap svg {
    color: #64748b !important;
}

.input-icon-wrapper:focus-within .leading-icon,
.input-icon-wrapper:focus-within svg.leading-icon,
.input-icon-wrapper:focus-within > span#schoolIdIconWrap svg {
    color: #2563eb !important;
}

.password-toggle-btn {
    color: #64748b !important;
}

.password-toggle-btn:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

/* Role Picker Cards (Light Mode) */
.role-picker-card {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.role-picker-card:hover {
    background: #f8fafc !important;
    border-color: #2563eb !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12) !important;
}

.role-picker-title {
    color: #0f172a !important;
}

.role-picker-desc {
    color: #64748b !important;
}

.role-picker-arrow {
    color: #94a3b8 !important;
}

.role-picker-card:hover .role-picker-arrow {
    color: #2563eb !important;
}

/* Secondary Button (Light Mode) */
.auth-btn-secondary {
    background: #f8fafc !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.auth-btn-secondary:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Google OAuth Button (Light Mode) */
.oauth-btn-google {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.oauth-btn-google:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Back Button (Light Mode) */
.back-btn {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #64748b !important;
}

.back-btn:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Dividers & Footer Links (Light Mode) */
.auth-card hr,
.auth-divider-line {
    border-color: #e2e8f0 !important;
    opacity: 1 !important;
}

.auth-divider-text,
.auth-footer-text {
    color: #64748b !important;
}

.auth-footer-link,
.auth-forgot-link {
    color: #2563eb !important;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-link:hover,
.auth-forgot-link:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

[data-theme="dark"] .auth-subtitle,
[data-bs-theme="dark"] .auth-subtitle,
body.dark-mode .auth-subtitle {
    color: #94a3b8 !important;
}

[data-theme="dark"] .auth-label,
[data-bs-theme="dark"] .auth-label,
body.dark-mode .auth-label {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .auth-label .required-star,
[data-bs-theme="dark"] .auth-label .required-star,
body.dark-mode .auth-label .required-star {
    color: #f87171 !important;
}

[data-theme="dark"] .auth-input,
[data-theme="dark"] select.auth-input,
[data-bs-theme="dark"] .auth-input,
[data-bs-theme="dark"] select.auth-input,
body.dark-mode .auth-input,
body.dark-mode select.auth-input {
    background-color: #071326 !important;
    border-color: #1e3a5f !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
}

[data-theme="dark"] .auth-input:hover,
[data-bs-theme="dark"] .auth-input:hover,
body.dark-mode .auth-input:hover {
    border-color: #2b558b !important;
}

[data-theme="dark"] .auth-input:focus,
[data-bs-theme="dark"] .auth-input:focus,
body.dark-mode .auth-input:focus {
    background-color: #0a1b35 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px #0d1e38, 0 0 0 4px rgba(59, 130, 246, 0.35) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

[data-theme="dark"] .auth-input::placeholder,
[data-bs-theme="dark"] .auth-input::placeholder,
body.dark-mode .auth-input::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

[data-theme="dark"] .auth-input:-webkit-autofill,
[data-theme="dark"] .auth-input:-webkit-autofill:hover,
[data-theme="dark"] .auth-input:-webkit-autofill:focus,
[data-bs-theme="dark"] .auth-input:-webkit-autofill,
[data-bs-theme="dark"] .auth-input:-webkit-autofill:hover,
[data-bs-theme="dark"] .auth-input:-webkit-autofill:focus,
body.dark-mode .auth-input:-webkit-autofill,
body.dark-mode .auth-input:-webkit-autofill:hover,
body.dark-mode .auth-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #071326 inset !important;
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc !important;
}

[data-theme="dark"] select.auth-input option,
[data-bs-theme="dark"] select.auth-input option,
body.dark-mode select.auth-input option {
    background-color: #071326 !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .auth-logo,
[data-bs-theme="dark"] .auth-logo,
body.dark-mode .auth-logo {
    background: #071326 !important;
    border-color: #1e3a5f !important;
}

[data-theme="dark"] .auth-btn-secondary,
[data-bs-theme="dark"] .auth-btn-secondary,
body.dark-mode .auth-btn-secondary {
    background: #142845 !important;
    border-color: #244b7a !important;
    color: #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .auth-btn-secondary:hover,
[data-bs-theme="dark"] .auth-btn-secondary:hover,
body.dark-mode .auth-btn-secondary:hover {
    background: #1d3962 !important;
    border-color: #3b6ea8 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .oauth-btn-google,
[data-bs-theme="dark"] .oauth-btn-google,
body.dark-mode .oauth-btn-google {
    background: #142845 !important;
    border-color: #244b7a !important;
    color: #f1f5f9 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .oauth-btn-google:hover,
[data-bs-theme="dark"] .oauth-btn-google:hover,
body.dark-mode .oauth-btn-google:hover {
    background: #1d3962 !important;
    border-color: #3b6ea8 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .back-btn,
[data-bs-theme="dark"] .back-btn,
body.dark-mode .back-btn {
    background: #142845 !important;
    border-color: #244b7a !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .back-btn:hover,
[data-bs-theme="dark"] .back-btn:hover,
body.dark-mode .back-btn:hover {
    background: #1d3962 !important;
    border-color: #3b6ea8 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .input-icon-wrapper > .leading-icon,
[data-theme="dark"] .input-icon-wrapper > svg.leading-icon,
[data-theme="dark"] .input-icon-wrapper > i:first-child,
[data-theme="dark"] .input-icon-wrapper > svg:first-child,
[data-theme="dark"] .input-icon-wrapper > span#schoolIdIconWrap svg,
[data-bs-theme="dark"] .input-icon-wrapper > .leading-icon,
[data-bs-theme="dark"] .input-icon-wrapper > svg.leading-icon,
[data-bs-theme="dark"] .input-icon-wrapper > i:first-child,
[data-bs-theme="dark"] .input-icon-wrapper > svg:first-child,
[data-bs-theme="dark"] .input-icon-wrapper > span#schoolIdIconWrap svg,
body.dark-mode .input-icon-wrapper > .leading-icon,
body.dark-mode .input-icon-wrapper > svg.leading-icon,
body.dark-mode .input-icon-wrapper > i:first-child,
body.dark-mode .input-icon-wrapper > svg:first-child,
body.dark-mode .input-icon-wrapper > span#schoolIdIconWrap svg {
    color: #94a3b8 !important;
}

[data-theme="dark"] .input-icon-wrapper:focus-within .leading-icon,
[data-theme="dark"] .input-icon-wrapper:focus-within svg.leading-icon,
[data-theme="dark"] .input-icon-wrapper:focus-within > span#schoolIdIconWrap svg,
[data-bs-theme="dark"] .input-icon-wrapper:focus-within .leading-icon,
[data-bs-theme="dark"] .input-icon-wrapper:focus-within svg.leading-icon,
[data-bs-theme="dark"] .input-icon-wrapper:focus-within > span#schoolIdIconWrap svg,
body.dark-mode .input-icon-wrapper:focus-within .leading-icon,
body.dark-mode .input-icon-wrapper:focus-within svg.leading-icon,
body.dark-mode .input-icon-wrapper:focus-within > span#schoolIdIconWrap svg {
    color: #60a5fa !important;
}

[data-theme="dark"] .password-toggle-btn,
[data-bs-theme="dark"] .password-toggle-btn,
body.dark-mode .password-toggle-btn {
    color: #94a3b8 !important;
}

[data-theme="dark"] .password-toggle-btn:hover,
[data-bs-theme="dark"] .password-toggle-btn:hover,
body.dark-mode .password-toggle-btn:hover {
    color: #ffffff !important;
    background: #142845 !important;
}

[data-theme="dark"] .password-meter-bar,
[data-bs-theme="dark"] .password-meter-bar,
body.dark-mode .password-meter-bar {
    background: #1e3a5f !important;
}

[data-theme="dark"] .password-meter-text,
[data-bs-theme="dark"] .password-meter-text,
body.dark-mode .password-meter-text {
    color: #94a3b8 !important;
}

[data-theme="dark"] .auth-card hr,
[data-theme="dark"] .auth-divider-line,
[data-bs-theme="dark"] .auth-card hr,
[data-bs-theme="dark"] .auth-divider-line,
body.dark-mode .auth-card hr,
body.dark-mode .auth-divider-line {
    border-color: #1e3a5f !important;
}

[data-theme="dark"] .auth-card .text-muted,
[data-theme="dark"] .auth-divider-text,
[data-theme="dark"] .auth-footer-text,
[data-bs-theme="dark"] .auth-card .text-muted,
[data-bs-theme="dark"] .auth-divider-text,
[data-bs-theme="dark"] .auth-footer-text,
body.dark-mode .auth-card .text-muted,
body.dark-mode .auth-divider-text,
body.dark-mode .auth-footer-text {
    color: #94a3b8 !important;
}

[data-theme="dark"] .auth-card a:not(.auth-btn):not(.back-btn),
[data-theme="dark"] .auth-footer-link,
[data-theme="dark"] .auth-forgot-link,
[data-bs-theme="dark"] .auth-card a:not(.auth-btn):not(.back-btn),
[data-bs-theme="dark"] .auth-footer-link,
[data-bs-theme="dark"] .auth-forgot-link,
body.dark-mode .auth-card a:not(.auth-btn):not(.back-btn),
body.dark-mode .auth-footer-link,
body.dark-mode .auth-forgot-link {
    color: #60a5fa !important;
}

/* Dark Mode Role Picker (Register Step 1) */
[data-theme="dark"] .role-picker-card,
[data-bs-theme="dark"] .role-picker-card,
body.dark-mode .role-picker-card {
    background: #09172e !important;
    border: 1px solid #1e3a5f !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .role-picker-card:hover,
[data-bs-theme="dark"] .role-picker-card:hover,
body.dark-mode .role-picker-card:hover {
    background: #0e2242 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.25) !important;
}

[data-theme="dark"] .role-picker-adviser:hover,
[data-bs-theme="dark"] .role-picker-adviser:hover,
body.dark-mode .role-picker-adviser:hover {
    border-color: #6366f1 !important;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.25) !important;
}

[data-theme="dark"] .role-picker-title,
[data-bs-theme="dark"] .role-picker-title,
body.dark-mode .role-picker-title {
    color: #f8fafc !important;
}

[data-theme="dark"] .role-picker-desc,
[data-bs-theme="dark"] .role-picker-desc,
body.dark-mode .role-picker-desc {
    color: #94a3b8 !important;
}

[data-theme="dark"] .role-picker-arrow,
[data-bs-theme="dark"] .role-picker-arrow,
body.dark-mode .role-picker-arrow {
    color: #475569 !important;
}

[data-theme="dark"] .role-picker-card:hover .role-picker-arrow,
[data-bs-theme="dark"] .role-picker-card:hover .role-picker-arrow,
body.dark-mode .role-picker-card:hover .role-picker-arrow {
    color: #60a5fa !important;
}

[data-theme="dark"] .role-picker-adviser:hover .role-picker-arrow,
[data-bs-theme="dark"] .role-picker-adviser:hover .role-picker-arrow,
body.dark-mode .role-picker-adviser:hover .role-picker-arrow {
    color: #818cf8 !important;
}

[data-theme="dark"] .role-picker-card.picked,
[data-bs-theme="dark"] .role-picker-card.picked,
body.dark-mode .role-picker-card.picked {
    border-color: #3b82f6 !important;
    background: #10284d !important;
}

[data-theme="dark"] .role-picker-adviser.picked,
[data-bs-theme="dark"] .role-picker-adviser.picked,
body.dark-mode .role-picker-adviser.picked {
    border-color: #6366f1 !important;
    background: #15224e !important;
}

/* =========================================
   DARK MODE FOR CHAT & CONVERSATIONS
   ========================================= */
[data-theme="dark"] .chat-container,
[data-bs-theme="dark"] .chat-container,
body.dark-mode .chat-container,
[data-theme="dark"] #chatWidgetContainer,
[data-bs-theme="dark"] #chatWidgetContainer,
body.dark-mode #chatWidgetContainer {
    background: #0f213d !important;
    border-color: #1e3a5f !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .chat-header,
[data-bs-theme="dark"] .chat-header,
body.dark-mode .chat-header,
[data-theme="dark"] .chat-widget-header,
[data-bs-theme="dark"] .chat-widget-header,
body.dark-mode .chat-widget-header {
    background: linear-gradient(135deg, #0b1a32 0%, #071326 100%) !important;
    border-bottom: 1px solid #1e3a5f !important;
}

[data-theme="dark"] .chat-header-icon,
[data-bs-theme="dark"] .chat-header-icon,
body.dark-mode .chat-header-icon {
    background: #1e3a5f !important;
    color: #60a5fa !important;
    border: 1px solid #2b558b !important;
}

[data-theme="dark"] .chat-messages,
[data-bs-theme="dark"] .chat-messages,
body.dark-mode .chat-messages,
[data-theme="dark"] .chat-widget-messages,
[data-bs-theme="dark"] .chat-widget-messages,
body.dark-mode .chat-widget-messages {
    background: #081226 !important;
}

[data-theme="dark"] .chat-bubble,
[data-bs-theme="dark"] .chat-bubble,
body.dark-mode .chat-bubble,
[data-theme="dark"] .cw-bubble,
[data-bs-theme="dark"] .cw-bubble,
body.dark-mode .cw-bubble {
    background: #112646 !important;
    color: #f1f5f9 !important;
    border: 1px solid #1e3a5f !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .chat-avatar,
[data-bs-theme="dark"] .chat-avatar,
body.dark-mode .chat-avatar,
[data-theme="dark"] .cw-avatar,
[data-bs-theme="dark"] .cw-avatar,
body.dark-mode .cw-avatar {
    border-color: #1e3a5f !important;
}

[data-theme="dark"] .sender-name,
[data-bs-theme="dark"] .sender-name,
body.dark-mode .sender-name,
[data-theme="dark"] .cw-sender-name,
[data-bs-theme="dark"] .cw-sender-name,
body.dark-mode .cw-sender-name {
    color: #93c5fd !important;
}

[data-theme="dark"] .role-badge,
[data-bs-theme="dark"] .role-badge,
body.dark-mode .role-badge,
[data-theme="dark"] .cw-role-badge,
[data-bs-theme="dark"] .cw-role-badge,
body.dark-mode .cw-role-badge {
    background: #1e3a5f !important;
    color: #93c5fd !important;
    border: 1px solid rgba(147, 197, 253, 0.2) !important;
}

[data-theme="dark"] .chat-meta,
[data-bs-theme="dark"] .chat-meta,
body.dark-mode .chat-meta,
[data-theme="dark"] .cw-meta,
[data-bs-theme="dark"] .cw-meta,
body.dark-mode .cw-meta {
    color: #64748b !important;
}

[data-theme="dark"] .chat-message.self .chat-meta,
[data-bs-theme="dark"] .chat-message.self .chat-meta,
body.dark-mode .chat-message.self .chat-meta,
[data-theme="dark"] .cw-message.self .cw-meta,
[data-bs-theme="dark"] .cw-message.self .cw-meta,
body.dark-mode .cw-message.self .cw-meta {
    color: #bfdbfe !important;
}

[data-theme="dark"] .chat-message.self .chat-bubble,
[data-bs-theme="dark"] .chat-message.self .chat-bubble,
body.dark-mode .chat-message.self .chat-bubble,
[data-theme="dark"] .cw-message.self .cw-bubble,
[data-bs-theme="dark"] .cw-message.self .cw-bubble,
body.dark-mode .cw-message.self .cw-bubble {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35) !important;
}

[data-theme="dark"] .chat-message.self .sender-name,
[data-bs-theme="dark"] .chat-message.self .sender-name,
body.dark-mode .chat-message.self .sender-name,
[data-theme="dark"] .cw-message.self .cw-sender-name,
[data-bs-theme="dark"] .cw-message.self .cw-sender-name,
body.dark-mode .cw-message.self .cw-sender-name {
    color: #e2e8f0 !important;
}

[data-theme="dark"] .chat-input-area,
[data-bs-theme="dark"] .chat-input-area,
body.dark-mode .chat-input-area,
[data-theme="dark"] .chat-widget-input-area,
[data-bs-theme="dark"] .chat-widget-input-area,
body.dark-mode .chat-widget-input-area {
    background: #0f213d !important;
    border-top: 1px solid #1e3a5f !important;
}

[data-theme="dark"] .chat-input,
[data-bs-theme="dark"] .chat-input,
body.dark-mode .chat-input,
[data-theme="dark"] .chat-widget-input,
[data-bs-theme="dark"] .chat-widget-input,
body.dark-mode .chat-widget-input {
    background: #081226 !important;
    color: #f1f5f9 !important;
    border-color: #1e3a5f !important;
}

[data-theme="dark"] .chat-input:focus,
[data-bs-theme="dark"] .chat-input:focus,
body.dark-mode .chat-input:focus,
[data-theme="dark"] .chat-widget-input:focus,
[data-bs-theme="dark"] .chat-widget-input:focus,
body.dark-mode .chat-widget-input:focus {
    background: #0a1832 !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .chat-input::placeholder,
[data-bs-theme="dark"] .chat-input::placeholder,
body.dark-mode .chat-input::placeholder,
[data-theme="dark"] .chat-widget-input::placeholder,
[data-bs-theme="dark"] .chat-widget-input::placeholder,
body.dark-mode .chat-widget-input::placeholder {
    color: #64748b !important;
}

[data-theme="dark"] .btn-attach,
[data-bs-theme="dark"] .btn-attach,
body.dark-mode .btn-attach,
[data-theme="dark"] .cw-btn-attach,
[data-bs-theme="dark"] .cw-btn-attach,
body.dark-mode .cw-btn-attach {
    color: #93c5fd !important;
}

[data-theme="dark"] .btn-attach:hover,
[data-bs-theme="dark"] .btn-attach:hover,
body.dark-mode .btn-attach:hover,
[data-theme="dark"] .cw-btn-attach:hover,
[data-bs-theme="dark"] .cw-btn-attach:hover,
body.dark-mode .cw-btn-attach:hover {
    background: #1e3a5f !important;
    color: #ffffff !important;
}

[data-theme="dark"] .attachment-preview-area,
[data-bs-theme="dark"] .attachment-preview-area,
body.dark-mode .attachment-preview-area,
[data-theme="dark"] .cw-attachment-preview-area,
[data-bs-theme="dark"] .cw-attachment-preview-area,
body.dark-mode .cw-attachment-preview-area {
    background: #0b1a32 !important;
    border-top: 1px solid #1e3a5f !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .chat-attachment-doc,
[data-bs-theme="dark"] .chat-attachment-doc,
body.dark-mode .chat-attachment-doc,
[data-theme="dark"] .cw-attachment-doc,
[data-bs-theme="dark"] .cw-attachment-doc,
body.dark-mode .cw-attachment-doc {
    background: #081226 !important;
    border: 1px solid #1e3a5f !important;
    color: #f1f5f9 !important;
}

/* Fractional Spacing Utilities */
.mb-1\.5 { margin-bottom: 0.375rem !important; }
.mb-2\.5 { margin-bottom: 0.75rem !important; }
.mb-3\.5 { margin-bottom: 1.25rem !important; }
.mt-1\.5 { margin-top: 0.375rem !important; }
.mt-2\.5 { margin-top: 0.75rem !important; }
.mt-3\.5 { margin-top: 1.25rem !important; }
.p-2\.5 { padding: 0.75rem !important; }
.p-3\.5 { padding: 1.25rem !important; }
.py-1\.5 { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-2\.5 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-3\.5 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
.px-2\.5 { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-3\.5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.gap-1\.5 { gap: 0.45rem !important; }
.gap-2\.5 { gap: 0.75rem !important; }
.gap-3\.5 { gap: 1.25rem !important; }

/* Chapter Workspace 5-Column Balanced Grid */
.chapter-workspace-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.chapter-workspace-card {
    min-width: 0;
    border-radius: 16px !important;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    position: relative;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 3px 12px -2px rgba(0, 0, 0, 0.05);
}

.chapter-workspace-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -6px rgba(0, 51, 153, 0.14), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .chapter-workspace-card,
[data-bs-theme="dark"] .chapter-workspace-card,
body.dark-mode .chapter-workspace-card {
    background: linear-gradient(180deg, #10203d 0%, #0a1426 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .chapter-workspace-card:hover,
[data-bs-theme="dark"] .chapter-workspace-card:hover,
body.dark-mode .chapter-workspace-card:hover {
    border-color: rgba(96, 165, 250, 0.35) !important;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5), 0 0 18px rgba(37, 99, 235, 0.2) !important;
}

.chapter-guide-card {
    border-radius: 14px !important;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.07));
    background: #f8fafc;
}

[data-theme="dark"] .chapter-guide-card,
[data-bs-theme="dark"] .chapter-guide-card,
body.dark-mode .chapter-guide-card {
    background: linear-gradient(180deg, #0e1c36 0%, #0a1426 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

@media (min-width: 576px) {
    .chapter-workspace-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 768px) {
    .chapter-workspace-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 992px) {
    .chapter-workspace-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.25rem;
    }
}

@media (min-width: 1400px) {
    .chapter-workspace-grid {
        gap: 1.5rem;
    }
}

/* ============================
   AI ASSISTANT BUTTON STYLES
   ============================ */
.btn-outline-purple {
    border-color: #8b5cf6 !important;
    color: #7c3aed !important;
    transition: all 0.25s ease;
}
.btn-outline-purple:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
[data-theme="dark"] .btn-outline-purple {
    border-color: #a78bfa !important;
    color: #c4b5fd !important;
}
[data-theme="dark"] .btn-outline-purple:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    border-color: #6366f1 !important;
    color: #ffffff !important;
}

@keyframes aiSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.spin-animation {
    display: inline-block;
    animation: aiSpin 0.9s linear infinite;
}

/* =========================================
   GLASSMORPHISM GPU COMPOSITING & FALLBACKS
   ========================================= */
.sidebar,
.top-navbar,
.auth-card,
.card,
.modal-content,
.dropdown-menu,
.chat-container,
#chatWidgetContainer {
    transform: translateZ(0);
}

@supports not (backdrop-filter: blur(1px)) {
    .glass,
    .glass-light,
    .glass-elevated,
    .card {
        background: #ffffff !important;
    }
    .sidebar,
    .glass-sidebar {
        background: #ffffff !important;
    }
    .top-navbar,
    .glass-topbar {
        background: #ffffff !important;
    }
    .auth-card {
        background: #ffffff !important;
    }
    [data-theme="dark"] .auth-card,
    [data-bs-theme="dark"] .auth-card,
    body.dark-mode .auth-card {
        background: #0d1e38 !important;
    }
    [data-theme="dark"] .card,
    [data-theme="dark"] .top-navbar,
    [data-theme="dark"] .sidebar,
    [data-theme="dark"] .glass-sidebar,
    [data-theme="dark"] .modal-content,
    [data-theme="dark"] .dropdown-menu,
    [data-theme="dark"] .chat-container,
    [data-bs-theme="dark"] .card,
    [data-bs-theme="dark"] .top-navbar,
    [data-bs-theme="dark"] .sidebar,
    [data-bs-theme="dark"] .glass-sidebar,
    [data-bs-theme="dark"] .modal-content,
    [data-bs-theme="dark"] .dropdown-menu,
    [data-bs-theme="dark"] .chat-container,
    body.dark-mode .card,
    body.dark-mode .top-navbar,
    body.dark-mode .sidebar,
    body.dark-mode .glass-sidebar,
    body.dark-mode .modal-content,
    body.dark-mode .dropdown-menu,
    body.dark-mode .chat-container {
        background: #0f213d !important;
    }
}

/* ==========================================================================
   Reusable Modern Empty State Component
   ========================================================================== */
.empty-state-card {
    text-align: center;
    padding: 2.25rem 1.5rem;
}
.empty-state-card .empty-state-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.85rem auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #64748b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.empty-state-card .empty-state-title {
    font-weight: 600;
    font-size: 0.98rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}
.empty-state-card .empty-state-desc {
    color: #64748b;
    font-size: 0.84rem;
    margin-bottom: 0;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}
[data-theme="dark"] .empty-state-card .empty-state-icon,
[data-bs-theme="dark"] .empty-state-card .empty-state-icon,
body.dark-mode .empty-state-card .empty-state-icon {
    background: #142845 !important;
    color: #94a3b8 !important;
}
[data-theme="dark"] .empty-state-card .empty-state-title,
[data-bs-theme="dark"] .empty-state-card .empty-state-title,
body.dark-mode .empty-state-card .empty-state-title {
    color: #f1f5f9 !important;
}

@keyframes countPop {
    0% { transform: scale(0.6); opacity: 0; }
    70% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Badge Contrast & Visibility Safeguards */
.badge.bg-success,
.badge-success {
    background-color: #059669 !important;
    color: #ffffff !important;
}
.badge.bg-success *,
.badge.bg-success i,
.badge.bg-success svg,
.badge.bg-success .lucide,
.badge-success * {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

[data-theme="dark"] .progress,
[data-bs-theme="dark"] .progress,
body.dark-mode .progress {
    background-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35) !important;
}

/* User Online Status Indicator Dots */
.status-dot-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: status-pulse-green 2s infinite;
    display: inline-block;
    flex-shrink: 0;
}
@keyframes status-pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.status-dot-offline {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #94a3b8;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot-away {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f59e0b;
    display: inline-block;
    flex-shrink: 0;
}

/* =========================================
   REAL-TIME STATUS PILL SYSTEM
   ========================================= */
.nexus-status-pill {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    padding: 0.22rem 0.65rem !important;
    border-radius: 50rem !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    line-height: 1 !important;
    letter-spacing: 0.02em;
    transition: all 0.25s ease;
}

.nexus-status-pill.status-online {
    background: rgba(16, 185, 129, 0.14) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}
[data-bs-theme="dark"] .nexus-status-pill.status-online,
[data-theme="dark"] .nexus-status-pill.status-online,
body.dark-mode .nexus-status-pill.status-online {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.38) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.nexus-status-pill.status-away {
    background: rgba(245, 158, 11, 0.14) !important;
    color: #d97706 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
[data-bs-theme="dark"] .nexus-status-pill.status-away,
[data-theme="dark"] .nexus-status-pill.status-away,
body.dark-mode .nexus-status-pill.status-away {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.38) !important;
}

.nexus-status-pill.status-offline {
    background: rgba(100, 116, 139, 0.12) !important;
    color: #64748b !important;
    border: 1px solid rgba(100, 116, 139, 0.24) !important;
}
[data-bs-theme="dark"] .nexus-status-pill.status-offline,
[data-theme="dark"] .nexus-status-pill.status-offline,
body.dark-mode .nexus-status-pill.status-offline {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(148, 163, 184, 0.26) !important;
}

/* Assigned Adviser Card Aesthetic Polish */
.adviser-presence-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.adviser-presence-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12) !important;
}
[data-bs-theme="dark"] .adviser-presence-card:hover,
[data-theme="dark"] .adviser-presence-card:hover,
body.dark-mode .adviser-presence-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 16px rgba(37, 99, 235, 0.2) !important;
    border-color: rgba(96, 165, 250, 0.3) !important;
}
.adviser-presence-card .adviser-avatar-wrap {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.adviser-presence-card:hover .adviser-avatar-wrap {
    transform: scale(1.03);
}
.adviser-schedule-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.adviser-schedule-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4) !important;
    color: #ffffff !important;
}
.adviser-schedule-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2) !important;
}



