/**
 * 7-dark-mode.css — Dark Mode Overrides
 * ============================================================
 * Color palette inspired by Facebook dark mode:
 *   #18191A — page background
 *   #242526 — surfaces (cards, nav, sidebar)
 *   #3A3B3C — elevated / hover / inputs
 *   #3E4042 — borders / dividers
 *   #E4E6EB — primary text
 *   #B0B3B8 — secondary / muted text
 *   --brand-ink — accent / links: the school color from Settings, lightened
 * ============================================================
 */


/* ============================================================
 * SECTION 1 — TOKEN OVERRIDES
 * ============================================================ */

html.dark-mode {
    /* Surfaces */
    --color-surface:          #242526;
    --color-surface-alt:      #18191A;

    /* Borders */
    --border-color:           #3E4042;
    --border-color-light:     #3E4042;

    /* Grays — remapped to FB palette */
    --color-gray-50:          #18191A;
    --color-gray-100:         #242526;
    --color-gray-200:         #3A3B3C;
    --color-gray-300:         #4E4F50;
    --color-gray-400:         #6A6B6C;
    --color-gray-500:         #8A8D91;
    --color-gray-600:         #B0B3B8;
    --color-gray-700:         #C9CDD4;
    --color-gray-800:         #E4E6EB;
    --color-gray-900:         #F0F2F5;

    /* Text */
    --color-text-primary:     #E4E6EB;
    --color-text-secondary:   #B0B3B8;
    --color-text:             #E4E6EB;
    --color-text-muted:       #B0B3B8;
    --color-text-faint:       #8A8D91;
    --color-border:           #3E4042;

    /* A soft fill inside a card: one step up from the card itself. */
    --color-surface-muted:    #3A3B3C;

    /* The school color as an accent (links, focus, outlines, selection):
       lightened, since the color itself is too dark to read on these
       surfaces. Solid buttons keep the color (4-components/theme-colors.css). */
    --brand-ink:              color-mix(in srgb, var(--color-primary) 55%, white);
    --brand-ring:             color-mix(in srgb, var(--color-primary) 40%, transparent);

    /* Tones (1-tokens.css): a translucent tint of the hue and its light ink.
       The status tokens (--color-success-bg...) and anything else built on
       them follow, so a chip written with tokens needs no rule in this file. */
    --tone-green-bg:  rgba(16,185,129,0.15);  --tone-green-text:  #6ee7b7;  --tone-green-border:  rgba(16,185,129,0.35);
    --tone-amber-bg:  rgba(251,191,36,0.18);  --tone-amber-text:  #fcd34d;  --tone-amber-border:  rgba(251,191,36,0.35);
    --tone-red-bg:    rgba(239,68,68,0.15);   --tone-red-text:    #fca5a5;  --tone-red-border:    rgba(239,68,68,0.35);
    --tone-blue-bg:   rgba(45,136,255,0.16);  --tone-blue-text:   #93c5fd;  --tone-blue-border:   rgba(45,136,255,0.35);
    --tone-sky-bg:    rgba(56,189,248,0.15);  --tone-sky-text:    #7dd3fc;  --tone-sky-border:    rgba(56,189,248,0.35);
    --tone-cyan-bg:   rgba(6,182,212,0.15);   --tone-cyan-text:   #67e8f9;  --tone-cyan-border:   rgba(6,182,212,0.35);
    --tone-teal-bg:   rgba(20,184,166,0.15);  --tone-teal-text:   #5eead4;  --tone-teal-border:   rgba(20,184,166,0.35);
    --tone-indigo-bg: rgba(99,102,241,0.18);  --tone-indigo-text: #a5b4fc;  --tone-indigo-border: rgba(99,102,241,0.35);
    --tone-purple-bg: rgba(139,92,246,0.16);  --tone-purple-text: #c4b5fd;  --tone-purple-border: rgba(139,92,246,0.35);
    --tone-pink-bg:   rgba(236,72,153,0.15);  --tone-pink-text:   #f9a8d4;  --tone-pink-border:   rgba(236,72,153,0.35);
    --tone-orange-bg: rgba(249,115,22,0.15);  --tone-orange-text: #fdba74;  --tone-orange-border: rgba(249,115,22,0.35);
    --tone-slate-bg:  #3A3B3C;                --tone-slate-text:  #B0B3B8;  --tone-slate-border:  #4E4F50;
    --tone-green-soft:  rgba(16,185,129,0.08);  --tone-amber-soft:  rgba(251,191,36,0.08);  --tone-red-soft:    rgba(239,68,68,0.08);
    --tone-blue-soft:   rgba(45,136,255,0.08);  --tone-sky-soft:    rgba(56,189,248,0.08);  --tone-cyan-soft:   rgba(6,182,212,0.08);
    --tone-teal-soft:   rgba(20,184,166,0.08);  --tone-indigo-soft: rgba(99,102,241,0.08);  --tone-purple-soft: rgba(139,92,246,0.08);
    --tone-pink-soft:   rgba(236,72,153,0.08);  --tone-orange-soft: rgba(249,115,22,0.08);  --tone-slate-soft:  #18191A;

    /* Inks: a status color as text, lifted to read on the dark surfaces. */
    --ink-success:    #4ade80;  --ink-success-rgb:   74, 222, 128;
    --ink-danger:     #f87171;  --ink-danger-rgb:    248, 113, 113;
    --ink-warning:    #fbbf24;  --ink-warning-rgb:   251, 191, 36;
    --ink-info:       #67e8f9;  --ink-info-rgb:      103, 232, 249;
    --ink-secondary:  #B0B3B8;  --ink-secondary-rgb: 176, 179, 184;

    /* Blue as a color code (4-components/theme-colors.css). */
    --color-blue:             #2D88FF;
    --color-blue-rgb:         45, 136, 255;
    --chart-sales:            #3987e5;
    --chart-expense:          #e66767;

    /* Shadows */
    --shadow-sm:              0 2px 6px rgba(0,0,0,0.4);
    --shadow-md:              0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg:              0 6px 20px rgba(0,0,0,0.5);
}


/* ============================================================
 * SECTION 2 — BASE
 * ============================================================ */


/* Bootstrap 5 CSS variable overrides — fixes table cells, links, etc. */
html.dark-mode {
    --bs-body-color:        #E4E6EB;
    --bs-body-bg:           #18191A;
    --bs-secondary-color:   #B0B3B8;
    --bs-secondary-bg:      #3A3B3C;
    --bs-table-color:       #E4E6EB;
    --bs-table-bg:          transparent;
    --bs-table-striped-bg:  #3A3B3C;
    --bs-table-hover-bg:    #3A3B3C;
    --bs-border-color:      #3E4042;
    --bs-border-color-translucent: rgba(255,255,255,0.1);
    --bs-link-color:        var(--brand-ink);
    --bs-link-hover-color:  color-mix(in srgb, var(--brand-ink) 80%, white);
    --bs-card-bg:           #242526;
    --bs-card-border-color: #3E4042;
    --bs-code-color:        #e685b5;   /* Bootstrap's own dark-theme pink: #d63384 reads at 3.4:1 here */
}


/* A plain link: Bootstrap colors it from --bs-link-color-rgb, which is the
   school color itself (too dark to read here). :where() keeps this at the
   specificity of Bootstrap's own `a` rule, so any class that colors a link
   (.btn, .nav-link, .badge, a card that is a link...) still wins. */
:where(html.dark-mode) a       { color: var(--bs-link-color); }
:where(html.dark-mode) a:where(:hover) { color: var(--bs-link-hover-color); }


/* ============================================================
 * SECTION 3 — LAYOUT (nav, sidebar, page header)
 * ============================================================ */

html.dark-mode .top-nav {
    background: rgba(36, 37, 38, 0.82) !important;
    backdrop-filter: saturate(1.2) blur(14px);
    -webkit-backdrop-filter: saturate(1.2) blur(14px);
    box-shadow: 0 1px 0 #3E4042, 0 6px 18px -12px rgba(0, 0, 0, 0.6);
    border-bottom-color: #3E4042;
}
html.dark-mode .user-info             { background: #3A3B3C; border-color: #4E4F50; }
html.dark-mode .school-motto          { background: rgba(255,255,255,0.06); border-color: #3E4042; color: #E4E6EB; }
html.dark-mode .school-motto i        { color: #B0B3B8; }
html.dark-mode .school-id-badge       { background: #3A3B3C; border-color: #4E4F50; color: #B0B3B8; }

html.dark-mode .sidebar               { background: rgba(36, 37, 38, 0.92) !important; border-right-color: #3E4042; box-shadow: 1px 0 0 #3E4042, 8px 0 24px -18px rgba(0,0,0,.7); }
html.dark-mode .sidebar-group-header:hover { color: var(--color-primary); }
html.dark-mode .sidebar-menu a        { color: #E4E6EB; }
html.dark-mode .sidebar-menu a:not(.active):hover  { background: #3A3B3C; color: #E4E6EB; }
html.dark-mode .sidebar-menu a.active { color: white; }
html.dark-mode .sidebar-copyright     { color: #8A8D91; border-top-color: #3E4042; }



/* ============================================================
 * SECTION 4 — BOOTSTRAP COMPONENTS
 * ============================================================ */

/* Cards */
html.dark-mode .card         { background: #242526; border-color: #3E4042; }
html.dark-mode .card-footer  { background: #242526; border-top-color: #3E4042; }

/* Tables */
html.dark-mode .table td                    { color: #E4E6EB; }
html.dark-mode .table th                    { background: #18191A; color: #B0B3B8; border-color: #3E4042; }
html.dark-mode .table td                    { border-color: #3E4042; }
html.dark-mode .table-hover tbody tr:hover > td,
html.dark-mode .table-hover tbody tr:hover > th { background-color: #3A3B3C !important; color: #E4E6EB !important; }
html.dark-mode .clickable-row:hover > td        { background-color: #3A3B3C !important; color: #E4E6EB !important; }
html.dark-mode .table-active  { --bs-table-bg: #3A3B3C; --bs-table-color: #E4E6EB; }
html.dark-mode .table-primary { --bs-table-bg: color-mix(in srgb, var(--brand-ink) 16%, #242526); --bs-table-color: #E4E6EB; --bs-table-hover-bg: color-mix(in srgb, var(--brand-ink) 26%, #242526); --bs-table-hover-color: #E4E6EB; --bs-table-border-color: var(--brand-ink); }
html.dark-mode .table-light {
    --bs-table-bg:          #18191A;
    --bs-table-color:       #C9CDD4;
    --bs-table-hover-bg:    #2D2E2F;
    --bs-table-hover-color: #E4E6EB;
    --bs-table-border-color: #3E4042;
}
html.dark-mode .table-success               { --bs-table-bg: rgba(20,83,45,0.4); --bs-table-color: #E4E6EB; background-color: rgba(20,83,45,0.4) !important; }
html.dark-mode .table-success > td,
html.dark-mode .table-success > th         { background-color: rgba(20,83,45,0.4) !important; color: #E4E6EB !important; }
html.dark-mode .table-warning               { --bs-table-bg: #3a2a08; --bs-table-color: #fcd34d; --bs-table-hover-bg: #4a3608; --bs-table-hover-color: #fde68a; --bs-table-border-color: #6b4f0a; }
html.dark-mode .table-warning > td,
html.dark-mode .table-warning > th         { background-color: #3a2a08 !important; color: #fcd34d !important; }
html.dark-mode .table-hover tbody tr.table-warning:hover > td,
html.dark-mode .table-hover tbody tr.table-warning:hover > th { background-color: #4a3608 !important; color: #fde68a !important; }
html.dark-mode .table-danger                { --bs-table-bg: rgba(127,29,29,0.4); --bs-table-color: #fca5a5; --bs-table-hover-bg: rgba(127,29,29,0.55); --bs-table-hover-color: #fecaca; --bs-table-border-color: #7f1d1d; background-color: rgba(127,29,29,0.4) !important; }
html.dark-mode .table-danger > td,
html.dark-mode .table-danger > th          { background-color: rgba(127,29,29,0.4) !important; color: #fca5a5 !important; }
html.dark-mode .table-hover tbody tr.table-danger:hover > td,
html.dark-mode .table-hover tbody tr.table-danger:hover > th { background-color: rgba(127,29,29,0.55) !important; color: #fecaca !important; }
/* keep inline emphasis/muted text legible on the dark-red row */
html.dark-mode .table-danger > td .text-danger,
html.dark-mode .table-danger > td.text-danger { color: #fca5a5 !important; }
html.dark-mode .table-danger > td .text-muted { color: #f0a5a5 !important; }
html.dark-mode .table-secondary             { --bs-table-bg: #2D2E2F; --bs-table-color: #C9CDD4; --bs-table-hover-bg: #3A3B3C; --bs-table-hover-color: #E4E6EB; --bs-table-border-color: #3E4042; }
html.dark-mode .table-secondary > td,
html.dark-mode .table-secondary > th       { background-color: #2D2E2F !important; color: #C9CDD4 !important; }

/* Personnel Profile (DepEd-style) table — reports/hr/personnel_profile.php */
html.dark-mode .pp-table,
html.dark-mode .pp-stat-total               { color: #E4E6EB; }
html.dark-mode .pp-table th,
html.dark-mode .pp-table td                 { border-color: #3E4042; color: #E4E6EB; }
html.dark-mode .pp-table thead th           { background: #18191A; }
html.dark-mode .pp-table .pp-group-row td   { background: #2D2E2F; }
html.dark-mode .pp-total-row td             { background: #2A2B2C; }
html.dark-mode .pp-detail,
html.dark-mode .pp-legend                   { color: #B0B3B8; }

/* Forms */
html.dark-mode .form-control,
html.dark-mode .form-select        { background-color: #3A3B3C; color: #E4E6EB; border-color: #4E4F50; }
html.dark-mode .form-select        { 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='%23B0B3B8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); }
html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus  { background-color: #3A3B3C; color: #E4E6EB; border-color: var(--brand-ink); box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--brand-ink) 15%, transparent); }
html.dark-mode .form-control::placeholder  { color: #6A6B6C; }
html.dark-mode input:-webkit-autofill,
html.dark-mode input:-webkit-autofill:hover,
html.dark-mode input:-webkit-autofill:focus,
html.dark-mode textarea:-webkit-autofill,
html.dark-mode textarea:-webkit-autofill:hover,
html.dark-mode textarea:-webkit-autofill:focus,
html.dark-mode select:-webkit-autofill,
html.dark-mode select:-webkit-autofill:hover,
html.dark-mode select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #3A3B3C inset !important;
    -webkit-text-fill-color: #E4E6EB !important;
    caret-color: #E4E6EB;
}
html.dark-mode .form-control[readonly]     { background-color: #18191A; color: #B0B3B8; }
html.dark-mode .input-group-text  { background: #4E4F50; color: #E4E6EB; border-color: #4E4F50; }
/* :not(:checked) -- otherwise this outranks .form-check-input:checked and a ticked box stays gray. */
html.dark-mode .form-check-input:not(:checked) { background-color: #3A3B3C; border-color: #4E4F50; }
html.dark-mode .form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }
html.dark-mode .form-label        { color: #E4E6EB; }
html.dark-mode input[type="file"] { background: #3A3B3C; color: #E4E6EB; border-color: #4E4F50; }
html.dark-mode input[type="file"]::file-selector-button {
    background: #4E4F50; color: #E4E6EB;
    border: 1px solid #6A6B6C; padding: .375rem .75rem;
    margin-right: .75rem; cursor: pointer;
}
html.dark-mode input[type="file"]::file-selector-button:hover { background: #6A6B6C; }
html.dark-mode input[type="date"],
html.dark-mode input[type="time"],
html.dark-mode input[type="datetime-local"],
html.dark-mode input[type="month"],
html.dark-mode input[type="week"],
html.dark-mode input[type="number"]            { color-scheme: dark; }
html.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
html.dark-mode input[type="time"]::-webkit-calendar-picker-indicator,
html.dark-mode input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html.dark-mode input[type="month"]::-webkit-calendar-picker-indicator,
html.dark-mode input[type="week"]::-webkit-calendar-picker-indicator  { filter: invert(1) brightness(0.8); cursor: pointer; }

/* Buttons */
html.dark-mode .btn-outline-secondary         { color: #E4E6EB; border-color: #4E4F50; background: transparent; }
html.dark-mode .btn-outline-secondary:hover,
html.dark-mode .btn-outline-secondary:focus   { background: #3A3B3C; border-color: #6A6B6C; color: #E4E6EB; }
html.dark-mode .btn-outline-secondary.active,
html.dark-mode .btn-outline-secondary:active  { background: #4E4F50; border-color: #6A6B6C; color: #E4E6EB; }
html.dark-mode .btn-outline-primary           { color: var(--brand-ink); border-color: var(--brand-ink); background: transparent; }
html.dark-mode .btn-outline-primary:hover     { background: color-mix(in srgb, var(--brand-ink) 12%, transparent); border-color: var(--brand-ink); color: var(--brand-ink); }
/* The selected one in a segmented group (the SF10 department filter is a row of
   these). The rule above sets background: transparent and out-specifies the fill
   Bootstrap gives .active, so the chosen button used to look like the rest — the
   same fill pagination's current page takes, for the same reason. */
html.dark-mode .btn-outline-primary.active,
html.dark-mode .btn-outline-primary:active,
html.dark-mode .btn-outline-primary.show      { background: var(--color-primary); border-color: var(--brand-ink); color: #fff; }
/* Outline success / danger / warning / info take their ink (theme-colors.css);
   on hover they tint instead of filling. */
html.dark-mode :is(.btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info):is(:hover, :focus-visible) {
    background: color-mix(in srgb, var(--bs-btn-color) 12%, transparent); color: var(--bs-btn-color); border-color: var(--bs-btn-color);
}
html.dark-mode .btn-outline-dark              { color: #E4E6EB; border-color: #6A6B6C; background: transparent; }
html.dark-mode .btn-outline-dark:hover        { background: #3A3B3C; border-color: #8A8D91; color: #E4E6EB; }
/* Solid "dark" would vanish into a dark surface, and it is usually the selected
   half of a btn-dark/btn-outline-dark pair — so it takes the same elevated fill
   as a selected .btn-secondary chip. */
html.dark-mode .btn-dark                      { background: #4E4F50; border-color: #4E4F50; color: #E4E6EB; }
html.dark-mode .btn-dark:hover,
html.dark-mode .btn-dark:focus                { background: #6A6B6C; border-color: #6A6B6C; color: #E4E6EB; }
html.dark-mode .btn-light                     { background: #3A3B3C; border-color: #4E4F50; color: #E4E6EB; }
html.dark-mode .btn-light:hover               { background: #4E4F50; color: #E4E6EB; }
html.dark-mode .btn-secondary                 { background: #4E4F50; border-color: #4E4F50; color: #E4E6EB; }
html.dark-mode .btn-secondary:hover           { background: #6A6B6C; border-color: #6A6B6C; }

/* Dropdowns */
html.dark-mode .dropdown-menu           { background: #242526; border-color: #3E4042; }
html.dark-mode .dropdown-item           { color: #E4E6EB; }
html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus     { background: #3A3B3C; color: #E4E6EB; }
html.dark-mode .dropdown-item.text-danger { color: #f87171 !important; }
html.dark-mode .dropdown-divider        { border-color: #3E4042; }

/* Modals */
html.dark-mode .modal-content  { background: #242526; color: #E4E6EB; border-color: #3E4042; }
html.dark-mode .modal-header   { border-bottom-color: #3E4042; }
html.dark-mode .modal-footer   { border-top-color: #3E4042; }
html.dark-mode .modal-title    { color: #E4E6EB; }
html.dark-mode .btn-close      { filter: invert(1) grayscale(100%) brightness(200%); }
html.dark-mode .modal-header.bg-warning .btn-close,
html.dark-mode .modal-header.bg-danger  .btn-close,
html.dark-mode .modal-header.bg-info    .btn-close,
html.dark-mode .modal-header.bg-success .btn-close,
html.dark-mode :is(.text-bg-info, .text-bg-warning) .btn-close { filter: none; }

/* Alerts */
html.dark-mode .alert .alert-link { color: inherit; }
html.dark-mode .alert-info      { background: color-mix(in srgb, var(--color-blue) 16%, #242526); border-color: var(--color-blue); color: var(--color-blue-text); }
html.dark-mode .alert-info .alert-link { color: #dbe8ff; }
html.dark-mode .alert-success   { background: #1a3a2a; border-color: #42b883; color: #a7f3d0; }
html.dark-mode .alert-danger    { background: #3b1a1a; border-color: #e55353; color: #fca5a5; }
html.dark-mode .alert-warning   { background: #3b2a10; border-color: #f0a500; color: #fde68a; }
html.dark-mode .alert-secondary { background: #242526; border-color: #3E4042; color: #B0B3B8; }
html.dark-mode .alert-primary   { background: color-mix(in srgb, var(--brand-ink) 16%, #242526); border-color: var(--brand-ink); color: var(--brand-ink); }
html.dark-mode .alert-light     { background: #3A3B3C; border-color: #4E4F50; color: #E4E6EB; }
html.dark-mode .alert-light .text-muted { color: #B0B3B8 !important; }

/* Nav tabs */
html.dark-mode .nav-tabs .nav-link:not(.active):hover { color: #E4E6EB; background: rgba(255,255,255,0.05); }
html.dark-mode .tab-content              { background: #242526; }

/* List groups, badges, misc */
html.dark-mode .list-group-item       { background: #242526; border-color: #3E4042; color: #E4E6EB; }
html.dark-mode .badge.bg-secondary    { background-color: #4E4F50 !important; color: #C9CDD4 !important; }
html.dark-mode .badge.bg-light        { background-color: #3A3B3C !important; color: #E4E6EB !important; }
html.dark-mode .badge.bg-warning      { background-color: rgba(251,191,36,0.18) !important; color: #fcd34d !important; }
html.dark-mode .badge.bg-info         { background-color: rgba(6,182,212,0.15) !important; color: #67e8f9 !important; }
html.dark-mode .badge.bg-primary      { background-color: color-mix(in srgb, var(--brand-ink) 20%, transparent) !important; color: var(--brand-ink) !important; }
html.dark-mode .badge.bg-success      { background-color: rgba(16,185,129,0.15) !important; color: #6ee7b7 !important; }
html.dark-mode .progress              { background-color: #3E4042; }
html.dark-mode .text-dark             { color: #E4E6EB !important; }
html.dark-mode .bg-white              { background-color: #242526 !important; }
html.dark-mode .bg-light              { background-color: #18191A !important; }
html.dark-mode .border                { border-color: #3E4042 !important; }
html.dark-mode hr                     { border-color: #3E4042; opacity: 0.5; }


/* ============================================================
 * SECTION 5 — 4-COMPONENTS
 * ============================================================ */

/* Stat cards */
html.dark-mode .stat-card      { background: #242526; border-color: rgba(255,255,255,.06); }
html.dark-mode .stat-card:hover { box-shadow: 0 12px 28px -8px rgba(0,0,0,.55); }
html.dark-mode .stat-value     { color: #E4E6EB; }

/* Dashboard redesign (v2) — dark surfaces */
html.dark-mode .dash-card {
    background: #242526;
    border-color: rgba(255,255,255,.06);
    box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px -10px rgba(0,0,0,.6);
}
html.dark-mode .dash-card:hover {
    box-shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 28px -14px rgba(0,0,0,.7);
}
html.dark-mode .dash-card-header h6 { color: #E4E6EB; }
html.dark-mode .main-content :is(h2, h3, h4, h5, h6) > i.bi:first-child { color: #E4E6EB; }
html.dark-mode .main-content {
    background:
        radial-gradient(900px 360px at 100% -5%, color-mix(in srgb, var(--brand-ink) 10%, transparent) 0%, transparent 60%),
        radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: auto, 22px 22px;
    background-attachment: fixed;
}
html.dark-mode .dist-bar-bg { background: #3A3B3C; }

/* Module dashboards (.module-dash) — dark surfaces */
html.dark-mode .module-dash .stat-card:hover { box-shadow: 0 12px 28px -8px rgba(0,0,0,.55); }
html.dark-mode .module-dash .dash-card {
    border-color: rgba(255,255,255,.06);
    box-shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px -10px rgba(0,0,0,.6);
}
html.dark-mode .module-dash .dash-card:hover {
    box-shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 28px -14px rgba(0,0,0,.7);
}
/* Header icons covered by the broader .main-content rule above — module
 * dashboards live inside .main-content, so no separate rule is needed. */

/* Pagination: built on tokens (4-components/navigation.css). */
html.dark-mode .page-item.active .page-link  { border-color: var(--brand-ink); }


/* ============================================================
 * SECTION 6 — MODULE-SPECIFIC OVERRIDES
 * ============================================================ */

/* ── hr.css ──────────────────────────────────────────────── */
/* dept bar chart track */
html.dark-mode .hr-dept-progress          { background: #3A3B3C; }
/* teacher avatar — replace color-mix() */
html.dark-mode .hr-emp-avatar.teacher     { background: linear-gradient(135deg, #059669, #047857); }
/* status stepper connector + inactive dots */
html.dark-mode .status-stepper::before   { background: #3E4042; }
html.dark-mode .status-step .step-dot    { background: #3A3B3C; color: #B0B3B8; }
html.dark-mode .status-step.active .step-dot  { box-shadow: 0 0 0 4px rgba(30,58,138,0.35); }
html.dark-mode .status-step.active .step-label { color: var(--color-secondary); }
/* disciplinary timeline */
html.dark-mode .timeline-item::before    { background: #3E4042; }
html.dark-mode .timeline-dot             { background: #242526; border-color: #3E4042; }
html.dark-mode .timeline-dot.scheduled  { border-color: var(--color-secondary); }

/* ── grades.css ──────────────────────────────────────────── */
/* Boys / girls divider row in the grade grid */
html.dark-mode .gender-divider td     { background: #18191A; color: #B0B3B8; border-bottom-color: #3E4042; }
/* Period a subject isn't taught in, and the per-semester subtotal column */
html.dark-mode .grade-na              { background: #18191A; color: #6A6D70; }
html.dark-mode .weight-badge          { background: rgba(245,158,11,0.15); color: #fcd34d; }
/* Honor bands keep the medal order on dark */
html.dark-mode .honor-gold            { background: rgba(245,158,11,0.16); color: #fcd34d; border-color: rgba(245,158,11,0.45); }
html.dark-mode .honor-silver          { background: rgba(148,163,184,0.16); color: #cbd5e1; border-color: rgba(148,163,184,0.45); }
html.dark-mode .honor-bronze          { background: rgba(180,120,70,0.18); color: #e0a878; border-color: rgba(180,120,70,0.45); }
html.dark-mode .honor-gold-text       { color: #fcd34d; }
html.dark-mode .honor-silver-text     { color: #cbd5e1; }
html.dark-mode .honor-bronze-text     { color: #e0a878; }
/* Grade-level chips in Subject Management */
html.dark-mode .badge.order-unset     { color: #8A8D91; border-color: #3E4042; }
html.dark-mode .gl-chip               { background: #3A3B3C; color: #E4E6EB; }
html.dark-mode .gl-chip.has-weight    { background: rgba(245,158,11,0.15); color: #fcd34d; }
html.dark-mode .gl-chip-more          { background: transparent; border-color: #3E4042; color: #B0B3B8; }
/* Encoding progress bars and their detail rows */
html.dark-mode .enc-bar               { background: #3E4042; }
/* Footer averages keep their pass/fail colour over the dark `.table th` rule */
html.dark-mode .grade-table tfoot th.grade-passed { color: #4ade80; }
html.dark-mode .grade-table tfoot th.grade-failed { color: #f87171; }
html.dark-mode .sem-grade             { background: #2A2B2D; }
/* Final-grade column cell — was a hardcoded light-blue !important bg */
html.dark-mode .final-grade           { background: #2A2B2D !important; }
/* Section roster (left-side student list) */
html.dark-mode .roster-item-name      { color: #E4E6EB; }
html.dark-mode .roster-item-meta      { color: #B0B3B8; }
html.dark-mode .roster-divider        { color: #B0B3B8; }
html.dark-mode .roster-item:hover     { background: color-mix(in srgb, var(--brand-ink) 10%, transparent); border-color: color-mix(in srgb, var(--brand-ink) 30%, transparent); }
html.dark-mode .roster-item.active    { background: color-mix(in srgb, var(--brand-ink) 16%, transparent); border-color: var(--brand-ink); }
/* ── library.css ─────────────────────────────────────────── */
/* Selected book/borrower card — was a hardcoded light-blue bg with dark text */
html.dark-mode .selected-item            { background: color-mix(in srgb, var(--brand-ink) 12%, transparent); border-color: var(--brand-ink); color: #E4E6EB; }
html.dark-mode .selected-item .text-muted { color: #B0B3B8 !important; }
/* dashboard teacher banners */
html.dark-mode .teacher-banner.advisory  { background: rgba(var(--color-blue-rgb), .08);  border-color: rgba(var(--color-blue-rgb), .25); color: var(--color-blue-text); }
html.dark-mode .teacher-banner.position  { background: rgba(var(--color-blue-rgb), .10);  border-color: rgba(var(--color-blue-rgb), .25); color: var(--color-blue-text); }
html.dark-mode .teacher-banner.no-access { background: rgba(245,158,11,0.10);  border-color: rgba(245,158,11,0.25); color: #fcd34d; }
/* subjects.php badges */
html.dark-mode .subject-code          { background: #3A3B3C; color: #C9CDD4; }
html.dark-mode .status-inactive       { background: rgba(239,68,68,0.15);  color: #fca5a5; }
html.dark-mode .badge-teaching-only   { background: rgba(245,158,11,0.15); color: #fcd34d; }
html.dark-mode .badge-no-teacher      { background: rgba(99,102,241,0.15); color: #c4b5fd; }
html.dark-mode .remarks-letter        { background: rgba(139,92,246,0.16); color: #c4b5fd; }
/* Add / edit modal: panes and the per-grade-level settings table */
html.dark-mode .subj-pane             { background: #242526; border-color: #3E4042; }
html.dark-mode .subj-pane-title       { color: #B0B3B8; border-bottom-color: #3E4042; }
html.dark-mode .gl-box                { border-color: #3E4042; }
html.dark-mode .gl-table thead th     { background: #3A3B3C; color: #C9CDD4; border-bottom-color: #3E4042; }
html.dark-mode .gl-table td           { border-bottom-color: #3E4042; }
html.dark-mode .gl-table tr.gl-row-on { background: color-mix(in srgb, var(--brand-ink) 10%, transparent); }
html.dark-mode .btn-purple            { background: #7c3aed; border-color: #7c3aed; }
html.dark-mode .btn-purple:hover      { background: #6d28d9; border-color: #6d28d9; }
html.dark-mode .input-locked          { background: #18191A; color: #8A8D91; }
html.dark-mode .mini-stat-pass        { border-left-color: #4ade80; }
html.dark-mode .badge-locked-all      { background: rgba(220,38,38,0.15); color: #fca5a5; }
html.dark-mode .badge-locked-partial  { background: rgba(245,158,11,0.15); color: #fcd34d; }
/* lock_grades.php — dept tabs + per-grade-level lock table */
html.dark-mode .tab-pane-card         { border: 1px solid #3E4042; border-top: none; }
html.dark-mode .period-badge.locked   { background: rgba(220,38,38,0.15); color: #fca5a5; }
html.dark-mode .grades-overview-card                    { background: #242526 !important; box-shadow: none; border: 1px solid #3E4042; }
html.dark-mode .grades-overview-card > div              { border-bottom-color: #3E4042 !important; }
html.dark-mode .grades-overview-card span               { color: #E4E6EB !important; }
html.dark-mode .grades-overview-card a.text-muted       { color: #8A8D91 !important; }
html.dark-mode .grades-overview-card thead              { background: #18191A !important; }
html.dark-mode .grades-overview-card th                 { color: #B0B3B8 !important; border-bottom-color: #3E4042 !important; }
html.dark-mode .grades-overview-card td                 { color: #E4E6EB !important; border-bottom-color: #3E4042 !important; }
html.dark-mode .grades-overview-card tr                 { border-bottom-color: #3E4042 !important; }

/* ── clinic.css ──────────────────────────────────────────── */
html.dark-mode .clinic-visit-card,
html.dark-mode .medicine-card,
html.dark-mode .patient-info-card { background: #242526; border-color: #3E4042; }

/* ── dashboard.css ───────────────────────────────────────── */
/* attendance stat cards */
html.dark-mode .att-stat-present  { background: rgba(16,185,129,0.12); }
html.dark-mode .att-stat-late     { background: rgba(245,158,11,0.12); }
html.dark-mode .att-stat-absent   { background: rgba(220,38,38,0.12);  }
html.dark-mode .att-stat-half_day { background: rgba(139,92,246,0.12); }
html.dark-mode .att-rate-track    { background: #3E4042; }
html.dark-mode .att-stat-count    { color: #E4E6EB; }
/* weekly schedule now-cell */
html.dark-mode .tbl-schedule .sch-now-cell { background: rgba(14,165,233,0.15); }
html.dark-mode .section-divider   { border-color: #3E4042; }
html.dark-mode .activity-item     { border-bottom-color: #3E4042; }
html.dark-mode .badge-borrowed { background: rgba(var(--color-blue-rgb), 0.15);  color: var(--color-blue-text); }
html.dark-mode .badge-overdue  { background: rgba(239,68,68,0.15);   color: #fca5a5; }
html.dark-mode .badge-returned { background: rgba(16,185,129,0.15);  color: #6ee7b7; }
html.dark-mode .badge-pending  { background: rgba(251,191,36,0.12);  color: #fcd34d; }
html.dark-mode .badge-treated  { background: rgba(16,185,129,0.15);  color: #6ee7b7; }
html.dark-mode .badge-referred { background: rgba(251,191,36,0.12);  color: #fcd34d; }
html.dark-mode .alert-item             { border-bottom-color: #3E4042; color: #E4E6EB; }
html.dark-mode .alert-item:hover       { background: #3A3B3C; }
html.dark-mode .alert-icon.info        { background: rgba(var(--color-blue-rgb), 0.15);  color: var(--color-blue-text); }
html.dark-mode .alert-icon.warning     { background: rgba(251,191,36,0.15);  color: #fcd34d; }
html.dark-mode .qa-green  { background: rgba(16,185,129,0.10); color: #6ee7b7; border-color: rgba(110,231,183,0.35); }
html.dark-mode .qa-green:hover  { background: rgba(16,185,129,0.18); color: #6ee7b7; }
html.dark-mode .qa-amber  { background: rgba(251,191,36,0.10);  color: #fcd34d; border-color: rgba(252,211,77,0.35); }
html.dark-mode .qa-amber:hover  { background: rgba(251,191,36,0.18); color: #fcd34d; }
html.dark-mode .qa-blue   { background: rgba(var(--color-blue-rgb), .10);  color: var(--color-blue-text); border-color: var(--color-blue-border); }
html.dark-mode .qa-blue:hover   { background: rgba(var(--color-blue-rgb), 0.18);  color: var(--color-blue-text); }
html.dark-mode .qa-purple { background: rgba(139,92,246,0.10);  color: #c4b5fd; border-color: rgba(196,181,253,0.35); }
html.dark-mode .qa-purple:hover { background: rgba(139,92,246,0.18);  color: #c4b5fd; }
html.dark-mode .qa-red    { background: rgba(239,68,68,0.10);   color: #fca5a5; border-color: rgba(252,165,165,0.35); }
html.dark-mode .qa-red:hover    { background: rgba(239,68,68,0.18);   color: #fca5a5; }
html.dark-mode .qa-cyan   { background: rgba(6,182,212,0.10);   color: #67e8f9; border-color: rgba(103,232,249,0.35); }
html.dark-mode .qa-cyan:hover   { background: rgba(6,182,212,0.18);   color: #67e8f9; }
html.dark-mode .qa-pink   { background: rgba(236,72,153,0.10);  color: #f9a8d4; border-color: rgba(249,168,212,0.35); }
html.dark-mode .qa-pink:hover   { background: rgba(236,72,153,0.18);  color: #f9a8d4; }
html.dark-mode .activity-item:last-child { border-bottom: none; }

/* ── profile.css ─────────────────────────────────────────── */
html.dark-mode .linked-employee      { background: rgba(20,83,45,0.2); border-color: #2d6a4f; }

/* ── academic.css ────────────────────────────────────────── */
html.dark-mode .sy-selector,
html.dark-mode .level-panel         { background: #242526; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
html.dark-mode .level-panel-header h6 { color: #E4E6EB; }
html.dark-mode .dept-sep td         { background: #18191A; color: #6A6B6C; border-top-color: #3E4042; }
html.dark-mode .order-badge:hover   { background: #4E4F50; color: #E4E6EB; }
html.dark-mode .grade-card          { background: #242526; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
html.dark-mode .grade-body          { background: #242526; }
html.dark-mode .section-item:hover  { background: #2a2b2c; }
html.dark-mode .section-name        { color: #E4E6EB; }
html.dark-mode .adviser-badge       { background: rgba(14,165,233,0.15); color: #7dd3fc; }
html.dark-mode .no-adviser          { background: rgba(245,158,11,0.15); color: #fcd34d; }
html.dark-mode .capacity-bar        { background: #3E4042; }
html.dark-mode .summary-stat-value  { color: #E4E6EB; }
html.dark-mode .adviser-results     { background: #242526; border-color: #3E4042; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
html.dark-mode .adviser-item        { border-bottom-color: #3E4042; color: #E4E6EB; }
html.dark-mode .adviser-item:hover  { background: #3A3B3C; }
html.dark-mode .adviser-item .name  { color: #E4E6EB; }
/* school_years.php */
html.dark-mode .sy-card             { background: #242526; box-shadow: 0 2px 8px rgba(0,0,0,0.4); border-left-color: #3E4042; }
html.dark-mode .sy-card:hover       { box-shadow: 0 4px 16px rgba(0,0,0,0.55); }
html.dark-mode .sy-card.current     { border-left-color: #10b981; background: linear-gradient(135deg, rgba(16,185,129,0.10), #242526); }
html.dark-mode .sy-card.current .sy-name { color: #6ee7b7; }
html.dark-mode .add-card:hover      { border-color: var(--brand-ink); background: linear-gradient(135deg, color-mix(in srgb, var(--brand-ink) 8%, transparent), color-mix(in srgb, var(--brand-ink) 16%, transparent)); }
html.dark-mode .add-card:hover i    { color: var(--brand-ink); }
/* grading_periods.php */
html.dark-mode .dept-card               { background: #242526; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
html.dark-mode .dept-card-header        { border-bottom-color: #3E4042; }
html.dark-mode .dept-card-sub           { color: #8A8D91; }
html.dark-mode .period-option           { border-color: #3E4042; }
html.dark-mode .period-option:hover     { border-color: var(--brand-ink); background: color-mix(in srgb, var(--brand-ink) 8%, transparent); }
html.dark-mode .period-option.selected  { background: color-mix(in srgb,var(--opt-color,#3b82f6) 12%,#242526); }
html.dark-mode .period-opt-label        { color: #E4E6EB; }
html.dark-mode .set-all-bar             { background: #242526; border-color: #3E4042; }
html.dark-mode .mode-toggle             { border-color: #3E4042; }
html.dark-mode .mode-toggle a:not(.active):hover { background: #3A3B3C; }
html.dark-mode .badge-grade-specific    { background: rgba(14,165,233,.2);  color: #7dd3fc; }
html.dark-mode .badge-from-dept         { background: rgba(34,197,94,.15);  color: #86efac; }
html.dark-mode .alert-override          { background: rgba(245,158,11,.12); color: #fcd34d; }
html.dark-mode .alert-override a        { color: #fbbf24; }
/* teacher_requirements.php */
html.dark-mode .tbl-manage th           { background: #18191A; color: #8A8D91; border-bottom-color: #3E4042; }
html.dark-mode .tbl-manage td           { border-bottom-color: #3E4042; }
html.dark-mode .tbl-manage tr:hover td  { background: #2a2b2c; }

/* ── settings.css ────────────────────────────────────────── */
html.dark-mode .surface-card       { background: #242526; border-color: #3E4042; }
html.dark-mode .danger-zone-card   { border-color: rgba(220,38,38,0.4) !important; }
html.dark-mode .danger-zone-header { background: rgba(220,38,38,0.1) !important; }
html.dark-mode .settings-panel         { background: #242526; border-color: #3E4042; }
html.dark-mode .settings-panel-header  { background: #18191A; border-bottom-color: #3E4042; color: #B0B3B8; }
html.dark-mode .settings-grid          { background: #3E4042; }
html.dark-mode .settings-item          { background: #242526; color: #E4E6EB; }
html.dark-mode .settings-item:hover    { background: #3A3B3C; color: #E4E6EB; }

/* ── 6-utilities.css ─────────────────────────────────────── */
html.dark-mode .info-box-blue  { background: rgba(var(--color-blue-rgb), .1); border-color: rgba(var(--color-blue-rgb), .3); }
html.dark-mode .info-box-green { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.25); }

/* ── reports.css ─────────────────────────────────────────── */
html.dark-mode .report-item            { color: #E4E6EB; border-bottom-color: #3E4042; }
html.dark-mode .report-item:hover      { background: #3A3B3C; color: #E4E6EB; }

/* ── hr/attendance.php ───────────────────────────────────── */
html.dark-mode .summary-card           { background: #242526; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
html.dark-mode .summary-card .val-hours { color: color-mix(in srgb, var(--color-blue) 80%, white); }
html.dark-mode .summary-card .val.text-blue      { color: color-mix(in srgb, var(--color-blue) 80%, white) !important; }
html.dark-mode .att-table th           { background: #18191A; color: #B0B3B8; border-bottom-color: #3E4042; }
html.dark-mode .att-table td           { border-bottom-color: #3E4042; }
html.dark-mode .att-table .hours-cell  { color: color-mix(in srgb, var(--color-blue) 80%, white); }
html.dark-mode .dept-total-row td      { background: var(--color-blue-bg) !important; }
html.dark-mode .empty-state            { color: #8A8D91; }
/* status colours — lifted for contrast on dark surfaces */
html.dark-mode .st-present { color: #4ade80; }
html.dark-mode .st-late    { color: #fbbf24; }
html.dark-mode .st-absent  { color: #f87171; }
html.dark-mode .st-half    { color: #22d3ee; }
/* DTR view (Civil Service Form No. 48) */
html.dark-mode .dtr                    { background: #242526; border-color: #3E4042; }
html.dark-mode .dtr-head .form-no      { color: #8A8D91; }
html.dark-mode .dtr-head .title        { color: #E4E6EB; }
html.dark-mode .dtr-head .sub          { color: #B0B3B8; }
html.dark-mode .dtr-meta .lbl          { color: #B0B3B8; }
html.dark-mode .dtr-meta .val          { color: #E4E6EB; }
html.dark-mode .guard-badge            { background: rgba(251,191,36,0.18); color: #fbbf24; }
html.dark-mode .dtr-table th           { background: #18191A; color: #B0B3B8; border-color: #4E4F50; }
html.dark-mode .dtr-table td           { border-color: #4E4F50; color: #E4E6EB; }
html.dark-mode .dtr-table .c-rem       { color: #B0B3B8; }
html.dark-mode .dtr-table .d-dow       { color: #8A8D91; }
html.dark-mode .dtr-table tr.weekend td { background: #18191A; color: #6A6B6C; }
html.dark-mode .dtr-table tr.leave td  { background: rgba(124,58,237,0.12); }
html.dark-mode .dtr-table tr.travel td { background: rgba(13,148,136,0.12); }
html.dark-mode .dtr-table tfoot td     { background: var(--color-blue-bg); color: #E4E6EB; }
html.dark-mode .dtr-table tfoot .c-rem { color: #B0B3B8; }
html.dark-mode .dtr-table tr.week-head td  { background: rgba(99,102,241,0.20); color: #c7d2fe; }
html.dark-mode .dtr-table tr.week-total td { background: var(--color-blue-bg); color: #E4E6EB; }
html.dark-mode .dtr-table tr.week-total .c-rem { color: #B0B3B8; }
html.dark-mode .dtr-table tr.adjust-row td { background: rgba(251,191,36,0.10); color: #fbbf24; }
html.dark-mode .dtr-table tr.adjust-row .c-hrs,
html.dark-mode .dtr-table tr.adjust-row .c-rem { background: #18191A; }
html.dark-mode .dtr-table .dash        { color: #4E4F50; }
html.dark-mode .extra-punches          { color: #8A8D91; }
html.dark-mode .dtr-cert     { color: #B0B3B8; }
html.dark-mode .sign-line    { border-top-color: #6A6B6C; color: #E4E6EB; }
html.dark-mode .sign-role    { color: #8A8D91; }

/* ── student_attendance.css ──────────────────────────────── */

/* Analytics views. The series hues are re-picked for the dark surface
 * (lighter, less saturated steps) rather than reused from light mode —
 * the light-mode greens/reds go muddy on #242526. */
html.dark-mode {
    --att-present: #34d399;
    --att-late:    #fbbf24;
    --att-absent:  #f87171;
    --att-excused: #a5b4fc;
}
html.dark-mode .att-nav-item:hover    { background: #3A3B3C; color: #E4E6EB; }
html.dark-mode .att-nav-item.active   { background: #242526; color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand-ink) 45%, transparent); }

html.dark-mode .metric-tile   { background: #242526; border-color: #3E4042; box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
html.dark-mode .metric-label,
html.dark-mode .metric-foot   { color: #8A8D91; }
html.dark-mode .metric-value  { color: #E4E6EB; }
html.dark-mode .metric-sep    { color: #4E4F50; }
html.dark-mode .metric-alert  { border-color: rgba(248,113,113,0.45); }

html.dark-mode .att-chip          { background: #3A3B3C; color: #B0B3B8; }
html.dark-mode .att-chip:hover    { background: #4E4F50; color: #E4E6EB; }
html.dark-mode .att-chip.active   { background: color-mix(in srgb, var(--brand-ink) 16%, transparent); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand-ink) 45%, transparent); }

html.dark-mode .att-hour-row td   { background: #3A3B3C; color: #B0B3B8; }
html.dark-mode .att-table .row-alert { background: rgba(248,113,113,0.10); }
html.dark-mode .time-strong       { color: #E4E6EB; }
html.dark-mode .time-strong.is-late { color: #fbbf24; }
html.dark-mode .late-by           { background: rgba(251,191,36,0.16); color: #fbbf24; }
html.dark-mode .where-in          { background: rgba(52,211,153,0.16); color: #6ee7b7; }
html.dark-mode .where-out         { background: #3A3B3C; color: #B0B3B8; }
html.dark-mode .streak-chip       { background: rgba(248,113,113,0.16); color: #fca5a5; }

html.dark-mode .rank-badge        { background: #3A3B3C; color: #B0B3B8; }
html.dark-mode .rank-badge.rank-1 { background: #a16207; color: #fff; }
html.dark-mode .rank-badge.rank-2 { background: #52525b; color: #fff; }
html.dark-mode .rank-badge.rank-3 { background: #78350f; color: #fff; }

html.dark-mode .cell-bar-track,
html.dark-mode .hbar-track        { background: #3A3B3C; }
html.dark-mode .cell-bar-pct      { color: #8A8D91; }
html.dark-mode .hbar-label        { color: #B0B3B8; }
html.dark-mode .hbar-value        { color: #E4E6EB; }
html.dark-mode .hbar-fill         { background: var(--color-blue); }

html.dark-mode .att-hist-plot     { border-bottom-color: #3E4042; }
html.dark-mode .att-hist-bar      { background: var(--color-blue); }
html.dark-mode .att-hist-peak     { color: #B0B3B8; }
html.dark-mode .att-hist-tick     { color: #6A6B6C; }
html.dark-mode .att-hist-cutoff   { border-left-color: rgba(248,113,113,0.7); }
html.dark-mode .att-hist-cutoff-tag { color: #fca5a5; }
html.dark-mode .att-hist-key,
html.dark-mode .chart-key         { color: #B0B3B8; }
html.dark-mode .key-ontime        { color: var(--color-blue); }

html.dark-mode .stack-rate        { color: #8A8D91; }
html.dark-mode .stack-tick        { color: #B0B3B8; border-top-color: #3E4042; }
html.dark-mode .stack-tick-sub    { color: #6A6B6C; }
html.dark-mode .data-table-toggle > summary { color: color-mix(in srgb, var(--color-blue) 80%, white); }
html.dark-mode .perfect-row       { border-bottom-color: #3E4042; }

html.dark-mode .att-hist-col[data-tip]:hover::after,
html.dark-mode .hbar-row[data-tip]:hover::after,
html.dark-mode .cell-bar[data-tip]:hover::after,
html.dark-mode .stack-col[data-tip]:hover::after { background: #0f172a; color: #E4E6EB; box-shadow: 0 4px 14px rgba(0,0,0,0.55); }

/* ── students.css ────────────────────────────────────────── */
html.dark-mode .profile-header              { background: var(--gradient-primary); box-shadow: 0 4px 6px rgba(0,0,0,0.4); }
html.dark-mode .profile-header.teacher      { background: linear-gradient(135deg, #065f46 0%, #10b981 100%); }
html.dark-mode .profile-header .student-number strong { color: #fff; }
html.dark-mode .profile-header .btn-primary-action   { background: rgba(255,255,255,0.22); color: #fff; border: 1.5px solid rgba(255,255,255,0.5); }
html.dark-mode .profile-header .btn-primary-action:hover { background: rgba(255,255,255,0.35); color: #fff; }
html.dark-mode .profile-header .btn-secondary-action { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.35); }
html.dark-mode .profile-header .btn-secondary-action:hover { background: rgba(255,255,255,0.25); color: #fff; border-color: rgba(255,255,255,0.6); }
html.dark-mode .info-card                   { background: #242526; box-shadow: 0 4px 6px rgba(0,0,0,0.4); }
html.dark-mode .card-header-custom          { color: #E4E6EB; border-bottom-color: #3E4042; }
html.dark-mode .info-row                    { border-bottom-color: #3E4042; }
html.dark-mode .info-value                  { color: #E4E6EB; }
html.dark-mode .parent-item,
html.dark-mode .sibling-item,
html.dark-mode .history-item                { background: #18191A; border-left-color: #4E4F50; }
html.dark-mode .form-section                { background: #242526; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
html.dark-mode .section-header              { color: #E4E6EB; border-bottom-color: #3E4042; }
html.dark-mode .sticky-save-bar             { background: #242526; border-top-color: #3E4042; }
html.dark-mode .list-filters                { background: #18191A; border-bottom-color: #3E4042; }
html.dark-mode .btn-clear-filters           { background: #242526; border-color: #3E4042; color: #B0B3B8; }
html.dark-mode .btn-clear-filters:hover     { background: #3b1a1a; border-color: #e55353; color: #fca5a5; }
html.dark-mode .btn-clear-filters.has-filters { border-color: #e55353; color: #f87171; }
/* list.php */
html.dark-mode .student-photo               { border-color: #3E4042; }
html.dark-mode .student-grade               { color: #8A8D91; }
html.dark-mode .dept-gs                     { background: rgba(var(--color-blue-rgb), .18); color: var(--color-blue-text); }
html.dark-mode .dept-jhs                    { background: rgba(6,95,70,0.2);   color: #6ee7b7; }
html.dark-mode .dept-shs                    { background: rgba(109,40,217,0.2); color: #c4b5fd; }
html.dark-mode .extra-filters .form-select:disabled { background-color: #18191A; color: #6A6B6C; }
html.dark-mode .filter-divider              { background: #3E4042; }

/* ── teacher_requirements.css ────────────────────────────── */
html.dark-mode .req-card              { background: #242526; border-color: #3E4042; }
html.dark-mode .req-card:hover        { box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
html.dark-mode .req-title             { color: #E4E6EB; }
html.dark-mode .req-subtitle          { color: #8A8D91; }
html.dark-mode .stat-pill             { background: #18191A; border-color: #3E4042; }
html.dark-mode .stat-pill .lbl        { color: #B0B3B8; }
html.dark-mode .reviewer-note.returned { background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.3); color: #fca5a5; }
html.dark-mode .reviewer-note.approved { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.25); color: #86efac; }
html.dark-mode .req-icon.st-pending     { background: rgba(148,163,184,0.12); color: #B0B3B8; }
html.dark-mode .req-icon.st-submitted   { background: rgba(var(--color-blue-rgb), .16);  color: var(--color-blue-text); }
html.dark-mode .req-icon.st-sc_approved { background: rgba(6,182,212,0.15);   color: #67e8f9; }
html.dark-mode .req-icon.st-ac_approved { background: rgba(245,158,11,0.15);  color: #fcd34d; }
html.dark-mode .req-icon.st-approved    { background: rgba(34,197,94,0.15);   color: #4ade80; }
html.dark-mode .req-icon.st-returned    { background: rgba(220,38,38,0.15);   color: #f87171; }
html.dark-mode .req-due.is-overdue      { color: #f87171; }
html.dark-mode .req-file-icon.fi-pdf    { color: #f87171; }
html.dark-mode .req-file-icon.fi-word   { color: #6ea8ff; }
html.dark-mode .req-file-icon.fi-excel  { color: #4ade80; }
html.dark-mode .req-file-icon.fi-ppt    { color: #fb923c; }
html.dark-mode .req-file-icon.fi-image  { color: #c084fc; }
html.dark-mode .req-file-list         { border-color: #3E4042; }
html.dark-mode .req-file-row          { background: #242526; color: #E4E6EB; }
html.dark-mode .req-file-row + .req-file-row { border-top-color: #3E4042; }
html.dark-mode .req-file-row:hover    { background: #3A3B3C; color: #E4E6EB; }
html.dark-mode .req-file-added        { background: rgba(var(--color-blue-rgb), .15); color: color-mix(in srgb, var(--color-blue) 80%, white); }
html.dark-mode .req-batch-prev        { border-color: #3E4042; }
html.dark-mode .req-batch-prev[open] > summary { border-bottom-color: #3E4042; }
html.dark-mode .req-batch-state.is-approved,
html.dark-mode .req-review-row.is-approved .req-review-icon { color: #4ade80; }
html.dark-mode .req-review-row.is-returned .req-review-icon,
html.dark-mode .req-review-row.is-returned .req-review-detail { color: #f87171; }
html.dark-mode .req-actions           { border-top-color: #3E4042; }
html.dark-mode .file-item             { background: #18191A; border-color: #3E4042; }
html.dark-mode .file-item-icon        { color: #8A8D91; }
html.dark-mode .file-item-name        { color: #E4E6EB; }
html.dark-mode .file-item-size        { color: #6A6B6C; }
html.dark-mode .file-item-remove      { color: #6A6B6C; }
html.dark-mode .pm-pending            { background: #3A3B3C; color: #8A8D91; }
html.dark-mode .pm-approved           { background: rgba(34,197,94,0.15); color: #4ade80; }
html.dark-mode .pm-returned           { background: rgba(220,38,38,0.15); color: #f87171; }
html.dark-mode .collapse-panel        { background: #242526; border-color: #3E4042; }
html.dark-mode .collapse-header h6    { color: #E4E6EB; }
html.dark-mode .stat-box              { background: #242526; border-color: #3E4042; }
html.dark-mode .teacher-checkbox-list { background: #18191A; border-color: #3E4042; }
html.dark-mode .teacher-dept-header   { color: #8A8D91; border-bottom-color: #3E4042; }
html.dark-mode .teacher-item-label    { color: #E4E6EB; }
html.dark-mode .badge-teaches         { background: rgba(var(--color-blue-rgb), .15); color: color-mix(in srgb, var(--color-blue) 80%, white); }
html.dark-mode .tbl-review th,
html.dark-mode .tbl-assign th         { background: #18191A; color: #B0B3B8; border-bottom-color: #3E4042; }
html.dark-mode .tbl-review td,
html.dark-mode .tbl-assign td         { border-bottom-color: #3E4042; }
html.dark-mode .tbl-review tr:hover td,
html.dark-mode .tbl-assign tr:hover td { background: #3A3B3C; }
html.dark-mode .ps-pending            { background: #3A3B3C; color: #8A8D91; }
html.dark-mode .ps-approved           { background: rgba(34,197,94,0.15); color: #4ade80; }
html.dark-mode .ps-returned           { background: rgba(220,38,38,0.15); color: #f87171; }
html.dark-mode .subject-group-header  { background: #18191A; border-color: #3E4042; color: #B0B3B8; }
html.dark-mode .dept-group-header     { background: #18191A; color: #B0B3B8; }
html.dark-mode .teacher-subheader     { background: #242526; }
/* review.php master–detail (most .rv-* use tokens; these need tuning) */
html.dark-mode .rv-dept-head          { background: #18191A; color: #B0B3B8; }
html.dark-mode .rv-item:hover         { background: #3A3B3C; }
html.dark-mode .rv-item.active        { background: color-mix(in srgb, var(--brand-ink) 16%, transparent); box-shadow: inset 3px 0 0 var(--brand-ink); }
html.dark-mode .rv-item-flash         { background: rgba(245,158,11,0.22) !important; }
html.dark-mode .rv-item-name          { color: #E4E6EB; }
html.dark-mode .rv-detail-title       { color: #E4E6EB; }
html.dark-mode .rv-field              { color: #E4E6EB; }
html.dark-mode .review-stats .stat-box.active { border-color: var(--brand-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-ink) 25%, transparent); }
/* assignments.php accordion group headers */
html.dark-mode .acc-toggle:hover     { background: #3A3B3C; }
html.dark-mode .acc-toggle.open      { background: #2D2E2F; }

/* ── teaching_load.css ───────────────────────────────────── */
html.dark-mode .schedule-table        { border-color: #3E4042; background: #242526; box-shadow: none; }
html.dark-mode .schedule-table td     { border-color: #3E4042; }
html.dark-mode .time-cell             { background: #18191A; color: #E4E6EB; }
html.dark-mode .schedule-cell:hover   { background: color-mix(in srgb, var(--color-primary) 15%, #242526) !important; }
html.dark-mode .teacher-select-card,
html.dark-mode .section-select-card   { background: #242526; box-shadow: none; }
html.dark-mode .teacher-row:hover     { background: #3A3B3C; }
html.dark-mode .hours-bar             { background: #3E4042; }
/* section / teacher color palette — dark translucent versions */
html.dark-mode .sc-0, html.dark-mode .tc-0 { background: rgba(var(--color-blue-rgb), 0.18);  color: var(--color-blue-text); }
html.dark-mode .sc-1, html.dark-mode .tc-1 { background: rgba(16,185,129,0.18);  color: #6ee7b7; }
html.dark-mode .sc-2, html.dark-mode .tc-2 { background: rgba(234,179,8,0.18);   color: #fcd34d; }
html.dark-mode .sc-3, html.dark-mode .tc-3 { background: rgba(236,72,153,0.18);  color: #f9a8d4; }
html.dark-mode .sc-4, html.dark-mode .tc-4 { background: rgba(139,92,246,0.18);  color: #c4b5fd; }
html.dark-mode .sc-5, html.dark-mode .tc-5 { background: rgba(249,115,22,0.18);  color: #fdba74; }
html.dark-mode .sc-6, html.dark-mode .tc-6 { background: rgba(6,182,212,0.18);   color: #67e8f9; }
html.dark-mode .sc-7, html.dark-mode .tc-7 { background: rgba(34,197,94,0.12);   color: #86efac; }
html.dark-mode .sc-general                  { background: rgba(148,163,184,0.16); color: #cbd5e1; border-color: rgba(148,163,184,0.55); } /* general / off-campus task */
/* vacancy.php — vacant cells keep the color, occupied ones stay quiet */
html.dark-mode .vl-name-cell a:hover  { color: var(--brand-ink); }
html.dark-mode .vl-free               { background: rgba(34,197,94,0.10); }
html.dark-mode .vl-free-mark          { color: #4ade80; opacity: 0.6; }
html.dark-mode .vl-busy               { background: #2D2E2F; color: #C9CDD4; }
html.dark-mode .vl-other              { background: rgba(251,191,36,0.15); color: #fcd34d; } /* class in another department */
html.dark-mode .vl-conflict           { outline-color: #f87171; }
html.dark-mode .vl-dept-locked        { background: #3A3B3C; border-color: #4E4F50; color: #E4E6EB; }
html.dark-mode .vl-legend .vl-swatch  { border-color: #4E4F50; }
html.dark-mode .vl-swatch-free        { background: rgba(34,197,94,0.10); }
html.dark-mode .vl-swatch-busy        { background: #2D2E2F; }
html.dark-mode .vl-swatch-other       { background: rgba(251,191,36,0.15); }

/* ── tickets.css ─────────────────────────────────────────── */
html.dark-mode .ticket-row:hover { background: #3A3B3C; }
html.dark-mode .ticket-title     { color: #E4E6EB; }
html.dark-mode .tl-body.internal { background: #2a1f00; border-color: #78350f; }

/* ── kiosk.css ───────────────────────────────────────────── */
html.dark-mode .kiosk-container { background: #18191A; }

/* ── Select2 (bootstrap-5 theme) ────────────────────────── */
html.dark-mode .select2-container--bootstrap-5 .select2-selection {
    background-color: #3A3B3C;
    border-color: #4E4F50;
    color: #E4E6EB;
}
html.dark-mode .select2-container--bootstrap-5 .select2-selection .select2-selection__rendered { color: #E4E6EB; }
html.dark-mode .select2-container--bootstrap-5 .select2-selection .select2-selection__placeholder { color: #8A8D91; }
html.dark-mode .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #242526;
    border-color: #3E4042;
    color: #E4E6EB;
}
html.dark-mode .select2-container--bootstrap-5 .select2-search .select2-search__field {
    background-color: #3A3B3C;
    border-color: #4E4F50;
    color: #E4E6EB;
}
html.dark-mode .select2-container--bootstrap-5 .select2-results__option { color: #E4E6EB; }
html.dark-mode .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #3A3B3C;
    color: #E4E6EB;
}
html.dark-mode .select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: var(--color-primary);
    color: #fff;
}
html.dark-mode .select2-container--bootstrap-5 .select2-results__option[aria-disabled="true"] { color: #6A6B6C; }

/* ── employees.css ───────────────────────────────────────── */
html.dark-mode .filter-tab             { background: #3A3B3C; color: #C9CDD4; }
html.dark-mode .filter-tab:hover       { background: #4E4F50; color: #E4E6EB; }
html.dark-mode .filter-tab.active      { background: var(--isms-gradient-primary, linear-gradient(135deg,#1e3a8a,#0ea5e9)); color: #fff; }
/* employment type badges */
html.dark-mode .badge-regular      { background: rgba(16,185,129,0.15);  color: #6ee7b7; }
html.dark-mode .badge-probationary { background: rgba(245,158,11,0.15);  color: #fcd34d; }
html.dark-mode .badge-contractual  { background: rgba(14,165,233,0.15);  color: #7dd3fc; }
html.dark-mode .badge-parttime     { background: rgba(139,92,246,0.15);  color: #c4b5fd; }
/* status pills */
html.dark-mode .status-leave       { background: rgba(245,158,11,0.15);  color: #fcd34d; }
html.dark-mode .status-resigned    { background: rgba(239,68,68,0.15);   color: #fca5a5; }
html.dark-mode .status-retired     { background: #242526; color: #8A8D91; }
/* table row hover */
html.dark-mode .employee-table tbody tr.clickable-row:hover td { background-color: #3A3B3C !important; }
/* section card (view.php) */
html.dark-mode .section-card       { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.25); }

/* ── employee_attendance.css ─────────────────────────────── */
html.dark-mode .source-kiosk            { background: rgba(16,185,129,0.15); color: #6ee7b7; }
html.dark-mode .source-biometric        { background: rgba(var(--color-blue-rgb), 0.15); color: var(--color-blue-text); }
html.dark-mode .source-manual           { background: #3A3B3C; color: #8A8D91; }

/* ── registrar.css ───────────────────────────────────────── */
html.dark-mode .section-card          { background: #242526; }
html.dark-mode .section-card.active   { background: #3A3B3C; }
html.dark-mode .search-result-item    { border-bottom-color: #3E4042; color: #E4E6EB; }
html.dark-mode .search-result-item:hover { background: #3A3B3C; }
html.dark-mode .student-card          { background: #242526; box-shadow: none; }
html.dark-mode .search-results        { background: #242526; box-shadow: none; }
html.dark-mode .list-card             { background: #242526; box-shadow: none; }
html.dark-mode .charges-table th      { background: #18191A; color: #B0B3B8; }
html.dark-mode .summary-row           { background: #3A3B3C; }
html.dark-mode .summary-row td        { color: #E4E6EB; }
/* check_balance.php — student name, balance box, clearance badge, summary tiles */
html.dark-mode .student-card h5       { color: #E4E6EB; }
html.dark-mode .balance-display.has-balance { background: linear-gradient(135deg, rgba(127,29,29,0.25), rgba(127,29,29,0.4)); border-color: rgba(248,113,113,0.5); }
html.dark-mode .balance-display.cleared     { background: linear-gradient(135deg, rgba(20,83,45,0.25), rgba(20,83,45,0.4)); border-color: rgba(74,222,128,0.5); }
html.dark-mode .balance-display.has-balance .balance-amount { color: #fca5a5; }
html.dark-mode .balance-display.cleared .balance-amount     { color: #6ee7b7; }
html.dark-mode .clearance-badge.cleared,   html.dark-mode .clearance-indicator.cleared     { background: rgba(20,83,45,0.3);  color: #6ee7b7; border-color: rgba(74,222,128,0.4); }
html.dark-mode .clearance-badge.not-cleared, html.dark-mode .clearance-indicator.not-cleared { background: rgba(127,29,29,0.3); color: #fca5a5; border-color: rgba(248,113,113,0.4); }
/* wizard */
html.dark-mode .step-circle           { background: #3A3B3C; border-color: #4E4F50; color: #B0B3B8; }
html.dark-mode .step-circle.active    { background: var(--color-primary); border-color: var(--color-primary); color: white; }
html.dark-mode .step-circle.done      { background: #10b981; border-color: #10b981; color: white; }
html.dark-mode .step-label            { color: #B0B3B8; }
html.dark-mode .step-label.active     { color: #E4E6EB; }
html.dark-mode .step-connector        { background: #3E4042; }
html.dark-mode .wizard-card           { background: #242526; box-shadow: none; border: 1px solid #3E4042; }
html.dark-mode .wizard-card-header    { background: #3A3B3C; border-bottom-color: #3E4042; color: #E4E6EB; }
html.dark-mode .student-search-results { background: #242526; border-color: #3E4042; }
html.dark-mode .student-search-item   { border-bottom-color: #3E4042; }
html.dark-mode .student-search-item:hover,
html.dark-mode .student-search-item.active { background: #3A3B3C; }
html.dark-mode .s-name                { color: #E4E6EB; }
html.dark-mode .s-meta                { color: #B0B3B8; }
html.dark-mode .selected-card         { background: #1a3a2a; border-color: #2d6a4f; }
html.dark-mode .fee-table th          { background: #18191A; color: #B0B3B8; }
html.dark-mode .fee-total-row td      { background: #1a3a2a; color: #E4E6EB; }
html.dark-mode .fee-net-row td        { background: #1c3a5e; color: #E4E6EB; }
html.dark-mode .fee-error             { background: #3b1a1a; color: #fca5a5; }
/* document requests */
html.dark-mode .request-card          { background: #242526; box-shadow: none; }
html.dark-mode .student-info          { background: #18191A; }
html.dark-mode .doc-option            { border-color: #3E4042; color: #E4E6EB; }
html.dark-mode .doc-option:hover      { background: #3A3B3C; border-color: #4E4F50; }
html.dark-mode .doc-option.selected   { background: color-mix(in srgb, var(--brand-ink) 16%, #242526); border-color: var(--brand-ink); }
html.dark-mode .status-tab            { background: #3A3B3C; color: #B0B3B8; }
html.dark-mode .status-tab:hover      { background: #4E4F50; color: #E4E6EB; }
/* The rule above outranks .status-tab.active, so the selected tab looked like
   every other one; restate it. The surface band further down (view_account's
   nav-tabs strip) is for that page -- pill tabs sit on the page like in light mode. */
html.dark-mode .status-tab.active     { background: var(--color-primary); color: #fff; }
html.dark-mode .request-row           { background: #242526; box-shadow: none; }
/* fee badges */
html.dark-mode .fee-badge.paid        { background: rgba(16,185,129,0.15); color: #6ee7b7; }
html.dark-mode .fee-badge.unpaid      { background: rgba(239,68,68,0.15);  color: #fca5a5; }
/* records */
html.dark-mode .info-card             { background: #18191A; }
html.dark-mode .info-card h6          { color: #E4E6EB; border-bottom-color: #3E4042; }
html.dark-mode .enrollment-item       { background: #18191A; }
html.dark-mode .document-card         { background: #18191A; }
/* grade breakdown */
html.dark-mode .cleared-row td             { background: rgba(20,83,45,0.2); }
html.dark-mode .balance-row td             { background: rgba(127,29,29,0.15); }
html.dark-mode tr.row-unassigned td        { background: rgba(69,26,3,0.2); }
html.dark-mode tr.row-unassigned:hover td  { background: rgba(69,26,3,0.35); }
html.dark-mode .unassigned-badge           { background: rgba(69,26,3,0.4); color: #fbbf24; }
html.dark-mode .balance-zero               { background: rgba(20,83,45,0.3); color: #4ade80; }
html.dark-mode .balance-has                { background: rgba(69,26,3,0.3); color: #fbbf24; }
html.dark-mode .search-highlight           { background-color: rgba(254,240,138,0.2); color: #fbbf24; }
/* online applications */
html.dark-mode .toggle-card.open    { background: rgba(20,83,45,0.2); border-color: #2d6a4f; }
html.dark-mode .toggle-card.closed  { background: #242526; border-color: #3E4042; }
html.dark-mode .link-box            { background: #18191A; border-color: #3E4042; color: #E4E6EB; }
html.dark-mode .status-pending      { background: rgba(251,191,36,0.18); color: #fcd34d; }
html.dark-mode .status-approved     { background: rgba(16,185,129,0.15); color: #6ee7b7; }
html.dark-mode .status-rejected     { background: rgba(239,68,68,0.15);  color: #fca5a5; }
html.dark-mode .status-cancelled    { background: #3A3B3C;               color: #B0B3B8; }
/* sf10 map */
html.dark-mode .field-item:hover    { background: #3A3B3C; }
html.dark-mode .field-item.active   { background: color-mix(in srgb, var(--brand-ink) 16%, #242526); border-left-color: var(--brand-ink); }
html.dark-mode .rc-corner,
html.dark-mode .rc-row-hdr,
html.dark-mode .rc-col-hdr          { background: #3A3B3C; color: #B0B3B8; }
/* sf10 grade inputs (sf10_data.php + sf10_grades.php) */
html.dark-mode .grade-table th                              { background: #3A3B3C; }
/* The SF10 record's grade boxes are plain inputs, not .form-control, so the
   browser painted them white: the .form-control field colours instead (their
   border is --color-gray-300, already the dark one). A figure the page works
   out (.is-computed, .computed-mark) keeps its transparent, dashed look, and the
   passed / failed / locked colours below still win (:where() adds no weight). */
html.dark-mode .transcript-table .grade-input:where(:not(.is-computed, .computed-mark)),
html.dark-mode .sem-block-head .grade-input:where(:not(.is-computed)) { background-color: #3A3B3C; color: #E4E6EB; }
/* A grade box that is not a .form-control (the SF10 letter grades). */
html.dark-mode .transcript-table .grade-input.passed        { background: rgba(34,197,94,0.18); border-color: #4ade80; color: #86efac; }
html.dark-mode .transcript-table .grade-input.failed        { background: rgba(239,68,68,0.18); border-color: #f87171; color: #fca5a5; }
html.dark-mode .transcript-table .grade-input.locked        { background: #2E2F30; border-color: #4E4F50; color: #B0B3B8; }
html.dark-mode .transcript-table .grade-input.out-of-range  { background: rgba(251,146,60,0.20); border-color: #fb923c; color: #fdba74; }
/* The year being edited. Bootstrap paints the active tab in --bs-body-bg, which is
   the page black here, so the chosen year sat DARKER than the card behind it and
   read as the disabled one. */
html.dark-mode .year-tab .nav-link.active {
    background: #3A3B3C; border-color: #4E4F50 #4E4F50 #3A3B3C; color: #fff;
}
/* Worked out, not typed — see .computed-mark in registrar.css. */
html.dark-mode .save-state { background: #242526; border-color: #3E4042; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
html.dark-mode .transcript-table .subject-cat-head td { background: #2E3A47; color: #E4E6EB; }
html.dark-mode .elig-cred.is-on { border-color: var(--brand-ink); background: color-mix(in srgb, var(--brand-ink) 10%, transparent); }
html.dark-mode .transcript-table tr[data-component] td:first-child::before {
    border-left-color: #4E4F50; border-bottom-color: #4E4F50;
}
html.dark-mode .sem-block + .sem-block { border-top-color: #3E4042; }
html.dark-mode .sem-block-title        { color: color-mix(in srgb, var(--color-blue) 80%, white); }

/* document_types.php */
html.dark-mode .doc-card              { background: #242526; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
html.dark-mode .doc-card.inactive     { background: #18191A; }
html.dark-mode .doc-header            { border-bottom-color: #3E4042; }
html.dark-mode .doc-info-item i      { color: #6A6B6C; }
html.dark-mode .doc-info-item .value { color: #E4E6EB; }
html.dark-mode .doc-add-card          { background: #242526; border-color: #4E4F50; }
html.dark-mode .doc-add-card:hover    { background: color-mix(in srgb, var(--brand-ink) 8%, transparent); border-color: var(--brand-ink); }
html.dark-mode .doc-add-card i        { color: #4E4F50; }
html.dark-mode .doc-add-card:hover i  { color: var(--brand-ink); }
/* signatories.php — role label pill */
html.dark-mode .badge.text-bg-light   { background: #3A3B3C !important; color: #C9CDD4 !important; border-color: #4E4F50 !important; }

/* ── dashboard.php announcements ────────────────────────── */
/* (type-specific .ann-info/.ann-warning/etc backgrounds defined later) */

html.dark-mode .bday-name               { color: #E4E6EB; }

/* ── settings-system.css (users.php) ────────────────────── */
html.dark-mode .user-list-card          { background: #242526 !important; box-shadow: none; border: 1px solid #3E4042; }
html.dark-mode .user-list-card.inactive { background: #18191A !important; }
html.dark-mode .user-list-card:hover    { box-shadow: 0 2px 12px rgba(0,0,0,0.4) !important; }
html.dark-mode .user-list-name          { color: #E4E6EB !important; }
html.dark-mode .stat-mini-value         { color: #E4E6EB !important; }

/* ── settings-system.css (school_info.php — Color Palette) ──
 * The .preview-card wrapper follows dark mode; the header/sidebar/
 * button swatches inside it keep the user's chosen colors (set
 * inline via JS), so the preview itself stays accurate. */
html.dark-mode .color-picker            { border-color: #3E4042; }
html.dark-mode .section-divider         { border-top-color: #3E4042; }
html.dark-mode .logo-upload-area        { border-color: #3E4042; }
html.dark-mode .logo-upload-area:hover  { border-color: var(--brand-ink); background: #3A3B3C; }
html.dark-mode .logo-preview            { background: #3A3B3C; }
html.dark-mode .logo-placeholder        { background: linear-gradient(135deg, #3A3B3C, #4E4F50); color: #B0B3B8; }

/* role badge dark variants */
html.dark-mode .role-badge-registrar    { background: rgba(var(--color-blue-rgb), 0.15);   color: var(--color-blue-text); }
html.dark-mode .role-badge-cashier      { background: rgba(245,158,11,0.15);   color: #fcd34d; }
html.dark-mode .role-badge-librarian    { background: rgba(139,92,246,0.15);   color: #c4b5fd; }
html.dark-mode .role-badge-nurse        { background: rgba(244,63,94,0.15);    color: #fda4af; }
html.dark-mode .role-badge-guidance     { background: rgba(168,85,247,0.15);   color: #d8b4fe; }
html.dark-mode .role-badge-custodian    { background: rgba(14,165,233,0.15);   color: #7dd3fc; }
html.dark-mode .role-badge-worker       { background: rgba(132,204,22,0.15);   color: #bef264; }
/* role picker (add_user.php / edit_user.php) */
html.dark-mode .role-option:hover       { border-color: var(--brand-ink); background: color-mix(in srgb, var(--brand-ink) 10%, transparent); }
html.dark-mode .role-option.selected    { border-color: var(--brand-ink); background: color-mix(in srgb, var(--brand-ink) 15%, transparent); }
html.dark-mode .role-desc               { color: #8A8D91; }
html.dark-mode .password-toggle        { color: #8A8D91; }
html.dark-mode .password-toggle:hover  { color: #E4E6EB; }
/* ── maintenance.css (backup.php) ───────────────────────── */
html.dark-mode .backup-card             { background: #242526; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
html.dark-mode .backup-card h6          { color: #E4E6EB; }
html.dark-mode .db-stat.clickable:hover { background: color-mix(in srgb, var(--brand-ink) 10%, transparent); }
html.dark-mode .db-stat-value           { color: #E4E6EB; }
html.dark-mode .table-list-popover      { background: #242526; border-color: #3E4042; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
html.dark-mode .table-list-popover h6   { color: #B0B3B8; border-bottom-color: #3E4042; }
html.dark-mode .table-list-popover .table-name { background: #18191A; color: #C9CDD4; }
html.dark-mode .table-list-popover .table-name.protected { background: rgba(147,51,234,.15); color: #d8b4fe; }
html.dark-mode .backup-item             { background: #18191A; }
html.dark-mode .backup-item .backup-name { color: #E4E6EB; }
html.dark-mode .backup-item .backup-meta { color: #8A8D91; }
html.dark-mode .upload-area             { border-color: #3E4042; }
html.dark-mode .upload-area:hover       { border-color: var(--brand-ink); background: color-mix(in srgb, var(--brand-ink) 6%, transparent); }
html.dark-mode .upload-area i           { color: #4E4F50; }
html.dark-mode .upload-area:hover i     { color: var(--brand-ink); }
html.dark-mode .safety-box  { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); color: #6ee7b7; }
html.dark-mode .progress-spinner { border-color: #3E4042; border-top-color: var(--brand-ink); }

/* ── cashier.css — receipt template designer ────────────── */
html.dark-mode .canvas-wrapper          { background: #18191A; }
/* .paper-canvas stays white — it simulates actual paper for print layout */
/* field labels must stay dark since they sit on the white paper canvas */
html.dark-mode .field-label { color: #1e293b; }
html.dark-mode .properties-panel        { background: #242526; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
html.dark-mode .panel-body              { background: #242526; }
html.dark-mode .field-list             { border-color: #3E4042; background: #242526; }
html.dark-mode .field-list-item        { border-bottom-color: #3E4042; color: #E4E6EB; }
html.dark-mode .field-list-item:hover  { background: #3A3B3C; }
html.dark-mode .field-list-item.active { background: color-mix(in srgb, var(--brand-ink) 15%, transparent); }
/* aux-designer (AR) amber accent */
html.dark-mode body.aux-designer .field-list-item.active { background: rgba(245,158,11,0.15); }

/* ── accounting.css ─────────────────────────────────────── */
html.dark-mode { --color-body-bg: #18191A; }
html.dark-mode .summary-card .opacity-75       { opacity: 1 !important; color: rgba(255,255,255,0.9); }
html.dark-mode .student-select-card:hover      { background: color-mix(in srgb, var(--brand-ink) 8%, transparent); border-color: var(--color-primary); }
html.dark-mode .student-select-card.selected   { background: color-mix(in srgb, var(--brand-ink) 12%, transparent); border-color: var(--color-primary); }
html.dark-mode .charge-row.paid                { background: rgba(16,185,129,0.10); border-color: rgba(16,185,129,0.3); }
html.dark-mode .charge-row.partial             { background: rgba(251,191,36,0.10); border-color: rgba(251,191,36,0.3); }
html.dark-mode .fee-card               { background: #242526; border-color: #3E4042; }
html.dark-mode .fee-card.inactive      { background: #18191A; }
html.dark-mode .fee-card:hover         { box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
html.dark-mode .category-header        { background: #18191A; color: #B0B3B8; }
html.dark-mode .category-Miscellaneous { background: color-mix(in srgb, var(--color-accent)     15%, #242526); color: var(--color-accent); }
html.dark-mode .category-Laboratory    { background: color-mix(in srgb, var(--color-success)    15%, #242526); color: #4ade80; }
html.dark-mode .category-Library       { background: color-mix(in srgb, var(--color-secondary)  15%, #242526); color: var(--color-secondary); }
html.dark-mode .category-Others        { background: #3A3B3C; color: #B0B3B8; }

/* ── payments.css ────────────────────────────────────────── */
/* index.php — reception layout */
html.dark-mode .student-panel          { background: #242526; box-shadow: none; border: 1px solid #3E4042; }
html.dark-mode .students-list          { background: #18191A; }
html.dark-mode .search-section         { background: #18191A; border-bottom-color: #3E4042; }
html.dark-mode .student-item           { background: transparent !important; border-color: #3E4042; }
html.dark-mode .student-item:hover     { background: transparent !important; border-color: var(--color-secondary); transform: translateX(3px); }
html.dark-mode .student-item.selected  { background: transparent !important; border-color: var(--color-primary); border-width: 2px; }
html.dark-mode .or-input-auto          { background: #18191A; }
html.dark-mode .bg-warning-subtle      { background-color: rgba(251,191,36,0.12) !important; color: #fde68a !important; }
html.dark-mode .bg-success-subtle      { background-color: rgba(34,197,94,0.10) !important; color: #86efac !important; }
html.dark-mode .bg-danger-subtle       { background-color: rgba(239,68,68,0.10) !important; color: #fca5a5 !important; }
html.dark-mode .bg-info-subtle         { background-color: rgba(6,182,212,0.10) !important; color: #67e8f9 !important; }
html.dark-mode .bg-primary-subtle      { background-color: color-mix(in srgb, var(--brand-ink) 10%, transparent) !important; color: var(--brand-ink) !important; }
html.dark-mode .bg-secondary-subtle    { background-color: #3A3B3C !important; color: #B0B3B8 !important; }
html.dark-mode .student-info           { color: #8A8D91; }
html.dark-mode .student-photo-thumb    { border-color: #4E4F50; }
html.dark-mode .payment-panel          { background: #242526; box-shadow: none; }
html.dark-mode .payment-section        { background: #18191A; border-color: #3E4042; }
html.dark-mode .form-label-custom      { color: #E4E6EB; }
html.dark-mode .allocation-table td    { border-bottom-color: #3E4042; }
html.dark-mode .total-row              { background: color-mix(in srgb, var(--color-accent) 15%, #242526); }
html.dark-mode .alloc-bar-wrap         { background: #3E4042; }
html.dark-mode .no-account             { color: #6A6B6C; }
html.dark-mode .charge-search-results .result-item        { border-bottom-color: #3E4042; color: #E4E6EB; }
html.dark-mode .charge-search-results .result-item:hover  { background: #3A3B3C; }
/* view_account.php */
html.dark-mode .info-grid .info-item   { background: rgba(0,0,0,0.25) !important; border-color: rgba(255,255,255,0.1); }
html.dark-mode .info-grid .info-item .info-value { color: #fff; }
html.dark-mode .info-grid .info-item .info-label { color: rgba(255,255,255,0.7); }
html.dark-mode .status-tabs .nav-tabs  { border-bottom-color: #3E4042; }
html.dark-mode .financial-summary                  { background: #242526 !important; border-color: #3E4042; }
html.dark-mode .financial-summary .summary-row     { background: transparent; }
html.dark-mode .summary-label                      { color: #B0B3B8; }
html.dark-mode .charges-table thead th { background: #18191A; color: #B0B3B8; }
html.dark-mode .charges-table tbody tr:hover { background: #3A3B3C; }
html.dark-mode .payment-table th       { background: #18191A; color: #B0B3B8; }
html.dark-mode .allocation-item        { border-bottom-color: #3E4042; }
html.dark-mode .allocation-item .fee-name { color: #B0B3B8; }
/* reports */
/* :not(.active) -- otherwise this outranks .report-tab.active and the chosen tab loses its highlight. */
html.dark-mode .report-tab:not(.active) { background: #3A3B3C; color: #B0B3B8; }
html.dark-mode .report-tab:hover:not(.active) { background: #4E4F50; }
html.dark-mode .balance-high           { background: rgba(127,29,29,0.2); }
html.dark-mode .balance-medium         { background: rgba(69,26,3,0.2); }
html.dark-mode .sortable-header:hover  { background-color: #3A3B3C; }
/* walk-in / store */
html.dark-mode .recent-payment         { background: rgba(20,83,45,0.25); border-left-color: #10b981; }

/* announcement carousel (dashboard) */
html.dark-mode .ann-item.ann-info    { background: rgba(var(--color-blue-rgb), .10); border-left-color: var(--color-blue); }
html.dark-mode .ann-item.ann-warning { background: rgba(251,191,36,0.10); border-left-color: #fcd34d; }
html.dark-mode .ann-item.ann-danger  { background: rgba(239,68,68,0.10);  border-left-color: #fca5a5; }
html.dark-mode .ann-item.ann-success { background: rgba(16,185,129,0.10); border-left-color: #6ee7b7; }
html.dark-mode .ann-title  { color: #E4E6EB; }
html.dark-mode .ann-body   { color: #C9CDD4; }
html.dark-mode .ann-meta   { color: #8A8D91; }
html.dark-mode .ann-expiring { color: #fca5a5; }
html.dark-mode .ann-delete-btn { color: #8A8D91; }
html.dark-mode .ann-delete-btn:hover { color: #fca5a5; }
html.dark-mode .ann-carousel .carousel-control-prev-icon,
html.dark-mode .ann-carousel .carousel-control-next-icon { filter: invert(85%); }
/* announcement modal */
html.dark-mode .ann-modal             { background: #242526; }
html.dark-mode .ann-modal-header      { background: #1c3a5e; }
html.dark-mode .ann-modal-count       { background: #242526 !important; color: var(--color-blue-text); }
html.dark-mode .ann-modal-body        { background: #242526; }
html.dark-mode .ann-modal-footer      { background: #18191A; border-top-color: #3E4042; }
html.dark-mode .ann-modal-footer .text-muted { color: #8A8D91 !important; }
html.dark-mode .ann-modal-item.ann-info    .ann-modal-icon { color: #60a5fa; }
html.dark-mode .ann-modal-item.ann-warning .ann-modal-icon { color: #fcd34d; }
html.dark-mode .ann-modal-item.ann-danger  .ann-modal-icon { color: #fca5a5; }
html.dark-mode .ann-modal-item.ann-success .ann-modal-icon { color: #6ee7b7; }
html.dark-mode .ann-progress         { color: #B0B3B8; }

/* ============================================================
 * SECTION — PHYSICAL PLANT MODULE (modules/physical_plant)
 * ============================================================ */
/* Page-header icons use an inline indigo colour; force them white in dark mode
   to match the light header text (overrides the inline style). */
/* book.php availability calendar */

/* ============================================================
 * SECTION — GUIDANCE MODULE (modules/guidance)
 * ============================================================ */
/* session_view.php — notes/recommendations box mixed primary into white,
   leaving a near-white cream box with invisible text in dark mode. */
html.dark-mode .notes-box  { background: #18191A; color: #E4E6EB; }

/* ============================================================
 * SECTION — INVENTORY MODULE (modules/inventory)
 * ============================================================ */
/* Search-suggest widget (.ss-*) — dropdown is body-appended, so it uses
   --color-white (not remapped in dark mode) for its surface. Override to a
   dark surface so options aren't pale text on white. */
html.dark-mode .ss-dropdown        { background: #242526; border-color: #3E4042; }
html.dark-mode .ss-item            { color: #E4E6EB; }
html.dark-mode .ss-item:hover,
html.dark-mode .ss-item.active     { background: #3A3B3C; }
html.dark-mode .ss-empty           { color: #8A8D91; }
html.dark-mode .ss-clear           { color: #8A8D91; }
html.dark-mode .ss-clear:hover     { color: #f87171; }

/* ── barcode-generator (moved from 5-modules/barcode-generator.css) ── */
html.dark-mode .controls-bar { background: #242526; border-color: #3E4042; }
html.dark-mode .controls-bar .form-check-label { color: #C9CDD4; }
html.dark-mode .barcode-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
html.dark-mode .spinner-overlay { background: rgba(0,0,0,0.7); }
html.dark-mode .spinner-overlay .fw-semibold { color: #E4E6EB !important; }

/* ── leaves (moved from 5-modules/leaves.css) ── */
html.dark-mode .leave-mobile-card { background: #242526; border-color: #3E4042; }
html.dark-mode .leave-mobile-card.actionable { border-color: #fbbf24; background: rgba(251,191,36,0.07); }
html.dark-mode .lmc-meta { color: #8A8D91; }
html.dark-mode .lmc-field-label { color: #6A6B6C; }

/* ── reports-enrollment (moved from 5-modules/reports-enrollment.css) ── */
html.dark-mode .enrol-table th, html.dark-mode .enrol-table td { border-color: #3E4042; }
html.dark-mode .enrol-table tbody tr:not(.row-subtotal):not(.row-overall):not(.row-shs-hdr):hover td { background: #2a2b2c; }
html.dark-mode .tbl-title-row td { background: #242526; color: #E4E6EB; border-bottom-color: #166534; }
html.dark-mode .row-subtotal td { background: rgba(34,197,94,0.15); color: #4ade80; }
html.dark-mode .row-overall td { background: rgba(234,179,8,0.15); color: #fcd34d; }
html.dark-mode .row-shs-hdr td { background: #18191A; color: #B0B3B8; }


