/**
 * theme.css — ResultVala Theme System v3 (Full Coverage)
 * Three modes: System (follows OS), Light, Dark (default)
 * Controlled by: data-theme="dark" | "light" on <html>
 * System mode removes data-theme entirely and relies on prefers-color-scheme.
 *
 * Requirements:
 * - Left Sidebar stays PERMANENTLY DARK (#161618) in all modes.
 * - High contrast text in Light mode for perfect accessibility.
 * - Orange branding (#ff6b1a) preserved across all themes.
 * - All hardcoded page-level styles overridden via [data-theme="light"] selectors.
 */

/* ── Smooth Theme Transitions ─────────────────────────────────────────────── */
*,
*::before,
*::after {
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.2s ease,
        box-shadow 0.2s ease !important;
}

.no-theme-transition,
.no-theme-transition * {
    transition: none !important;
}

/* ── GLOBAL TYPOGRAPHY & FONT SYSTEM ──────────────────────────────────────── */
body, button, input, select, textarea, optgroup, .btn, .form-control, .form-select, .table, .modal-content {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* ── DARK MODE (default) ─────────────────────────────────────────────────── */
:root,
html[data-theme="dark"] {
    --primary:       #ff6b1a;
    --primary-hover: #ff8033;
    --primary-glow:  rgba(255, 107, 26, 0.25);
    --accent:        #ff6b1a;

    --bg:           #090a0f;
    --bg-soft:      #10111a;
    --panel:        #14151f;
    --panel-hover:  #1b1c2a;
    --panel-2:      #191a26;
    --line:         rgba(255,255,255,.09);
    --line-hover:   rgba(255,255,255,.16);

    --orange:       #ff6b1a;
    --orange-glow:  rgba(255,107,26,.35);

    --text:         #f8fafc;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --muted:        #8a8a98;
    --muted-2:      #64748b;

    --success:      #10b981;
    --warning:      #f59e0b;
    --danger:       #ef4444;
    --info:         #3b82f6;

    /* Permanent Dark Sidebar */
    --sidebar-bg:          #161618;
    --sidebar-text:        #a4a4aa;
    --sidebar-active-bg:   #ff6b1a;
    --sidebar-active-text: #ffffff;

    --navbar-bg:      rgba(16,16,18,.94);
    --table-head-bg:  #181924;
    --table-stripe:   rgba(255,255,255,.02);
    --table-hover:    rgba(255,107,26,.05);

    --input-bg:       #181924;
    --input-border:   rgba(255,255,255,.12);
    --input-text:     #f8fafc;

    --label-color:    #cbd5e1;
    --section-head-color: #ffffff;
    --card-bg:        #14151f;

    --skeleton-base:  rgba(255,255,255,.06);
    --skeleton-shine: rgba(255,255,255,.1);

    color-scheme: dark;
}

/* ── LIGHT MODE ─────────────────────────────────────────────────────────── */
html[data-theme="light"] {
    --bg:           #f1f5f9;
    --bg-soft:      #e8edf5;
    --panel:        #ffffff;
    --panel-hover:  #f8fafc;
    --panel-2:      #f8fafc;
    --line:         #e2e8f0;
    --line-hover:   #cbd5e1;

    --orange:       #ff6b1a;
    --orange-glow:  rgba(255,107,26,.2);
    --accent:       #ff6b1a;

    --text:         #0f172a;
    --muted:        #475569;
    --muted-2:      #64748b;

    --success:      #059669;
    --warning:      #d97706;
    --danger:       #dc2626;
    --info:         #2563eb;

    /* KEEP SIDEBAR PERMANENTLY DARK */
    --sidebar-bg:          #161618;
    --sidebar-text:        #a4a4aa;
    --sidebar-active-bg:   #ff6b1a;
    --sidebar-active-text: #ffffff;

    --navbar-bg:      rgba(255,255,255,.97);
    --table-head-bg:  #f1f5f9;
    --table-stripe:   #f8fafc;
    --table-hover:    rgba(255,107,26,.05);

    --input-bg:       #ffffff;
    --input-border:   #cbd5e1;
    --input-text:     #0f172a;

    --label-color:    #374151;
    --section-head-color: #0f172a;
    --card-bg:        #ffffff;

    --skeleton-base:  rgba(0,0,0,.06);
    --skeleton-shine: rgba(0,0,0,.03);

    color-scheme: light;
}

/* ── SYSTEM MODE (Light OS preference) ────────────────────────────────────── */
@media (prefers-color-scheme: light) {
    html:not([data-theme]) {
        --bg:           #f1f5f9;
        --bg-soft:      #e8edf5;
        --panel:        #ffffff;
        --panel-hover:  #f8fafc;
        --panel-2:      #f8fafc;
        --line:         #e2e8f0;
        --line-hover:   #cbd5e1;
        --orange:       #ff6b1a;
        --orange-glow:  rgba(255,107,26,.2);
        --accent:       #ff6b1a;
        --text:         #0f172a;
        --muted:        #475569;
        --muted-2:      #64748b;
        --success:      #059669;
        --warning:      #d97706;
        --danger:       #dc2626;
        --info:         #2563eb;
        --sidebar-bg:          #161618;
        --sidebar-text:        #a4a4aa;
        --sidebar-active-bg:   #ff6b1a;
        --sidebar-active-text: #ffffff;
        --navbar-bg:      rgba(255,255,255,.97);
        --table-head-bg:  #f1f5f9;
        --table-stripe:   #f8fafc;
        --table-hover:    rgba(255,107,26,.05);
        --input-bg:       #ffffff;
        --input-border:   #cbd5e1;
        --input-text:     #0f172a;
        --label-color:    #374151;
        --section-head-color: #0f172a;
        --card-bg:        #ffffff;
        --skeleton-base:  rgba(0,0,0,.06);
        --skeleton-shine: rgba(0,0,0,.03);
        color-scheme: light;
    }
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE — FULL COMPONENT OVERRIDES
   These selectors target every hardcoded dark value found in
   page-level <style> blocks and in dashboard.css / style.css
═══════════════════════════════════════════════════════════════ */

/* ── Helper macro for both explicit light and system-light ── */
/* All rules below use html[data-theme="light"] only.
   System-light is covered by @media prefers-color-scheme above. */

/* 1. BODY & LAYOUT ─────────────────────────────────────────── */
html[data-theme="light"] body {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .dashboard-content {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

/* 2. PERMANENTLY DARK SIDEBAR ──────────────────────────────── */
html[data-theme="light"] .admin-sidebar,
html[data-theme="light"] .student-sidebar {
    background: #161618 !important;
    border-right: 1px solid #2b2b30 !important;
    color: #a4a4aa !important;
}
html[data-theme="light"] .admin-sidebar__link,
html[data-theme="light"] .sidebar-link,
html[data-theme="light"] .sidebar-group__toggle {
    color: #a4a4aa !important;
}
html[data-theme="light"] .admin-sidebar__link:hover,
html[data-theme="light"] .sidebar-link:hover,
html[data-theme="light"] .sidebar-group__toggle:hover {
    color: #ffffff !important;
    background: #232326 !important;
}
html[data-theme="light"] .admin-sidebar__link.is-active,
html[data-theme="light"] .sidebar-link.is-active {
    color: #ffffff !important;
    background: #ff6b1a !important;
    box-shadow: 0 8px 20px rgba(255,107,26,.18) !important;
}
html[data-theme="light"] .admin-sidebar__label {
    color: #737378 !important;
}
html[data-theme="light"] .admin-sidebar__brand {
    color: #ffffff !important;
}
html[data-theme="light"] .sidebar-group__items {
    background: transparent !important;
}
html[data-theme="light"] .toggle-icon {
    color: #737378 !important;
}

/* 3. TOP NAVBAR ─────────────────────────────────────────────── */
html[data-theme="light"] .admin-navbar,
html[data-theme="light"] header.admin-navbar {
    background: rgba(255,255,255,.97) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 8px rgba(0,0,0,.06) !important;
    backdrop-filter: blur(16px) !important;
}
html[data-theme="light"] .admin-navbar__title {
    color: #0f172a !important;
}
html[data-theme="light"] .admin-navbar__eyebrow {
    color: #ff6b1a !important;
}
html[data-theme="light"] .admin-navbar__user strong {
    color: #0f172a !important;
}
html[data-theme="light"] .admin-navbar__user span {
    color: #475569 !important;
}
html[data-theme="light"] .admin-navbar__profile > i {
    color: #475569 !important;
}

/* 4. PANELS & CARDS ─────────────────────────────────────────── */
html[data-theme="light"] .panel,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .wizard-main-card,
html[data-theme="light"] .wizard-sidebar,
html[data-theme="light"] .wizard-side-panel,
html[data-theme="light"] .form-panel,
html[data-theme="light"] .modal-content {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.04) !important;
    color: #0f172a !important;
}

/* 5. TYPOGRAPHY ─────────────────────────────────────────────── */
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6 {
    color: #0f172a !important;
}
html[data-theme="light"] p {
    color: #475569 !important;
}
html[data-theme="light"] .section-kicker {
    color: #ff6b1a !important;
}
html[data-theme="light"] .dashboard-welcome > div > p:last-child {
    color: #475569 !important;
}
html[data-theme="light"] .panel__header p,
html[data-theme="light"] .stat-card p,
html[data-theme="light"] .page-note {
    color: #475569 !important;
}
html[data-theme="light"] .stat-card h3 {
    color: #0f172a !important;
}

/* Section Heads — override ip-section-head color:#fff hardcoding */
html[data-theme="light"] .ip-section-head,
html[data-theme="light"] [class*="section-head"] {
    color: #0f172a !important;
    border-bottom-color: #e2e8f0 !important;
}

/* 6. LABELS — Full coverage (form-panel label, ip-upload-group label,
   status-toggle label, standalone label, inline style labels) ── */
html[data-theme="light"] label,
html[data-theme="light"] .form-panel label,
html[data-theme="light"] .ip-upload-group label,
html[data-theme="light"] .status-toggle label,
html[data-theme="light"] .mapping-save,
html[data-theme="light"] .mapping-grid label {
    color: #374151 !important;
}
html[data-theme="light"] .ip-thumb span {
    color: #64748b !important;
}

/* 7. FORM INPUTS, SELECTS, TEXTAREAS ────────────────────────── */
html[data-theme="light"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] .form-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    border-radius: 9px !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
    color: #94a3b8 !important;
}
html[data-theme="light"] input:hover:not([type="color"]),
html[data-theme="light"] select:hover,
html[data-theme="light"] textarea:hover {
    border-color: #94a3b8 !important;
}
html[data-theme="light"] input:focus:not([type="color"]),
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus {
    border-color: #ff6b1a !important;
    box-shadow: 0 0 0 3px rgba(255,107,26,.18) !important;
    outline: none !important;
}
html[data-theme="light"] input[readonly],
html[data-theme="light"] select:disabled,
html[data-theme="light"] input:disabled {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
}

/* Override status-toggle select dark hardcoding */
html[data-theme="light"] .status-toggle select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* admin-form inputs (dashboard.css line 23) */
html[data-theme="light"] .admin-form input,
html[data-theme="light"] .admin-form select,
html[data-theme="light"] .admin-form textarea,
html[data-theme="light"] .admin-search input,
html[data-theme="light"] .mapping-grid select {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

/* ip-thumb image background */
html[data-theme="light"] .ip-thumb img {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* Color picker hex inputs (hardcoded background:#111 inline) */
html[data-theme="light"] input[type="text"][readonly] {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #374151 !important;
}

/* 8. TABLES ──────────────────────────────────────────────────── */
html[data-theme="light"] .table,
html[data-theme="light"] .results-table {
    --bs-table-bg: #ffffff !important;
    --bs-table-color: #0f172a !important;
    --bs-table-striped-bg: #f8fafc !important;
    --bs-table-hover-bg: rgba(255,107,26,.04) !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}
html[data-theme="light"] .table th,
html[data-theme="light"] .results-table th {
    background-color: #f1f5f9 !important;
    color: #374151 !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #e2e8f0 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
}
html[data-theme="light"] .table td,
html[data-theme="light"] .results-table td {
    background-color: #ffffff !important;
    color: #1e293b !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
html[data-theme="light"] .table-striped > tbody > tr:nth-of-type(even) > *,
html[data-theme="light"] .results-table tr:nth-child(even) td {
    background-color: #f8fafc !important;
    color: #1e293b !important;
}
html[data-theme="light"] .table-hover > tbody > tr:hover > *,
html[data-theme="light"] .results-table tr:hover td {
    background-color: rgba(255,107,26,.04) !important;
}
html[data-theme="light"] .results-table td:first-child {
    color: #0f172a !important;
    font-weight: 600 !important;
}

/* 9. BUTTONS ─────────────────────────────────────────────────── */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .dashboard-action {
    background: #ff6b1a !important;
    color: #ffffff !important;
    border-color: #ff6b1a !important;
    box-shadow: 0 4px 14px rgba(255,107,26,.25) !important;
}
html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .dashboard-action:hover {
    background: #e85e10 !important;
    color: #ffffff !important;
}
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .action-btn-ghost {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
html[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .btn-ghost:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .btn-outline-secondary {
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}
html[data-theme="light"] .btn-outline-secondary:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .btn-link {
    color: #ff6b1a !important;
}

/* 10. BADGES & PILLS ────────────────────────────────────────── */
html[data-theme="light"] .badge-draft {
    color: #c2410c !important;
    background: rgba(255,107,26,.12) !important;
}
html[data-theme="light"] .badge-published {
    color: #065f46 !important;
    background: rgba(5,150,105,.12) !important;
}
html[data-theme="light"] .badge-archived {
    color: #475569 !important;
    background: #e2e8f0 !important;
}
html[data-theme="light"] .status-pill {
    color: #065f46 !important;
    background: rgba(5,150,105,.12) !important;
}
html[data-theme="light"] .excel-chip {
    color: #c2410c !important;
    background: rgba(255,107,26,.08) !important;
    border-color: rgba(255,107,26,.3) !important;
}

/* 11. MODALS ────────────────────────────────────────────────── */
html[data-theme="light"] .modal-content {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .modal-header {
    border-bottom: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
}
html[data-theme="light"] .modal-footer {
    border-top: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
}
html[data-theme="light"] .modal-title {
    color: #0f172a !important;
}
html[data-theme="light"] .btn-close {
    filter: none !important;
    color: #374151 !important;
}

/* 12. QUICK ACTIONS ─────────────────────────────────────────── */
html[data-theme="light"] .quick-actions a {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #374151 !important;
}
html[data-theme="light"] .quick-actions a:hover {
    border-color: rgba(255,107,26,.5) !important;
    color: #0f172a !important;
}

/* 13. FILE DROP ZONE ─────────────────────────────────────────── */
html[data-theme="light"] .file-drop {
    background: #f8fafc !important;
    border: 1px dashed #cbd5e1 !important;
    color: #475569 !important;
}

/* 14. INSTITUTION ALERTS ────────────────────────────────────── */
html[data-theme="light"] .institution-alert {
    border: 1px solid rgba(255,107,26,.3) !important;
    color: #9a3412 !important;
    background: rgba(255,107,26,.08) !important;
}
html[data-theme="light"] .institution-alert--success {
    border-color: rgba(5,150,105,.3) !important;
    color: #065f46 !important;
    background: rgba(5,150,105,.08) !important;
}

/* 15. ALERT BANNERS (in light mode adapt for contrast) ────────── */
html[data-theme="light"] .alert-banner--success {
    background: rgba(5,150,105,.08) !important;
    border: 1px solid rgba(5,150,105,.25) !important;
    color: #065f46 !important;
}
html[data-theme="light"] .alert-banner--error {
    background: rgba(220,38,38,.08) !important;
    border: 1px solid rgba(220,38,38,.25) !important;
    color: #991b1b !important;
}
html[data-theme="light"] .alert-banner--info {
    background: rgba(37,99,235,.08) !important;
    border: 1px solid rgba(37,99,235,.25) !important;
    color: #1e40af !important;
}
html[data-theme="light"] .alert-banner--warning {
    background: rgba(217,119,6,.08) !important;
    border: 1px solid rgba(217,119,6,.25) !important;
    color: #92400e !important;
}

/* Bootstrap alert classes */
html[data-theme="light"] .alert-success {
    background: rgba(5,150,105,.08) !important;
    border-color: rgba(5,150,105,.25) !important;
    color: #065f46 !important;
}
html[data-theme="light"] .alert-danger {
    background: rgba(220,38,38,.08) !important;
    border-color: rgba(220,38,38,.25) !important;
    color: #991b1b !important;
}
html[data-theme="light"] .alert-info {
    background: rgba(37,99,235,.08) !important;
    border-color: rgba(37,99,235,.25) !important;
    color: #1e40af !important;
}
html[data-theme="light"] .alert-warning {
    background: rgba(217,119,6,.08) !important;
    border-color: rgba(217,119,6,.25) !important;
    color: #92400e !important;
}

/* 16. EMPTY STATE ───────────────────────────────────────────── */
html[data-theme="light"] .empty-state {
    color: #64748b !important;
}
html[data-theme="light"] .empty-state__title {
    color: #0f172a !important;
}
html[data-theme="light"] .empty-state__desc {
    color: #64748b !important;
}

/* 17. ACTIVITY LIST ─────────────────────────────────────────── */
html[data-theme="light"] .activity-list strong {
    color: #0f172a !important;
}
html[data-theme="light"] .activity-list p {
    color: #64748b !important;
}
html[data-theme="light"] .activity-list time {
    color: #94a3b8 !important;
}

/* 18. CHART BAR LABELS ──────────────────────────────────────── */
html[data-theme="light"] .chart-bar small {
    color: #64748b !important;
}
html[data-theme="light"] .performance-chart {
    border-bottom-color: #e2e8f0 !important;
}

/* 19. MUTED TEXT SPANS & MISC ───────────────────────────────── */
html[data-theme="light"] .text-muted,
html[data-theme="light"] small {
    color: #64748b !important;
}
html[data-theme="light"] .panel__header > a {
    color: #ff6b1a !important;
}
html[data-theme="light"] .panel__more {
    color: #64748b !important;
}
html[data-theme="light"] .section-kicker,
html[data-theme="light"] .admin-navbar__eyebrow {
    color: #ff6b1a !important;
}

/* 20. STAT CARD ICONS ───────────────────────────────────────── */
html[data-theme="light"] .stat-card__icon--orange { background: rgba(255,107,26,.12) !important; }
html[data-theme="light"] .stat-card__icon--blue   { background: rgba(37,99,235,.12)  !important; }
html[data-theme="light"] .stat-card__icon--purple { background: rgba(124,58,237,.12) !important; }
html[data-theme="light"] .stat-card__icon--green  { background: rgba(5,150,105,.12)  !important; }

/* 21. TEMPLATE CARDS ────────────────────────────────────────── */
html[data-theme="light"] .template-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}
html[data-theme="light"] .template-card h3 {
    color: #0f172a !important;
}
html[data-theme="light"] .template-card p {
    color: #475569 !important;
}

/* 22. DROPDOWN MENUS (Bootstrap) ────────────────────────────── */
html[data-theme="light"] .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.1) !important;
}
html[data-theme="light"] .dropdown-item {
    color: #374151 !important;
}
html[data-theme="light"] .dropdown-item:hover,
html[data-theme="light"] .dropdown-item:focus {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .dropdown-divider {
    border-top-color: #e2e8f0 !important;
}

/* 23. BREADCRUMB ─────────────────────────────────────────────── */
html[data-theme="light"] .breadcrumb-item,
html[data-theme="light"] .breadcrumb-item a {
    color: #475569 !important;
}
html[data-theme="light"] .breadcrumb-item.active {
    color: #0f172a !important;
}
html[data-theme="light"] .breadcrumb-item + .breadcrumb-item::before {
    color: #94a3b8 !important;
}

/* 24. PAGINATION ─────────────────────────────────────────────── */
html[data-theme="light"] .page-link {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #374151 !important;
}
html[data-theme="light"] .page-link:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .page-item.active .page-link {
    background: #ff6b1a !important;
    border-color: #ff6b1a !important;
    color: #ffffff !important;
}
html[data-theme="light"] .page-item.disabled .page-link {
    background: #f8fafc !important;
    color: #94a3b8 !important;
}

/* 25. FEES MODULE SPECIFIC ───────────────────────────────────── */
html[data-theme="light"] .fee-summary-card,
html[data-theme="light"] .fee-card,
html[data-theme="light"] .fee-section {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .progress {
    background-color: #e2e8f0 !important;
}

/* 26. PROGRESS BARS ─────────────────────────────────────────── */
html[data-theme="light"] .progress {
    background-color: #e2e8f0 !important;
    border-radius: 999px !important;
}

/* 27. LIST GROUPS ────────────────────────────────────────────── */
html[data-theme="light"] .list-group-item {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .list-group-item:hover {
    background-color: #f8fafc !important;
}

/* 28. NAV TABS ───────────────────────────────────────────────── */
html[data-theme="light"] .nav-tabs {
    border-bottom-color: #e2e8f0 !important;
}
html[data-theme="light"] .nav-tabs .nav-link {
    color: #475569 !important;
}
html[data-theme="light"] .nav-tabs .nav-link.active {
    background: #ffffff !important;
    border-color: #e2e8f0 #e2e8f0 #ffffff !important;
    color: #0f172a !important;
}
html[data-theme="light"] .nav-tabs .nav-link:hover {
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

/* 29. HR / DIVIDERS ──────────────────────────────────────────── */
html[data-theme="light"] hr {
    border-color: #e2e8f0 !important;
    opacity: 1 !important;
}

/* 30. CODE BLOCKS ───────────────────────────────────────────── */
html[data-theme="light"] code {
    background: #f1f5f9 !important;
    color: #c2410c !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

/* ── THEME TOGGLE BUTTON & DROPDOWN ─────────────────────────── */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}
html[data-theme="light"] .theme-toggle-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.05) !important;
}
.theme-toggle-btn:hover {
    border-color: #ff6b1a !important;
    color: var(--orange) !important;
}
.theme-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    z-index: 9999;
    display: none;
    animation: themeDropIn 0.15s ease;
}
html[data-theme="light"] .theme-dropdown {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,.1) !important;
}
.theme-dropdown.is-open { display: block; }
@keyframes themeDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}
html[data-theme="light"] .theme-option {
    color: #475569 !important;
}
.theme-option:hover {
    background: var(--panel-2);
    color: var(--text);
}
html[data-theme="light"] .theme-option:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
.theme-option.is-active {
    background: rgba(255,107,26,.1);
    color: #ff6b1a;
    font-weight: 700;
}
html[data-theme="light"] .theme-option.is-active {
    background: rgba(255,107,26,.08) !important;
    color: #ff6b1a !important;
}
.theme-option i {
    font-size: 15px;
    width: 18px;
    text-align: center;
}

/* ── SKELETON LOADER ────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        var(--skeleton-base) 25%,
        var(--skeleton-shine) 50%,
        var(--skeleton-base) 75%
    );
    background-size: 200% 100%;
    animation: skeletonPulse 1.6s ease-in-out infinite;
    border-radius: 6px;
    display: inline-block;
}
@keyframes skeletonPulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text    { height: 14px; width: 100%; margin-bottom: 8px; }
.skeleton-text.sm { height: 11px; }
.skeleton-text.lg { height: 18px; }
.skeleton-title   { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-avatar  { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.skeleton-btn     { height: 36px; width: 100px; border-radius: 8px; }
.skeleton-badge   { height: 20px; width: 60px; border-radius: 20px; }
.skeleton-cell    { height: 13px; border-radius: 4px; }

/* ── FORCE INLINE-STYLE OVERRIDES IN LIGHT MODE ─────────────── */
/* Some pages use style="color:#fff" or style="background:#111" inline.
   We can't override inline styles with CSS alone, but the JS theme
   initializer below handles stripping problematic ones.
   For known patterns we use attribute selectors: */

/* ── PERMANENT DARK TIMETABLE GRID IN LIGHT & DARK MODES ── */
/* ── DYNAMIC THEME SWITCHING: NOTICEBOARD, ALLOCATIONS, STAT CARDS & TIMETABLE ── */

/* Dark Mode Defaults */
.noticeboard-container {
    background: #0f1017 !important;
    border: 2px solid var(--orange) !important;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.6);
}
.noticeboard-table th {
    background: #181924 !important;
    color: #ffffff !important;
    border: 1px solid #2d2d38 !important;
}
.noticeboard-table td {
    background: #111118 !important;
    border: 1px solid #252530 !important;
    color: #ffffff !important;
}
.noticeboard-table td.day-cell {
    background: #181822 !important;
    color: #ffffff !important;
}
.allocation-card, .form-panel {
    background: var(--panel) !important;
    border: 1px solid var(--line) !important;
}
.stat-box {
    background: var(--panel-2) !important;
    border: 1px solid var(--line) !important;
}
.stat-box__num {
    color: var(--text) !important;
}
.course-checkbox-grid, .subject-checkbox-grid {
    background: var(--bg-soft) !important;
    border: 1px solid var(--line) !important;
}
.checkbox-tile {
    background: var(--panel) !important;
    border: 1px solid var(--line) !important;
    color: var(--text) !important;
}

/* Light Mode Overrides — ALL COMPONENTS LIGHT WHEN LIGHT THEME SELECTED */
html[data-theme="light"] .noticeboard-container {
    background: #ffffff !important;
    border: 2px solid #ff6b1a !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06) !important;
}
html[data-theme="light"] .noticeboard-header {
    border-bottom-color: #e2e8f0 !important;
}
html[data-theme="light"] .noticeboard-header h2,
html[data-theme="light"] .noticeboard-header p {
    color: #0f172a !important;
}
html[data-theme="light"] .noticeboard-table {
    border-color: #e2e8f0 !important;
}
html[data-theme="light"] .noticeboard-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
html[data-theme="light"] .period-time-badge {
    color: #ea580c !important;
}
html[data-theme="light"] .noticeboard-table td {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .noticeboard-table td.day-cell {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-right: 2px solid #ff6b1a !important;
}
html[data-theme="light"] .notice-card__subject {
    color: #0f172a !important;
}
html[data-theme="light"] .notice-card__code {
    color: #ea580c !important;
}
html[data-theme="light"] .notice-card__teacher {
    color: #059669 !important;
}
html[data-theme="light"] .notice-card__room {
    background: rgba(255, 107, 26, 0.1) !important;
    border-color: rgba(255, 107, 26, 0.3) !important;
    color: #c2410c !important;
}
html[data-theme="light"] .free-slot-text {
    color: #94a3b8 !important;
}
html[data-theme="light"] .qr-panel {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

/* Allocations & Stat Boxes in Light Mode */
html[data-theme="light"] .allocation-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05) !important;
}
html[data-theme="light"] .stat-box {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
html[data-theme="light"] .stat-box__num {
    color: #0f172a !important;
}
html[data-theme="light"] .stat-box__label {
    color: #64748b !important;
}
html[data-theme="light"] .course-checkbox-grid,
html[data-theme="light"] .subject-checkbox-grid {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
html[data-theme="light"] .checkbox-tile {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html[data-theme="light"] .checkbox-tile:hover {
    background: #f1f5f9 !important;
    border-color: #ff6b1a !important;
}
html[data-theme="light"] .badge-tag {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

/* Timetable Cards & Grid in Light Mode */
html[data-theme="light"] .timetable-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}
html[data-theme="light"] .timetable-card:hover {
    border-color: #ff6b1a !important;
    box-shadow: 0 4px 14px rgba(255,107,26,0.15) !important;
}
html[data-theme="light"] .timetable-card strong,
html[data-theme="light"] .timetable-card .slot-subject-title {
    color: #0f172a !important;
}
html[data-theme="light"] .timetable-card .slot-subject-code {
    color: #ea580c !important;
}
html[data-theme="light"] .timetable-card--free {
    background: #f8fafc !important;
    border: 1.5px dashed #cbd5e1 !important;
    color: #64748b !important;
}
html[data-theme="light"] .timetable-card--free:hover {
    background: rgba(255, 107, 26, 0.08) !important;
    border-color: #ff6b1a !important;
    color: #0f172a !important;
}
html[data-theme="light"] .timetable-grid-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
html[data-theme="light"] .timetable-grid-table td {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}
html[data-theme="light"] .timetable-grid-table td.day-cell {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

/* ── LOGIN PAGE PORTAL OPTION CARD PROTECTIONS ── */
.role-info h4,
#role-selection-section h2,
#login-form-section h2,
html[data-theme="light"] .role-info h4,
html[data-theme="light"] #role-selection-section h2,
html[data-theme="light"] #login-form-section h2 {
    color: #ffffff !important;
}
.role-info p,
#role-selection-section p,
#login-form-section p,
html[data-theme="light"] .role-info p,
html[data-theme="light"] #role-selection-section p,
html[data-theme="light"] #login-form-section p {
    color: #cbd5e1 !important;
}
