/* ═══════════════════════════════════════════════════════════
   DayReady — Design System
   Substitute Teacher Command Center for K-12 Districts

   ── Canonical breakpoints (use these in new code) ───────────
     Desktop  → no media query (default)
     Tablet   → @media (max-width: 768px)   ← sidebar collapses to drawer here
     Phone    → @media (max-width: 480px)
     Compact  → @media (max-width: 360px)   (iPhone SE width — only when
                                              a 480px layout still cramps)

   Hover-only styles MUST be wrapped:
     @media (hover: hover) { .x:hover { ... } }
   This skips touch devices, where :hover sticks after a tap.

   Existing CSS predates this convention and uses 540/600/640/700/720/
   900/991/1024/1100 in places. Do NOT mass-rewrite — too risky for
   visually-tuned pages (find-subs Gantt, classroom seating). New code
   should stick to the four canonical widths above.
   ═══════════════════════════════════════════════════════════ */

/* ─── Google Fonts ─────────────────────────────────────────── */
@import url('../vendor/fonts/gf-1.css');

/* ─── CSS Custom Properties ────────────────────────────────── */
:root {
    /* Primary — Warm Indigo */
    --primary: #5B4FC7;
    --primary-hover: #4A3FB0;
    --primary-light: #7B6FE0;
    --primary-bg: #F0EEFA;
    --primary-rgb: 91, 79, 199;

    /* Accent — Sunrise Amber (fills, gradients, borders) */
    --accent: #E8913A;
    --accent-hover: #D47E2A;
    --accent-bg: #FEF3E6;
    --accent-rgb: 232, 145, 58;
    /* Amber as TEXT on white: 2.46:1 fails WCAG AA — use this token for
       text/icons instead (5.1:1). Keep --accent for fills. (v2.67.0) */
    --accent-text: #A35510;   /* was #B45F12: 4.3:1 on card backgrounds; now 5.1:1 (v2.74.0) */

    /* Status Colors */
    --success: #2D9B5A;
    --success-bg: #EAFAF1;
    --warning: #8F5F00;      /* was #D4940A (2.6:1), then #A66F00 (4.3:1 measured); now 5.4:1 on white (v2.74.0) */
    --warning-bg: #FDF8E8;
    --danger: #D94452;
    --danger-bg: #FDE8EB;
    --info: #3B82F6;
    --info-bg: #EFF6FF;
    /* Status hues as TEXT on white / card backgrounds (v2.74.0, B5). The
       fills above stay for backgrounds, borders and icons; small text uses
       these (all >= 4.5:1 on #FFFFFF and #F8F6FF). */
    --success-text: #1F7A4D;
    --danger-text: #B42335;
    --info-text: #1D5FD1;

    /* Neutrals */
    --text-dark: #2D2B3D;
    --text-body: #3D3B50;
    --text-muted: #6B6980;
    --text-light: #68657D;   /* was #9E9BB5 (2.7:1), then #76738C (4.3:1 on card backgrounds); now >= 4.75:1 on every surface (v2.74.0) */
    --text-white: #FFFFFF;

    /* Backgrounds */
    --bg-body: linear-gradient(135deg, #3D2E8C 0%, #4A3BB0 25%, #5B4FC7 50%, #7B6FE0 75%, #9B91F0 100%);
    --bg-card: #F8F6FF;
    --bg-card-alt: #EEEAFC;
    --bg-subtle: #F0EFF5;
    --bg-sidebar: linear-gradient(180deg, #f8f6ff 0%, #f1eefb 50%, #e8e4f8 100%);
    --bg-sidebar-hover: rgba(91, 79, 199, 0.06);
    --bg-sidebar-active: rgba(91, 79, 199, 0.12);

    /* Borders */
    --border: #E4E2F0;
    --border-light: #EDECF4;
    --border-focus: var(--primary);

    /* Container */
    --container-padding: 1.5rem;
    --container-max-width: 95vw;
    --radius-container: 2rem;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(45, 43, 61, 0.04);
    --shadow-sm: 0 1px 3px rgba(45, 43, 61, 0.06), 0 1px 2px rgba(45, 43, 61, 0.04);
    --shadow-md: 0 4px 12px rgba(45, 43, 61, 0.08);
    --shadow-lg: 0 10px 30px rgba(45, 43, 61, 0.10);
    --shadow-xl: 0 20px 50px rgba(45, 43, 61, 0.14);

    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --container-max: 1400px;

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 0.25s;
    --duration-fast: 0.15s;
    --duration-slow: 0.4s;
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent iOS auto-scaling text in landscape orientation. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Kill the gray flash iOS Safari adds on tap so taps feel like clicks.
   Per-control focus rings still render via :focus-visible below. */
html, body {
    -webkit-tap-highlight-color: transparent;
}

/* Snappier taps + scroll on touch devices for everything that's clearly
   interactive. (Without `touch-action: manipulation`, iOS adds a 300ms
   double-tap-zoom delay on inline-block clickables.) */
button,
.btn,
a.btn,
.filter-pill,
.pill,
.nav-item,
.tab-item,
.accordion-header,
.role-switcher-btn,
.role-switcher-item,
.topbar-action-btn,
.mobile-menu-btn,
.quick-action,
.role-card,
.hub-card,
.offer-card,
.month-pill,
.cal-day,
.jobs-tab,
.jobs-week-btn,
.report-card,
.js-card,
.dr-detail-card {
    touch-action: manipulation;
}

/* HTML5-draggable elements: stop the browser from scrolling/zooming while
   the polyfill is mid-drag. The polyfill's tiny press-hold gate then has
   room to start a real drag without the page sliding under the finger. */
[draggable="true"] {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    background: linear-gradient(135deg, #3D2E8C 0%, #4A3BB0 25%, #5B4FC7 50%, #7B6FE0 75%, #9B91F0 100%);
    background-attachment: fixed;
    height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 991px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
}

/* ─── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

h1 { font-size: 1.875rem; font-weight: 700; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

p { margin-bottom: 0.75rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
}
a:hover { color: var(--primary-hover); }

small { font-size: 0.8125rem; color: var(--text-muted); }

/* ─── Utility Classes ──────────────────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent-text) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-dark { color: var(--text-dark) !important; }

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.font-heading { font-family: var(--font-heading); }

/* ─── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-header h3,
.card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-subtle);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration) var(--ease);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.stat-card .stat-value.text-success { color: var(--success) !important; }
.stat-card .stat-value.text-danger { color: var(--danger) !important; }
.stat-card .stat-value.text-accent { color: var(--accent-text) !important; }

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
    line-height: 1.4;
}

.btn i { font-size: 1.125rem; }

.btn-primary {
    background: var(--primary);
    color: var(--text-white);
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}

/* Amber buttons carry dark ink: white on Sunrise Amber is 2.5:1, the
   brand's own dark text on it is 7:1 (v2.74.0, B5). */
.btn-accent {
    background: var(--accent);
    color: var(--text-dark);
}
.btn-accent:hover {
    background: #F09C48;   /* lighter on hover keeps dark ink >= 4.5:1 */
    color: var(--text-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.35);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    background-size: 200% 200%;
    color: var(--text-white);
    animation: gradientShift 4s ease infinite;
}
.btn-gradient:hover {
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-body);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.btn-outline-primary {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--text-white);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
}
.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text-dark);
}

.btn-sm {
    font-size: 0.8125rem;
    padding: 0.4375rem 0.875rem;
}

.btn-lg {
    font-size: 1rem;
    padding: 0.8125rem 1.75rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ─── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    line-height: 1.4;
    white-space: nowrap;
}

.badge-primary   { background: var(--primary-bg); color: var(--primary); }
.badge-accent    { background: var(--accent-bg);  color: var(--accent-text); }
.badge-success   { background: var(--success-bg); color: var(--success); }
.badge-warning   { background: var(--warning-bg); color: var(--warning); }
.badge-danger    { background: var(--danger-bg);  color: var(--danger); }
.badge-info      { background: var(--info-bg);    color: var(--info); }
.badge-muted     { background: var(--bg-subtle);  color: var(--text-muted); }

/* Solid badges */
.badge-solid-success { background: var(--success); color: white; }
.badge-solid-danger  { background: var(--danger);  color: white; }
.badge-solid-primary { background: var(--primary); color: white; }
.badge-solid-accent  { background: var(--accent);  color: white; }

/* ─── Filter Pills (Evaluatd Pattern) ──────────────────────── */
.stats-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stats-filter-bar .filter-bar-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    white-space: nowrap;
}

.filter-pills {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #f8f6ff 0%, var(--border) 100%);
    color: var(--text-muted);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.filter-pill:hover {
    border-color: var(--text-muted);
    background: linear-gradient(135deg, #f8f6ff 0%, #d8d5e8 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.filter-pill:focus:not(:focus-visible) { outline: none; }

.filter-pill .pill-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.filter-pill.active .pill-icon { opacity: 1; }

.filter-pill .pill-count {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--border);
    color: var(--text-body);   /* text-muted was 4.15:1 on the pill (v2.74.0) */
    min-width: 1.5rem;
    text-align: center;
}

.filter-pill.active .pill-count {
    /* Solid chip: white text on a translucent overlay measured 3.9:1 (v2.74.0). */
    background: #fff;
    color: var(--primary-hover);
}

/* Active pill — primary indigo */
.filter-pill.active {
    color: var(--primary-hover);
    background: linear-gradient(135deg, var(--primary-bg) 0%, #c4bef0 100%);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

/* Legacy .pill class (maps to filter-pill) */
.pill-group {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #f8f6ff 0%, var(--border) 100%);
    color: var(--text-muted);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.pill:hover {
    border-color: var(--text-muted);
    background: linear-gradient(135deg, #f8f6ff 0%, #d8d5e8 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.pill.active {
    color: var(--primary-hover);
    background: linear-gradient(135deg, var(--primary-bg) 0%, #c4bef0 100%);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.25);
}

/* ─── Breadcrumb Stepper (Evaluatd Pattern) ────────────────── */
.breadcrumb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.breadcrumb-row .breadcrumb-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Make the primary CTA in the breadcrumb row visually prominent. */
.breadcrumb-row .breadcrumb-actions .btn-cta {
    font-size: 0.9375rem;
    font-weight: 700;
    padding: 0.75rem 1.375rem;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 55%, var(--accent) 100%);
    background-size: 200% 200%;
    background-position: 0% 50%;
    color: var(--text-white);
    border-radius: var(--radius-md);
    box-shadow:
        0 6px 18px rgba(var(--primary-rgb), 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform var(--duration) var(--ease),
                box-shadow var(--duration) var(--ease),
                background-position 600ms var(--ease);
}
.breadcrumb-row .breadcrumb-actions .btn-cta:hover {
    color: var(--text-white);
    transform: translateY(-1px);
    background-position: 100% 50%;
    box-shadow:
        0 10px 24px rgba(var(--primary-rgb), 0.38),
        0 4px 10px rgba(var(--accent-rgb), 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.breadcrumb-row .breadcrumb-actions .btn-cta:active {
    transform: translateY(0);
}
.breadcrumb-row .breadcrumb-actions .btn-cta i {
    font-size: 1.25rem;
}

.breadcrumb-stepper {
    display: inline-flex;
    align-items: stretch;
    background: var(--border);
    padding: 6px;
    border-radius: 8px;
}

/* Standalone (non-row) usage retains the prior trailing space. */
.breadcrumb-stepper:not(.breadcrumb-row .breadcrumb-stepper) {
    margin-bottom: 1.5rem;
}

.breadcrumb-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 8px 12px;
    position: relative;
    height: 38px;
    box-sizing: border-box;
}

.breadcrumb-step::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 19px solid transparent;
    border-bottom: 19px solid transparent;
    border-left: 10px solid white;
    z-index: 2;
}

.breadcrumb-step::before {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 19px solid transparent;
    border-bottom: 19px solid transparent;
    border-left: 10px solid var(--border);
    z-index: 1;
}

.breadcrumb-step:first-child {
    border-radius: 4px 0 0 4px;
    padding-left: 14px;
}

.breadcrumb-step:not(:first-child) {
    padding-left: 20px;
}

.breadcrumb-step:last-child {
    border-radius: 0 4px 4px 0;
    padding-right: 14px;
}

.breadcrumb-step:last-child::after,
.breadcrumb-step:last-child::before {
    display: none;
}

.breadcrumb-step:first-child:last-child {
    border-radius: 4px;
    padding-left: 14px;
}

.breadcrumb-step .step-number {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--text-light);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.breadcrumb-step .step-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

a.step-label:hover {
    color: var(--primary);
}

.breadcrumb-step.active {
    background: var(--primary);
}

.breadcrumb-step.active::after {
    border-left-color: var(--primary);
}

.breadcrumb-step.active .step-number {
    background: white;
    border-color: white;
    color: var(--primary);
}

.breadcrumb-step.active .step-label {
    color: white;
    font-weight: 600;
}

@media (max-width: 576px) {
    .breadcrumb-stepper {
        flex-wrap: wrap;
    }
    .filter-pill {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* ─── Form Elements ────────────────────────────────────────── */
.form-group {
    display: block;
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.375rem;
}

.form-control {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    width: 100%;
    padding: 0.6875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-body);
    transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B6980' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    font-size: 0.9375rem;
    cursor: pointer;
}

/* ─── iOS-style toggle (.dr-toggle) — canonical ───────────────
   Green slider with "ON" label when checked, red with "OFF" when
   unchecked. Used everywhere a boolean is flipped (settings page,
   coverage policies, absence-create form, etc.). 64x32 to fit the
   text label beside the thumb; thumb travel is 32px. */
.dr-toggle {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 32px;
    flex-shrink: 0;
}
.dr-toggle input {
    position: absolute;
    opacity: 0; width: 100%; height: 100%; margin: 0;
    cursor: pointer; z-index: 1;
}
.dr-toggle input[disabled] { cursor: not-allowed; }
.dr-toggle-slider {
    position: absolute; inset: 0;
    background: var(--danger, #DC2626);
    border-radius: 999px;
    transition: background 0.2s ease;
}
.dr-toggle-slider::before {
    content: ''; position: absolute;
    height: 28px; width: 28px;
    left: 2px; top: 2px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease;
    z-index: 2;
}
.dr-toggle-slider::after {
    content: 'OFF';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #fff;
    pointer-events: none;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}
.dr-toggle input:checked + .dr-toggle-slider { background: var(--success, #16A34A); }
.dr-toggle input:checked + .dr-toggle-slider::before { transform: translateX(32px); }
.dr-toggle input:checked + .dr-toggle-slider::after {
    content: 'ON';
    right: auto;
    left: 10px;
}
.dr-toggle input:disabled + .dr-toggle-slider { opacity: 0.55; }
.dr-toggle input:focus-visible + .dr-toggle-slider {
    outline: 2px solid var(--primary, #5B4FC7);
    outline-offset: 2px;
}

/* ─── Tables ───────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    white-space: nowrap;
}

td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9375rem;
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr:hover td {
    background: rgba(var(--primary-rgb), 0.02);
}

/* ─── Avatars ──────────────────────────────────────────────── */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-white);
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.125rem; }
.avatar-xl { width: 68px; height: 68px; font-size: 1.375rem; }

.avatar-primary   { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
.avatar-accent    { background: linear-gradient(135deg, var(--accent), #F0A860); }
.avatar-success   { background: linear-gradient(135deg, var(--success), #45B978); }
.avatar-danger    { background: linear-gradient(135deg, var(--danger), #E86B76); }
.avatar-info      { background: linear-gradient(135deg, var(--info), #60A5FA); }

/* ─── Empty States ─────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h4 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* ─── Tabs ─────────────────────────────────────────────────── */
.nav-tabs-custom {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

.nav-tabs-custom .tab-item {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.nav-tabs-custom .tab-item:hover {
    color: var(--text-dark);
}

.nav-tabs-custom .tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ─── Accordion ────────────────────────────────────────────── */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    background: var(--bg-card);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background var(--duration-fast) var(--ease);
}

.accordion-header:hover {
    background: var(--bg-subtle);
}

.accordion-header .accordion-icon {
    transition: transform var(--duration) var(--ease);
}

.accordion-header.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    padding: 0 1.25rem 1.25rem;
    display: none;
}

.accordion-body.open {
    display: block;
}

/* ─── Toasts ───────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-white);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--duration-slow) var(--ease-bounce);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { background: var(--success-text); }  /* white on --success was 3.4:1; --success-text is 5.4:1 (v2.77.0) */
.toast-danger  { background: var(--danger-text); }   /* white on --danger was 3.9:1; --danger-text is 5.9:1 (v2.77.0) */
.toast-info    { background: var(--primary); }
/* Undo action on a delete toast (v2.77.0, window.drUndoToast). */
.toast .toast-action { margin-left: 0.5rem; padding: 0.2rem 0.75rem; border: 1px solid rgba(255, 255, 255, 0.75); border-radius: var(--radius-full); background: transparent; color: var(--text-white); font: 600 0.82rem var(--font-body); cursor: pointer; }
.toast .toast-action:hover, .toast .toast-action:focus-visible { background: rgba(255, 255, 255, 0.18); outline: 2px solid #fff; outline-offset: 1px; }
.toast .toast-action:disabled { opacity: 0.6; cursor: wait; }

/* ─── Star Rating ──────────────────────────────────────────── */
.star-rating {
    display: inline-flex;
    gap: 0.25rem;
}

.star-rating .star {
    font-size: 1.375rem;
    color: var(--border);
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease-bounce);
}

.star-rating .star.active,
.star-rating .star.hovered {
    color: var(--accent-text);
}

.star-rating .star:hover {
    transform: scale(1.15);
}

/* Star rating display (non-interactive) */
.star-display {
    display: inline-flex;
    gap: 0.125rem;
}

.star-display .star {
    font-size: 0.875rem;
    color: var(--border);
}

.star-display .star.filled {
    color: var(--accent-text);
}

/* ─── Divider ──────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 1.5rem 0;
}

/* ─── Animations ───────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.05); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.animate-slide-up { animation: slideUp var(--duration-slow) var(--ease) both; }

/* Staggered entrance delays */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }

/* ─── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ─── Selection ────────────────────────────────────────────── */
::selection {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-hover);
}

/* ─── Touch & Focus States ─────────────────────────────────── */
/* Ensure all interactive elements have focus/active states for touch */
.btn:focus-visible,
.filter-pill:focus-visible,
.pill:focus-visible,
.nav-tabs-custom .tab-item:focus-visible,
.accordion-header:focus-visible,
.quick-action:focus-visible,
.role-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar-nav .nav-item:active,
.sidebar-footer .nav-item:active {
    background: var(--bg-sidebar-active);
    color: var(--primary);
}

.quick-action:active {
    transform: scale(0.98);
    border-color: var(--primary);
    background: var(--primary-bg);
}

.filter-pill:active,
.pill:active {
    transform: scale(0.97);
}

.accordion-header:active {
    background: var(--bg-subtle);
}

/* ─── Responsive Utilities ─────────────────────────────────── */
.hide-mobile { display: block; }
.show-mobile { display: none; }

/* ─── Tablet (768px) ───────────────────────────────────────── */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .card-body { padding: 1rem; }
    .card-header { padding: 0.875rem 1rem; }

    /* Touch-friendly form controls */
    .form-check input[type="checkbox"],
    .form-check input[type="radio"] {
        width: 22px;
        height: 22px;
    }

    .form-control {
        font-size: 1rem; /* Prevent iOS zoom on focus */
        padding: 0.75rem 1rem;
    }

    select.form-control {
        font-size: 1rem;
    }

    textarea.form-control {
        font-size: 1rem;
    }

    /* Apple's 44pt minimum touch target — applied to every interactive
       button/link on touch sizes, not just nav. */
    .btn,
    a.btn,
    .topbar-action-btn,
    .mobile-menu-btn,
    .role-switcher-btn,
    .item-remove,
    .add-item-btn,
    .picker-add-link,
    .dr-dashboard-reset {
        min-height: 44px;
    }

    .btn-sm { min-height: 40px; }

    /* Icon-only square buttons in topbar — give them a comfortable footprint. */
    .topbar-action-btn {
        width: 44px;
        height: 44px;
    }

    /* Larger touch targets for nav */
    .sidebar-nav .nav-item {
        padding: 0.75rem 1rem;
        min-height: 44px;
    }

    .sidebar-footer .nav-item {
        padding: 0.625rem 1rem;
        min-height: 44px;
    }

    /* Larger filter pills on touch */
    .filter-pill {
        padding: 0.5rem 0.875rem;
        min-height: 40px;
    }

    .pill {
        padding: 0.5rem 0.875rem;
        min-height: 40px;
    }

    /* The × icon-only remove button in editable lists is hostile to thumbs at
       the desktop-default size. Bump it on touch so the input still gets the
       lion's share of the row width. */
    .editable-list .item-remove {
        min-width: 36px;
        padding: 0.4rem 0.6rem;
    }

    /* Table responsive */
    th { padding: 0.625rem 0.75rem; font-size: 0.6875rem; }
    td { padding: 0.625rem 0.75rem; font-size: 0.875rem; }

    /* Breadcrumb wrap */
    .breadcrumb-stepper {
        flex-wrap: wrap;
        gap: 4px;
    }

    /* Tabs scroll horizontally on mobile */
    .nav-tabs-custom {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs-custom::-webkit-scrollbar { display: none; }

    .nav-tabs-custom .tab-item {
        min-height: 44px;
    }
}

/* ─── Small Phone (480px) ──────────────────────────────────── */
@media (max-width: 480px) {
    body { font-size: 0.9375rem; }

    .breadcrumb-stepper {
        padding: 4px;
    }

    .breadcrumb-step {
        padding: 6px 10px;
        height: 34px;
    }

    .breadcrumb-step:not(:first-child) {
        padding-left: 16px;
    }

    .breadcrumb-step .step-label {
        font-size: 0.75rem;
    }

    .breadcrumb-step::after {
        right: -8px;
        border-top-width: 17px;
        border-bottom-width: 17px;
        border-left-width: 8px;
    }

    .breadcrumb-step::before {
        right: -10px;
        border-top-width: 17px;
        border-bottom-width: 17px;
        border-left-width: 8px;
    }

    .filter-pill .pill-count {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* ─── DataTables — mobile responsive scroll ───────────────────────────────
   DataTables 1.13 doesn't ship the Responsive plugin in this app; instead
   we wrap any wide table in a horizontal-scroll container on small screens
   and add a fading-edge affordance so the user knows there's more to swipe.
   ----------------------------------------------------------------------- */
@media (max-width: 991px) {
    .dataTables_wrapper {
        position: relative;
    }
    .dataTables_wrapper > table.dataTable {
        /* Force the table to overflow rather than squish; horizontal scroll
           is the right pattern for wide grids on a phone. */
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .dataTables_wrapper > table.dataTable thead,
    .dataTables_wrapper > table.dataTable tbody,
    .dataTables_wrapper > table.dataTable tfoot {
        display: table;
        width: 100%;
        table-layout: auto;
    }
    /* Right-edge fade hint that more columns exist off-screen. */
    .dataTables_wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 24px;
        pointer-events: none;
        background: linear-gradient(to left, rgba(255,255,255,0.95), rgba(255,255,255,0));
        opacity: 0.85;
    }

    /* Length / search controls stack on top of each other on phones. */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        margin-bottom: 0.5rem;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        max-width: none;
        font-size: 1rem; /* prevent iOS zoom */
        margin-left: 0 !important;
    }
    .dataTables_wrapper .dataTables_length select {
        font-size: 1rem;
    }

    /* Buttons stack as a 2-up grid so they each get a real touch target. */
    .dataTables_wrapper .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .dataTables_wrapper .dt-buttons .btn {
        flex: 1 1 calc(50% - 0.25rem);
        min-height: 40px;
        justify-content: center;
    }

    /* Pagination — bigger tap targets on the page-number buttons. */
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-width: 40px;
        min-height: 40px;
        line-height: 1;
        padding: 0.5rem 0.75rem;
    }
}

/* Generic .table-responsive utility (Bootstrap-style) — also gets the
   fade affordance. Using `data-scroll-hint` lets pages opt-in cleanly. */
.table-responsive,
[data-scroll-hint] {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive::after,
[data-scroll-hint]::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 18px;
    pointer-events: none;
    background: linear-gradient(to left, rgba(255,255,255,0.95), rgba(255,255,255,0));
}

/* ─── Streamline colorful nav icons ──────────────────────── */
.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item:hover .nav-icon {
    transform: scale(1.1);
}
.nav-item.active .nav-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

/* ════════════════════════════════════════════════════════════════
   Staff avatar — see includes/avatar-helper.php
   Single component for every place we render a teacher / sub /
   admin's face. Image when photo_url is present; initials with a
   stable per-user color otherwise. NEVER applied to students.
   ════════════════════════════════════════════════════════════════ */
.dr-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: var(--size, 40px);
    height: var(--size, 40px);
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light, var(--primary)) 100%);
    color: white;
    font-family: var(--font-heading, var(--font-body));
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
    box-shadow: 0 1px 2px rgba(45, 43, 61, 0.06), inset 0 0 0 1px rgba(255,255,255,0.18);
}
.dr-avatar img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}
.dr-avatar-fallback {
    /* Initials are sized as a fraction of the circle so 24px and 64px
       both look right without a per-call font-size override. */
    font-size: calc(var(--size, 40px) * 0.42);
}
.dr-avatar.dr-avatar-initials {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--bg, var(--primary)) 90%, white 0%) 0%,
        color-mix(in srgb, var(--bg, var(--primary)) 70%, black 0%) 100%);
}
/* When the <img> errors, dr-avatar-broken is set by inline onerror.
   Hide the broken img so the initials behind it show through. */
.dr-avatar.dr-avatar-broken img { display: none; }

/* ════════════════════════════════════════════════════════════════
   Tom Select — `dr-searchable-people` mode
   ════════════════════════════════════════════════════════════════
   Renders an avatar + name + meta line (role · school) inside both
   the dropdown options and the selected item pill. Driven by
   data-photo / data-meta / data-initial-bg attributes on each
   <option>. Mirrors the .dr-avatar look so the picker stays visually
   consistent with the rest of the staff UI. */
.dr-ts-person {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
}
.dr-ts-person-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.dr-ts-person-name {
    font-family: var(--font-heading, var(--font-body));
    font-weight: 600;
    color: var(--text-dark, #1c1a30);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dr-ts-person-meta {
    font-size: 0.6875rem;
    color: var(--text-muted, #6B6980);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.02em;
}
.dr-ts-avatar {
    position: relative;
    flex-shrink: 0;
    width: var(--size, 28px);
    height: var(--size, 28px);
    border-radius: 50%;
    overflow: hidden;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover, var(--primary)) 100%);
    color: #fff;
    font-family: var(--font-heading, var(--font-body));
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(45, 43, 61, 0.06), inset 0 0 0 1px rgba(255,255,255,0.18);
}
.dr-ts-avatar img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}
.dr-ts-avatar-fallback {
    font-size: calc(var(--size, 28px) * 0.42);
}
.dr-ts-avatar.dr-ts-avatar-initials {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--bg, var(--primary)) 90%, white 0%) 0%,
        color-mix(in srgb, var(--bg, var(--primary)) 70%, black 0%) 100%);
}
.dr-ts-avatar.is-broken img { display: none; }

/* Tighten Tom Select's option/item padding when rendering people so the
   avatar circle has breathing room without towering over short option
   lists. The default option padding is ~8px which crops avatars. */
.dr-ts-dropdown-people .ts-dropdown .option {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light, #EDECF4);
}
.dr-ts-dropdown-people .ts-dropdown .option:last-child { border-bottom: 0; }
.dr-ts-dropdown-people .ts-dropdown .option.active {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--text-dark, #1c1a30);
}
.dr-ts-dropdown-people .ts-dropdown .option.selected .dr-ts-person-name {
    color: var(--primary);
}
.dr-ts-dropdown-people .ts-dropdown .optgroup-header {
    font-family: var(--font-heading, var(--font-body));
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted, #6B6980);
    padding: 0.5rem 0.75rem 0.25rem;
    background: linear-gradient(180deg, #FAFAFD 0%, #fff 100%);
    border-top: 1px solid var(--border-light, #EDECF4);
}
.dr-ts-dropdown-people .ts-dropdown .optgroup:first-child .optgroup-header {
    border-top: 0;
}

/* Selected item pill — make sure the avatar fits the pill height comfortably. */
.ts-wrapper.dr-searchable-people .ts-control > .item {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem 0.125rem 0.125rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--text-dark, #1c1a30);
}
.ts-wrapper.dr-searchable-people .ts-control > .item .dr-ts-person-meta {
    display: none; /* Selected pill stays compact: avatar + name only. */
}
.ts-wrapper.dr-searchable-people .ts-control > .item .dr-ts-person {
    gap: 0.375rem;
}

/* ── Topbar inbox bell badge (rendered on every authenticated page) ──── */
.topbar-action-btn { position: relative; }
.topbar-inbox-btn { text-decoration: none; }
.inbox-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #E8913A;
    color: #fff;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(232, 145, 58, 0.45);
    pointer-events: none;
    line-height: 1;
}

/* ─── Reduced motion (v2.67.0) ─────────────────────────────────────────
   Honoured globally: auth-card shapes, pulses, gauges, slide-ups and the
   gradient hover sweeps all collapse to instant transitions. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Button loading state for [data-loading] (csp-delegate.js). Moved from a
   JS-injected <style> that the strict style-src blocked (v2.74.0, B5). */
.btn-loading-state { pointer-events: none; cursor: wait; opacity: 0.9; }
.btn-loading-state .csp-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: csp-spin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
    opacity: 0.8;
}
@keyframes csp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-loading-state .csp-spinner { animation-duration: 2s; } }

/* Skip link (v2.74.0, B5): first stop in the tab order on every page,
   visible only when focused. */
.skip-link {
    position: absolute; left: 0.75rem; top: -3.5rem; z-index: 10000;
    padding: 0.6rem 1rem; border-radius: 0 0 10px 10px;
    background: #2D2B3D; color: #fff; font-weight: 600; font-size: 0.9rem;
    text-decoration: none; box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
    transition: top 0.15s ease;
}
.skip-link:focus, .skip-link:focus-visible { top: 0; outline: 3px solid #E8913A; outline-offset: 2px; color: #fff; }
#main:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }

/* Chart data tables (v2.76.0): every Highcharts chart gets a "View data as
   table" disclosure right under it (dayready-highcharts-theme.js). Native
   <details>, so it works by keyboard and with no page JS. */
.dr-chart-data { margin-top: 0.5rem; font-size: 0.8125rem; }
.dr-chart-data > summary {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.65rem 0.3rem 0.5rem; border-radius: 999px;
    color: var(--primary); background: transparent;
    border: 1px solid rgba(var(--primary-rgb), 0.22);
    font-weight: 600; font-size: 0.75rem; letter-spacing: 0.01em;
    cursor: pointer; list-style: none; user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.dr-chart-data > summary::-webkit-details-marker { display: none; }
.dr-chart-data > summary .bx { font-size: 0.95rem; }
.dr-chart-data > summary .dr-chart-data__chev { transition: transform 0.15s ease; }
.dr-chart-data[open] > summary .dr-chart-data__chev { transform: rotate(180deg); }
.dr-chart-data > summary:hover { background: var(--primary-bg); border-color: rgba(var(--primary-rgb), 0.4); }
.dr-chart-data > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dr-chart-data__scroll {
    margin-top: 0.5rem; max-height: 320px; overflow: auto;
    border: 1px solid rgba(var(--primary-rgb), 0.14); border-radius: 10px; background: #fff;
}
.dr-chart-data__scroll:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dr-chart-data__table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dr-chart-data__table caption {
    caption-side: top; text-align: left; padding: 0.55rem 0.75rem 0.35rem;
    font-family: var(--font-heading, 'Outfit', sans-serif); font-weight: 600; color: var(--text-dark);
}
.dr-chart-data__table th, .dr-chart-data__table td { padding: 0.4rem 0.75rem; border-top: 1px solid rgba(var(--primary-rgb), 0.08); text-align: right; white-space: nowrap; }
.dr-chart-data__table th:first-child, .dr-chart-data__table td:first-child { text-align: left; white-space: normal; }
.dr-chart-data__table thead th {
    position: sticky; top: 0; background: var(--bg-card-alt); color: var(--text-dark);
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
}
.dr-chart-data__table tbody th { font-weight: 500; color: var(--text-body); }
.dr-chart-data__table tbody tr:nth-child(even) { background: #FBFAFF; }
@media (prefers-reduced-motion: reduce) { .dr-chart-data > summary, .dr-chart-data > summary .dr-chart-data__chev { transition: none; } }
@media print { .dr-chart-data { display: none; } }
