/* =========================================================
   SITE-WIDE LIGHT/DARK THEME
   =========================================================
   Loaded on every page (dashboards + landing page), after that
   page's own stylesheet(s). Two layers:

   1. Dark redefinitions of the CSS custom properties every shell
      already uses for its surfaces/text (--bg-main, --white,
      --text-dark, --text-gray, --text-muted, --card-border,
      --card-shadow). admin_dashboard.css, student_dashboard.css,
      coordinator_dashboard.css (inherits student's), set_password.css
      and landing_page.css all build their components on top of these
      same variable names, so redefining them once here re-themes the
      overwhelming majority of every page's chrome automatically --
      no need to duplicate this block per file.

   2. Targeted overrides for the specific places a page hardcodes a
      raw color instead of a variable (a handful of white card/input
      backgrounds in landing_page.css, set_password.css, and plain
      HTML form controls that get their light-gray border/background
      from the browser default or an inline style). Kept to a short,
      named list rather than trying to chase every inline style in
      the app -- see the session notes for what's intentionally out
      of scope.

   Toggled via [data-theme="dark"] on <html>, set by js/theme_toggle.js
   and persisted in localStorage; the inline anti-flash snippet in
   each page's <head> applies it before first paint. */

/* ===== PAGE TRANSITION: CROSSFADE + SUBTLE SLIDE =====
   Applies to every page (dashboards AND the landing page -- this is a
   generic navigation-feel polish, unrelated to the light/dark theme, so
   unlike the theme itself it isn't excluded from index.php). Paired with
   js/theme_toggle.js, which toggles .page-exiting on the right element just
   before an internal link is actually followed, so leaving a page
   crossfades out instead of cutting straight to a blank flash while the
   next page loads; arriving at the new page then plays the entrance below
   the same way. A real single-page-app transition (old and new page
   visible at once) isn't possible across a full page navigation -- this is
   the closest equivalent that works with plain multi-page PHP.

   On a dashboard page the sidebar/topbar are meant to read as persistent
   app chrome, not as content that reloads -- fading the WHOLE page
   (sidebar included) on every tab click undercuts that and made the
   sidebar look like it "flickers" on each navigation instead of staying
   put. So only .content-area/.main-content (the actual page content, next
   to a sidebar that stays exactly where it is) transitions on those pages;
   body is the fallback target for pages that don't have either (the
   landing page has no sidebar at all, so the whole page transitioning
   there is correct, not a compromise). */
body {
    animation: pageEnter 0.35s ease-out;
}
.content-area,
.main-content {
    animation: pageEnter 0.35s ease-out;
}
body:has(.content-area, .main-content) {
    animation: none;
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-exiting {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ===== TOAST NOTIFICATIONS =====
   Paired with window.showToast() in js/theme_toggle.js -- the replacement
   for the plain browser alert() previously scattered across the app's AJAX
   error/validation handling. Stacks in the top-right corner; each toast
   slides+fades in independently and the container itself never needs
   sizing/positioning logic since flex + gap handles stacking multiple. */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 360px;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 280px;
    background: var(--white);
    color: var(--text-dark);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow-lift, 0 10px 30px rgba(0, 0, 0, 0.15));
    border-left: 4px solid #999;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo);
}
.toast.toast-visible {
    opacity: 1;
    transform: translateX(0);
}
.toast.toast-leaving {
    opacity: 0;
    transform: translateX(30px);
}
.toast-icon {
    font-size: 17px;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-message {
    font-size: 13px;
    line-height: 1.45;
    flex: 1;
    font-family: 'Montserrat', sans-serif;
}
.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-gray);
    font-size: 16px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
@media (hover: hover) and (pointer: fine) { .toast-close:hover {
    color: var(--text-dark);
} }
.toast-success { border-left-color: #22c55e; }
.toast-success .toast-icon { color: #22c55e; }
.toast-error { border-left-color: #dc3545; }
.toast-error .toast-icon { color: #dc3545; }
.toast-warning { border-left-color: #f59e0b; }
.toast-warning .toast-icon { color: #f59e0b; }
.toast-info { border-left-color: #3b82f6; }
.toast-info .toast-icon { color: #3b82f6; }

@media (max-width: 480px) {
    #toastContainer {
        left: 12px;
        right: 12px;
        top: 12px;
        max-width: none;
    }
    .toast {
        min-width: 0;
        width: 100%;
    }
}

/* ===== SKELETON LOADING PLACEHOLDER =====
   For a KPI number that genuinely doesn't exist yet -- the Analytics
   pages' 3 summary numbers start unknown and only get a real value once
   their AJAX fetch resolves, unlike the Dashboard pages' KPI cards, which
   are server-rendered with the real number already and only animate it
   cosmetically. Showing a plain "0" for that gap reads as real data (an
   actual zero), not as "still loading" -- this shimmer communicates the
   difference. Add/remove the class in JS around the real fetch; the
   element's own text stays in the DOM (color: transparent), so nothing
   needs restructuring once the real value replaces it. */
.stat-skeleton {
    color: transparent !important;
    display: inline-block;
    min-width: 64px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.12) 37%, rgba(0, 0, 0, 0.06) 63%);
    background-size: 400% 100%;
    animation: skeletonShimmer 1.4s ease infinite;
}
:root[data-theme="dark"] .stat-skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.14) 37%, rgba(255, 255, 255, 0.06) 63%);
    background-size: 400% 100%;
}
@keyframes skeletonShimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ===== TABLE ROW ENTRANCE (staggered, one level deeper than the panel) =====
   The panel/card holding a table already fades+slides in (the shared
   entrance system further up this file); rows inside it used to just
   appear fully rendered the instant the panel's own animation finished,
   which reads as the stagger stopping abruptly at the panel boundary. This
   extends the same "staggered loading" language one level deeper, into
   the actual rows -- covers both table shapes in the app: real
   `<table class="data-table">` markup (admin/offense classifications/AI
   knowledge base/user management) and the div-grid ".report-row" pattern
   (student/coordinator's reports and student lists). Runs identically
   whether the rows were server-rendered at page load or just replaced via
   an AJAX table refresh -- a CSS animation plays whenever a matching
   element is inserted into the render tree, regardless of how it got
   there, so no JS wiring is needed per page. Capped at the first 10 rows;
   anything beyond that shares the last step's delay so a long table
   doesn't take increasingly longer to finish appearing. */
.data-table tbody tr,
.report-row {
    opacity: 0;
    animation: tableRowIn 0.35s ease-out forwards;
}
@keyframes tableRowIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.data-table tbody tr:nth-child(1),  .report-row:nth-child(1)  { animation-delay: 0.03s; }
.data-table tbody tr:nth-child(2),  .report-row:nth-child(2)  { animation-delay: 0.06s; }
.data-table tbody tr:nth-child(3),  .report-row:nth-child(3)  { animation-delay: 0.09s; }
.data-table tbody tr:nth-child(4),  .report-row:nth-child(4)  { animation-delay: 0.12s; }
.data-table tbody tr:nth-child(5),  .report-row:nth-child(5)  { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(6),  .report-row:nth-child(6)  { animation-delay: 0.18s; }
.data-table tbody tr:nth-child(7),  .report-row:nth-child(7)  { animation-delay: 0.21s; }
.data-table tbody tr:nth-child(8),  .report-row:nth-child(8)  { animation-delay: 0.24s; }
.data-table tbody tr:nth-child(9),  .report-row:nth-child(9)  { animation-delay: 0.27s; }
.data-table tbody tr:nth-child(10), .report-row:nth-child(10) { animation-delay: 0.3s; }
.data-table tbody tr:nth-child(n+11), .report-row:nth-child(n+11) { animation-delay: 0.3s; }

/* ===== EMPTY-STATE ICON BOUNCE =====
   Every "no data yet" empty state across the app (no reports, no
   announcements, no coordinators, no pending registrations, ...) uses the
   same faded icon treatment -- literally the same two inline colors
   (color: #ddd or #ccc) copy-pasted at every one of its ~13 call sites
   across both PHP-rendered markup and two AJAX-rendered ones
   (fetch_admin_reports.php, fetch_registrations.php's own empty-table
   HTML string). That repetition is what makes a single attribute-value
   selector viable here instead of touching each file: it reliably targets
   exactly those icons and nothing else, with zero markup changes needed
   anywhere (works on the two AJAX-built ones the same as the static
   ones). A small personality touch for a state that otherwise reads as
   "nothing happened" rather than "designed for this." */
i[style*="color: #ddd"], i[style*="color:#ddd"],
i[style*="color: #ccc"], i[style*="color:#ccc"] {
    display: inline-block;
    animation: emptyIconBounce 0.5s var(--ease-out-expo) forwards;
}
@keyframes emptyIconBounce {
    0%   { opacity: 0; transform: scale(0.5); }
    60%  { opacity: 1; transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

/* ===== DASHBOARD GREETING TYPEWRITER =====
   Paired with js/theme_toggle.js's typewriterEffect(). Starts hidden via
   visibility (not opacity/display -- the heading still occupies its real
   layout space immediately, so nothing around it jumps once the text
   starts appearing) so there's no flash of the full, server-rendered
   greeting before JS blanks it and starts typing it back in. JS flips this
   to visible at the exact moment it's ready to reveal the first
   character, matching every dashboard's actual greeting heading (Admin's
   "Good morning, Admin!" h2, Student's/Coordinator's h1.greeting). */
.welcome-header h2,
h1.greeting {
    visibility: hidden;
}

/* The JS-positioned sliding active-tab indicator bar that used to be
   styled here was removed (see js/theme_toggle.js's own comment at the end
   of its IIFE) -- it lagged behind the page's own instant CSS active-pill
   background and could drift out of sync with the actual <li>. .sidebar-nav
   keeps position:relative since other absolutely-positioned children may
   still rely on it. */
.sidebar-nav {
    position: relative;
}

/* ===== SHARED DASHBOARD ENTRANCE ANIMATION SYSTEM =====
   One set of keyframes + timing/easing, used by every dashboard tab across
   every role (Admin, Coordinator, Student, and their Analytics/Reports
   pages) instead of each page's own CSS file inventing its own duration,
   easing curve, and slide-up-only motion. Originally built for
   admin_dashboard.php's KPI cards; moved here (the one stylesheet already
   loaded everywhere) so every other dashboard's cards/panels reference the
   exact same keyframes and can stagger with the same 0.1s-per-step
   convention -- literally the same animation engine everywhere, not a
   lookalike re-implementation per file. Each page's own CSS still decides
   WHICH of these five to use on which element and what accent color goes
   with it (that's genuinely page-specific -- a KPI's meaning drives its
   color), but the motion itself, its duration, and its easing curve are
   shared so the whole app reads as one system.
   --ease-out-expo is also defined locally in admin_dashboard.css/
   student_dashboard.css/landing_page.css (same value) for pages that use
   it before this file loads; declared again here so it's available to
   anything that only depends on theme.css. */
:root {
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

    /* Modal spacing system -- consolidates the 5/6/8/12/15/20/25/30px values
       previously copy-pasted (inconsistently) across every modal in the app
       into one shared, tunable scale. Tightest at the top (label -> its own
       input), loosest at the bottom (content -> the action buttons), same
       intent every modal already had, just not expressed consistently.
       Deliberately generous (not just a 1-2px nudge from the old values) so
       the change reads as an obvious, intentional spacing upgrade rather
       than something that could pass for a caching artifact. */
    --modal-padding: 36px;
    --modal-padding-mobile: 24px;
    --modal-header-gap: 12px;      /* header title -> subtitle */
    --modal-section-gap: 28px;     /* header block -> body content */
    --modal-field-gap: 20px;       /* between stacked input-groups */
    --modal-label-gap: 8px;        /* label -> its input */
    --modal-action-gap: 32px;      /* last field/content -> button(s) */
    --modal-button-gap: 14px;      /* between multiple buttons */

    /* Entrance-animation tiers -- 3 durations instead of the 9 distinct
       values previously in use, all on the same --ease-out-expo curve. */
    --anim-micro: 0.3s var(--ease-out-expo);     /* badges, pulses, bubbles */
    --anim-standard: 0.6s var(--ease-out-expo);  /* cards, panels, modal pop-in */
    --anim-section: 0.8s var(--ease-out-expo);   /* page headers, hero content */

    /* Unread-report row highlight (staff queues: admin/coordinator/GHD
       Reports Tables + the admin dashboard's "Needs Action" list) -- the
       brand green: a soft green wash with a solid green stripe, so it sits
       inside the system's palette instead of introducing a blue. Referenced
       via var() from inline styles generated in PHP, so it still re-themes
       correctly even though those rows aren't built from a CSS class. */
    --unread-bg: rgba(10, 95, 37, 0.09);
    --unread-accent: #0a5f25;
}

@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Report Viewing Animation -- the modal SHELL already fades+scales in on
   .active (see .modal-content below), but its inner content used to just
   snap from "Loading..." to the real report with no transition at all,
   feeling like two disconnected motions back to back. This is applied via
   JS the moment real content replaces the loading placeholder (see
   openAdminReport() et al.) -- micro tier (0.3s) on purpose, so it reads as
   quick and natural rather than delaying access to the report. */
.report-content-fade-in {
    animation: cardFadeUp var(--anim-micro, 0.3s ease) both;
}
@keyframes cardSlideLeft {
    from { opacity: 0; transform: translateX(-32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes cardSlideRight {
    from { opacity: 0; transform: translateX(32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes cardZoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes cardBounceIn {
    0%   { opacity: 0; transform: scale(0.7) translateY(10px); }
    60%  { opacity: 1; transform: scale(1.04) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

/* Baseline every dashboard card/panel picks up automatically -- a page that
   never customizes further (admin_reports.php, user_management.php,
   coordinator_reports.php, ai_knowledge_base.php, offense_classifications.php,
   my_reports.php, etc.) still fades its panels in on the same curve as
   everywhere else, instead of appearing with no motion at all. Pages that DO
   want a specific card to slide/zoom/bounce instead just set that element's
   own animation-name + animation-delay -- duration/easing/fill-mode stay
   inherited from here so the "feel" never drifts between a hand-tuned card
   and a default one. */
.stat-card,
.panel,
.glass-panel,
.counter-card {
    animation-duration: 0.6s;
    animation-timing-function: var(--ease-out-expo);
    /* "both", not "forwards" -- a staggered card's animation-delay would
       otherwise render it at full opacity during the wait (fill-mode
       "forwards" only holds the END state, not the START one), so a later
       card flashes visible then snaps back to invisible the instant its
       delayed animation actually begins. "both" holds the keyframe's 0%
       state through the delay too, so it stays properly hidden until its
       turn in the stagger. */
    animation-fill-mode: both;
    animation-name: cardFadeUp;
}

/* A per-page entrance animation on .top-header was tried here and reverted
   -- `animation-fill-mode: forwards` leaves a permanent (if visually
   identity) `transform` on the element even after the animation finishes,
   and ANY non-"none" transform on an ancestor makes it the containing
   block for `position: fixed` descendants (the logout modal, notification/
   profile dropdowns, ...) instead of the real viewport. That silently
   broke exactly the kind of thing it looks like: fixed-position UI
   rendering in the wrong place or not at all, worst on Coordinator's pages
   (its sidebar is itself position:fixed, a different layout model than
   Admin's/Student's flex-based one, so the breakage compounded there).
   The topbar intentionally has no entrance animation -- it's persistent
   app chrome, matching the sidebar's own (correct) lack of one. */

/* ===== MODAL DARK-MODE FIX =====
   Every modal in the app (logout confirmation on ~18 pages, the report-
   submission form, student/report detail popups, add/edit/confirm dialogs
   in user_management.php, etc.) was built the same way: a `.modal-content`
   box with its background, text colors, and borders set as literal inline
   `style="..."` attributes (background: #ffffff, color: #222/#666/#555,
   border: 1px solid #ddd, ...) instead of this app's `var(--white)`/
   `var(--text-dark)` design tokens. An inline style always wins over an
   external stylesheet's normal rule, so toggling dark mode left every one
   of these modals a bright white box with dark text -- the exact bug
   reported. `!important` here is deliberate and the only way to win
   against an inline style without editing 18+ files' worth of individual
   `style="..."` attributes one at a time; it's scoped tightly (dark theme
   only, .modal-content/.modal-overlay descendants only) so it can't leak
   into anything else.

   1. The container itself: every modal shares `.modal-content` (a plain
      `.modal` wrapper for compact dialogs like the logout confirmation, or
      `.modal-overlay` for the larger report-submission forms), so fixing
      this one class re-themes all of them at once. */
:root[data-theme="dark"] .modal-content {
    background: var(--white) !important;
    color: var(--text-dark) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
}
:root[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
}

/* 2. Form fields inside any modal -- the report-submission forms
      (student/faculty/security/GHD) hardcode every <input>/<select>/
      <textarea> to a white background with a light-gray border, which is
      the single biggest source of "can't read what I'm typing" in dark
      mode short of the modal background itself. */
:root[data-theme="dark"] .modal-content input,
:root[data-theme="dark"] .modal-content select,
:root[data-theme="dark"] .modal-content textarea {
    background: var(--bg-main) !important;
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
:root[data-theme="dark"] .modal-content input::placeholder,
:root[data-theme="dark"] .modal-content textarea::placeholder {
    color: var(--text-muted) !important;
}

/* 3. The most common literal hex values used for body text/labels/
      captions across every modal's inline styles -- grouped by the
      brightness they were originally meant to read as (a light-mode
      "medium gray" like #888/#666 becomes this theme's --text-gray; a
      light-mode "near-black" like #222/#333 becomes --text-dark). Matches
      both "color: #xxx" and "color:#xxx" since both spacings appear in the
      codebase. Deliberately NOT touching every h3/p/label generically --
      several modal headings already correctly use var(--primary-green,
      ...) and would be broken (forced to plain gray) by a blanket tag
      override; matching the literal hardcoded values instead only ever
      touches the actually-hardcoded ones. */
:root[data-theme="dark"] .modal-content [style*="color: #888"],
:root[data-theme="dark"] .modal-content [style*="color:#888"],
:root[data-theme="dark"] .modal-content [style*="color: #999"],
:root[data-theme="dark"] .modal-content [style*="color:#999"],
:root[data-theme="dark"] .modal-content [style*="color: #666"],
:root[data-theme="dark"] .modal-content [style*="color:#666"],
:root[data-theme="dark"] .modal-content [style*="color: #555"],
:root[data-theme="dark"] .modal-content [style*="color:#555"],
:root[data-theme="dark"] .modal-content [style*="color: #444"],
:root[data-theme="dark"] .modal-content [style*="color:#444"] {
    color: var(--text-gray) !important;
}
:root[data-theme="dark"] .modal-content [style*="color: #222"],
:root[data-theme="dark"] .modal-content [style*="color:#222"],
:root[data-theme="dark"] .modal-content [style*="color: #333"],
:root[data-theme="dark"] .modal-content [style*="color:#333"] {
    color: var(--text-dark) !important;
}

/* 4. Literal white/near-white backgrounds inside a modal that aren't the
      form fields above -- the decorative white icon circle behind the
      logout modal's sign-out icon, and any other inline
      background:#fff/#ffffff/#f8f9fa/#fafafa/#eceff1-style "light chip"
      inside a modal. Shifted to this theme's own surface tone instead of
      staying a bright white patch inside an otherwise dark box. */
:root[data-theme="dark"] .modal-content [style*="background: #fff"],
:root[data-theme="dark"] .modal-content [style*="background:#fff"],
:root[data-theme="dark"] .modal-content [style*="background: #f8f9fa"],
:root[data-theme="dark"] .modal-content [style*="background: #fafafa"],
:root[data-theme="dark"] .modal-content [style*="background: #eceff1"],
:root[data-theme="dark"] .modal-content [style*="background: #f0fdf4"] {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* 5. Borders -- the light 1px gray borders every input/divider/card-inside-
      a-modal uses (#ddd/#eee/#f5f5f5), which otherwise stay exactly as
      bright against a dark modal background as they were meant to be
      against a white one. */
:root[data-theme="dark"] .modal-content [style*="border: 1px solid #ddd"],
:root[data-theme="dark"] .modal-content [style*="border: 1px solid #eee"],
:root[data-theme="dark"] .modal-content [style*="border: 1px solid #f5f5f5"],
:root[data-theme="dark"] .modal-content [style*="border-bottom: 1px solid #eee"],
:root[data-theme="dark"] .modal-content [style*="border-bottom: 1px solid #f5f5f5"] {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* 6. The universal close button (the "&times;" X in the corner of every
      report/detail modal) -- css/student_dashboard.css's .close-btn is
      colored for a white background and otherwise nearly disappears
      against a dark one. */
:root[data-theme="dark"] .close-btn {
    color: var(--text-gray) !important;
}
/* :hover already reads var(--accent-orange) from student_dashboard.css --
   already theme-safe, left alone. */

/* ===== SHARED REPORT CHAT BOX (case messages) =====
   Coordinator's report-detail message thread (js/coordinator_dashboard.js)
   is the reference implementation, per explicit request -- these classes
   are the same markup/shape now emitted by Admin (js/admin_reports.js) and
   Student (js/student_dashboard.js) too, instead of each rebuilding the
   same bubble with its own independent inline styles (which had quietly
   drifted apart, and all shared the same hardcoded-light-colors problem in
   dark mode). Defined here in theme.css rather than a per-shell file since
   this is the one stylesheet already loaded on every role's pages. */
.case-msg {
    margin-bottom: 12px;
    padding: 12px 15px;
    border-radius: 14px;
    max-width: 85%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    margin-right: auto;
    text-align: left;
}
.case-msg.mine {
    background: #e8f5e9;
    border-color: #c8e6c9;
    margin-left: auto;
    margin-right: 0;
}
.case-msg.internal {
    background: #fffdf5;
    border-color: #ffe082;
}
.case-msg-meta {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
}
.case-msg-body {
    font-size: 13px;
    color: #222;
    line-height: 1.4;
}
.case-msg-badge {
    background: #ff9800;
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 700;
}

:root[data-theme="dark"] .case-msg {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .case-msg.mine {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
}
:root[data-theme="dark"] .case-msg.internal {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}
:root[data-theme="dark"] .case-msg-meta {
    color: var(--text-gray);
}
:root[data-theme="dark"] .case-msg-body {
    color: var(--text-dark);
}

:root[data-theme="dark"] {
    /* Green-tinted near-black rather than a neutral blue-slate dark --
       requested to read as "dark green" overall (like a premium dark
       dashboard with a green house color), not just a gray dark mode with
       green accents. */
    --bg-main: #0c100d;
    --white: #161c17;
    --text-dark: #e9ece9;
    --text-gray: #9bab9e;
    --text-muted: #77897b;
    --card-border: 1px solid rgba(74, 222, 128, 0.1);
    --card-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    --shadow-lift: 0 10px 25px rgba(0, 0, 0, 0.55);
    --light-green-bg: rgba(74, 222, 128, 0.18);
    /* The brand green (#0a5f25) is dark by design -- fine as a solid
       button fill with white text, but reused everywhere as TEXT/icon
       color too (badges, "View" pills, active nav items), often sitting
       directly on --light-green-bg's tint. Dark-on-dark-tint reads as
       nearly invisible, so both greens shift lighter/more saturated here
       -- still unmistakably "the brand green," just legible against a
       dark surface. */
    --primary-green: #22c55e;
    --secondary-green: #16a34a;

    /* Lighter/more saturated for the same reason the greens above shift --
       the light-mode tint reads correctly against a white surface but is
       nearly invisible against this theme's near-black background. */
    --unread-bg: rgba(34, 197, 94, 0.14);
    --unread-accent: #22c55e;
}

/* ===== THEME TOGGLE BUTTON =====
   Same circular icon-button shape everywhere, sized/colored off the
   existing shared tokens so it fits every header without per-page
   styling. */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(10, 95, 37, 0.08);
    color: var(--primary-green, #0a5f25);
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
@media (hover: hover) and (pointer: fine) { .theme-toggle-btn:hover {
    background: rgba(10, 95, 37, 0.16);
    transform: rotate(15deg);
} }
:root[data-theme="dark"] .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #ffc107;
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.14);
} }

/* ===== GENERIC SURFACES =====
   Dashboards' own body/.panel/.stat-card/.data-table/.modal-content/table
   rules already read var(--bg-main)/var(--white)/var(--text-dark)/
   var(--card-border), so the :root override above reaches them without
   repeating selectors here. This block only covers plain elements that
   don't carry one of those classes -- plus .sidebar as a named exception:
   coordinator_dashboard.css's own .sidebar rule hardcodes a translucent
   rgba(255,255,255,0.75) glass background instead of var(--white) (unlike
   admin's/student's, which both already read the variable correctly), so
   it never picked up dark mode at all -- the actual "sidebar is still
   white" bug. Fixed generically here rather than only in that one file,
   since admin/student's sidebars end up with the same resolved color
   either way. */
:root[data-theme="dark"] .sidebar {
    background: rgba(22, 28, 23, 0.9) !important;
}
/* Header search pill -- background already reads var(--white) and flips
   correctly, but its border is hardcoded #eaeaea, so it stayed a bright
   light-gray ring around an otherwise dark pill. */
:root[data-theme="dark"] .search-container {
    border-color: rgba(255, 255, 255, 0.12) !important;
}
:root[data-theme="dark"] .search-container i {
    color: var(--text-gray) !important;
}
:root[data-theme="dark"] body {
    /* admin_analytics.php sets its own inline style="background-color:
       #f4f7f6" on <body> -- an inline style beats any external stylesheet
       rule regardless of specificity, so this needs !important to still
       win there (and to stay safe against any future page doing the
       same). */
    background-color: var(--bg-main) !important;
    color: var(--text-dark);
}

:root[data-theme="dark"] hr {
    border-color: rgba(255, 255, 255, 0.08);
}

/* Form controls -- many pages set border/background via inline
   style="..." (higher specificity than any class), so this needs
   !important to actually win. Only background/text/border colors are
   touched -- layout properties set inline (padding, border-radius,
   width) are left alone. */
:root[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
    /* Slightly lighter than --white (the general card/modal surface) and a
       more visible border, so a field reads as a distinct interactive
       control instead of blending into whatever card/modal it sits in --
       most noticeable in the login/register modal, where the input and
       its parent .modal-content would otherwise be the exact same shade. */
    background-color: #1e251f !important;
    color: var(--text-dark) !important;
    border-color: rgba(74, 222, 128, 0.22) !important;
    /* Tells the browser to draw its own native form-control chrome (a
       date/time input's calendar-icon button, a select's dropdown arrow)
       in dark style too -- without this the icon stays black-on-transparent
       and is nearly invisible on the dark background we just gave the
       field itself. */
    color-scheme: dark;
}
:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
    border-color: var(--primary-green) !important;
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
    color: var(--text-gray);
    opacity: 1;
}
:root[data-theme="dark"] input:disabled,
:root[data-theme="dark"] select:disabled,
:root[data-theme="dark"] textarea:disabled {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-gray) !important;
}

/* Table rows/zebra-striping/hover states that hardcode a light color
   directly on <tr>/<td> instead of through .data-table's variables. */
:root[data-theme="dark"] table {
    color: var(--text-dark);
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
} }
:root[data-theme="dark"] thead,
:root[data-theme="dark"] th {
    border-color: rgba(255, 255, 255, 0.08) !important;
}
/* The pill-shaped header itself (.data-table th's own background, and the
   div-grid equivalent .custom-table-header/.coordinator-table-header used
   by the Student/Coordinator table pattern) was missed by the border-only
   rule above -- left as a bright light-gray strip inside an otherwise dark
   card/table, on the Admin dashboard itself, not just elsewhere. */
:root[data-theme="dark"] .data-table th,
:root[data-theme="dark"] .custom-table-header {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-gray) !important;
}
:root[data-theme="dark"] td {
    border-color: rgba(255, 255, 255, 0.06) !important;
    /* Several pages (e.g. offense_classifications.php) set color directly
       on <td> in their own inline <style> block -- an explicit rule on the
       element itself always beats inherited color from the `table` rule
       above, no matter the ancestor's specificity, so td needs its own
       !important override here too. */
    color: var(--text-dark) !important;
}

/* Analytics pages (admin_analytics.php, coordinator_analytics.php) build
   their cards from their own page-local glassmorphism classes instead of
   .panel/.stat-card, so they need their own dark pass here. */
:root[data-theme="dark"] .glass-panel {
    background: rgba(22, 28, 23, 0.75) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-dark);
}
:root[data-theme="dark"] .filter-toolbar,
:root[data-theme="dark"] .reports-toolbar {
    background: rgba(22, 28, 23, 0.85) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-dark);
}
/* The coordinator-family "initials avatar" circle (sidebar footer, topbar
   profile pic, the student-info modal's avatar) hardcodes this exact
   pastel green as an inline style on every one of its ~5+ call sites --
   not reused from var(--light-green-bg), which is a paler, more
   transparent tint by design and would visibly change the look if swapped
   in for this specifically, so it gets its own targeted override instead. */
:root[data-theme="dark"] [style*="background: #cce3d2"] {
    background: rgba(74, 222, 128, 0.18) !important;
}
:root[data-theme="dark"] .stat-box .stat-info h4 {
    color: var(--text-gray) !important;
}
:root[data-theme="dark"] .stat-box .stat-info > div {
    color: var(--text-dark) !important;
}
:root[data-theme="dark"] .filter-input {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    color: var(--text-dark) !important;
}
:root[data-theme="dark"] .chart-state-overlay {
    background: rgba(22, 28, 23, 0.9) !important;
}
:root[data-theme="dark"] .chart-state-overlay p {
    color: var(--text-gray) !important;
}

/* Several pages define their own local .panel/.stat-card/table overrides
   in a page-specific inline <style> block (e.g. ai_knowledge_base.php's
   ".panel { background: #fff; }") instead of using var(--white) the way
   the shared CSS files do -- same class name, so a plain
   [data-theme="dark"] .panel rule would only tie on specificity and could
   lose depending on source order. !important makes the dark theme win
   regardless of which file's version of ".panel" runs last. */
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .stat-card {
    background-color: var(--white) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-dark);
}
:root[data-theme="dark"] .panel-title,
:root[data-theme="dark"] .stat-title {
    color: var(--text-dark) !important;
}

/* Reports/User Management pagination + filters -- another set of
   page-local <style> block classes (admin_reports.php, user_management.php,
   coordinator_reports.php all define these identically) with hardcoded
   light colors instead of the shared variables. */
:root[data-theme="dark"] .filter-select,
:root[data-theme="dark"] .filter-date,
:root[data-theme="dark"] .search-input-field,
:root[data-theme="dark"] .page-link,
:root[data-theme="dark"] .action-tab-btn {
    background: var(--white) !important;
    color: var(--text-dark) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .page-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--primary-green) !important;
    color: var(--primary-green) !important;
} }
:root[data-theme="dark"] .student-avatar-box {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-gray) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

/* Logout/cancel confirmation buttons' hover state -- duplicated near-
   identically across many pages' own <style> blocks (same #cancelLogoutBtn/
   #confirmLogoutBtn ids each time), always as a hardcoded light hover
   color. */


/* ai_knowledge_base.php's upload feedback banners -- keep their color
   identity (green/yellow/red) but at an opacity that reads as a tinted
   badge on a dark card instead of a bright, out-of-place light box. */
:root[data-theme="dark"] .alert-success {
    background: transparent !important;
    border: 0 !important;
    color: #4ade80 !important;
}
:root[data-theme="dark"] .alert-warning {
    background: transparent !important;
    border: 0 !important;
    color: #fbbf24 !important;
}
:root[data-theme="dark"] .alert-error {
    background: transparent !important;
    border: 0 !important;
    color: #f87171 !important;
}

/* .btn-cancel (used for "Cancel"/"Reset"/"Close" buttons across many
   modals app-wide) intentionally keeps a fixed light-gray background in
   both themes -- but its text color reads var(--text-dark), which we just
   flipped to a near-white value for dark mode, making the label vanish
   against a background that never changed. Force it back to a dark,
   readable color since the button's own background isn't going dark. */
:root[data-theme="dark"] .btn-cancel {
    color: #333 !important;
}

/* Common literal white-background patterns repeated across the app's
   inline styles (cards, notes, panel headers) -- a pragmatic net for
   the most frequent exact strings, not exhaustive coverage of every
   inline style in the codebase. */
:root[data-theme="dark"] [style*="background: #fff"],
:root[data-theme="dark"] [style*="background:#fff"],
:root[data-theme="dark"] [style*="background: #ffffff"],
:root[data-theme="dark"] [style*="background:#ffffff"],
:root[data-theme="dark"] [style*="background: white"],
:root[data-theme="dark"] [style*="background-color: #fff"],
/* Chrome reflects the style="..." attribute back with hex colors
   normalized to rgb(), so an attribute selector written against the hex
   form silently fails to match on some elements (observed on the
   notification dropdown menus, which all share this exact inline style).
   rgb(255, 255, 255) covers that normalized case for plain white. */
:root[data-theme="dark"] [style*="background: rgb(255, 255, 255)"],
:root[data-theme="dark"] [style*="background-color: rgb(255, 255, 255)"],
:root[data-theme="dark"] [style*="background: #f8f9fa"],
:root[data-theme="dark"] [style*="background: #f9f9f9"],
:root[data-theme="dark"] [style*="background: #fafafa"],
:root[data-theme="dark"] [style*="background: #f0f4f1"],
:root[data-theme="dark"] [style*="background: #f8faf9"],
:root[data-theme="dark"] [style*="background: #e9ecef"],
:root[data-theme="dark"] [style*="background: #eceff1"],
:root[data-theme="dark"] [style*="background: #f1f5f9"],
:root[data-theme="dark"] [style*="background: #eee"],
:root[data-theme="dark"] [style*="background: #e2e6ea"],
:root[data-theme="dark"] [style*="background: #f8fafc"],
:root[data-theme="dark"] [style*="background: #fdfbf5"],
:root[data-theme="dark"] [style*="background: #fffdf9"],
:root[data-theme="dark"] [style*="background: #fffdf4"] {
    background-color: var(--white) !important;
}

/* Notification/profile dropdown menus (the .dropdown-menu/.dropdown-item/
   .user-name family shared by every role's header bell + the profile
   dropdown) -- hardcoded text colors meant for the menu's permanently-white
   card, which is exactly what the rule above just darkened. */
:root[data-theme="dark"] .user-name {
    color: var(--text-dark) !important;
}
:root[data-theme="dark"] .user-role {
    color: var(--text-gray) !important;
}
:root[data-theme="dark"] .dropdown-divider {
    background-color: rgba(255, 255, 255, 0.08) !important;
}
:root[data-theme="dark"] .dropdown-item {
    color: var(--text-gray) !important;
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
} }
:root[data-theme="dark"] .dropdown-header {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Report detail modal's "Info/Details" grid -- .field-label already reads
   var(--text-dark) and flips automatically, but .field-value is hardcoded
   #555 (a mid-gray tuned for a white card), which reads low-contrast
   against a dark one. */
:root[data-theme="dark"] .detail-field .field-value {
    color: var(--text-dark) !important;
}

/* Admin dashboard's "Student Satisfaction" stat card -- a one-off inline
   gradient (not a plain solid color the generic [style*="background: #fff"]
   net above catches) with several of its own inline text colors. */
:root[data-theme="dark"] .stat-card[style*="linear-gradient(135deg, #fdfbfb"] {
    background: linear-gradient(135deg, #1e251f 0%, #161c17 100%) !important;
}
:root[data-theme="dark"] .stat-card[style*="linear-gradient(135deg, #fdfbfb"] [style*="color: #333"] {
    color: var(--text-dark) !important;
}
:root[data-theme="dark"] .stat-card[style*="linear-gradient(135deg, #fdfbfb"] [style*="color: #666"] {
    color: var(--text-gray) !important;
}

/* Coordinator dashboard's "Action Required" urgent-queue banner -- styled
   in a <style> block inline in coordinator_dashboard.php itself rather
   than a shared CSS file, so it needs its own named override here too. */
:root[data-theme="dark"] .urgent-queue-panel {
    background: rgba(255, 193, 7, 0.08) !important;
    border-color: rgba(255, 193, 7, 0.3) !important;
}
:root[data-theme="dark"] .urgent-queue-title {
    color: #ffc107 !important;
}
:root[data-theme="dark"] .urgent-item-row {
    background: var(--white) !important;
    border-color: rgba(255, 193, 7, 0.25) !important;
}
:root[data-theme="dark"] .urgent-ref {
    color: var(--text-dark) !important;
}
:root[data-theme="dark"] .urgent-category {
    color: var(--text-gray) !important;
}

/* Common literal muted/dark inline text colors -- the same handful of
   grays (#333/#555/#666/#888/#999) get reused as inline styles and small
   page-local classes (e.g. offense_classifications.php's .sanction-list)
   across the app for secondary text. On a dark card these read as
   near-invisible dark-on-dark, so remap them to the two dark-mode text
   tokens. Pragmatic net for the most frequent exact strings, same spirit
   as the background net above -- not exhaustive line-by-line coverage. */
:root[data-theme="dark"] [style*="color: #333"],
:root[data-theme="dark"] [style*="color:#333"],
:root[data-theme="dark"] [style*="color: #222"],
:root[data-theme="dark"] [style*="color:#222"] {
    color: var(--text-dark) !important;
}
:root[data-theme="dark"] [style*="color: #555"],
:root[data-theme="dark"] [style*="color:#555"],
:root[data-theme="dark"] [style*="color: #666"],
:root[data-theme="dark"] [style*="color:#666"],
:root[data-theme="dark"] [style*="color: #888"],
:root[data-theme="dark"] [style*="color:#888"],
:root[data-theme="dark"] [style*="color: #999"],
:root[data-theme="dark"] [style*="color:#999"] {
    color: var(--text-gray) !important;
}
:root[data-theme="dark"] .sanction-list {
    color: var(--text-gray) !important;
}
:root[data-theme="dark"] .sanction-list strong {
    color: var(--text-dark) !important;
}

/* Scrollbars -- the green thumb from earlier work stays, just needs a
   visible track on a dark page instead of the near-invisible default. */
:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: rgba(61, 220, 132, 0.35);
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(61, 220, 132, 0.55);
} }

/* ===== STATUS BADGES ===== keep their hue, lift opacity a touch so
   the tinted backgrounds stay visible against a dark card. */
:root[data-theme="dark"] [class*="status-badge"],
:root[data-theme="dark"] [class*="badge-"] {
    filter: brightness(1.15);
}

/* =========================================================
   LANDING PAGE -- fully excluded from the light/dark theme.
   =========================================================
   The public landing page (index.php) -- hero, nav, services, contacts,
   the AI chat widget, and every modal that lives on it (login/register,
   OTP, forgot-password, the generic success/error alert) -- always keeps
   its original light design, full stop, regardless of the theme toggle.
   That toggle exists for the logged-in dashboards; this page was never
   meant to follow it.

   The toggle still visually exists on this page for a first-time visitor
   to set their preference before logging in, but it must not repaint
   the page itself while doing so. Achieved by re-declaring the shared
   variables back to their light-mode values on .sas-landing-page's own
   subtree, PLUS explicit resets for the handful of rules above that
   hardcode a color rather than reading a variable (so they'd otherwise
   still fire here regardless of what the variables say). This page's own
   4 modals (#authModal, #otpModal, #forgotPasswordModal,
   #customAlertModal) are addressed by ID rather than by their shared
   `.modal-overlay` class -- they render outside .sas-landing-page's own
   DOM subtree, but `.modal-overlay`/`.modal-content` are generic names
   every dashboard's report-submission/detail modals also use, and a
   bare-class rule here was quietly forcing THOSE to stay white in dark
   mode too. Naming this page's specific modal IDs keeps the "landing page
   never follows dark mode" promise scoped to the landing page. */
:root[data-theme="dark"] .sas-landing-page,
:root[data-theme="dark"] #authModal,
:root[data-theme="dark"] #otpModal,
:root[data-theme="dark"] #forgotPasswordModal,
:root[data-theme="dark"] #customAlertModal {
    --bg-main: #f4f7f6;
    --white: #ffffff;
    --text-dark: #333333;
    --text-gray: #555555;
    --text-muted: #6b7280;
    --card-border: 1px solid rgba(0, 0, 0, 0.05);
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-lift: 0 8px 20px rgba(0, 0, 0, 0.08);
    --light-green-bg: rgba(10, 95, 37, 0.1);
    --primary-green: #0a5f25;
    --secondary-green: #147934;
}
:root[data-theme="dark"] body.landing-body {
    background-color: #ffffff !important;
    color: #333333 !important;
}
:root[data-theme="dark"] #authModal input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] #authModal select,
:root[data-theme="dark"] #authModal textarea,
:root[data-theme="dark"] #otpModal input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] #otpModal select,
:root[data-theme="dark"] #otpModal textarea,
:root[data-theme="dark"] #forgotPasswordModal input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] #forgotPasswordModal select,
:root[data-theme="dark"] #forgotPasswordModal textarea,
:root[data-theme="dark"] #customAlertModal input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] #customAlertModal select,
:root[data-theme="dark"] #customAlertModal textarea {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #ddd !important;
    color-scheme: light;
}
:root[data-theme="dark"] .sas-landing-page input::placeholder,
:root[data-theme="dark"] .sas-landing-page textarea::placeholder,
:root[data-theme="dark"] #authModal input::placeholder,
:root[data-theme="dark"] #otpModal input::placeholder,
:root[data-theme="dark"] #forgotPasswordModal input::placeholder,
:root[data-theme="dark"] #customAlertModal input::placeholder {
    color: #999999 !important;
}
:root[data-theme="dark"] #authModal .modal-content,
:root[data-theme="dark"] #otpModal .modal-content,
:root[data-theme="dark"] #forgotPasswordModal .modal-content,
:root[data-theme="dark"] #customAlertModal .modal-content {
    background-color: #ffffff !important;
    color: #333333 !important;
}
:root[data-theme="dark"] .sas-landing-page .chat-container,
:root[data-theme="dark"] .sas-landing-page .action-block {
    background: #ffffff !important;
}
:root[data-theme="dark"] .sas-landing-page .pill-btn {
    background: #ffffff !important;
    border-color: #ddd !important;
    color: #333333 !important;
}
:root[data-theme="dark"] .sas-landing-page .pill-btn:focus-visible {
    background: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    color: #ffffff !important;
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .sas-landing-page .pill-btn:hover {
    background: var(--primary-green) !important;
    border-color: var(--primary-green) !important;
    color: #ffffff !important;
} }
:root[data-theme="dark"] .sas-landing-page .contact-card {
    background: rgba(244, 246, 245, 0.95) !important;
    color: #333333 !important;
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .sas-landing-page .contact-card:hover, :root[data-theme="dark"] .sas-landing-page .contact-card.settled:hover {
    background: #ffffff !important;
} }
:root[data-theme="dark"] .sas-landing-page .services::before {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.4)) !important;
}

/* ===== AI ASSISTANT CHAT BOX -- DARK MODE READABILITY =====
   The input pill's border and the input bar's top border are hardcoded
   black-tinted (rgba(0,0,0,...) / #eee) in css/Ai_assistant.css, so they're
   essentially invisible on a dark surface. The textarea itself is
   deliberately transparent there (meant to blend into the pill around it),
   which the generic dark input rule above would otherwise override with a
   solid fill -- undone here so it goes back to blending in, with its own
   explicit text/placeholder colors instead of an inherited one. */
:root[data-theme="dark"] .ai-input-bar {
    border-top-color: rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .ai-input-form {
    border-color: rgba(255, 255, 255, 0.12) !important;
}
:root[data-theme="dark"] .ai-input-form textarea {
    background-color: transparent !important;
    color: var(--text-dark) !important;
}
:root[data-theme="dark"] .ai-input-form textarea::placeholder {
    color: var(--text-gray) !important;
    opacity: 1;
}
:root[data-theme="dark"] .ai-chip {
    border-color: rgba(255, 255, 255, 0.1);
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .ai-history-item-row:hover {
    background: rgba(255, 255, 255, 0.05);
} }

@media (max-width: 480px) {
    .theme-toggle-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
}

/* ===== CHART "GROWTH" ENTRANCE ANIMATION =====
   Paired with window.animateChartEntrance() in js/theme_toggle.js. A plain
   CSS transition on the chart <canvas> itself -- runs on the compositor,
   independent of Chart.js's own requestAnimationFrame-driven bar/donut
   animation, so the chart visibly grows in even in a browser context where
   rAF callbacks are being throttled/starved. */
.chart-grow-in {
    opacity: 0;
    transition: opacity 0.4s ease-out;
}
.chart-grow-in.chart-grow-in-visible {
    opacity: 1;
}

/* One corner radius for every modal card -- they had drifted to 16/20/24px. */
.modal-content { border-radius: var(--modal-radius, 20px); }

/* ===== 7. DARK MODE COMPLETION PASS =====
   The nets above only matched a handful of exact inline-style strings, mostly inside
   .modal-content, so many inline-styled panels (chat box, record cards, chips, notice
   boxes) stayed light or kept dark text on a dark card. This pass covers the remaining
   spellings (with/without the space after the colon), the light tint chips, the common
   inline text colors page-wide, and the light 1px borders. Light mode is untouched. */
:root[data-theme="dark"] [style*="background: #fff;"],
:root[data-theme="dark"] [style*="background:#fff;"],
:root[data-theme="dark"] [style*="background: #fff "],
:root[data-theme="dark"] [style*="background: #ffffff;"],
:root[data-theme="dark"] [style*="background:#ffffff;"],
:root[data-theme="dark"] [style*="background: #ffffff "],
:root[data-theme="dark"] [style*="background: #f8f9fa;"],
:root[data-theme="dark"] [style*="background:#f8f9fa;"],
:root[data-theme="dark"] [style*="background: #f8f9fa "],
:root[data-theme="dark"] [style*="background: #f9f9f9;"],
:root[data-theme="dark"] [style*="background:#f9f9f9;"],
:root[data-theme="dark"] [style*="background: #f9f9f9 "],
:root[data-theme="dark"] [style*="background: #fafafa;"],
:root[data-theme="dark"] [style*="background:#fafafa;"],
:root[data-theme="dark"] [style*="background: #fafafa "],
:root[data-theme="dark"] [style*="background: #fdfdfd;"],
:root[data-theme="dark"] [style*="background:#fdfdfd;"],
:root[data-theme="dark"] [style*="background: #fdfdfd "],
:root[data-theme="dark"] [style*="background: #f0f4f1;"],
:root[data-theme="dark"] [style*="background:#f0f4f1;"],
:root[data-theme="dark"] [style*="background: #f0f4f1 "],
:root[data-theme="dark"] [style*="background: #f4f8f5;"],
:root[data-theme="dark"] [style*="background:#f4f8f5;"],
:root[data-theme="dark"] [style*="background: #f4f8f5 "],
:root[data-theme="dark"] [style*="background: #f8faf9;"],
:root[data-theme="dark"] [style*="background:#f8faf9;"],
:root[data-theme="dark"] [style*="background: #f8faf9 "],
:root[data-theme="dark"] [style*="background: #f0f0f0;"],
:root[data-theme="dark"] [style*="background:#f0f0f0;"],
:root[data-theme="dark"] [style*="background: #f0f0f0 "],
:root[data-theme="dark"] [style*="background: #eef3ef;"],
:root[data-theme="dark"] [style*="background:#eef3ef;"],
:root[data-theme="dark"] [style*="background: #eef3ef "],
:root[data-theme="dark"] [style*="background: #e9ecef;"],
:root[data-theme="dark"] [style*="background:#e9ecef;"],
:root[data-theme="dark"] [style*="background: #e9ecef "],
:root[data-theme="dark"] [style*="background: #eceff1;"],
:root[data-theme="dark"] [style*="background:#eceff1;"],
:root[data-theme="dark"] [style*="background: #eceff1 "],
:root[data-theme="dark"] [style*="background: #f1f5f9;"],
:root[data-theme="dark"] [style*="background:#f1f5f9;"],
:root[data-theme="dark"] [style*="background: #f1f5f9 "],
:root[data-theme="dark"] [style*="background: #f8fafc;"],
:root[data-theme="dark"] [style*="background:#f8fafc;"],
:root[data-theme="dark"] [style*="background: #f8fafc "],
:root[data-theme="dark"] [style*="background: #e2e6ea;"],
:root[data-theme="dark"] [style*="background:#e2e6ea;"],
:root[data-theme="dark"] [style*="background: #e2e6ea "],
:root[data-theme="dark"] [style*="background: #e0e0e0;"],
:root[data-theme="dark"] [style*="background:#e0e0e0;"],
:root[data-theme="dark"] [style*="background: #e0e0e0 "],
:root[data-theme="dark"] [style*="background: #fdfbf5;"],
:root[data-theme="dark"] [style*="background:#fdfbf5;"],
:root[data-theme="dark"] [style*="background: #fdfbf5 "],
:root[data-theme="dark"] [style*="background: #fffdf9;"],
:root[data-theme="dark"] [style*="background:#fffdf9;"],
:root[data-theme="dark"] [style*="background: #fffdf9 "],
:root[data-theme="dark"] [style*="background: #f5f5f5;"],
:root[data-theme="dark"] [style*="background:#f5f5f5;"],
:root[data-theme="dark"] [style*="background: #f5f5f5 "],
:root[data-theme="dark"] [style*="background-color: #fff;"],
:root[data-theme="dark"] [style*="background-color:#fff;"],
:root[data-theme="dark"] [style*="background-color: #fff "],
:root[data-theme="dark"] [style*="background-color: #ffffff;"],
:root[data-theme="dark"] [style*="background-color:#ffffff;"],
:root[data-theme="dark"] [style*="background-color: #ffffff "],
:root[data-theme="dark"] [style*="rgba(245, 245, 245, 0.5)"],
:root[data-theme="dark"] [style*="rgba(245,245,245,0.5)"],
:root[data-theme="dark"] [style$="background: #fff"],
:root[data-theme="dark"] [style$="background:#fff"],
:root[data-theme="dark"] [style$="background: #ffffff"],
:root[data-theme="dark"] [style$="background:#ffffff"],
:root[data-theme="dark"] [style$="background: #f8f9fa"],
:root[data-theme="dark"] [style$="background:#f8f9fa"],
:root[data-theme="dark"] [style$="background: #f0f4f1"],
:root[data-theme="dark"] [style$="background:#f0f4f1"],
:root[data-theme="dark"] [style*="background: rgb(255, 255, 255)"],
:root[data-theme="dark"] [style*="background-color: rgb(255, 255, 255)"],
:root[data-theme="dark"] [style*="background: rgb(248, 249, 250)"],
:root[data-theme="dark"] [style*="background-color: rgb(248, 249, 250)"],
:root[data-theme="dark"] [style*="background: rgb(249, 249, 249)"],
:root[data-theme="dark"] [style*="background-color: rgb(249, 249, 249)"],
:root[data-theme="dark"] [style*="background: rgb(250, 250, 250)"],
:root[data-theme="dark"] [style*="background-color: rgb(250, 250, 250)"],
:root[data-theme="dark"] [style*="background: rgb(240, 244, 241)"],
:root[data-theme="dark"] [style*="background-color: rgb(240, 244, 241)"],
:root[data-theme="dark"] [style*="background: rgb(244, 248, 245)"],
:root[data-theme="dark"] [style*="background-color: rgb(244, 248, 245)"],
:root[data-theme="dark"] [style*="background: rgb(240, 247, 242)"],
:root[data-theme="dark"] [style*="background-color: rgb(240, 247, 242)"] {
    background-color: #1e251f !important;
}
:root[data-theme="dark"] [style*="background: #e8f5e9;"],
:root[data-theme="dark"] [style*="background:#e8f5e9;"],
:root[data-theme="dark"] [style*="background: #e8f5e9 "],
:root[data-theme="dark"] [style*="background: #f0fdf4;"],
:root[data-theme="dark"] [style*="background:#f0fdf4;"],
:root[data-theme="dark"] [style*="background: #f0fdf4 "] {
    background-color: rgba(34, 197, 94, 0.14) !important;
}
:root[data-theme="dark"] [style*="background: #ffebee;"],
:root[data-theme="dark"] [style*="background:#ffebee;"],
:root[data-theme="dark"] [style*="background: #ffebee "],
:root[data-theme="dark"] [style*="background: #fdecee;"],
:root[data-theme="dark"] [style*="background:#fdecee;"],
:root[data-theme="dark"] [style*="background: #fdecee "],
:root[data-theme="dark"] [style*="background: #fff5f5;"],
:root[data-theme="dark"] [style*="background:#fff5f5;"],
:root[data-theme="dark"] [style*="background: #fff5f5 "] {
    background-color: rgba(239, 68, 68, 0.14) !important;
}
:root[data-theme="dark"] [style*="background: #fff8e6;"],
:root[data-theme="dark"] [style*="background:#fff8e6;"],
:root[data-theme="dark"] [style*="background: #fff8e6 "],
:root[data-theme="dark"] [style*="background: #fff4d6;"],
:root[data-theme="dark"] [style*="background:#fff4d6;"],
:root[data-theme="dark"] [style*="background: #fff4d6 "],
:root[data-theme="dark"] [style*="background: #fffbe6;"],
:root[data-theme="dark"] [style*="background:#fffbe6;"],
:root[data-theme="dark"] [style*="background: #fffbe6 "] {
    background-color: rgba(245, 158, 11, 0.14) !important;
}
:root[data-theme="dark"] [style*="background: #faf5fb;"],
:root[data-theme="dark"] [style*="background:#faf5fb;"],
:root[data-theme="dark"] [style*="background: #faf5fb "] {
    background-color: rgba(168, 85, 247, 0.14) !important;
}

:root[data-theme="dark"] .chat-section {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
:root[data-theme="dark"] .case-msg-body { font-size: 13.5px; line-height: 1.5; }
:root[data-theme="dark"] [style*="color: #111827;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#111827;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #111;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#111;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #222;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#222;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #333;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#333;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #444;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#444;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #4b5563;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#4b5563;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]) {
    color: var(--text-dark) !important;
}
:root[data-theme="dark"] [style*="color: #555;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#555;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #666;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#666;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #777;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#777;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #888;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#888;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #999;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#999;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color: #9ca3af;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]),
:root[data-theme="dark"] [style*="color:#9ca3af;"]:not([style*="background: #ffc107"]):not([style*="background:#ffc107"]) {
    color: var(--text-gray) !important;
}
:root[data-theme="dark"] [style*="color: #1b5e20"],
:root[data-theme="dark"] [style*="color:#1b5e20"],
:root[data-theme="dark"] [style*="color: #0a5f25"] {
    color: var(--primary-green) !important;
}
:root[data-theme="dark"] [style*="solid #eee"],
:root[data-theme="dark"] [style*="solid #e5e7eb"],
:root[data-theme="dark"] [style*="solid #ddd"],
:root[data-theme="dark"] [style*="solid #f0f0f0"],
:root[data-theme="dark"] [style*="solid #e0e0e0"],
:root[data-theme="dark"] [style*="solid #f5f5f5"] {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Admin dashboard "Student Satisfaction" card: the gradient was changed to #fdfbf5 -> #f3ecd8
   so the original #fdfbfb override no longer matched and the card stayed cream. */
:root[data-theme="dark"] .stat-card[style*="linear-gradient(135deg, #fdfbf5"] {
    background: linear-gradient(135deg, #1e251f 0%, #161c17 100%) !important;
}

/* Faculty, Security and Gender Help Desk greet with <h2>Welcome, <span class="greeting-name">:
   the h2 fell back to the browser default (24px bold black) while Student/Coordinator/Admin
   use a 30px greeting (light gray lead-in + 800-weight green name). Same look everywhere now. */
.welcome-header h2:has(> .greeting-name) {
    font-family: 'Montserrat', sans-serif;
    font-size: 30px;
    font-weight: 500;
    color: var(--text-gray);
}
@media (max-width: 600px) {
    .welcome-header h2:has(> .greeting-name) { font-size: clamp(22px, 6vw, 30px); }
}

/* ===== SHARED PAGINATION =====
   Most pages declare their own .pagination-container/.page-link inline, but a few
   (Offense Classifications, AI Knowledge Base, ...) never did, so their pager rendered as
   bare "12345Next" text. :where() keeps this at zero specificity, so every page-level rule
   still wins and only the unstyled pages pick this up. */
:where(.pagination-container) { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 25px; padding-bottom: 10px; flex-wrap: wrap; }
:where(.page-link) { padding: 8px 14px; border: 1px solid #ddd; border-radius: 6px; text-decoration: none; color: #333; font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 500; background: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
@media (hover: hover) and (pointer: fine) { :where(.page-link:hover) { background: #fdfbf5; border-color: #d4af37; color: var(--primary-green, #1b5e20); } }
:where(.page-link.active) { background: var(--primary-green, #1b5e20); color: #fff; border-color: var(--primary-green, #1b5e20); cursor: default; }

/* Action buttons stay on one line ("Export to Excel" / "Create Case" were wrapping to two lines when
   the toolbar next to them got crowded). Zero specificity: any page rule still wins. */
:where(.btn-action, .btn-export) { white-space: nowrap; }

/* Notification bell items (admin, coordinator, GHD): left-aligned text, not centered. */
.dropdown-menu .dropdown-item[style*="flex-direction: column"],
.dropdown-menu a.dropdown-item[style*="flex-direction:column"] {
    text-align: left;
    align-items: flex-start;
}

/* ===== Stat-card filter bar and clickable stat cards (SAS Office, coordinator, Gender Help Desk dashboards) ===== */
.stats-filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; font-family: 'Montserrat', sans-serif; }
.stats-filter-bar label { font-size: 12px; font-weight: 700; color: var(--text-gray, #666); }
.stats-filter-bar select { padding: 7px 28px 7px 12px; border-radius: 20px; border: 1px solid rgba(127, 127, 127, 0.35); background: var(--white, #fff); color: var(--text-dark, #222); font: 600 12.5px 'Montserrat', sans-serif; }
.stats-filter-bar .stats-reset { border: none; background: none; color: #d32f2f; font: 700 12px 'Montserrat', sans-serif; cursor: pointer; padding: 4px 6px; }
.stats-filter-bar .stats-note { font-size: 11.5px; color: var(--text-gray, #888); }
.stats-filter-bar.loading { opacity: 0.6; }
.stat-card[data-href], .stat-card[data-click-status] { cursor: pointer; transition: transform 0.25s, box-shadow 0.25s; }
@media (hover: hover) and (pointer: fine) { .stat-card[data-href]:hover, .stat-card[data-click-status]:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(10, 95, 37, 0.15); } }
.stat-card[data-href]:focus-visible, .stat-card[data-click-status]:focus-visible { outline: 2px solid var(--primary-green, #0a5f25); outline-offset: 2px; }

/* "Showing: 2026-2027" label beside the Academic Year filter of the case lists */
.showing-year { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 18px; background: rgba(10, 95, 37, 0.1); color: var(--primary-green, #0a5f25); font: 600 12px 'Montserrat', sans-serif; white-space: nowrap; }
.showing-year b { font-weight: 800; }
.showing-year.archive { background: #fff4d6; color: #8a6200; }
:root[data-theme="dark"] .showing-year { background: rgba(120, 220, 150, 0.14); color: #8fe0a2; }
:root[data-theme="dark"] .showing-year.archive { background: rgba(243, 156, 18, 0.18); color: #f7c26b; }

/* Reminder for cases waiting more than 7 days (js/stats_filter.js) */
.overdue-reminder { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 11px 16px; border-radius: 12px; background: #fff4e0; color: #8a5300; border: 1px solid #f3d29a; font-size: 13px; text-decoration: none; }
.overdue-reminder i { font-size: 15px; }
@media (hover: hover) and (pointer: fine) { .overdue-reminder:hover { background: #ffecc7; } }
html[data-theme="dark"] .overdue-reminder, body.dark-mode .overdue-reminder { background: rgba(243, 156, 18, 0.14); color: #f5c26b; border-color: rgba(243, 156, 18, 0.35); }

/* Payment option cards of a document request (student form) */
.pay-opt { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #ddd; border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; cursor: pointer; font-size: 13.5px; background: #fff; }
.pay-opt input { margin-top: 4px; accent-color: var(--primary-green, #0a5f25); }
.pay-opt small { color: #777; }
.pay-opt:has(input:checked) { border-color: var(--primary-green, #0a5f25); background: var(--light-green-bg, #f0f4f1); }
:root[data-theme="dark"] .pay-opt { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.14); }
:root[data-theme="dark"] .pay-opt small { color: #a9b3ad; }

/* Loading state of a button that is working (js/button_loading.js): a small spinner after the label */
.is-loading { cursor: progress !important; opacity: .85; pointer-events: none; }
.is-loading::after { content: ''; display: inline-block; width: 1em; height: 1em; margin-left: .55em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.15em; animation: btn-spin .7s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-loading::after { animation-duration: 1.6s; } }

/* Progress bar under an upload button (js/button_loading.js: attachUploadProgress) */
.upload-progress { margin-top: 8px; width: 100%; max-width: 320px; }
.upload-progress-track { height: 8px; background: rgba(127, 127, 127, 0.22); border-radius: 8px; overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0; background: var(--primary-green, #0a5f25); border-radius: 8px; transition: width .15s linear; }
.upload-progress-label { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-gray, #666); }


/* ===== 8. DARK MODE CONTRAST PASS =====
   Found with an automatic contrast check of every role's pages in dark mode (WCAG AA: 4.5:1 for text). Light mode is untouched.
   - sidebar labels and help text were dark gray on a dark surface;
   - the notification/profile dropdown stayed white while its text turned light;
   - status pills, badges and trend numbers kept the light-mode text colors;
   - buttons on the bright dark-mode green or yellow kept white/light text. */
:root[data-theme="dark"] .dropdown-menu {
    background-color: var(--white) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55) !important;
}

/* sidebar */
:root[data-theme="dark"] .sidebar-nav li:not(.active) > a,
:root[data-theme="dark"] .sidebar-nav li:not(.active) > a .nav-text {
    color: #b9c4bc;
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .sidebar-nav li:not(.active) > a:hover, :root[data-theme="dark"] .sidebar-nav li:not(.active) > a:hover .nav-text {
    color: #ffffff;
} }
:root[data-theme="dark"] .sidebar-nav .logout-trigger,
:root[data-theme="dark"] .sidebar-nav .logout-trigger .nav-text {
    color: #ff8d98 !important;
}

/* red, amber, cyan and gray text written inline for a white background */
:root[data-theme="dark"] [style*="color: #dc3545"],
:root[data-theme="dark"] [style*="color:#dc3545"],
:root[data-theme="dark"] [style*="color: #c62828"],
:root[data-theme="dark"] [style*="color:#c62828"],
:root[data-theme="dark"] [style*="color: #a02330"],
:root[data-theme="dark"] [style*="color:#a02330"] {
    color: #ff8d98 !important;
}
:root[data-theme="dark"] [style*="color: #d68910"],
:root[data-theme="dark"] [style*="color:#d68910"],
:root[data-theme="dark"] [style*="color: #a37c00"],
:root[data-theme="dark"] [style*="color:#a37c00"] {
    color: #f5c451 !important;
}
:root[data-theme="dark"] [style*="color: #17a2b8"],
:root[data-theme="dark"] [style*="color:#17a2b8"] {
    color: #5ad1e6 !important;
}
:root[data-theme="dark"] [style*="color: #777"],
:root[data-theme="dark"] [style*="color:#777"],
:root[data-theme="dark"] [style*="color: #64748b"],
:root[data-theme="dark"] [style*="color:#64748b"],
:root[data-theme="dark"] .empty-text,
:root[data-theme="dark"] .profile-upload-hint,
:root[data-theme="dark"] .sig-sub p,
:root[data-theme="dark"] .sig-head p,
:root[data-theme="dark"] .sig-file-name {
    color: #a3ada6 !important;
}
:root[data-theme="dark"] span[style*="background:#eef2f5"],
:root[data-theme="dark"] span[style*="background: #eef2f5"] {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #c9d3cc !important;
}

/* avatars: initials on the light green circle */
:root[data-theme="dark"] .profile-pic,
:root[data-theme="dark"] .profile-avatar {
    background: rgba(74, 222, 128, 0.18) !important;
    color: #6ee7a0 !important;
}

/* status pills and badges */
:root[data-theme="dark"] .status-pending,
:root[data-theme="dark"] .badge-pending { color: #f5c451; }
:root[data-theme="dark"] .status-under-review { color: #8fb4ff; }
:root[data-theme="dark"] .status-escalated-to-sas { color: #ffbf5e; }
:root[data-theme="dark"] .status-resolved,
:root[data-theme="dark"] .badge-approved { color: #6ee7a0; }
:root[data-theme="dark"] .status-dismissed,
:root[data-theme="dark"] .badge-rejected { color: #ff8d98; }
:root[data-theme="dark"] .status-withdrawn { background: rgba(255, 255, 255, 0.1); color: #c5ccc7; }
:root[data-theme="dark"] .status-unknown { background: rgba(255, 255, 255, 0.06); color: #a3ada6; border-color: rgba(255, 255, 255, 0.25); }

/* trend arrows and change figures */
:root[data-theme="dark"] .stat-trend-up,
:root[data-theme="dark"] .stat-change.up { color: #6ee7a0 !important; }
:root[data-theme="dark"] .stat-trend-down,
:root[data-theme="dark"] .stat-change.down { color: #ff8d98 !important; }
:root[data-theme="dark"] .stat-change.neutral { color: #a3ada6 !important; }

/* buttons: dark text on the bright dark-mode green / yellow / orange */
:root[data-theme="dark"] .btn-green-custom,
:root[data-theme="dark"] .btn-export,
:root[data-theme="dark"] .ai-new-chat-btn,
:root[data-theme="dark"] .sig-btn-primary,
:root[data-theme="dark"] #changePasswordSubmitBtn,
:root[data-theme="dark"] .btn-action.btn-approve,
:root[data-theme="dark"] a.btn-action.btn-approve,
:root[data-theme="dark"] button[style*="background: var(--primary-green)"],
:root[data-theme="dark"] button[style*="background:var(--primary-green)"],
:root[data-theme="dark"] a[style*="background: var(--primary-green)"] {
    color: #04200c !important;
}
:root[data-theme="dark"] .btn-yellow,
:root[data-theme="dark"] .btn.btn-yellow,
:root[data-theme="dark"] label[for="profilePictureInput"] {
    color: #2b1d00 !important;
}
:root[data-theme="dark"] .btn-action.btn-reject { color: #ffffff !important; }
:root[data-theme="dark"] .btn-view-report { color: #6ee7a0; }

/* chips, banners and boxes with light-mode colors */
:root[data-theme="dark"] .offense-no-badge {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #7ee2a0 !important;
}
:root[data-theme="dark"] .warning-box { color: #ff9aa4 !important; }
:root[data-theme="dark"] .warning-box strong { color: #ff8d98 !important; }
:root[data-theme="dark"] .confidentiality-banner {
    background: rgba(220, 53, 69, 0.12) !important;
    border-color: rgba(220, 53, 69, 0.35) !important;
    color: #ffb3ba !important;
}

/* dark gray / near-black text written inline for a white card */
:root[data-theme="dark"] [style*="color: #555"],
:root[data-theme="dark"] [style*="color:#555"],
:root[data-theme="dark"] [style*="color: #666"],
:root[data-theme="dark"] [style*="color:#666"] {
    color: #b9c4bc !important;
}
:root[data-theme="dark"] [style*="color: #333"],
:root[data-theme="dark"] [style*="color:#333"],
:root[data-theme="dark"] [style*="color: #444"],
:root[data-theme="dark"] [style*="color:#444"],
:root[data-theme="dark"] [style*="color: #222"],
:root[data-theme="dark"] [style*="color:#222"] {
    color: var(--text-dark) !important;
}

/* "Export to Excel" on the coordinator pages is a .btn-approve link, but those pages do not load admin_dashboard.css, so it had no button look (dark text on a dark page in dark mode) */
a.btn-action.btn-approve { background: var(--primary-green); color: #fff; border: none; border-radius: 30px; font-family: 'Montserrat', sans-serif; font-weight: 600; cursor: pointer; }
:root[data-theme="dark"] .form-group label { color: #b9c4bc !important; }

/* ===== DARK MODE: DEEP GREEN GLASS LOOK =====
   Colors, borders and radius only (no layout changes), dark mode only.
   - page: deep green with a soft glow instead of flat black;
   - cards: near-black green, bigger radius, hairline border, no hard shadow;
   - one mint accent for the active nav item, primary buttons and highlights. */
:root[data-theme="dark"] {
    --bg-main: #08100b;
    --white: #101a13;
    --card-border: 1px solid rgba(110, 231, 160, 0.09);
    --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --primary-green: #3ee79a;
    --secondary-green: #22c97f;
    --light-green-bg: rgba(62, 231, 154, 0.14);
    --unread-bg: rgba(62, 231, 154, 0.12);
    --unread-accent: #3ee79a;
}
:root[data-theme="dark"] body {
    background-image:
        radial-gradient(900px 520px at 85% -8%, rgba(34, 201, 127, 0.16), transparent 60%),
        radial-gradient(700px 480px at -5% 105%, rgba(10, 95, 37, 0.28), transparent 60%) !important;
    background-attachment: fixed !important;
}
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .stat-card {
    background-color: rgba(16, 26, 19, 0.92) !important;
    border: 1px solid rgba(110, 231, 160, 0.09) !important;
    border-radius: 20px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35) !important;
}
:root[data-theme="dark"] .sidebar {
    background: rgba(12, 20, 15, 0.94) !important;
    border-right: 1px solid rgba(110, 231, 160, 0.08);
    box-shadow: none !important;
}
:root[data-theme="dark"] .sidebar-nav li.active a {
    background: var(--primary-green) !important;
    color: #04200c !important;
    box-shadow: 0 6px 18px rgba(62, 231, 154, 0.25) !important;
}
:root[data-theme="dark"] .sidebar-nav li.active a i,
:root[data-theme="dark"] .sidebar-nav li.active a .nav-text { color: #04200c !important; }
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .sidebar-nav li:not(.active) a:hover { background-color: rgba(62, 231, 154, 0.08); } }
:root[data-theme="dark"] .search-container,
:root[data-theme="dark"] .search-bar {
    background-color: rgba(16, 26, 19, 0.85) !important;
    border-color: rgba(110, 231, 160, 0.14) !important;
    border-radius: 30px !important;
}
:root[data-theme="dark"] .stat-card .stat-value,
:root[data-theme="dark"] .stat-card .stat-number,
:root[data-theme="dark"] .stat-card h2 { font-weight: 800; letter-spacing: -0.5px; }
:root[data-theme="dark"] .stat-card .stat-title { color: var(--text-gray) !important; font-weight: 500; }
:root[data-theme="dark"] .btn-green-custom,
:root[data-theme="dark"] .btn-export,
:root[data-theme="dark"] .sig-btn-primary,
:root[data-theme="dark"] a.btn-action.btn-approve { background: var(--primary-green) !important; }
:root[data-theme="dark"] .dropdown-menu { background-color: #101a13 !important; border-color: rgba(110, 231, 160, 0.12) !important; border-radius: 16px !important; }
:root[data-theme="dark"] .modal-content,
:root[data-theme="dark"] .modal-box { border: 1px solid rgba(110, 231, 160, 0.1); border-radius: 20px; }
:root[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus { border-color: var(--primary-green) !important; box-shadow: 0 0 0 3px rgba(62, 231, 154, 0.15) !important; outline: none; }
:root[data-theme="dark"] .status-pending,
:root[data-theme="dark"] .status-under-review,
:root[data-theme="dark"] .status-escalated-to-sas,
:root[data-theme="dark"] .status-resolved,
:root[data-theme="dark"] .status-dismissed { border: 1px solid transparent; border-radius: 20px; backdrop-filter: blur(4px); }

/* ===== DARK MODE: fixes after the glass pass ===== */
/* "Reported Cases of the Month" card kept its light-mode gradient (background-image beats the dark background-color), so the light title and legend were invisible */
:root[data-theme="dark"] .chart-panel-donut,
:root[data-theme="dark"] .glass-panel.chart-panel-donut {
    background: linear-gradient(160deg, rgba(34, 201, 127, 0.20) 0%, rgba(16, 26, 19, 0.96) 55%, #0c140f 100%) !important;
}
:root[data-theme="dark"] .chart-panel-donut .panel-title,
:root[data-theme="dark"] .chart-panel-donut h3 { color: #e9ece9 !important; }

/* student profile modal: offense cards were light pink with light text; initials were dim */
:root[data-theme="dark"] .offense-record-item,
:root[data-theme="dark"] #addOffensePanel {
    background: rgba(255, 90, 105, 0.08) !important;
    border-color: rgba(255, 141, 152, 0.25) !important;
}
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .offense-record-item:hover { background: rgba(255, 90, 105, 0.16) !important; } }
:root[data-theme="dark"] .offense-record-item > div:first-child { color: #f1f4f1 !important; }
:root[data-theme="dark"] .offense-record-item > div:nth-child(2) { color: #a9b6ac !important; }
:root[data-theme="dark"] .student-avatar-box {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
}
:root[data-theme="dark"] #addOffensePanel select,
:root[data-theme="dark"] #addOffensePanel textarea { background: rgba(255, 255, 255, 0.06) !important; color: var(--text-dark) !important; border-color: rgba(255, 255, 255, 0.18) !important; }

/* confirm dialogs (app-confirm): deep green gradient */
:root[data-theme="dark"] .app-confirm-box {
    background: linear-gradient(160deg, #123d27 0%, #0e2418 45%, #0a140e 100%) !important;
    border: 1px solid rgba(110, 231, 160, 0.22) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(34, 201, 127, 0.10) !important;
}
:root[data-theme="dark"] .app-confirm-title { color: #f1f7f2 !important; }
:root[data-theme="dark"] .app-confirm-msg { color: #b4c4b8 !important; }
:root[data-theme="dark"] .app-confirm-cancel {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #d6e2d9 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

/* the yellow-to-mint "Submit a Case" button and the profile form labels: white text on the lighter dark-mode accent */:root[data-theme="dark"] .btn-gradient, :root[data-theme="dark"] .btn-gradient i { color: #1f2a00 !important; }
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .btn-gradient:hover { color: #1f2a00 !important; } }
:root[data-theme="dark"] .input-group > label { color: #b9c4bc !important; }
:root[data-theme="dark"] .btn-confirm:not(.btn-danger) { color: #04200c !important; }
:root[data-theme="dark"] .btn-cancel { background: rgba(255, 255, 255, 0.08) !important; color: #d6e2d9 !important; border: 1px solid rgba(255, 255, 255, 0.16) !important; }
:root[data-theme="dark"] #modalStudentId { color: rgba(255, 255, 255, 0.95) !important; }

/* case detail modal: notes, warning box, chat Send / Add Note buttons and inline colors written for a white background */
:root[data-theme="dark"] .timeline-note { color: #dfe7e1 !important; }
:root[data-theme="dark"] .field-label { color: #a9b6ac !important; }
:root[data-theme="dark"] [style*="color:#8a1f1f"],
:root[data-theme="dark"] [style*="color: #8a1f1f"] { color: #ffb3ba !important; }
:root[data-theme="dark"] [style*="color:#8a6d00"],
:root[data-theme="dark"] [style*="color: #8a6d00"] { color: #f5c451 !important; }
:root[data-theme="dark"] [style*="color:#888"],
:root[data-theme="dark"] [style*="color: #888"],
:root[data-theme="dark"] [style*="color:#999"],
:root[data-theme="dark"] [style*="color: #999"] { color: #a3ada6 !important; }
:root[data-theme="dark"] .btn-green,
:root[data-theme="dark"] #sendChatBtn,
:root[data-theme="dark"] button[style*="background: var(--primary-green"],
:root[data-theme="dark"] button[style*="background:var(--primary-green"] { color: #04200c !important; }
:root[data-theme="dark"] [style*="color: #444"],
:root[data-theme="dark"] [style*="color:#444"] { color: #c9d3cc !important; }
:root[data-theme="dark"] label[style*="rgb(68, 68, 68)"] { color: #c9d3cc !important; }
:root[data-theme="dark"] label[style*="rgb(68, 68, 68)"] > span > span { color: #a3ada6 !important; }

/* Good Moral: "proof that your sanction is completed" boxes (student and SAS) */
:root[data-theme="dark"] #clearanceSection,
:root[data-theme="dark"] #adminClearancePanel {
    background: rgba(245, 196, 81, 0.08) !important;
    border-color: rgba(245, 196, 81, 0.28) !important;
}
:root[data-theme="dark"] #clearanceSection > div:last-child { background: rgba(255, 255, 255, 0.05) !important; border-color: rgba(255, 255, 255, 0.12) !important; }
:root[data-theme="dark"] #clearanceSection h4,
:root[data-theme="dark"] #clearanceSection div { color: #dfe7e1; }
:root[data-theme="dark"] #adminClearancePanel .field-label { color: #f5c451 !important; }
:root[data-theme="dark"] #clearanceSection [style*="#a66a00"], :root[data-theme="dark"] #adminClearancePanel [style*="#a66a00"], :root[data-theme="dark"] #adminPaymentPanel [style*="#a66a00"], :root[data-theme="dark"] #paymentSection [style*="#a66a00"] { color: #f5c451 !important; }
:root[data-theme="dark"] #clearanceSection [style*="#1565c0"], :root[data-theme="dark"] #adminClearancePanel [style*="#1565c0"], :root[data-theme="dark"] #adminPaymentPanel [style*="#1565c0"], :root[data-theme="dark"] #paymentSection [style*="#1565c0"] { color: #8fb4ff !important; }
:root[data-theme="dark"] #clearanceSection [style*="#2e7d32"], :root[data-theme="dark"] #adminClearancePanel [style*="#2e7d32"], :root[data-theme="dark"] #adminPaymentPanel [style*="#2e7d32"], :root[data-theme="dark"] #paymentSection [style*="#2e7d32"] { color: #6ee7a0 !important; }
:root[data-theme="dark"] #clearanceSection [style*="#c62828"], :root[data-theme="dark"] #adminClearancePanel [style*="#c62828"], :root[data-theme="dark"] #adminPaymentPanel [style*="#c62828"], :root[data-theme="dark"] #paymentSection [style*="#c62828"] { color: #ff8d98 !important; }

/* ===== LIGHT MODE: sage-green colors (dashboards) =====
   Colors only. The layout is the original one (full-height sidebar, same card shapes and sizes); what changes is the palette:
   the page is a soft sage green with a light glow at the top and a deeper green in the bottom corner, the cards are translucent
   white so the green shows through a little, and the sidebar has a faint green tint at the bottom.
   Scoped to dashboards with a sidebar and to the light theme: the landing page, the dark theme and the phone layout keep their own. */
:root:not([data-theme="dark"]) body:has(.sidebar) {
    background-color: #dcece2 !important;
    background-image:
        radial-gradient(900px 560px at 86% -10%, rgba(255, 255, 255, 0.65), transparent 60%),
        radial-gradient(820px 620px at -6% 106%, rgba(10, 95, 37, 0.15), transparent 62%),
        linear-gradient(160deg, #e6f2ea 0%, #d3e8da 100%);
    background-attachment: fixed;
}
:root:not([data-theme="dark"]) body:has(.sidebar) .panel:not(.chart-panel-donut):not([style*="background"]),
:root:not([data-theme="dark"]) body:has(.sidebar) .stat-card:not(.stat-card-hero):not([style*="background"]) {
    background-color: rgba(255, 255, 255, 0.8);
    background-image: none;
    border: 1px solid rgba(255, 255, 255, 0.8);
}
:root:not([data-theme="dark"]) .sidebar { background-image: linear-gradient(180deg, #ffffff 0%, #eaf4ee 100%); }
:root:not([data-theme="dark"]) body:has(.sidebar) .panel-title { color: #0a4d20; }

/* text that sits straight on the sage page (not inside a card) or in the lightest grays: a little darker so it stays readable */
:root:not([data-theme="dark"]) body:has(.sidebar) .welcome-header:not(.welcome-split):not(:has(> h2 > .greeting-name)) .welcome-date { color: #7a5600 !important; }
:root:not([data-theme="dark"]) body:has(.sidebar) .welcome-header:not(:has(> h2 > .greeting-name)):not(.welcome-split) p { color: #33473b; }
:root:not([data-theme="dark"]) body:has(.sidebar) .empty-text { color: #3f5046; }
:root:not([data-theme="dark"]) body:has(.sidebar) .empty-subtext { color: #55665c; }
:root:not([data-theme="dark"]) body:has(.sidebar) .showing-year,
:root:not([data-theme="dark"]) body:has(.sidebar) label { color: #33473b; }

/* ===== STUDENT, COORDINATOR, FACULTY, SECURITY, HELP DESK: welcome banner and colorful stat cards =====
   The greeting was plain gray text on the page. It is now a green banner (brand gradient, soft gold glow, a faint ring) with the
   name in the italic serif of the landing page ("Instrument Serif", the same face as "AI Assistant" and "How to Use" there).
   The stat cards get an accent color each: a colored top edge, a faint tint, and a solid gradient icon chip.
   The banner works in both themes; the stat card tints are for the light theme (the dark theme keeps its own cards). */
.welcome-section,
.welcome-header.welcome-split,
.welcome-header:has(> h2 > .greeting-name) {
    position: relative;
    overflow: hidden;
    padding: 28px 34px;
    border-radius: 28px;
    color: #ffffff;
    background:
        radial-gradient(520px 260px at 92% -22%, rgba(255, 210, 122, 0.30), transparent 62%),
        radial-gradient(420px 300px at -6% 122%, rgba(255, 255, 255, 0.14), transparent 60%),
        linear-gradient(125deg, #0a4d20 0%, #0a5f25 48%, #17894a 100%);
    box-shadow: 0 18px 40px rgba(10, 95, 37, 0.26);
}
.welcome-section::after,
.welcome-header.welcome-split::after,
.welcome-header:has(> h2 > .greeting-name)::after {
    content: "";
    position: absolute;
    right: -64px;
    top: -64px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    border: 30px solid rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.welcome-section > *,
.welcome-header.welcome-split > *,
.welcome-header:has(> h2 > .greeting-name) > * { position: relative; z-index: 1; }
.welcome-section .greeting-time,
.welcome-header.welcome-split .hero-left > h2,
.welcome-header:has(> h2 > .greeting-name) > h2 {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(18px, 2.4vw, 26px);
    font-weight: 500;
}
.greeting-name {
    font-family: 'Instrument Serif', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(28px, 3.2vw, 40px);
    line-height: 1.05;
    letter-spacing: -0.3px;
    color: #ffd27a;
}
.welcome-section .greeting-subtext,
.welcome-header.welcome-split .hero-left > p,
.welcome-header:has(> h2 > .greeting-name) > p { color: rgba(255, 255, 255, 0.9); font-size: 14.5px; }
.welcome-section .btn-green {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
@media (hover: hover) and (pointer: fine) { .welcome-section .btn-green:hover { background: rgba(255, 255, 255, 0.26); } }
@media (max-width: 767px) {
    .welcome-section,
    .welcome-header.welcome-split,
    .welcome-header:has(> h2 > .greeting-name) { padding: 22px 20px; border-radius: 22px; }
    .welcome-section .greeting-time { font-size: 17px; }
    .greeting-name { font-size: clamp(26px, 8vw, 32px); }
}

:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid .stat-card:not([style*="background"]) {
    background-image: linear-gradient(160deg, color-mix(in srgb, var(--stat-accent, #0a5f25) 13%, #ffffff) 0%, rgba(255, 255, 255, 0) 64%);
    box-shadow: inset 0 4px 0 var(--stat-accent, #0a5f25), 0 10px 26px rgba(10, 70, 32, 0.09);
}
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid .stat-card .stat-icon {
    background: linear-gradient(135deg, var(--stat-accent, #0a5f25), color-mix(in srgb, var(--stat-accent, #0a5f25) 62%, #ffffff));
    color: #ffffff;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--stat-accent, #0a5f25) 32%, transparent);
}
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid .stat-card .huge-number { color: var(--stat-accent, #0a5f25); }
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid .stat-card .card-title { color: #33473b; }
body:has(.welcome-section) .panel-title::before,
body:has(.welcome-header .greeting-name) .panel-title::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 18px;
    margin-right: 10px;
    border-radius: 6px;
    background: linear-gradient(180deg, #f39c12, #ffcf70);
    vertical-align: -3px;
}

/* ===== STUDENT WELCOME BANNER, SPLIT: greeting and buttons on the left, a snapshot of the student's cases on the right ===== */
.welcome-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
    gap: 28px;
    align-items: center;
}
.welcome-split .hero-left { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero-snapshot {
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
}
.hs-label { font-size: 12px; font-weight: 700; letter-spacing: 0.9px; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); margin-bottom: 12px; }
.hs-latest { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.hs-latest-k { font-size: 12px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.hs-latest-v { font-size: 18px; font-weight: 800; line-height: 1.25; color: #ffffff; overflow-wrap: anywhere; }
.hs-latest-t { font-size: 13px; color: rgba(255, 255, 255, 0.85); line-height: 1.4; }
.hs-sum { margin: 0; padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, 0.2); font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.92); }
.hs-list { list-style: none; margin: 0; padding: 11px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.2); display: flex; flex-direction: column; gap: 7px; }
.hs-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, 0.92); }
.hs-list li b { font-size: 16px; font-weight: 800; color: #ffffff; }
.hs-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.hs-dot-gold { background: #ffd27a; }
.hs-dot-mint { background: rgba(255, 255, 255, 0.45); }
.hs-empty { display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, 0.9); }
.hs-empty i { font-size: 26px; color: #ffd27a; flex: none; }
@media (max-width: 900px) {
    .welcome-split { grid-template-columns: 1fr; gap: 20px; }
    .hero-snapshot { max-width: 420px; }
}

/* ===== TABLES AND CASE LISTS (all roles) =====
   Header: a soft mint band with small uppercase column names. Rows: roomy, no hard lines, one color (so the unread ones stand out), a
   little darker on hover, with the first column (the reference or name) in green. Action buttons in a table are small tinted
   rounded buttons (green for view / approve, red for reject or delete) that fill in on hover.
   Applies to <table class="data-table"> and to the grid lists made of .custom-table-header + .report-row. */
.data-table { border-collapse: separate; border-spacing: 0; }
.data-table th {
    background-color: #e7f2ed;
    color: #3b574b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    padding: 13px 16px;
    border-bottom: none;
}
.data-table th:first-child { border-radius: 12px 0 0 12px; }
.data-table th:last-child { border-radius: 0 12px 12px 0; }
.data-table td { padding: 15px 16px; border-bottom: none; }
.data-table tbody td:first-child { border-radius: 10px 0 0 10px; }
.data-table tbody td:last-child { border-radius: 0 10px 10px 0; }
.data-table tbody td:first-child strong { color: var(--primary-green); }
.custom-table-header {
    background-color: #e7f2ed;
    color: #3b574b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    padding: 13px 16px;
    border-radius: 12px;
}
.report-row { padding: 14px 16px; border-bottom: none; border-radius: 10px; }
@media (min-width: 769px) {
    /* no zebra stripes: one row color, so the tinted unread rows are the only ones that stand out */@media (hover: hover) and (pointer: fine) { .data-table tbody tr:hover td { background-color: rgba(10, 95, 37, 0.06); } }
    @media (hover: hover) and (pointer: fine) { .report-row[data-id]:hover, .report-row:hover { background-color: rgba(10, 95, 37, 0.06); } }
}
:root:not([data-theme="dark"]) .data-table .btn-action.btn-approve {
    background: #e3f3ea;
    color: #0a6a2a;
    border: 1px solid #cde6d6;
    border-radius: 10px;
    box-shadow: none;
}
@media (hover: hover) and (pointer: fine) { :root:not([data-theme="dark"]) .data-table .btn-action.btn-approve:hover { background: var(--primary-green); color: #ffffff; border-color: var(--primary-green); } }
:root:not([data-theme="dark"]) .data-table .btn-action.btn-reject {
    background: #fdecee;
    color: #c62828;
    border: 1px solid #f6cfd4;
    border-radius: 10px;
    box-shadow: none;
}
@media (hover: hover) and (pointer: fine) { :root:not([data-theme="dark"]) .data-table .btn-action.btn-reject:hover { background: #dc3545; color: #ffffff; border-color: #dc3545; } }
:root[data-theme="dark"] .data-table th { letter-spacing: 0.7px; }
:root[data-theme="dark"] .data-table tbody td:first-child strong { color: #6ee7a0; }
@media (min-width: 769px) {
    @media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .data-table tbody tr:hover td { background-color: rgba(62, 231, 154, 0.07); } }
}
.welcome-header.welcome-split .script-font,
.welcome-header:has(> h2 > .greeting-name) .script-font { color: rgba(255, 255, 255, 0.92) !important; }
.welcome-header.welcome-split .hero-left > p .welcome-date,
.welcome-header:has(> h2 > .greeting-name) > p .welcome-date { color: #ffd27a !important; }

/* ===== Logout modal: the original size, with a green gradient card ===== */
#logoutModal .modal-content.lg-card {
    padding: 40px 30px 30px; width: 90%; max-width: 380px; text-align: center; overflow: hidden; position: relative;
    border: 1px solid rgba(10, 95, 37, 0.16); border-radius: 20px;
    background: linear-gradient(160deg, #cfeadb 0%, #e9f5ee 42%, #ffffff 100%);
    box-shadow: 0 20px 50px rgba(8, 60, 28, 0.22);
}
.lg-card .lg-top { display: flex; justify-content: center; padding: 0; background: none; margin-bottom: 20px; }
.lg-card .lg-ring {
    width: 75px; height: 75px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: #dc3545; background: #fff; box-shadow: 0 10px 25px rgba(10, 95, 37, 0.14);
}
.lg-card .lg-ring i { margin-left: 6px; line-height: 1; }
.lg-card .lg-body { padding: 0; margin: 0; background: none; }
.lg-card h3 { font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 700; color: #123d27; margin: 0 0 12px; }
.lg-card p { font-size: 13px; line-height: 1.5; color: #4f6357; margin: 0 0 30px; }
.lg-card .lg-actions { display: flex; flex-direction: row; gap: 12px; }
.lg-card .lg-actions button {
    flex: 1; padding: 12px; border-radius: 30px; font-family: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.lg-card .lg-stay { background: rgba(255, 255, 255, 0.85); color: #0a5f25; border: 1px solid rgba(10, 95, 37, 0.25); }
.lg-card .lg-out { background: linear-gradient(135deg, #ef4444, #dc3545); color: #fff; border: none; box-shadow: 0 8px 20px rgba(220, 53, 69, 0.25); }
.lg-card .lg-actions button:focus-visible { outline: 3px solid rgba(10, 95, 37, 0.35); outline-offset: 2px; }

:root[data-theme="dark"] #logoutModal .modal-content.lg-card {
    background: linear-gradient(160deg, #123d27 0%, #0e2418 45%, #0a140e 100%) !important;
    border-color: rgba(110, 231, 160, 0.22);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(34, 201, 127, 0.10);
}
:root[data-theme="dark"] .lg-card .lg-ring { background: rgba(62, 231, 154, 0.12); color: #ff8a8a; border: 1px solid rgba(110, 231, 160, 0.25); box-shadow: 0 0 24px rgba(62, 231, 154, 0.18); }
:root[data-theme="dark"] .lg-card h3 { color: #f1f7f2; }
:root[data-theme="dark"] .lg-card p { color: #b4c4b8; }
:root[data-theme="dark"] .lg-card .lg-stay { background: rgba(255, 255, 255, 0.07); color: #d6e2d9; border-color: rgba(255, 255, 255, 0.16); }

/* phone landscape: tighter so it fits the short screen */
@media (orientation: landscape) and (max-height: 520px) {
    #logoutModal .modal-content.lg-card { padding: 20px 26px 20px; }
    .lg-card .lg-top { margin-bottom: 10px; }
    .lg-card .lg-ring { width: 56px; height: 56px; font-size: 22px; }
    .lg-card h3 { font-size: 18px; margin-bottom: 6px; }
    .lg-card p { margin-bottom: 16px; }
}

/* the pages' old inline #cancelLogoutBtn:hover / #confirmLogoutBtn:hover rules are stronger than the classes above */@media (hover: hover) and (pointer: fine) { #logoutModal #cancelLogoutBtn.lg-stay:hover { background: #fff !important; color: #0a5f25 !important; transform: translateY(-1px) !important; } }
@media (hover: hover) and (pointer: fine) { #logoutModal #confirmLogoutBtn.lg-out:hover { background: linear-gradient(135deg, #f87171, #e3342f) !important; color: #fff !important; transform: translateY(-1px) !important; box-shadow: 0 10px 22px rgba(220, 53, 69, 0.32) !important; } }
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] #logoutModal #cancelLogoutBtn.lg-stay:hover { background: rgba(255, 255, 255, 0.12) !important; color: #fff !important; } }

/* ===== Unread stays obvious (the sage page and one-color rows made the old faint tint hard to see) =====
   Unread case rows: a stronger green tint, a solid green bar on the left and bolder text.
   Unread notifications (the dropdown items the scripts color inline): the same tint and bar. */
:root { --unread-bg: rgba(10, 95, 37, 0.17); }
:root[data-theme="dark"] { --unread-bg: rgba(62, 231, 154, 0.16); }
.row-unread { background: var(--unread-bg); border-radius: 10px; }
tr.row-unread td:first-child { box-shadow: inset 4px 0 0 var(--unread-accent); }
div.row-unread { box-shadow: inset 4px 0 0 var(--unread-accent); }
tr.row-unread td, div.row-unread { font-weight: 600; }
.dropdown-menu .dropdown-item[style*="rgba(10, 95, 37, 0.05)"],
.dropdown-menu .dropdown-item[style*="rgba(220, 53, 69, 0.0"] {
    box-shadow: inset 4px 0 0 var(--unread-accent);
}
.dropdown-menu .dropdown-item[style*="rgba(10, 95, 37, 0.05)"] { background-color: var(--unread-bg) !important; }
.dropdown-menu .dropdown-item[style*="rgba(220, 53, 69, 0.0"] { background-color: rgba(220, 53, 69, 0.13) !important; box-shadow: inset 4px 0 0 #dc3545; }

/* the logout title shows the system name styled like the sidebar logo (Oswald, green + orange) */
.lg-card .lg-brand { white-space: nowrap; font-family: 'Oswald', sans-serif; font-weight: 700; letter-spacing: 0.5px; color: var(--primary-green); }
.lg-card .lg-brand .lg-orange { color: var(--accent-orange); }

/* dark mode: the search field of the top bar is one pill (the input blends into the container, no darker strip inside it) */
:root[data-theme="dark"] body .search-container input:not(#_x),
:root[data-theme="dark"] body .search-bar input:not(#_x) { background-color: transparent !important; border: none !important; box-shadow: none !important; }

/* buttons use the page font (the browser default is Arial) */
button, input, textarea, select { font-family: inherit; }

/* the Super Admin badge next to the avatar in the top bar */
.role-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 14px; font: 700 10.5px/1 'Montserrat', sans-serif; letter-spacing: .6px; text-transform: uppercase;
    color: #3a2c00; background: linear-gradient(135deg, #ffd27a, #f3b43f); box-shadow: 0 2px 8px rgba(243, 180, 63, .35); white-space: nowrap; order: 5; }
@media (max-width: 480px) { .role-pill { display: none; } }

/* ===== Light mode contrast pass: small gray, yellow and red text that was below 4.5:1 =====
   Only the exact light grays that pages write inline (#999, #888, #aaa, #777) are darkened, and only outside dark mode. */
:root:not([data-theme="dark"]) [style*="color: #999"], :root:not([data-theme="dark"]) [style*="color:#999"],
:root:not([data-theme="dark"]) [style*="color: #888"], :root:not([data-theme="dark"]) [style*="color:#888"],
:root:not([data-theme="dark"]) [style*="color: #aaa"], :root:not([data-theme="dark"]) [style*="color:#aaa"],
:root:not([data-theme="dark"]) [style*="color: #777"], :root:not([data-theme="dark"]) [style*="color:#777"] { color: #4f5c54 !important; }
:root:not([data-theme="dark"]) .sidebar-section-title,
:root:not([data-theme="dark"]) .sidebar-footer-link,
:root:not([data-theme="dark"]) .sidebar-footer-link .nav-text,
:root:not([data-theme="dark"]) .ai-disclaimer { color: #4f5c54; }
:root:not([data-theme="dark"]) .status-pending { color: #6f5300; }
:root:not([data-theme="dark"]) .status-escalated-to-sas { color: #8a5200; }
:root:not([data-theme="dark"]) .status-under-review { color: #264fa6; }
:root:not([data-theme="dark"]) .card-title[style*="dc3545"], :root:not([data-theme="dark"]) h4[style*="dc3545"], :root:not([data-theme="dark"]) span[style*="color: #dc3545"] { color: #b81d2c !important; }
:root:not([data-theme="dark"]) label[for="profilePictureInput"] { color: #2b2100 !important; }
:root:not([data-theme="dark"]) .main-content small, :root:not([data-theme="dark"]) .content-area small { color: #4c5951; }

/* light mode contrast pass 2: small colored text written inline (yellow, orange, red, blue-gray) */
:root:not([data-theme="dark"]) span[style*="color: #d68910"], :root:not([data-theme="dark"]) span[style*="color:#d68910"], :root:not([data-theme="dark"]) small[style*="color: #d68910"], :root:not([data-theme="dark"]) p[style*="color: #d68910"], :root:not([data-theme="dark"]) div[style*="color: #d68910"] { color: #8a5200 !important; }
:root:not([data-theme="dark"]) span[style*="color: #b8860b"], :root:not([data-theme="dark"]) span[style*="color:#b8860b"], :root:not([data-theme="dark"]) small[style*="color: #b8860b"], :root:not([data-theme="dark"]) p[style*="color: #b8860b"], :root:not([data-theme="dark"]) div[style*="color: #b8860b"] { color: #7a5a00 !important; }
:root:not([data-theme="dark"]) span[style*="color: #f57c00"], :root:not([data-theme="dark"]) span[style*="color:#f57c00"], :root:not([data-theme="dark"]) small[style*="color: #f57c00"], :root:not([data-theme="dark"]) p[style*="color: #f57c00"], :root:not([data-theme="dark"]) div[style*="color: #f57c00"] { color: #a85400 !important; }
:root:not([data-theme="dark"]) span[style*="color: #fa9f04"], :root:not([data-theme="dark"]) span[style*="color:#fa9f04"], :root:not([data-theme="dark"]) small[style*="color: #fa9f04"], :root:not([data-theme="dark"]) p[style*="color: #fa9f04"], :root:not([data-theme="dark"]) div[style*="color: #fa9f04"] { color: #8a5200 !important; }
:root:not([data-theme="dark"]) span[style*="color: #dc3545"], :root:not([data-theme="dark"]) span[style*="color:#dc3545"], :root:not([data-theme="dark"]) small[style*="color: #dc3545"], :root:not([data-theme="dark"]) p[style*="color: #dc3545"], :root:not([data-theme="dark"]) div[style*="color: #dc3545"] { color: #b81d2c !important; }
:root:not([data-theme="dark"]) span[style*="color: #6b7280"], :root:not([data-theme="dark"]) span[style*="color:#6b7280"], :root:not([data-theme="dark"]) small[style*="color: #6b7280"], :root:not([data-theme="dark"]) p[style*="color: #6b7280"], :root:not([data-theme="dark"]) div[style*="color: #6b7280"] { color: #4b5563 !important; }
:root:not([data-theme="dark"]) span[style*="color: #a37c00"], :root:not([data-theme="dark"]) span[style*="color:#a37c00"], :root:not([data-theme="dark"]) small[style*="color: #a37c00"], :root:not([data-theme="dark"]) p[style*="color: #a37c00"], :root:not([data-theme="dark"]) div[style*="color: #a37c00"] { color: #6f5300 !important; }
:root:not([data-theme="dark"]) span[style*="color: #e0a800"], :root:not([data-theme="dark"]) span[style*="color:#e0a800"], :root:not([data-theme="dark"]) small[style*="color: #e0a800"], :root:not([data-theme="dark"]) p[style*="color: #e0a800"], :root:not([data-theme="dark"]) div[style*="color: #e0a800"] { color: #7a5a00 !important; }
:root:not([data-theme="dark"]) span[style*="color: #f39c12"], :root:not([data-theme="dark"]) span[style*="color:#f39c12"], :root:not([data-theme="dark"]) small[style*="color: #f39c12"], :root:not([data-theme="dark"]) p[style*="color: #f39c12"], :root:not([data-theme="dark"]) div[style*="color: #f39c12"] { color: #8a5200 !important; }
:root:not([data-theme="dark"]) .badge-pending { color: #6f5300; }
:root:not([data-theme="dark"]) .ins-more-hint { color: #4f5c54 !important; }
:root:not([data-theme="dark"]) .stat-trend-badge.stat-trend-up { color: #14663a; }

/* ===== Super Admin confirmation modal (Security & Health): the same card as the logout modal, with a password field ===== */
#saModal .modal-content.lg-card {
    padding: 36px 30px 28px; width: 92%; max-width: 400px; text-align: center; overflow: hidden; position: relative;
    border: 1px solid rgba(10, 95, 37, 0.16); border-radius: 20px;
    background: linear-gradient(160deg, #cfeadb 0%, #e9f5ee 42%, #ffffff 100%);
    box-shadow: 0 20px 50px rgba(8, 60, 28, 0.22);
}
#saModal .lg-ring i { margin-left: 0; }
#saModal .lg-ring.lg-ring-ok { color: #0a5f25; }
#saModal .lg-body p { margin-bottom: 20px; }
.lg-card .lg-field { text-align: left; margin: 0 0 14px; }
.lg-card .lg-field label { display: block; font-size: 12px; font-weight: 700; color: #123d27; margin: 0 0 6px 4px; }
.lg-card .lg-field input {
    width: 100%; padding: 12px 16px; border-radius: 30px; font-family: inherit; font-size: 14px; color: #123d27;
    background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(10, 95, 37, 0.25); outline: none; box-sizing: border-box;
}
.lg-card .lg-field input:focus { border-color: #0a5f25; box-shadow: 0 0 0 3px rgba(10, 95, 37, 0.15); }
.lg-card .lg-error { display: none; margin: -4px 4px 12px; font-size: 12.5px; color: #c62828; text-align: left; }
.lg-card .lg-go { background: linear-gradient(135deg, #12873a, #0a5f25); color: #fff; border: none; box-shadow: 0 8px 20px rgba(10, 95, 37, 0.25); }
@media (hover: hover) and (pointer: fine) { #saModal .lg-actions button:hover { transform: translateY(-1px); } }
#saModal .lg-actions button:disabled { opacity: .6; cursor: wait; transform: none; }
:root[data-theme="dark"] #saModal .modal-content.lg-card {
    background: linear-gradient(160deg, #123d27 0%, #0e2418 45%, #0a140e 100%) !important;
    border-color: rgba(110, 231, 160, 0.22);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(34, 201, 127, 0.10);
}
:root[data-theme="dark"] #saModal .lg-ring { background: rgba(62, 231, 154, 0.12); color: #ff8a8a; border: 1px solid rgba(110, 231, 160, 0.25); box-shadow: 0 0 24px rgba(62, 231, 154, 0.18); }
:root[data-theme="dark"] #saModal .lg-ring.lg-ring-ok { color: #3ee79a; }
:root[data-theme="dark"] .lg-card .lg-field label { color: #d6e2d9; }
:root[data-theme="dark"] .lg-card .lg-field input { background: rgba(255, 255, 255, 0.07); color: #f1f7f2; border-color: rgba(255, 255, 255, 0.18); }
:root[data-theme="dark"] .lg-card .lg-error { color: #ff8a8a; }
:root[data-theme="dark"] .lg-card .lg-go { background: linear-gradient(135deg, #22c97f, #12873a); }

/* ===== Super Admin dialogs: every form modal uses the same card as the logout modal ===== */
.modal-content.lg-card.lg-form {
    padding: 34px 28px 26px; width: 92%; max-width: 420px; text-align: center; overflow: hidden; position: relative;
    border: 1px solid rgba(10, 95, 37, 0.16); border-radius: 20px;
    background: linear-gradient(160deg, #cfeadb 0%, #e9f5ee 42%, #ffffff 100%);
    box-shadow: 0 20px 50px rgba(8, 60, 28, 0.22); max-height: 92vh; overflow-y: auto;
}
.lg-card.lg-form .lg-top { margin-bottom: 16px; }
.lg-card.lg-form .lg-ring { width: 64px; height: 64px; font-size: 24px; }
.lg-card.lg-form .lg-ring i { margin-left: 0; }
.lg-card .lg-ring.lg-ring-ok { color: #0a5f25; }
.lg-card.lg-form h3 { font-size: 20px; margin-bottom: 8px; }
.lg-card.lg-form .lg-body > p { margin-bottom: 18px; word-break: break-word; }
.lg-card .lg-warn { text-align: left; font-size: 12.5px; line-height: 1.5; color: #8f2230; background: rgba(220, 53, 69, 0.08); border: 1px solid rgba(220, 53, 69, 0.22); border-radius: 14px; padding: 12px 14px; margin: 0 0 16px; }
.lg-card .lg-warn strong { color: #c62828; }
.lg-card .lg-field input[type="file"] { padding: 9px 14px; border-radius: 16px; }
.lg-card .lg-feedback { text-align: left; font-size: 12.5px; margin: 0 4px 12px; }
.lg-card .lg-feedback:empty { display: none; }
.lg-card .lg-temp { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.lg-card .lg-temp code { flex: 1; font-size: 17px; letter-spacing: 1px; padding: 11px 14px; border-radius: 14px; background: rgba(10, 95, 37, 0.08); border: 1px dashed rgba(10, 95, 37, 0.4); user-select: all; color: #123d27; }
.lg-card .lg-copy { padding: 10px 18px; border-radius: 30px; border: 1px solid rgba(10, 95, 37, 0.3); background: #fff; color: #0a5f25; font-weight: 700; font-size: 12.5px; cursor: pointer; }
.lg-card.lg-form .lg-actions button:disabled { opacity: .6; cursor: wait; }
@media (hover: hover) and (pointer: fine) { .lg-card .lg-actions button:hover { transform: translateY(-1px); } }
:root[data-theme="dark"] .modal-content.lg-card.lg-form {
    background: linear-gradient(160deg, #123d27 0%, #0e2418 45%, #0a140e 100%) !important;
    border-color: rgba(110, 231, 160, 0.22);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(34, 201, 127, 0.10);
}
:root[data-theme="dark"] .lg-card.lg-form .lg-ring { background: rgba(62, 231, 154, 0.12); color: #ff8a8a; border: 1px solid rgba(110, 231, 160, 0.25); box-shadow: 0 0 24px rgba(62, 231, 154, 0.18); }
:root[data-theme="dark"] .lg-card.lg-form .lg-ring.lg-ring-ok { color: #3ee79a; }
:root[data-theme="dark"] .lg-card .lg-warn { color: #ffb4bd; background: rgba(220, 53, 69, 0.14); border-color: rgba(255, 138, 138, 0.3); }
:root[data-theme="dark"] .lg-card .lg-warn strong { color: #ff8a8a; }
:root[data-theme="dark"] .lg-card .lg-temp code { color: #f1f7f2; background: rgba(62, 231, 154, 0.1); border-color: rgba(110, 231, 160, 0.4); }
:root[data-theme="dark"] .lg-card .lg-copy { background: rgba(255, 255, 255, 0.07); color: #d6e2d9; border-color: rgba(255, 255, 255, 0.18); }

/* the small "are you sure" dialogs (app_confirm.js: appConfirm, appForm) on Super Admin pages */
body.sa-cards .app-confirm-box {
    width: 400px; text-align: center; padding: 32px 28px 26px; border: 1px solid rgba(10, 95, 37, 0.16);
    background: linear-gradient(160deg, #cfeadb 0%, #e9f5ee 42%, #ffffff 100%); box-shadow: 0 20px 50px rgba(8, 60, 28, 0.22);
}
body.sa-cards .app-confirm-ring { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; background: #fff; color: #0a5f25; box-shadow: 0 10px 25px rgba(10, 95, 37, 0.14); }
body.sa-cards .app-confirm-ring.danger { color: #dc3545; }
body.sa-cards .app-confirm-title { font-size: 20px; font-weight: 700; color: #123d27; margin: 0 0 8px; }
body.sa-cards .app-confirm-msg { color: #4f6357; text-align: center; }
body.sa-cards .app-confirm-actions { justify-content: stretch; gap: 12px; }
body.sa-cards .app-confirm-actions button { flex: 1; padding: 12px; font-size: 14px; }
body.sa-cards .app-confirm-cancel { background: rgba(255, 255, 255, 0.85); color: #0a5f25; border: 1px solid rgba(10, 95, 37, 0.25); }
body.sa-cards .app-confirm-ok { background: linear-gradient(135deg, #12873a, #0a5f25); box-shadow: 0 8px 20px rgba(10, 95, 37, 0.25); }
body.sa-cards .app-confirm-ok.danger { background: linear-gradient(135deg, #ef4444, #dc3545); box-shadow: 0 8px 20px rgba(220, 53, 69, 0.25); }
body.sa-cards .app-confirm-box label { color: #123d27 !important; text-align: left; }
body.sa-cards .app-confirm-box input, body.sa-cards .app-confirm-box textarea { border-radius: 24px !important; padding: 11px 16px !important; }
:root[data-theme="dark"] body.sa-cards .app-confirm-box { background: linear-gradient(160deg, #123d27 0%, #0e2418 45%, #0a140e 100%); border-color: rgba(110, 231, 160, 0.22); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
:root[data-theme="dark"] body.sa-cards .app-confirm-ring { background: rgba(62, 231, 154, 0.12); color: #3ee79a; border: 1px solid rgba(110, 231, 160, 0.25); }
:root[data-theme="dark"] body.sa-cards .app-confirm-ring.danger { color: #ff8a8a; }
:root[data-theme="dark"] body.sa-cards .app-confirm-title { color: #f1f7f2; }
:root[data-theme="dark"] body.sa-cards .app-confirm-msg { color: #b4c4b8; }
:root[data-theme="dark"] body.sa-cards .app-confirm-cancel { background: rgba(255, 255, 255, 0.07); color: #d6e2d9; border-color: rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] body.sa-cards .app-confirm-box label { color: #d6e2d9 !important; }

/* phones: the form dialogs fit the screen */
@media (max-width: 768px) {
    .modal-content.lg-card.lg-form, #saModal .modal-content.lg-card { width: min(420px, calc(100vw - 32px)) !important; max-height: calc(100vh - 40px) !important; overflow-y: auto !important; padding: 26px 20px 20px !important; }
}

/* ===== Skeleton loading: shimmering gradient shapes instead of spinners (js/skeleton.js builds them) ===== */
@keyframes skShimmer { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes skIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* the "gradient" pattern: a soft multi-colour gradient (green, mint, a touch of gold) that drifts back and forth */
.sk {
    display: inline-block; vertical-align: middle; border-radius: 8px;
    background: linear-gradient(110deg, rgba(10, 95, 37, 0.16), rgba(120, 205, 150, 0.30), rgba(243, 156, 18, 0.20), rgba(120, 205, 150, 0.30), rgba(10, 95, 37, 0.16));
    background-size: 200% 200%; animation: skShimmer 2.6s ease-in-out infinite;
}
/* "staggered": the rows and cards appear one after another from the top */
.sk-row, .sk-card { opacity: 0; animation: skIn .45s ease-out forwards; }
.sk-row:nth-child(1), .sk-card:nth-child(1) { animation-delay: 0s; }
.sk-row:nth-child(2), .sk-card:nth-child(2) { animation-delay: .08s; }
.sk-row:nth-child(3), .sk-card:nth-child(3) { animation-delay: .16s; }
.sk-row:nth-child(4), .sk-card:nth-child(4) { animation-delay: .24s; }
.sk-row:nth-child(5), .sk-card:nth-child(5) { animation-delay: .32s; }
.sk-row:nth-child(n+6), .sk-card:nth-child(n+6) { animation-delay: .4s; }
.sk-line { height: 12px; width: 100%; }
.sk-line.s { height: 10px; }
.sk-pill { height: 22px; width: 84px; border-radius: 12px; }
.sk-circle { width: 38px; height: 38px; border-radius: 50%; flex: none; }
.sk-row td { padding: 17px 14px !important; border-bottom: 1px solid rgba(10, 95, 37, 0.06); }
.sk-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 10px; border-radius: 16px; border: 1px solid rgba(10, 95, 37, 0.1); background: rgba(255, 255, 255, 0.55); }
.sk-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.sk-notes { padding: 6px 4px; }
.sk-notes .sk-card { margin: 0 8px 8px; padding: 10px 12px; }
.sk-chart { display: flex; align-items: flex-end; gap: 12px; width: 78%; height: 68%; margin: 0 auto; }
.sk-chart span { flex: 1; border-radius: 8px 8px 0 0; }
.sk-donut { width: 54%; max-width: 230px; aspect-ratio: 1; border-radius: 50%; margin: 0 auto; -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%); mask: radial-gradient(circle, transparent 52%, #000 53%); }
:root[data-theme="dark"] .sk { background: linear-gradient(110deg, rgba(62, 231, 154, 0.10), rgba(62, 231, 154, 0.24), rgba(243, 156, 18, 0.18), rgba(62, 231, 154, 0.24), rgba(62, 231, 154, 0.10)); background-size: 200% 200%; }
:root[data-theme="dark"] .sk-card { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.07); }
:root[data-theme="dark"] .sk-row td { border-bottom-color: rgba(255, 255, 255, 0.05); }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } .sk-row, .sk-card { animation: none; opacity: 1; } }

/* ===== NOTIFICATION BELL BADGE: the red dot of the student, faculty, security, coordinator and Gender Help Desk bells is a number, like the SAS Office bell ===== */
.notification-dot.has-count {
    display: flex; align-items: center; justify-content: center; width: auto; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; top: -7px; right: -9px; font: 700 9px/1 'Montserrat', sans-serif; color: #fff; box-sizing: content-box; pointer-events: none;
}

/* ---------- Validation (shared): a red border on the field and one short message under it, no icon ---------- */
.is-invalid, input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: #d32f2f !important; box-shadow: 0 0 0 1px #d32f2f; }
.fv-msg { color: #c62828; font-size: 12px; font-weight: 600; line-height: 1.35; margin-top: 4px; min-height: 0; }
.fv-msg:empty { display: none; }
:root[data-theme="dark"] .fv-msg { color: #ff8a80; }
:root[data-theme="dark"] .is-invalid { border-color: #ff6b6b !important; box-shadow: 0 0 0 1px #ff6b6b; }
.req-star { color: #d32f2f; font-weight: 700; margin-left: 2px; }
.page-note { padding: 2px 0; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.page-note.ok { background: transparent; color: #1b5e20; }
.page-note.bad { background: transparent; color: #c62828; border: 0; }
:root[data-theme="dark"] .page-note.ok { background: transparent; color: #8fe3a2; }
:root[data-theme="dark"] .page-note.bad { color: #ff8a80; }

/* ===== Dashboard cards that are links (the filter or page they open is in their title) ===== */
a.stat-link { display: block; color: inherit; text-decoration: none; cursor: pointer; }
a.stat-link:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(10, 95, 37, 0.14); }
@media (hover: hover) and (pointer: fine) { a.stat-link:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(10, 95, 37, 0.14); } }
a.stat-link:focus-visible { outline: 2px solid var(--primary-green, #0a5f25); outline-offset: 2px; }

/* ===== The header of a case view: letterhead, case title, and who is involved ===== */
.rh { margin: 0 0 20px; padding-right: 36px; }
.rh-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.rh-title { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: var(--text-dark, #222); }
.rh-ref { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rh-refno { font-weight: 800; font-size: 14px; letter-spacing: .3px; color: var(--text-dark, #333); }
.rh-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: rgba(10, 95, 37, .06); border: 1px solid rgba(10, 95, 37, .12); }
.rh-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rh-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #777; }
.rh-label i { margin-right: 3px; color: var(--primary-green, #1b5e20); }
.rh-value { font-size: 13.5px; font-weight: 600; color: var(--text-dark, #222); word-break: break-word; }
.rh-na { color: #999; font-weight: 500; font-style: italic; }
@media (max-width: 560px) { .rh { padding-right: 0; } .rh-ref { align-items: flex-start; text-align: left; } }

/* ===== Notifications: plain white; the unread ones are highlighted green =====
   The bell lists of the SAS Office and the coordinators color their items inline (green and red tints); here they are white, and
   while the list holds something not yet seen (the bell shows a count) the items get the green tint and bar. The student, faculty
   and security lists mark each notification on its own (.nf-item.is-unread). */
.dropdown-menu .dropdown-item[style*="background-color"] { background-color: var(--surface-card, #fff) !important; box-shadow: none !important; }
:root[data-theme="dark"] .dropdown-menu .dropdown-item[style*="background-color"] { background-color: transparent !important; }
.nf-unread .dropdown-item[style*="background-color"] { background-color: var(--unread-bg) !important; box-shadow: inset 4px 0 0 var(--unread-accent) !important; }
#notificationMenu .nf-item { background: #fff; }
:root[data-theme="dark"] #notificationMenu .nf-item { background: transparent; }
#notificationMenu .nf-item.is-unread { background: var(--unread-bg); box-shadow: inset 4px 0 0 var(--unread-accent); }
@media (hover: hover) and (pointer: fine) { #notificationMenu .nf-item.is-unread:hover { background: rgba(10, 95, 37, 0.24); } }

/* ===== Error and success messages are plain colored text (no box, no fill) ===== */
.coord-feedback.error, .profile-feedback.success, .profile-feedback.error { background: transparent !important; border: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }

/* ===== Student dashboard cards (stats-v2) =====
   One quiet card: a round icon chip on the left, the number big beside it, the label under the number, and a small "View ..." line
   that says the card is a link (hover alone is not enough on touch). The color of a card lives only in its icon chip and its link
   line (and the red of recorded offenses); the card itself is white with a hairline border. Hover and keyboard focus change the
   border and shadow only, so nothing around the card moves. Text is dark enough for 4.5:1 on white. */
.stats-grid.stats-v2 { gap: 16px; }
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid.stats-v2 .stat-card:not([style*="background"]),
.stats-grid.stats-v2 .stat-card {
    background: #ffffff; background-image: none;
    border: 1px solid #dfe7e1; box-shadow: 0 1px 2px rgba(10, 60, 30, 0.05);
    display: flex; flex-direction: row; align-items: center; gap: 14px;
    min-height: 0; padding: 18px; border-radius: 16px; overflow: visible; text-align: left;
}
.stats-v2 .stat-card.stat-link:focus-visible {
    transform: none; border-color: var(--stat-accent, #0a5f25); box-shadow: 0 6px 18px rgba(10, 60, 30, 0.10);
}
@media (hover: hover) and (pointer: fine) { .stats-v2 .stat-card.stat-link:hover {
    transform: none; border-color: var(--stat-accent, #0a5f25); box-shadow: 0 6px 18px rgba(10, 60, 30, 0.10);
} }
.stats-v2 .stat-card.stat-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--stat-accent, #0a5f25) 45%, transparent); outline-offset: 2px; }
.stats-v2 .stat-card.stat-link:active { box-shadow: 0 1px 2px rgba(10, 60, 30, 0.08); border-color: var(--stat-accent, #0a5f25); }
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid.stats-v2 .stat-card .stat-icon,
.stats-v2 .stat-card .stat-icon {
    width: 48px; height: 48px; flex: none; font-size: 21px; border-radius: 14px;
    background: color-mix(in srgb, var(--stat-accent, #0a5f25) 12%, #ffffff);
    color: var(--stat-accent, #0a5f25); box-shadow: none;
}
.stats-v2 .stat-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid.stats-v2 .stat-card .huge-number,
.stats-v2 .stat-card .huge-number {
    font-size: 34px; line-height: 1.05; font-weight: 700; justify-content: flex-start; flex: none; text-align: left;
    color: #14231a; font-variant-numeric: tabular-nums;
}
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid.stats-v2 .stat-card .card-title,
.stats-v2 .stat-card .card-title { font-size: 12px; letter-spacing: .6px; color: #3d4f44; font-weight: 700; }
.stats-v2 .stat-hint { display: inline-flex; align-items: center; gap: 2px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--stat-accent, #0a5f25); }
.stats-v2 .stat-hint i { font-size: 14px; line-height: 1; transition: transform .18s ease; }
.stats-v2 .stat-card.stat-link:focus-visible .stat-hint i { transform: translateX(3px); }
@media (hover: hover) and (pointer: fine) { .stats-v2 .stat-card.stat-link:hover .stat-hint i { transform: translateX(3px); } }
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid.stats-v2 .stat-card.stat-offense .huge-number,
.stats-v2 .stat-card.stat-offense .huge-number { color: #b02a37; }
:root[data-theme="dark"] .stats-v2 .stat-card { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.12); }
:root[data-theme="dark"] .stats-v2 .stat-card .huge-number { color: #f1f5f2; }
:root[data-theme="dark"] .stats-v2 .stat-card .card-title { color: #b9c7be; }
:root[data-theme="dark"] .stats-v2 .stat-card .stat-icon { background: color-mix(in srgb, var(--stat-accent) 22%, transparent); color: color-mix(in srgb, var(--stat-accent) 40%, #ffffff); }
:root[data-theme="dark"] .stats-v2 .stat-hint { color: color-mix(in srgb, var(--stat-accent) 35%, #ffffff); }
:root[data-theme="dark"] .stats-v2 .stat-card.stat-offense .huge-number { color: #ff8a80; }
@media (prefers-reduced-motion: reduce) { .stats-v2 .stat-hint i { transition: none; } @media (hover: hover) and (pointer: fine) { .stats-v2 .stat-card.stat-link:hover .stat-hint i { transform: none; } } }
@media (max-width: 480px) { .stats-v2 .stat-card { padding: 14px; gap: 10px; } .stats-v2 .stat-card .huge-number { font-size: 28px !important; } .stats-v2 .stat-card .stat-icon { width: 40px !important; height: 40px !important; font-size: 18px !important; } }

/* ===== stats-v2 for every dashboard =====
   The card colors are set by a class on the card (sv-green, sv-gold, sv-teal, sv-red) so each dashboard picks its own order;
   the student cards above use the position as a fallback. Cards that open a list (data-href) get the same hover and focus as links. */
body .stats-v2 .stat-card.sv-green { --stat-accent: #1b5e20; }
body .stats-v2 .stat-card.sv-gold { --stat-accent: #8a6a00; }
body .stats-v2 .stat-card.sv-teal { --stat-accent: #0b6f8a; }
body .stats-v2 .stat-card.sv-red { --stat-accent: #b02a37; }
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-v2 .stat-card:not([style*="background"]) {
    background: #ffffff !important; background-image: none !important; border: 1px solid #dfe7e1 !important;
    box-shadow: 0 1px 2px rgba(10, 60, 30, 0.05) !important; border-radius: 16px; color: #14231a;
}
.stats-v2 .stat-card[data-href]:focus-visible {
    transform: none; border-color: var(--stat-accent, #0a5f25) !important; box-shadow: 0 6px 18px rgba(10, 60, 30, 0.10) !important;
}
@media (hover: hover) and (pointer: fine) { .stats-v2 .stat-card[data-href]:hover {
    transform: none; border-color: var(--stat-accent, #0a5f25) !important; box-shadow: 0 6px 18px rgba(10, 60, 30, 0.10) !important;
} }
.stats-v2 .stat-card[data-href]:focus-visible { outline: 3px solid color-mix(in srgb, var(--stat-accent, #0a5f25) 45%, transparent); outline-offset: 2px; }
.stats-v2 .stat-card[data-href]:focus-visible .stat-hint i { transform: translateX(3px); }
@media (hover: hover) and (pointer: fine) { .stats-v2 .stat-card[data-href]:hover .stat-hint i { transform: translateX(3px); } }
/* the three-card rows (faculty, security) and the coordinator row: icon beside the number, like the student cards */
.faculty-stats-row.stats-v2, .coordinator-stats-grid.stats-v2 { gap: 16px; }
.faculty-stats-row.stats-v2 .stat-card, .coordinator-stats-grid.stats-v2 .stat-card {
    display: flex; flex-direction: row; align-items: center; gap: 14px; min-height: 0; padding: 18px; overflow: visible; text-align: left;
}

/* admin: the same quiet card, keeping the icon, title and trend badge on top and the number below */
.stats-row.stats-v2 { gap: 16px; }
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-row.stats-v2 .stat-card.stat-card-hero { color: #14231a; }
.stats-row.stats-v2 .stat-card { min-height: 0; padding: 18px; overflow: visible; }
.stats-row.stats-v2 .stat-card-hero::after { display: none; }
.stats-row.stats-v2 .stat-card .stat-icon,
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-row.stats-v2 .stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 14px; font-size: 19px; box-shadow: none;
    background: color-mix(in srgb, var(--stat-accent, #0a5f25) 12%, #ffffff); color: var(--stat-accent, #0a5f25);
}
.stats-row.stats-v2 .stat-card .stat-title,
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-row.stats-v2 .stat-card .stat-title { color: #3d4f44 !important; font-weight: 700; }
.stats-row.stats-v2 .stat-card .stat-number,
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-row.stats-v2 .stat-card .stat-number { color: #14231a !important; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .stats-row.stats-v2 .stat-card .stat-icon { background: color-mix(in srgb, var(--stat-accent) 22%, transparent); color: color-mix(in srgb, var(--stat-accent) 40%, #ffffff); }
:root[data-theme="dark"] .stats-row.stats-v2 .stat-card .stat-title { color: #b9c7be !important; }
:root[data-theme="dark"] .stats-row.stats-v2 .stat-card .stat-number { color: #f1f5f2 !important; }

/* narrow screens: four cards in a row are too tight for icon + number + link, so they go two by two */
.stats-v2 .stat-hint { white-space: nowrap; }
@media (max-width: 1180px) { .coordinator-stats-grid.stats-v2, .stats-grid.stats-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 760px) { .faculty-stats-row.stats-v2 { grid-template-columns: 1fr; } }

/* ===== Student dashboard polish =====
   1) the recent-cases header and rows no longer collapse on narrow panels; 2) a "next step" line under the greeting;
   3) a calmer card row while everything is still zero; 4) three-step progress under every recent case; 5) a shorter hero;
   6) a "New" tag on announcements of the last 7 days; 7) a note under the Disciplinary Record heading. */

/* 1. the case list */
.custom-table-header, .report-row { column-gap: 14px; }
.custom-table-header > span, .report-row > span { min-width: 0; overflow-wrap: anywhere; }
.report-row { position: relative; }
@media (max-width: 1180px) {
    /* the My Cases page (.my-reports-grid) keeps its own table; this reflow is for the recent-cases list of the dashboard */
    .custom-table-header:not(.my-reports-grid) { display: none; }
    .report-row:not(.my-reports-grid) { grid-template-columns: 1fr auto; row-gap: 4px; padding: 14px 6px; }
    .report-row:not(.my-reports-grid) > span:nth-child(1) { font-weight: 700; color: var(--primary-green, #1b5e20); }
    .report-row:not(.my-reports-grid) > span:nth-child(4) { grid-column: 2; grid-row: 1 / span 2; justify-self: end; text-align: right; align-self: start; }
    .report-row:not(.my-reports-grid) > span:nth-child(2) { grid-column: 1; color: #3d4f44; }
    .report-row:not(.my-reports-grid) > span:nth-child(3) { grid-column: 1; }
}


/* 2. next step */
.next-step { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 14px 18px; border: 1px solid #dfe7e1; border-left: 4px solid #d4af37; border-radius: 14px; background: #fff; }
.next-step-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: #faf3d9; color: #8a6a00; }
.next-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.next-step-text strong { font-size: 14.5px; color: #14231a; }
.next-step-text span { font-size: 13px; color: #3d4f44; line-height: 1.4; }
.next-step-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--primary-green, #1b5e20); color: #fff; font: inherit; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .next-step-btn:hover { background: #14471a; } }
.next-step-btn:focus-visible { outline: 3px solid rgba(27, 94, 32, 0.4); outline-offset: 2px; }
:root[data-theme="dark"] .next-step { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.12); border-left-color: #d4af37; }
:root[data-theme="dark"] .next-step-text strong { color: #f1f5f2; }
:root[data-theme="dark"] .next-step-text span { color: #b9c7be; }
:root[data-theme="dark"] .next-step-icon { background: rgba(212, 175, 55, 0.18); color: #f1d874; }
@media (max-width: 640px) { .next-step { flex-wrap: wrap; } .next-step-btn { width: 100%; } }

/* 3. everything is still zero: smaller, quieter cards (the next step card above says what to do) */
.stats-v2.stats-empty .stat-card { padding: 12px 16px; }
.stats-v2.stats-empty .stat-card .huge-number { font-size: 24px; color: #6a7a70 !important; }
.stats-v2.stats-empty .stat-card .stat-icon { width: 38px; height: 38px; font-size: 17px; }
.stats-v2 .stat-hint-plain { color: #3d4f44; font-weight: 500; }
.stats-v2 .stat-card.is-zero .huge-number { color: #14231a; }

/* 5. a shorter hero: the greeting on one line */
.welcome-section.student-hero { padding: 20px 26px; gap: 22px; min-height: 0; }
.student-hero .greeting { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; margin: 0 0 4px; }
.student-hero .greeting-time, .student-hero .greeting-name { font-size: clamp(22px, 2.6vw, 28px); }
.student-hero .greeting-subtext { margin: 0 0 12px; }

/* 6. announcements */
.new-tag { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #faf3d9; color: #6b5200; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; }
:root[data-theme="dark"] .new-tag { background: rgba(212, 175, 55, 0.2); color: #f1d874; }

/* 7. disciplinary record */
.record-note { margin: -4px 0 12px; font-size: 13px; color: #3d4f44; line-height: 1.45; }
:root[data-theme="dark"] .record-note { color: #b9c7be; }

/* ===== Survey required notice ===== */
.survey-required { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 14px 18px; border: 1px solid #dfe7e1; border-left: 4px solid #b02a37; border-radius: 14px; background: #fff; }
.survey-required-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: #fbe5e7; color: #b02a37; }
.survey-required-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.survey-required-text strong { font-size: 14.5px; color: #14231a; }
.survey-required-text span { font-size: 13px; color: #3d4f44; line-height: 1.4; }
.survey-required-btn { flex: none; min-height: 44px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--primary-green, #1b5e20); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .survey-required-btn:hover { background: #14471a; } }
.survey-required-btn:focus-visible { outline: 3px solid rgba(27, 94, 32, 0.4); outline-offset: 2px; }
:root[data-theme="dark"] .survey-required { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.12); border-left-color: #ff8a80; }
:root[data-theme="dark"] .survey-required-text strong { color: #f1f5f2; }
:root[data-theme="dark"] .survey-required-text span { color: #b9c7be; }
:root[data-theme="dark"] .survey-required-icon { background: rgba(255, 138, 128, 0.16); color: #ff8a80; }
@media (max-width: 640px) { .survey-required { flex-wrap: wrap; } .survey-required-btn { width: 100%; } }





/* ===== Bottom navigation of the student pages (phone) ===== */
.bottom-nav { display: none; }
@media (max-width: 768px) {
    .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; display: flex; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: #ffffff; border-top: 1px solid #dfe7e1; box-shadow: 0 -4px 16px rgba(10, 60, 30, 0.08); }
    .bn-item { flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; color: #3d4f44; text-decoration: none; font-size: 11.5px; font-weight: 600; }
    .bn-item .bn-icon { position: relative; font-size: 20px; line-height: 1; }
    .bn-item.is-current { color: var(--primary-green, #1b5e20); background: #eaf3ec; }
    .bn-item:focus-visible { outline: 3px solid rgba(27, 94, 32, 0.4); outline-offset: -2px; }
    .bn-badge { position: absolute; top: -6px; right: -12px; min-width: 17px; padding: 0 5px; border-radius: 9px; background: #c62828; color: #fff; font-size: 10px; line-height: 17px; text-align: center; font-style: normal; }
    body:has(.bottom-nav) .main-content { padding-bottom: 86px; }
    :root[data-theme="dark"] .bottom-nav { background: #14201a; border-top-color: rgba(255, 255, 255, 0.12); }
    :root[data-theme="dark"] .bn-item { color: #b9c7be; }
    :root[data-theme="dark"] .bn-item.is-current { color: #3ee79a; background: rgba(62, 231, 154, 0.12); }
}


/* ===== My Notices: groups and the New tag ===== */
.notice-group { margin: 18px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #3d4f44; }
.notice-group:first-of-type { margin-top: 4px; }
.notice-card.is-new { border-left: 4px solid var(--primary-green, #1b5e20); }
:root[data-theme="dark"] .notice-group { color: #b9c7be; }

.ai-ask-office { display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--primary-green, #1b5e20); text-decoration: underline; text-underline-offset: 3px; }
.ai-ask-office:focus-visible { outline: 3px solid rgba(27, 94, 32, 0.4); outline-offset: 2px; }
:root[data-theme="dark"] .ai-ask-office { color: #3ee79a; }




/* ===== Empty states: one sentence and one thing to do ===== */
.empty-state .empty-text { margin: 10px 0 4px; font-size: 15px; font-weight: 700; color: #14231a; }
.empty-state .empty-subtext { max-width: 420px; margin: 0 auto 14px; font-size: 13px; color: #3d4f44; line-height: 1.5; }
.empty-action { min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--primary-green, #1b5e20); color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .empty-action:hover { background: #14471a; } }
.empty-action:focus-visible { outline: 3px solid rgba(27, 94, 32, 0.4); outline-offset: 2px; }
:root[data-theme="dark"] .empty-state .empty-text { color: #f1f5f2; }
:root[data-theme="dark"] .empty-state .empty-subtext { color: #b9c7be; }

/* Native dropdowns (select / datalist options) are drawn by the browser: with a light text color and a transparent option
   background they showed light text on a white list in dark mode (the Case Type list could not be read). Give them a real dark
   surface and ask the browser for its dark form controls. */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="dark"] select,
:root[data-theme="dark"] select option,
:root[data-theme="dark"] select optgroup { background-color: #1a241e; color: #e9ece9; }
:root[data-theme="dark"] select option:disabled { color: #77897b; }
:root[data-theme="dark"] select option:checked { background-color: #1f3a2c; color: #ffffff; }
:root[data-theme="dark"] .next-step-btn { background: #3ee79a; color: #04200c; }
@media (hover: hover) and (pointer: fine) { :root[data-theme="dark"] .next-step-btn:hover { background: #6af0b4; } }

/* The landing page stays light in dark mode (see above): its chat box input and the options of its dropdowns too. */
:root[data-theme="dark"] .sas-landing-page input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] .sas-landing-page textarea,
:root[data-theme="dark"] .sas-landing-page select {
    background-color: #ffffff !important; color: #333333 !important; color-scheme: light;
}
:root[data-theme="dark"] .sas-landing-page select option,
:root[data-theme="dark"] #authModal select option,
:root[data-theme="dark"] #otpModal select option,
:root[data-theme="dark"] #forgotPasswordModal select option,
:root[data-theme="dark"] #customAlertModal select option { background-color: #ffffff; color: #333333; }
:root[data-theme="dark"] .empty-action { background: #3ee79a; color: #04200c; }

/* Buttons and chips that are "primary green with white text" in light mode: in dark mode the primary green is a light mint, so
   white text on it could not be read. One dark rule for all of them: dark text on the mint. */
:root[data-theme="dark"] .ai-report-btn,
:root[data-theme="dark"] .ins-toggle[aria-expanded="true"],
:root[data-theme="dark"] .ins-tab.on,
:root[data-theme="dark"] .cy-n,
:root[data-theme="dark"] .survey-required-btn,
:root[data-theme="dark"] .ai-retry-btn,
:root[data-theme="dark"] .sig-btn-primary,
:root[data-theme="dark"] .action-tab-btn.active,
:root[data-theme="dark"] .btn-green:not(.btn-gradient) { background: #3ee79a; color: #04200c; }

/* Dark mode: the dashboard greys that were fixed dark-green-on-dark (about 2:1) now use the soft night ink. */
:root[data-theme="dark"] .report-row > span:nth-child(2),
:root[data-theme="dark"] .next-step-text span,
:root[data-theme="dark"] .stats-v2 .stat-card .card-title,
:root[data-theme="dark"] .stats-v2 .stat-hint-plain { color: #b9c7be; }

/* Things that open something when pressed but are not links or buttons (case rows, the bell, the avatar): reachable and visible with the keyboard. */
[data-kb="1"]:focus-visible { outline: 3px solid rgba(10, 95, 37, 0.55); outline-offset: 2px; border-radius: 12px; }
:root[data-theme="dark"] [data-kb="1"]:focus-visible { outline-color: rgba(62, 231, 154, 0.7); }

/* "Submit a Case" while a survey is pending: the form is shown but locked, with the reason on top. */
.survey-gate { display: flex; gap: 12px; align-items: flex-start; text-align: left; margin: 0 0 18px; padding: 14px 16px; border-radius: 14px; border: 1px solid #e6d9a8; background: #fbf6e3; color: #5a4300; }
.survey-gate strong { display: block; font-size: 14px; margin-bottom: 2px; }
.survey-gate span { font-size: 13px; line-height: 1.45; }
.survey-gate-btn { flex: none; align-self: center; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--primary-green, #0a5f25); color: #fff; font: 700 13px 'Montserrat', sans-serif; cursor: pointer; }
:root[data-theme="dark"] .survey-gate { background: rgba(212, 175, 55, 0.12); border-color: rgba(212, 175, 55, 0.35); color: #f1d874; }
:root[data-theme="dark"] .survey-gate-btn { background: #3ee79a; color: #04200c; }
.survey-gate-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.survey-gate-fs[disabled] { opacity: 0.55; }
@media (max-width: 520px) { .survey-gate { flex-direction: column; } .survey-gate-btn { align-self: stretch; } }

/* Dashboard tiles: a zero is not a warning. The offense number is red only when there is something on the record. */
:root:not([data-theme="dark"]) body:has(.sidebar) .stats-grid.stats-v2 .stat-card.stat-offense.is-zero .huge-number, body .stats-v2 .stat-card.stat-offense.is-zero .huge-number { color: #222222; }
:root[data-theme="dark"] body .stats-v2 .stat-card.stat-offense.is-zero .huge-number { color: #f1f5f2; }

/* ===== Readable and tappable on a phone (every logged-in page) =====
   Nothing a person has to read is under 12px; buttons, the burger, the bell, the theme toggle and the avatar are at least 44px; and form
   fields are 16px on a phone so iOS does not zoom the page when one is focused. */
.sidebar-section-title, .status-pill, .bn-label, .report-row small, .data-table small, .stat-hint, .hs-label { font-size: max(12px, 1em); }
.sidebar-section-title, .status-pill, .bn-label { font-size: 12px; }
.report-row small, .data-table small { font-size: 12px; }
@media (max-width: 900px), (pointer: coarse) {
    body:has(.sidebar) .toggle-btn, body:has(.sidebar) .theme-toggle-btn, body:has(.sidebar) .notification-bell, body:has(.sidebar) .profile-avatar,
    body:has(.sidebar) .close-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    body:has(.sidebar) .btn, body:has(.sidebar) a.btn, body:has(.sidebar) button.btn, .sidebar-footer-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    body:has(.sidebar) input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), body:has(.sidebar) select, body:has(.sidebar) textarea { font-size: 16px; }
}
body:has(.sidebar) small:not([style*="font-size"]) { font-size: 12px; }

/* Phones: the four dashboard tiles sit two by two and drop the "View ..." hint (the whole tile is the link), so the cases below come into view sooner. */
@media (max-width: 480px) {
    .stats-grid.stats-v2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stats-v2 .stat-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
    .stats-v2 .stat-card .stat-hint:not(.stat-hint-plain) { display: none; }
    .stats-v2 .stat-card .card-title { font-size: 12px; letter-spacing: .3px; }
}

/* Staff dashboards on a phone: their small action buttons and the profile picture link are 44px too, and their text 12px. */
@media (max-width: 900px), (pointer: coarse) {
    body:has(.sidebar) .btn-action, body:has(.sidebar) a.logout-trigger, body:has(.sidebar) a.profile-pic { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
    body:has(.sidebar) .btn-action { font-size: 12px !important; }
    body:has(.sidebar) .data-table th { font-size: 12px; }
    body:has(.sidebar) .stat-trend-badge, body:has(.sidebar) .badge, body:has(.sidebar) #adminBellDot { font-size: 12px; }
}

/* ===== Feels installed on a phone (mobile-native) =====
   No grey flash on tap (every tappable thing has its own press state), no double-tap delay, a press state for buttons on touch, and hover
   looks only where a real mouse exists so nothing stays "hovered" after a tap. The page is never kept from zooming. */
html { -webkit-tap-highlight-color: transparent; }
a, button, [role="button"], label, select, summary, input[type="checkbox"], input[type="radio"] { touch-action: manipulation; }
button, .btn, .btn-action, [role="button"] { -webkit-user-select: none; user-select: none; }
@media (hover: none) {
    .btn:active, .btn-action:active, button:active { transform: scale(0.98); }
}
/* the top bar and the bottom nav clear the notch and the home indicator on phones that have them */
@supports (padding: max(0px)) {
    body:has(.sidebar) .main-content, body:has(.sidebar) .content-area { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
    .bottom-nav, .mobile-bottom-nav, nav.bottom-tabs { padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== Worst-case data (break-ui) =====
   A 60-letter name with no spaces, a long e-mail or a reference typed as one word must wrap or cut with "..." and never push the page
   sideways or spill out of its card. */
.welcome-header h2, .greeting-name, .welcome-text h1, .welcome-text h2 { overflow-wrap: anywhere; max-width: 100%; }
.report-row > span, .notice-response, .stat-body, .hs-latest-v, .case-title, .dropdown-item, .profile-name { overflow-wrap: anywhere; min-width: 0; }
/* table cells: break only a word that cannot fit, and never shrink a column to one letter */
.data-table td, .data-table th { overflow-wrap: break-word; }
.profile-container, .profile-pic { max-width: 100%; box-sizing: border-box; }

/* ===== Less motion, kept meaningful =====
   For people who asked their device for reduced motion: things that loop forever stop (the new-update pulse, shimmers), and entrances
   show the finished state at once instead of sliding. State changes (a hover, a focus ring, a toggle) still show, because they are
   feedback and not decoration. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .update-badge, [class*="pulse"], .sk, .skeleton { animation: none !important; }
    .data-table tbody tr, .report-row, .panel, .stat-card, .welcome-section, .welcome-header, .hero-snapshot, .counter-card, .modal-content, .modal-overlay {
        animation-duration: 0.01ms !important; animation-delay: 0s !important;
    }
}

/* table headers and trend badges of the dashboards: 12px, like the rest of the text */
body:has(.sidebar) th, .stat-trend-badge { font-size: 12px; }

/* ===== Polish: the student dashboard =====
   - the small gold bar before every panel title carried no meaning: gone;
   - cells wrap at spaces and slashes ("Inquiry/Assistance") and break a word only when it cannot fit. */
body:has(.welcome-section) .panel-title::before, body:has(.welcome-header .greeting-name) .panel-title::before { display: none; }
.report-row > span, .notice-response, .stat-body, .hs-latest-v, .case-title, .dropdown-item, .profile-name { overflow-wrap: break-word; }
.greeting-name, .welcome-header h2 { overflow-wrap: anywhere; }

/* ===== Polish: the pages after the dashboards (Cases, User Management, Activity Log) =====
   Dialogs open quicker and from a smaller starting scale (they are opened often); the count on the bell is readable; the small icon
   buttons, page numbers and links of the tables are 44px on a phone; and the last small inline texts are 12px. */
.modal .modal-content, .modal-overlay .modal-content { transition: transform 0.22s var(--ease-out-expo, ease-out), opacity 0.18s ease; }
.modal:not(.active) .modal-content, .modal-overlay:not(.active) .modal-content { transform: scale(0.96); }
.notification-dot.has-count, #adminBellDot.has-count { min-width: 20px; height: 20px; padding: 0 5px; font-size: 12px; border-radius: 10px; top: -10px; right: -12px; }
.role-badge, button.linked-toggle { font-size: 12px; }
body:has(.sidebar) span[style*="font-size: 9px"], body:has(.sidebar) span[style*="font-size:9px"], body:has(.sidebar) span[style*="font-size: 9.5px"], body:has(.sidebar) span[style*="font-size:9.5px"],
body:has(.sidebar) span[style*="font-size: 10px"], body:has(.sidebar) span[style*="font-size:10px"], body:has(.sidebar) span[style*="font-size: 10.5px"], body:has(.sidebar) span[style*="font-size:10.5px"],
body:has(.sidebar) span[style*="font-size: 11px"], body:has(.sidebar) span[style*="font-size:11px"], body:has(.sidebar) span[style*="font-size: 11.5px"], body:has(.sidebar) span[style*="font-size:11.5px"] { font-size: 12px !important; }
@media (max-width: 900px), (pointer: coarse) {
    body:has(.sidebar) .page-link, body:has(.sidebar) a.filter-select, body:has(.sidebar) button.linked-toggle, body:has(.sidebar) .profile-pic,
    body:has(.sidebar) .btn-view-user, body:has(.sidebar) .btn-edit-coord, body:has(.sidebar) .btn-toggle-account, body:has(.sidebar) .btn-edit-student-section, body:has(.sidebar) .btn-delete-coord,
    .sidebar a.logout-trigger, .sidebar-footer-link { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
}
body:has(.sidebar) button.linked-toggle { font-size: 12px !important; }
@media (max-width: 900px), (pointer: coarse) { .sidebar a, .sidebar-menu a { min-height: 44px; box-sizing: border-box; } }

/* The count on a bell sits on the top-right corner of the icon, not over it. */
.notification-container #adminBellDot.has-count, .notification-container .notification-dot.has-count, .notification-bell .notification-dot.has-count {
    top: -6px !important; right: -10px !important; left: auto !important;
}

/* the place dropdown looks like the other fields of a form in dark mode (it sat darker than its neighbours) */
:root[data-theme="dark"] select.loc-choice, :root[data-theme="dark"] input.loc-other { background-color: rgba(255, 255, 255, 0.06) !important; border-color: rgba(255, 255, 255, 0.14) !important; color: #e9ece9 !important; }

/* Admin dashboard: the five figures sit on one line. The cards used to center their content, so a card with a longer title or a badge on a second row pushed its number lower than its neighbours. Now the header has the same minimum height in every card and the number comes right after it. */
.stats-row .stat-card { justify-content: flex-start; }
.stats-row .stat-card > .stat-header { min-height: 114px; align-content: flex-start; margin-bottom: 8px; }
.stats-row .stat-card > .stat-number { margin-top: 0; }
.stats-row .stat-card > div[style*="align-items: baseline"] { margin-top: 0 !important; }
@media (max-width: 760px) { .stats-row .stat-card > .stat-header { min-height: 0; } }

/* The survey gate wraps the case form in a fieldset: it keeps the spacing of the form between the fields and the button */
.survey-gate-fs { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--modal-field-gap, 16px); }
.survey-gate-fs > .form-row { margin-bottom: 0; }


/* ===== "File for a student": a case typed in by the SAS Office or the School coordinator for a student who came in person ===== */
.wi-overlay { position: fixed; inset: 0; z-index: 1200; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(8, 24, 14, 0.5); backdrop-filter: blur(3px); }
.wi-overlay.active { display: flex; }
.wi-card { position: relative; width: min(600px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px 28px 22px; border-radius: 20px; text-align: left; background: var(--white, #fff); color: var(--text-dark, #222); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3); }
.wi-card h3 { margin: 0 0 4px; font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 700; color: var(--primary-green, #0a5f25); }
.wi-sub { margin: 0 0 18px; font-size: 12.5px; line-height: 1.55; color: var(--text-gray, #666); }
.wi-close { position: absolute; top: 14px; right: 18px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--text-gray, #777); cursor: pointer; }
.wi-field { margin-bottom: 14px; }
.wi-field[hidden], .wi-row[hidden], .wi-results[hidden], .wi-chip[hidden], .wi-error[hidden] { display: none; }
.wi-field label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--text-gray, #555); }
.wi-req { color: #dc3545; }
.wi-field input[type="text"], .wi-field input[type="date"], .wi-field select, .wi-field textarea { width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: 8px; border: 1px solid rgba(127, 127, 127, 0.4); background: var(--white, #fff); color: var(--text-dark, #222); font-family: 'Montserrat', sans-serif; font-size: 14px; }
.wi-field textarea { resize: vertical; }
.wi-field input:focus, .wi-field select:focus, .wi-field textarea:focus { outline: 2px solid var(--primary-green, #0a5f25); outline-offset: 1px; }
.wi-row { display: flex; gap: 14px; }
.wi-row > .wi-field { flex: 1; min-width: 0; }
.wi-hint { margin: 5px 0 0; font-size: 11.5px; color: var(--text-muted, #888); }
.wi-results { position: absolute; left: 0; right: 0; top: 66px; z-index: 5; max-height: 220px; overflow-y: auto; border-radius: 10px; border: 1px solid rgba(127, 127, 127, 0.35); background: var(--white, #fff); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18); }
.wi-results button { display: block; width: 100%; padding: 9px 14px; border: 0; background: none; text-align: left; font: 13px 'Montserrat', sans-serif; color: var(--text-dark, #222); cursor: pointer; }
.wi-results button span { color: var(--text-muted, #888); font-size: 12px; }
@media (hover: hover) and (pointer: fine) { .wi-results button:hover { background: var(--light-green-bg, rgba(10, 95, 37, 0.1)); } }
.wi-none { padding: 12px 14px; font-size: 12.5px; color: var(--text-muted, #888); }
.wi-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; border-radius: 10px; background: var(--light-green-bg, rgba(10, 95, 37, 0.1)); font-size: 13px; }
.wi-chip button { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--text-gray, #666); cursor: pointer; }
.wi-error { margin: 4px 0 10px; padding: 9px 12px; border-radius: 8px; background: rgba(220, 53, 69, 0.12); color: #c62828; font-size: 12.5px; font-weight: 600; }
.wi-actions { display: flex; gap: 10px; margin-top: 6px; }
.wi-actions button { flex: 1; padding: 12px; border-radius: 30px; font: 700 13.5px 'Montserrat', sans-serif; cursor: pointer; }
.wi-cancel { border: 1px solid rgba(127, 127, 127, 0.45); background: transparent; color: var(--text-dark, #333); }
.wi-go { border: 0; background: var(--primary-green, #0a5f25); color: #fff; }
.wi-go:disabled { opacity: 0.6; cursor: default; }
.wi-toast { position: fixed; z-index: 1300; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: #0a5f25; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); }
.wi-toast.bad { background: #b02a2a; }
.wi-toast button { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
@media (max-width: 560px) { .wi-row { flex-direction: column; gap: 0; } .wi-card { padding: 22px 18px 18px; } }

/* ===== Read and unread messages of a case (coordinator and SAS Office) ===== */
.msg-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: #0a5f25; color: #fff; font-size: 11px; font-weight: 800; vertical-align: middle; }
.msg-badge i { font-size: 10px; }
.case-msg.is-new { border-left: 4px solid #f39c12; }
.case-msg-new { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #f39c12; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; }
.msg-new-divider { display: flex; align-items: center; gap: 10px; margin: 6px 0; color: #c47f0a; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.msg-new-divider::before, .msg-new-divider::after { content: ''; flex: 1; border-top: 2px dotted #f39c12; }
