/**
 * SpeedBath HR — core stylesheet, design "D" (gold band, warm neutrals)
 *
 * Every page loads this file. Views use the tokens below, so changing a
 * token here re-skins every page. Guide for page work:
 * docs/speedbath-web/D-THEME.md
 *
 * TOKENS                light      dark       use
 *   --band              #8C6D2C    #6E5523    gold band behind header + page title
 *   --accent            #8C6D2C    #CDAA5C    gold fills: primary button, active rail, current page
 *   --on-accent         #FFFFFF    #1E1D1A    text on --accent
 *   --gold-text         #6B5220    #E3C47D    gold text and links on cards
 *   --gold-tint         #F6EDDA    #3A2F17    gold tinted fills (active nav, avatars)
 *   --bg-body           #F1F0ED    #121315    page ground
 *   --bg-surface        #FFFFFF    #1C1D20    cards, rail, menus
 *   --bg-panel          #FAF9F7    #17181B    sidebar panel, card footers
 *   --input-bg          #F1F0ED    #26272B    input fill, soft buttons, tiles
 *   --border-color      #ECEAE5    #2C2E33    hairlines, table dividers
 *   --input-border      #DDD9D1    #3A3C42    input and outline-button borders
 *   --text-primary      #1E1D1A    #F3F1EB    text
 *   --text-secondary    #4E4A43    #C4C7CC    secondary text
 *   --text-muted        #66625B    #A9AEB6    muted labels (still >= 4.5:1 on cards)
 *   Status (tint / text): present #E2F4EA/#1F7A4B   late #FFEFD6/#8A4B00
 *     absent #FDE8E6/#B42318   leave #EEE6FB/#6B44B8   wfh #E3EEFF/#2A5DB0
 *     field #FFEBD9/#AD5019    half day #DFF3F2/#17716C   off #ECEAE5/#4E4A43
 *   Radius   card 24 (--radius-xl) · tile 18 (--radius-lg) · input 12 (--radius-md) · pill 999
 *   Shadow   card 0 4px 14px rgba(30,29,26,.05) · raised (overlaps band) 0 8px 24px rgba(30,29,26,.08)
 *   Font     Plus Jakarta Sans 400-700
 */

/* ============================================================
   DESIGN TOKENS — LIGHT
   ============================================================ */

:root {
    /* ---- Brand gold ---- */
    --band: #8C6D2C;               /* the gold band (header + page title area) */
    --on-band: #FFFFFF;            /* text on the band: 4.8:1 */
    --band-btn-text: #6B5220;      /* gold text on the white band button */
    --accent: #8C6D2C;             /* gold fills */
    --accent-hover: #6B5220;
    --on-accent: #FFFFFF;
    --gold-text: #6B5220;          /* gold text on white: 7.4:1 */
    --gold-text-hover: #4A3814;
    --gold-tint: #F6EDDA;
    --gold-faint: #FBF7EF;         /* row hover */
    --badge-alert: #C2410C;        /* count bubbles (notifications) */

    /* Gold scale. Legacy name, used by about 70 view rules.
       500 equals 600 on purpose: views use both for TEXT and for FILLS, and
       #8C6D2C is the lightest gold that reaches 4.5:1 both ways. */
    --primary-50:  #FBF7EF;
    --primary-100: #F6EDDA;
    --primary-200: #EDDCB5;
    --primary-300: #DFC58E;
    --primary-400: #CDAA5C;
    --primary-500: #8C6D2C;
    --primary-600: #8C6D2C;
    --primary-700: #6B5220;
    --primary-800: #4A3814;
    --primary-900: #33270E;

    /* ---- Warm neutrals (legacy name --gray-*) ---- */
    --gray-50:  #FAF9F7;
    --gray-100: #F1F0ED;
    --gray-200: #ECEAE5;
    --gray-300: #DDD9D1;
    --gray-400: #A8A39A;
    --gray-500: #66625B;
    --gray-600: #4E4A43;
    --gray-700: #3A3731;
    --gray-800: #2A2824;
    --gray-900: #1E1D1A;
    --gray-950: #121110;

    /* ---- Tones: tint (bg) + text (fg); every pair is >= 4.5:1 ---- */
    --tone-gold-bg:   #F6EDDA;  --tone-gold-fg:   #6B5220;
    --tone-green-bg:  #E2F4EA;  --tone-green-fg:  #1F7A4B;
    --tone-amber-bg:  #FFEFD6;  --tone-amber-fg:  #8A4B00;
    --tone-red-bg:    #FDE8E6;  --tone-red-fg:    #B42318;
    --tone-blue-bg:   #E3EEFF;  --tone-blue-fg:   #2A5DB0;
    --tone-purple-bg: #EEE6FB;  --tone-purple-fg: #6B44B8;
    --tone-teal-bg:   #DFF3F2;  --tone-teal-fg:   #17716C;
    --tone-orange-bg: #FFEBD9;  --tone-orange-fg: #AD5019;
    --tone-grey-bg:   #ECEAE5;  --tone-grey-fg:   #4E4A43;

    /* Status names -> tones (one colour per status on every screen) */
    --status-present-bg: var(--tone-green-bg);  --status-present-fg: var(--tone-green-fg);
    --status-late-bg:    var(--tone-amber-bg);  --status-late-fg:    var(--tone-amber-fg);
    --status-absent-bg:  var(--tone-red-bg);    --status-absent-fg:  var(--tone-red-fg);
    --status-leave-bg:   var(--tone-purple-bg); --status-leave-fg:   var(--tone-purple-fg);
    --status-wfh-bg:     var(--tone-blue-bg);   --status-wfh-fg:     var(--tone-blue-fg);
    --status-field-bg:   var(--tone-orange-bg); --status-field-fg:   var(--tone-orange-fg);
    --status-halfday-bg: var(--tone-teal-bg);   --status-halfday-fg: var(--tone-teal-fg);
    --status-off-bg:     var(--tone-grey-bg);   --status-off-fg:     var(--tone-grey-fg);

    /* Semantic scales (legacy names). -500/-600 are text-safe colours. */
    --success-50:  #E2F4EA;
    --success-100: #C8EBD7;
    --success-500: #1F7A4B;
    --success-600: #1F7A4B;
    --success-700: #17603A;
    --danger-50:   #FDE8E6;
    --danger-100:  #FAD3CE;
    --danger-200:  #F6C4BF;
    --danger-500:  #B42318;
    --danger-600:  #B42318;
    --danger-700:  #912018;
    --warning-50:  #FFEFD6;
    --warning-100: #FFE3B8;
    --warning-200: #FBD089;
    --warning-300: #F0B85C;
    --warning-400: #D9962E;
    --warning-500: #8A4B00;
    --warning-600: #8A4B00;
    --warning-700: #6E3C00;
    --info-50:     #E3EEFF;
    --info-200:    #C2D7F7;
    --info-500:    #2A5DB0;
    --info-600:    #2A5DB0;
    --info-700:    #214A8C;
    --purple-50:   #EEE6FB;
    --purple-500:  #6B44B8;
    --purple-600:  #6B44B8;
    --teal-50:     #DFF3F2;
    --teal-500:    #17716C;
    --orange-50:   #FFEBD9;
    --orange-500:  #AD5019;
    --pink-500:    #AD5019;   /* D has no pink: mapped to the orange "Field" tone */

    /* Button fills that keep white text >= 4.5:1 in both themes */
    --btn-success-bg: #1F7A4B;  --btn-success-hover: #17603A;
    --btn-danger-bg:  #B42318;  --btn-danger-hover:  #912018;
    --btn-warning-bg: #8A4B00;  --btn-warning-hover: #6E3C00;

    /* ---- Spacing ---- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* ---- Typography ---- */
    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-xs:   0.75rem;
    --font-sm:   0.8125rem;
    --font-base: 0.9375rem;
    --font-md:   1rem;
    --font-lg:   1.125rem;
    --font-xl:   1.25rem;
    --font-2xl:  1.5rem;
    --font-3xl:  1.875rem;
    --font-4xl:  2.25rem;

    /* ---- Radius ---- */
    --radius-sm:  8px;     /* nav links, small chips */
    --radius-md:  12px;    /* inputs */
    --radius-lg:  18px;    /* inner tiles, menus */
    --radius-xl:  24px;    /* cards, modals */
    --radius-2xl: 28px;
    --radius-full: 999px;  /* pills, round buttons */
    --radius: var(--radius-md);

    /* ---- Shadows ---- */
    --shadow-sm:  0 1px 2px rgba(30, 29, 26, 0.06);
    --shadow-md:  0 4px 14px rgba(30, 29, 26, 0.05);
    --shadow-lg:  0 8px 24px rgba(30, 29, 26, 0.08);
    --shadow-xl:  0 16px 40px rgba(30, 29, 26, 0.16);
    --shadow-card: var(--shadow-md);
    --shadow-raised: var(--shadow-lg);
    --shadow-band-btn: 0 2px 8px rgba(30, 29, 26, 0.12);

    /* ---- Layout ---- */
    --rail-width: 64px;
    --panel-width: 220px;
    --sidebar-width: 284px;              /* rail + panel */
    --sidebar-collapsed: 72px;           /* legacy, unused */
    --header-height: 64px;               /* legacy */
    --content-max-width: 1280px;
    --gutter: 32px;
    --band-skirt: 84px;                  /* gold below the band's last line */
    --band-overlap: 64px;                /* how far the first card rises into it */
    --touch: 44px;

    /* ---- Transitions ---- */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* ---- Surfaces and text ---- */
    --bg-body: #F1F0ED;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #FBF7EF;
    --bg-panel: #FAF9F7;
    --bg-sidebar: #FFFFFF;               /* the icon rail */
    --bg-sidebar-hover: #F1F0ED;
    --bg-sidebar-active: #F6EDDA;
    --text-primary: #1E1D1A;
    --text-secondary: #4E4A43;
    --text-muted: #66625B;
    --text-sidebar: #1E1D1A;
    --text-sidebar-active: #6B5220;
    --border-color: #ECEAE5;
    --border-color-light: #F1F0ED;
    --input-bg: #F1F0ED;
    --input-border: #DDD9D1;
    --focus-outline: #8C6D2C;
    --focus-ring: 0 0 0 3px rgba(140, 109, 44, 0.30);
    --overlay: rgba(30, 29, 26, 0.48);

    /* ---- Aliases that views use but the old file never defined ---- */
    --primary: var(--accent);
    --primary-light: var(--gold-tint);
    --primary-dark: var(--accent-hover);
    --secondary: var(--tone-purple-fg);
    --success: var(--tone-green-fg);
    --danger: var(--tone-red-fg);
    --warning: var(--tone-amber-fg);
    --bg-elevated: #FAF9F7;
    --bg-muted: #F1F0ED;
    --bg-card: var(--bg-surface);
    --card-bg: var(--bg-surface);
    --bg-hover: var(--bg-surface-hover);
    --bg-light: var(--bg-panel);
    --border: var(--border-color);
    --border-color-dark: var(--input-border);
    --text-body: var(--text-primary);
    --text-tertiary: var(--text-muted);

    /* Legacy --color-* names (dark.css, dashboard.css, worker.css, a few views) */
    --color-primary: var(--accent);
    --color-bg: var(--bg-body);
    --color-bg-secondary: var(--bg-panel);
    --color-bg-card: var(--bg-surface);
    --color-bg-hover: var(--bg-surface-hover);
    --color-bg-input: var(--input-bg);
    --color-bg-modal: var(--bg-surface);
    --color-bg-sidebar: var(--bg-sidebar);
    --color-bg-header: var(--band);
    --color-bg-dropdown: var(--bg-surface);
    --color-bg-tooltip: var(--text-primary);
    --color-bg-table-stripe: transparent;
    --color-bg-table-hover: var(--bg-surface-hover);
    --color-bg-code: var(--bg-muted);
    --color-bg-tag: var(--gold-tint);
    --color-surface-raised: var(--bg-surface);
    --color-text: var(--text-primary);
    --color-text-secondary: var(--text-secondary);
    --color-text-muted: var(--text-muted);
    --color-text-heading: var(--text-primary);
    --color-text-link: var(--gold-text);
    --color-text-inverse: var(--bg-surface);
    --color-border: var(--border-color);
    --color-border-light: var(--border-color-light);
    --color-border-input: var(--input-border);
    --color-border-focus: var(--accent);
    --color-shadow: rgba(30, 29, 26, 0.12);
    --color-overlay: var(--overlay);
}

/* ============================================================
   DESIGN TOKENS — DARK  ([data-theme="dark"] on <html>)
   Values follow the mobile app (lib/core/theme/app_colors.dart).
   ============================================================ */

[data-theme="dark"] {
    color-scheme: dark;

    --band: #6E5523;               /* white text on it: 7.0:1 */
    --on-band: #FFFFFF;
    --band-btn-text: #6B5220;
    --accent: #CDAA5C;             /* lighter gold fill, dark text on it */
    --accent-hover: #E3C47D;
    --on-accent: #1E1D1A;
    --gold-text: #E3C47D;
    --gold-text-hover: #F0D9A4;
    --gold-tint: #3A2F17;
    --gold-faint: #25221B;
    --focus-outline: #E3C47D;
    --focus-ring: 0 0 0 3px rgba(205, 170, 92, 0.40);
    --overlay: rgba(0, 0, 0, 0.62);

    --primary-50:  #25221B;
    --primary-100: #3A2F17;
    --primary-200: #4E3F1F;
    --primary-300: #6E5523;
    --primary-400: #A88844;
    --primary-500: #CDAA5C;
    --primary-600: #CDAA5C;
    --primary-700: #E3C47D;
    --primary-800: #EED9A6;
    --primary-900: #F6EBCF;

    /* neutral scale flips: 50 stays closest to the page */
    --gray-50:  #17181B;
    --gray-100: #26272B;
    --gray-200: #2C2E33;
    --gray-300: #3A3C42;
    --gray-400: #6B6F77;
    --gray-500: #A9AEB6;
    --gray-600: #C4C7CC;
    --gray-700: #DADCE0;
    --gray-800: #ECEDEF;
    --gray-900: #F3F1EB;
    --gray-950: #FFFFFF;

    --tone-gold-bg:   #3A2F17;  --tone-gold-fg:   #E3C47D;
    --tone-green-bg:  #18352A;  --tone-green-fg:  #7DDBA3;
    --tone-amber-bg:  #3A2D12;  --tone-amber-fg:  #F0C46C;
    --tone-red-bg:    #3B1A17;  --tone-red-fg:    #FF9B91;
    --tone-blue-bg:   #182A45;  --tone-blue-fg:   #9CC2FF;
    --tone-purple-bg: #2A2140;  --tone-purple-fg: #C9B3F5;
    --tone-teal-bg:   #12322F;  --tone-teal-fg:   #7FD8D1;
    --tone-orange-bg: #3A2416;  --tone-orange-fg: #FFB38A;
    --tone-grey-bg:   #2C2E33;  --tone-grey-fg:   #C4C7CC;

    --success-50:  #18352A;
    --success-100: #1F4535;
    --success-500: #7DDBA3;
    --success-600: #7DDBA3;
    --success-700: #A6E8C1;
    --danger-50:   #3B1A17;
    --danger-100:  #4D211D;
    --danger-200:  #6A2B25;
    --danger-500:  #FF9B91;
    --danger-600:  #FF9B91;
    --danger-700:  #FFC1BA;
    --warning-50:  #3A2D12;
    --warning-100: #4A3916;
    --warning-200: #5E481B;
    --warning-300: #8A6A27;
    --warning-400: #C99A3E;
    --warning-500: #F0C46C;
    --warning-600: #F0C46C;
    --warning-700: #F7DCA3;
    --info-50:     #182A45;
    --info-200:    #24406A;
    --info-500:    #9CC2FF;
    --info-600:    #9CC2FF;
    --info-700:    #C4DBFF;
    --purple-50:   #2A2140;
    --purple-500:  #C9B3F5;
    --purple-600:  #C9B3F5;
    --teal-50:     #12322F;
    --teal-500:    #7FD8D1;
    --orange-50:   #3A2416;
    --orange-500:  #FFB38A;
    --pink-500:    #FFB38A;

    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.40);
    --shadow-md:  0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-xl:  0 16px 40px rgba(0, 0, 0, 0.55);
    --shadow-band-btn: 0 2px 8px rgba(0, 0, 0, 0.30);

    --bg-body: #121315;
    --bg-surface: #1C1D20;
    --bg-surface-hover: #25221B;
    --bg-panel: #17181B;
    --bg-sidebar: #1C1D20;
    --bg-sidebar-hover: #26272B;
    --bg-sidebar-active: #3A2F17;
    --text-primary: #F3F1EB;
    --text-secondary: #C4C7CC;
    --text-muted: #A9AEB6;
    --text-sidebar: #F3F1EB;
    --text-sidebar-active: #E3C47D;
    --border-color: #2C2E33;
    --border-color-light: #26272B;
    --input-bg: #26272B;
    --input-border: #3A3C42;
    --bg-elevated: #26272B;
    --bg-muted: #26272B;
    --color-shadow: rgba(0, 0, 0, 0.5);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    line-height: 1.55;
    color: var(--text-primary);
    background-color: var(--bg-body);
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    letter-spacing: -0.01em;
}

a {
    color: var(--gold-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--gold-text-hover);
}

img {
    max-width: 100%;
    height: auto;
}

button, input, select, textarea, optgroup {
    font-family: inherit;
}

input[type="checkbox"],
input[type="radio"],
input[type="range"],
progress {
    accent-color: var(--accent);
}

::selection {
    background: var(--gold-tint);
    color: var(--text-primary);
}

/* Visible keyboard focus everywhere (white on the gold band, see BAND) */
:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10000;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--gold-text);
    font-weight: 700;
    transform: translateY(-160%);
}

/* The shadow only while it is shown: parked above the page, its 40px blur
   still reached into the top-left corner as a faint smudge (worst in dark). */
.skip-link:focus {
    transform: none;
    box-shadow: var(--shadow-xl);
}

/* ============================================================
   LAYOUT — SIDEBAR (icon rail + page panel)
   ============================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    display: flex;
    z-index: 100;
    background: var(--bg-panel);
    color: var(--text-sidebar);
}

/* --- Rail (64px): one button per menu group --- */
.sidebar-rail {
    flex: 0 0 var(--rail-width);
    width: var(--rail-width);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 0 20px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-rail::-webkit-scrollbar {
    display: none;
}

.sidebar-rail-brand {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: var(--gold-tint);
    color: var(--gold-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
}

.sidebar-rail-brand:hover {
    color: var(--gold-text);
}

.sidebar-rail-brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #FFFFFF;
    padding: 2px;
}

.sidebar-rail-item {
    position: relative;
    flex-shrink: 0;
    width: 60px;
    min-height: 52px;
    padding: 5px 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font: inherit;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
}

.sidebar-rail-icon {
    width: 40px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-rail-icon svg {
    width: 19px;
    height: 19px;
}

.sidebar-rail-label {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10.5px;
    line-height: 13px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-muted);
}

.sidebar-rail-item:hover {
    color: var(--text-primary);
}

.sidebar-rail-item:hover .sidebar-rail-icon {
    background: var(--bg-sidebar-hover);
}

.sidebar-rail-item[aria-pressed="true"] .sidebar-rail-icon {
    background: var(--accent);
    color: var(--on-accent);
}

.sidebar-rail-item[aria-pressed="true"] .sidebar-rail-label,
.sidebar-rail-item[aria-current="page"] .sidebar-rail-label {
    font-weight: 700;
    color: var(--gold-text);
}

.sidebar-rail-item[aria-current="page"] .sidebar-rail-icon {
    background: var(--gold-tint);
    color: var(--gold-text);
}

/* small dot when a closed group holds a pending-count badge */
.sidebar-rail-dot {
    position: absolute;
    top: 5px;
    right: 11px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--badge-alert);
    box-shadow: 0 0 0 2px var(--bg-sidebar);
}

/* --- Panel (220px): Pinned + the open group's links --- */
.sidebar-panel {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 18px 12px 6px 20px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gold-tint);
    color: var(--gold-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sidebar-brand-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-group[hidden] {
    display: none !important;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* .sidebar-link also appears inside page content (reports list), so the
   base rule works on any light surface. */
.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    font-weight: 600;
}

.sidebar-link.active::after {
    content: '';
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--accent);
}

/* active link with a count: badge on the right, the dot just after it */
.sidebar-link.active:has(.sidebar-badge)::after {
    margin-left: 0;
}

.sidebar-link-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* D panel lists are text only; the group icon lives on the rail */
.sidebar-panel .sidebar-link-icon {
    display: none;
}

.sidebar-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--gold-tint);
    color: var(--gold-text);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.sidebar-link.active .sidebar-badge {
    background: var(--bg-surface);
}

/* --- User block at the bottom of the panel --- */
.sidebar-footer {
    margin-top: auto;
    padding: 10px 12px 14px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 4px 6px;
    border-radius: var(--radius-md);
}

.sidebar-user .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-logout:hover {
    background: var(--tone-red-bg);
    color: var(--tone-red-fg);
}

.sidebar-close-btn {
    display: none;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-close-btn:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
}

/* ============================================================
   LAYOUT — CONTENT + GOLD BAND
   The band is the header row (.top-header). On pages that start with
   their own .page-header (or the dashboard .welcome-card) that block
   joins the band and the layout title is not printed (one title per page).
   app.php adds these classes to .main-content:
     .d-title-in-view   the view's first block is the band title
     .d-band-overlap    the first card rises 64px into the band
   ============================================================ */

.main-content {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--sidebar-width);
    overflow-x: clip;
    background: var(--bg-body);
}

.top-header {
    background: var(--band);
    color: var(--on-band);
    padding: 28px var(--gutter) 32px;
}

.top-header-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
}

.top-header-left {
    flex: 1 1 320px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.top-header-titles {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top-header-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.page-title {
    font-size: var(--font-2xl);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.top-header .page-title {
    font-size: 2rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--on-band);
    overflow-wrap: anywhere;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.breadcrumb a {
    color: inherit;
}

.breadcrumb a:hover {
    color: var(--gold-text);
}

.breadcrumb-sep {
    opacity: 0.7;
}

.top-header .breadcrumb,
.top-header .breadcrumb a,
.top-header .breadcrumb a:hover {
    color: var(--on-band);
}

.top-header .breadcrumb a {
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.55);
    text-underline-offset: 3px;
}

.top-header .breadcrumb a:hover {
    text-decoration-color: #FFFFFF;
}

/* Page content column, centred, same width as the band content */
.page-content {
    max-width: calc(var(--content-max-width) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 28px var(--gutter) 40px;
}

/* target of the skip link; no ring around the whole page */
.page-content:focus {
    outline: none;
}

/* --- Overlap: the first card rises into the band --- */
.d-band-overlap .top-header {
    padding-bottom: var(--band-skirt);
}

.d-band-overlap .page-content {
    margin-top: calc(-1 * var(--band-overlap));
    padding-top: 0;
}

.d-title-in-view .top-header {
    padding-bottom: 0;
}

.d-title-in-view .page-content {
    margin-top: 0;
    padding-top: 0;
}

/* --- The view's own title block, shown inside the band --- */
.d-title-in-view .page-content > .page-header,
.d-title-in-view .page-content > .welcome-card {
    position: static;
    margin: 0;
    padding: 20px 0 var(--band-skirt);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--on-band);
    background: var(--band);
    /* paints the gold edge to edge of the content column without moving layout */
    border-image: linear-gradient(var(--band), var(--band)) fill 0 / 0 / 0 100vmax;
}

/* the block right after it overlaps the band */
.d-title-in-view .page-content > .page-header + *,
.d-title-in-view .page-content > .welcome-card + *,
.d-title-in-view .page-content > .page-header + :is(style, script, link) + *,
.d-title-in-view .page-content > .welcome-card + :is(style, script, link) + * {
    margin-top: calc(-1 * var(--band-overlap));
}

/* --- Things that sit ON the band (header, view title block, or any
       element a page marks with .on-band) --- */
.top-header :focus-visible,
.on-band :focus-visible,
.d-title-in-view .page-content > .page-header :focus-visible,
.d-title-in-view .page-content > .welcome-card :focus-visible {
    outline-color: #FFFFFF;
}

.on-band,
.on-band :is(h1, h2, h3, p, small, .page-title, .page-subtitle, .text-muted, .text-secondary),
.d-title-in-view .page-content > .page-header :is(h1, h2, h3, p, small, .page-title, .page-subtitle, .text-muted, .text-secondary),
.d-title-in-view .page-content > .welcome-card :is(h1, h2, h3, p, small, .welcome-date) {
    color: var(--on-band);
}

.on-band :is(h1, .page-title),
.d-title-in-view .page-content > .page-header :is(h1, h2, .page-title),
.d-title-in-view .page-content > .welcome-card h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.d-title-in-view .page-content > .page-header .page-subtitle,
.d-title-in-view .page-content > .welcome-card p,
.on-band .page-subtitle {
    font-size: 15px;
    font-weight: 500;
    opacity: 1;
}

.on-band a:not(.btn):not(.band-pill),
.d-title-in-view .page-content > .page-header a:not(.btn):not(.band-pill) {
    color: var(--on-band);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Band buttons: white outline (secondary) or solid white with gold text
   (primary). Success / danger / warning keep their own fills. */
.top-header .btn:not(.btn-primary),
.on-band .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning),
.d-title-in-view .page-content > .page-header .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning) {
    min-height: var(--touch);
    background: transparent;
    color: var(--on-band);
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    box-shadow: none;
}

.top-header .btn:not(.btn-primary):hover,
.on-band .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):hover,
.d-title-in-view .page-content > .page-header .btn:not(.btn-primary):not(.btn-success):not(.btn-danger):not(.btn-warning):hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: #FFFFFF;
    color: var(--on-band);
}

.top-header .btn-primary,
.on-band .btn-primary,
.d-title-in-view .page-content > .page-header .btn-primary {
    min-height: var(--touch);
    background: #FFFFFF;
    color: var(--band-btn-text);
    border-color: transparent;
    font-weight: 700;
    box-shadow: var(--shadow-band-btn);
}

.top-header .btn-primary:hover,
.on-band .btn-primary:hover,
.d-title-in-view .page-content > .page-header .btn-primary:hover {
    background: #FBF7EF;
    color: #4A3814;
    border-color: transparent;
}

.top-header .btn-icon,
.on-band .btn-icon,
.d-title-in-view .page-content > .page-header .btn-icon {
    width: var(--touch);
    height: var(--touch);
    padding: 0;
    border-radius: 50%;
}

/* Pills on the band (D: employee status filter, Day / Month): outline when
   off, solid white with gold text when on. Links or buttons; mark the
   current one with .active, aria-pressed="true" or aria-current. */
.band-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-header > .band-pills {
    flex-basis: 100%;
}

.band-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: var(--touch);
    padding: 0 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--on-band);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.band-pill:has(.band-pill-count) {
    padding-right: 8px;
}

.band-pill:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--on-band);
}

.band-pill.active,
.band-pill[aria-pressed="true"],
.band-pill[aria-current] {
    background: #FFFFFF;
    border-color: transparent;
    color: var(--band-btn-text);
    font-weight: 700;
}

/* count bubble: darkens the gold, so white text stays above 4.5:1 */
.band-pill-count {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: var(--radius-full);
    background: rgba(30, 29, 26, 0.22);
    color: #FFFFFF;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.band-pill.active .band-pill-count,
.band-pill[aria-pressed="true"] .band-pill-count,
.band-pill[aria-current] .band-pill-count {
    background: var(--band);
}

.band-pill:focus-visible {
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
}

/* ============================================================
   PAGE HEADER (views) — light version when it is not in the band
   ============================================================ */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: var(--space-6);
}

.page-header > div:first-child {
    min-width: 0;
}

.page-subtitle {
    margin-top: 4px;
    font-size: 14.5px;
    color: var(--text-muted);
}

.page-actions,
.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--bg-surface);
    border: 0;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* the card that sits over the gold band gets the stronger shadow */
.d-band-overlap .page-content > .card:first-child,
.d-band-overlap .page-content > :first-child > .card:first-child,
.d-title-in-view .page-content > .page-header + .card {
    box-shadow: var(--shadow-raised);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.card-title {
    font-size: var(--font-lg);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-panel);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}

/* ============================================================
   STAT CARDS — tinted tiles like D's summary
   A stat card whose icon carries a colour class (.green, .red …) turns
   into a tinted tile of that tone; without one it stays a white tile.
   ============================================================ */

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 88px;
    padding: 16px 18px;
    background: var(--bg-surface);
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
}

.stat-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--tone-gold-bg);
    color: var(--tone-gold-fg);
}

.stat-icon.blue   { background: var(--tone-blue-bg);   color: var(--tone-blue-fg); }
.stat-icon.green  { background: var(--tone-green-bg);  color: var(--tone-green-fg); }
.stat-icon.red    { background: var(--tone-red-bg);    color: var(--tone-red-fg); }
.stat-icon.yellow { background: var(--tone-amber-bg);  color: var(--tone-amber-fg); }
.stat-icon.purple { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.stat-icon.gold   { background: var(--tone-gold-bg);   color: var(--tone-gold-fg); }
.stat-icon.teal   { background: var(--tone-teal-bg);   color: var(--tone-teal-fg); }
.stat-icon.orange { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.stat-icon.grey,
.stat-icon.gray   { background: var(--tone-grey-bg);   color: var(--tone-grey-fg); }

.stat-card:has(> .stat-icon.blue)   { --tile-bg: var(--tone-blue-bg);   --tile-fg: var(--tone-blue-fg); }
.stat-card:has(> .stat-icon.green)  { --tile-bg: var(--tone-green-bg);  --tile-fg: var(--tone-green-fg); }
.stat-card:has(> .stat-icon.red)    { --tile-bg: var(--tone-red-bg);    --tile-fg: var(--tone-red-fg); }
.stat-card:has(> .stat-icon.yellow) { --tile-bg: var(--tone-amber-bg);  --tile-fg: var(--tone-amber-fg); }
.stat-card:has(> .stat-icon.purple) { --tile-bg: var(--tone-purple-bg); --tile-fg: var(--tone-purple-fg); }
.stat-card:has(> .stat-icon.gold)   { --tile-bg: var(--tone-gold-bg);   --tile-fg: var(--tone-gold-fg); }
.stat-card:has(> .stat-icon.teal)   { --tile-bg: var(--tone-teal-bg);   --tile-fg: var(--tone-teal-fg); }
.stat-card:has(> .stat-icon.orange) { --tile-bg: var(--tone-orange-bg); --tile-fg: var(--tone-orange-fg); }

.stat-card:has(> .stat-icon:is(.blue, .green, .red, .yellow, .purple, .gold, .teal, .orange)) {
    background: var(--tile-bg);
    color: var(--tile-fg);
    box-shadow: none;
}

.stat-card:has(> .stat-icon:is(.blue, .green, .red, .yellow, .purple, .gold, .teal, .orange)) > .stat-icon {
    background: var(--bg-surface);
    color: var(--tile-fg);
}

.stat-card:has(> .stat-icon:is(.blue, .green, .red, .yellow, .purple, .gold, .teal, .orange)) :is(.stat-value, .stat-label, .stat-change) {
    color: var(--tile-fg);
}

.stat-info,
.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    margin-top: 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-change {
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-change.up   { color: var(--tone-green-fg); }
.stat-change.down { color: var(--tone-red-fg); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* D building blocks for page work: round tinted icon + tinted tile.
   Combine with a tone class: <span class="d-icon tone-green">…</span> */
.tone-gold   { --tone-bg: var(--tone-gold-bg);   --tone-fg: var(--tone-gold-fg); }
.tone-green  { --tone-bg: var(--tone-green-bg);  --tone-fg: var(--tone-green-fg); }
.tone-amber  { --tone-bg: var(--tone-amber-bg);  --tone-fg: var(--tone-amber-fg); }
.tone-red    { --tone-bg: var(--tone-red-bg);    --tone-fg: var(--tone-red-fg); }
.tone-blue   { --tone-bg: var(--tone-blue-bg);   --tone-fg: var(--tone-blue-fg); }
.tone-purple { --tone-bg: var(--tone-purple-bg); --tone-fg: var(--tone-purple-fg); }
.tone-teal   { --tone-bg: var(--tone-teal-bg);   --tone-fg: var(--tone-teal-fg); }
.tone-orange { --tone-bg: var(--tone-orange-bg); --tone-fg: var(--tone-orange-fg); }
.tone-grey   { --tone-bg: var(--tone-grey-bg);   --tone-fg: var(--tone-grey-fg); }

.d-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tone-bg, var(--gold-tint));
    color: var(--tone-fg, var(--gold-text));
}

.d-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 88px;
    padding: 14px 12px;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--tone-bg, var(--input-bg));
    color: var(--tone-fg, var(--text-primary));
    font: inherit;
    text-align: left;
}

.d-tile-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.d-tile-label {
    font-size: 13.5px;
    font-weight: 600;
}

/* ============================================================
   BUTTONS — pills, 44px tall
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--touch);
    padding: 0 20px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: var(--radius-full);
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.btn:disabled,
.btn[disabled],
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--on-accent);
}

.btn-success {
    background: var(--btn-success-bg);
    color: #FFFFFF;
}

.btn-success:hover {
    background: var(--btn-success-hover);
    color: #FFFFFF;
}

.btn-danger {
    background: var(--btn-danger-bg);
    color: #FFFFFF;
}

.btn-danger:hover {
    background: var(--btn-danger-hover);
    color: #FFFFFF;
}

.btn-warning {
    background: var(--btn-warning-bg);
    color: #FFFFFF;
}

.btn-warning:hover {
    background: var(--btn-warning-hover);
    color: #FFFFFF;
}

.btn-outline {
    background: var(--bg-surface);
    border-color: var(--input-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--gold-faint);
    border-color: var(--accent);
    color: var(--gold-text);
}

.btn-secondary {
    background: var(--input-bg);
    color: var(--gold-text);
}

.btn-secondary:hover {
    background: var(--gold-tint);
    color: var(--gold-text-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.btn-sm {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.btn-lg {
    min-height: 52px;
    padding: 0 28px;
    font-size: var(--font-base);
}

.btn-icon {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ============================================================
   FORMS — 44px fields, 12px radius, soft fill, gold focus ring
   ============================================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-label .required,
.required {
    color: var(--tone-red-fg);
}

.form-input,
.form-select,
.form-textarea,
.form-control {
    width: 100%;
    min-height: var(--touch);
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14.5px;
    line-height: 1.4;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-select,
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234E4A43' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
}

.form-select[multiple],
.form-select[size]:not([size="1"]),
select.form-control[multiple] {
    padding-right: 14px;
    background-image: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.form-control:hover {
    border-color: var(--gray-400);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-control:focus {
    outline: none;
    background-color: var(--bg-surface);
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.form-input::placeholder,
.form-textarea::placeholder,
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled,
.form-control:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.form-input[readonly],
.form-textarea[readonly],
.form-control[readonly] {
    background-color: var(--bg-panel);
}

.form-input[type="file"],
.form-control[type="file"] {
    padding: 8px 10px;
}

.form-input.error,
.form-select.error,
.form-control.is-invalid {
    border-color: var(--tone-red-fg);
}

.form-textarea,
textarea.form-control,
textarea.form-input {
    min-height: 96px;
    resize: vertical;
}

.form-hint {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.form-error {
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tone-red-fg);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.form-row > .form-group {
    flex: 1 1 200px;
    min-width: 0;
}

.form-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
}

/* ₹ prefix inside an input:  <div class="input-icon"><span class="input-icon-addon">₹</span><input class="form-input pl-8"> */
div.input-icon {
    position: relative;
}

.input-icon-addon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

.form-input.pl-8,
.pl-8 {
    padding-left: 2rem;
}

/* ============================================================
   TABLES — uppercase 12px headers, 15px rows, warm dividers
   ============================================================ */

.table-wrapper,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table,
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.data-table thead,
.table thead {
    background: transparent;
}

.data-table th,
.table th {
    height: 44px;
    padding: 0 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    vertical-align: middle;
    background: transparent;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.data-table td,
.table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr,
.table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover,
.table tbody tr:hover {
    background: var(--gold-faint);
}

.data-table tbody tr:last-child td,
.table tbody tr:last-child td {
    border-bottom: none;
}

/* tables that run edge to edge inside a card get D's 24px side inset */
.card > :is(.table-wrapper, .table-responsive) > :is(.data-table, .table) :is(th, td):first-child,
.card > :is(.data-table, .table) :is(th, td):first-child {
    padding-left: 24px;
}

.card > :is(.table-wrapper, .table-responsive) > :is(.data-table, .table) :is(th, td):last-child,
.card > :is(.data-table, .table) :is(th, td):last-child {
    padding-right: 24px;
}

.card > :is(.table-wrapper, .table-responsive):first-child > :is(.data-table, .table) thead th,
.card > :is(.data-table, .table):first-child thead th {
    border-top: 0;
}

/* ============================================================
   BADGES — pills in the D status tints
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.3;
    border-radius: var(--radius-full);
    white-space: nowrap;
    background: var(--tone-grey-bg);
    color: var(--tone-grey-fg);
}

.badge-success,
.badge-present,
.badge-green   { background: var(--tone-green-bg);  color: var(--tone-green-fg); }
.badge-warning,
.badge-late,
.badge-amber   { background: var(--tone-amber-bg);  color: var(--tone-amber-fg); }
.badge-danger,
.badge-absent,
.badge-red     { background: var(--tone-red-bg);    color: var(--tone-red-fg); }
.badge-info,
.badge-wfh,
.badge-blue    { background: var(--tone-blue-bg);   color: var(--tone-blue-fg); }
.badge-purple,
.badge-leave   { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }
.badge-field,
.badge-orange  { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.badge-halfday,
.badge-half-day,
.badge-teal    { background: var(--tone-teal-bg);   color: var(--tone-teal-fg); }
.badge-primary,
.badge-gold    { background: var(--tone-gold-bg);   color: var(--tone-gold-fg); }
.badge-gray,
.badge-grey,
.badge-secondary,
.badge-off,
.badge-holiday { background: var(--tone-grey-bg);   color: var(--tone-grey-fg); }

/* D's employee-status pill: white with a coloured dot.
   <span class="badge badge-dot tone-green">Active</span> */
.badge-dot {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding-left: 8px;
}

.badge-dot::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tone-fg, var(--text-muted));
}

/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--gold-tint);
    color: var(--gold-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 48px; height: 48px; font-size: var(--font-lg); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--font-xl); }

/* ============================================================
   GRID + UTILITIES (kept from the old file; a few the views expect added)
   ============================================================ */

.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .sm-flex-col { flex-direction: column; align-items: stretch; }
    .sm-w-full { width: 100%; justify-content: center; }
    .sm-grid-1 { grid-template-columns: minmax(0, 1fr); }
    .form-row-2 { grid-template-columns: minmax(0, 1fr); }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; min-width: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.m-0 { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.w-full { width: 100%; }
.whitespace-nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }

.text-xs { font-size: var(--font-xs); }
.text-sm { font-size: var(--font-sm); }
.text-base { font-size: var(--font-base); }
.text-lg { font-size: var(--font-lg); }
.text-xl { font-size: var(--font-xl); }
.text-2xl { font-size: var(--font-2xl); }
.text-3xl { font-size: var(--font-3xl); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--tone-green-fg); }
.text-danger { color: var(--tone-red-fg); }
.text-warning { color: var(--tone-amber-fg); }
.text-info { color: var(--tone-blue-fg); }
.text-gold { color: var(--gold-text); }
.text-center { text-align: center; }

/* ============================================================
   EMPTY STATES
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    background: var(--gold-tint);
    color: var(--gold-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    overflow: hidden;
}

.empty-state-icon svg {
    max-width: 30px;
    max-height: 30px;
}

.empty-state-title {
    margin-bottom: 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.empty-state p {
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================================
   HEADER CONTROLS (on the band)
   ============================================================ */

.sidebar-toggle {
    display: none;
    flex-shrink: 0;
    width: var(--touch);
    height: var(--touch);
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    background: transparent;
    color: var(--on-band);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}

.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: var(--radius-full);
    background: var(--badge-alert);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--band);
    pointer-events: none;
}

/* ============================================================
   USER DROPDOWN (header)
   ============================================================ */

.user-dropdown {
    position: relative;
}

.user-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--touch);
    padding: 4px 14px 4px 4px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-full);
    color: var(--on-band);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.user-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: #FFFFFF;
}

.user-dropdown-trigger .avatar {
    width: 34px;
    height: 34px;
    background: #FFFFFF;
    color: var(--band-btn-text);
}

.user-dropdown-trigger .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.user-dropdown-name {
    font-size: 14px;
    font-weight: 600;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    padding: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    color: var(--text-primary);
    z-index: 200;
    display: none;
    overflow: hidden;
}

.user-dropdown-menu.show {
    display: block;
    animation: slideUp 0.15s ease-out;
}

.user-dropdown-header {
    padding: 12px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-dropdown-header strong {
    font-size: 14.5px;
    color: var(--text-primary);
}

.user-dropdown-header small {
    font-size: 12.5px;
    color: var(--text-muted);
    word-break: break-all;
}

.user-dropdown-header .badge {
    background: var(--tone-gold-bg);
    color: var(--tone-gold-fg);
}

.user-dropdown-divider {
    height: 1px;
    margin: 4px 6px;
    background: var(--border-color);
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.user-dropdown-item:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.user-dropdown-item.text-danger,
.user-dropdown-item.text-danger:hover {
    color: var(--tone-red-fg);
}

/* ============================================================
   DROPDOWN (generic)
   ============================================================ */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    padding: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 50;
    display: none;
}

.dropdown-menu.show {
    display: block;
    animation: slideUp 0.15s ease-out;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    margin: 4px 6px;
    background: var(--border-color);
}

/* ============================================================
   TABS — underline, gold active (same as the mobile app)
   ============================================================ */

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.tab {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 16px;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--gold-text);
    border-bottom-color: var(--accent);
}

/* ============================================================
   PAGINATION — round 40px, gold current page
   ============================================================ */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: var(--space-6);
}

.card-footer .pagination {
    margin-top: 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.pagination-btn:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.pagination-btn.active,
.pagination-btn.active:hover {
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
}

.pagination-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */

.toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle input,
.toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--gray-300);
    transition: background-color var(--transition-fast);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(30, 29, 26, 0.25);
    transition: transform var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle input:focus-visible + .toggle-slider {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

/* ============================================================
   SEARCH BOX
   ============================================================ */

.search-box {
    position: relative;
    max-width: 320px;
}

.search-box input {
    width: 100%;
    min-height: var(--touch);
    padding: 10px 14px 10px 40px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
}

.search-box input:focus {
    outline: none;
    background: var(--bg-surface);
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.search-box .search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ============================================================
   ALERTS + DETAIL ROWS
   ============================================================ */

/* Block by default, so a note written as running text with <strong> words
   flows as one paragraph (as flex, every text run and <strong> became its
   own column). An alert built from parts (an icon - svg or .d-icon - or
   <div> blocks) is flex below: the icon keeps its own column and the text
   lines up beside it, and div parts sit in a row as before. */
.alert {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: var(--tone-grey-bg);
    color: var(--tone-grey-fg);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.alert-success { background: var(--tone-green-bg);  color: var(--tone-green-fg); }
.alert-danger,
.alert-error   { background: var(--tone-red-bg);    color: var(--tone-red-fg); }
.alert-warning { background: var(--tone-amber-bg);  color: var(--tone-amber-fg); }
.alert-info    { background: var(--tone-blue-bg);   color: var(--tone-blue-fg); }

/* :where() keeps this at the specificity of .alert, like the old flex rule */
.alert:where(:has(> svg, > .d-icon, > div)) {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-label {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.detail-value {
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    overflow-wrap: anywhere;
}

.progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--input-bg);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent);
}

/* ============================================================
   MODALS — radius 24
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: var(--overlay);
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-surface);
    color: var(--text-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.modal-title {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
    background: var(--input-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-3);
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

.confirm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    border-radius: 50%;
    background: var(--tone-amber-bg);
    color: var(--tone-amber-fg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon svg {
    width: 32px;
    height: 32px;
}

.confirm-title {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
   TOASTS — tinted pills of the status tones
   ============================================================ */

/* bottom right (snackbar, like the app), so a toast never covers the
   header controls or the band's page actions */
.toast-container {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: calc(100vw - 32px);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 420px;
    min-height: 52px;
    padding: 8px 8px 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-xl);
    font-size: 14px;
    font-weight: 600;
    animation: slideIn 0.3s ease-out;
}

.toast > svg {
    flex-shrink: 0;
}

.toast.success { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.toast.error   { background: var(--tone-red-bg);   color: var(--tone-red-fg); }
.toast.warning { background: var(--tone-amber-bg); color: var(--tone-amber-fg); }
.toast.info    { background: var(--tone-blue-bg);  color: var(--tone-blue-fg); }

.toast-message {
    flex: 1;
    min-width: 0;
}

.toast-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
    cursor: pointer;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(30, 29, 26, 0.06);
}

/* ============================================================
   DASHBOARD PIECES (welcome card, activity, quick actions)
   The dashboard page agent owns their layout; these are the D tokens.
   ============================================================ */

.welcome-card {
    position: relative;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    background: var(--band);
    color: var(--on-band);
    overflow: hidden;
}

.welcome-card h2 {
    margin-bottom: var(--space-2);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.welcome-card p {
    font-size: 15px;
    font-weight: 500;
}

.welcome-card .welcome-date {
    margin-top: var(--space-3);
    font-size: 14px;
    font-weight: 600;
}

.activity-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 50%;
}

.activity-dot.blue   { background: var(--tone-blue-fg); }
.activity-dot.green  { background: var(--tone-green-fg); }
.activity-dot.red    { background: var(--tone-red-fg); }
.activity-dot.yellow { background: var(--tone-amber-fg); }

.activity-text {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-primary);
}

.activity-time {
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-muted);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 104px;
    padding: 16px 12px;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.quick-action-btn:hover {
    background: var(--gold-tint);
    color: var(--gold-text);
}

.quick-action-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--gold-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-action-label {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ============================================================
   SKELETON + SPINNER
   ============================================================ */

.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0.85;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* ============================================================
   ANIMATIONS (switched off by prefers-reduced-motion below)
   ============================================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

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

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideUp 0.4s ease-out; }

/* ============================================================
   RESPONSIVE
   Below 1024px the whole sidebar (rail + panel) becomes the off-canvas
   drawer opened by #sidebarToggle; #sidebarOverlay closes it.
   ============================================================ */

@media (max-width: 1023.98px) {
    :root {
        --gutter: 20px;
    }

    /* hidden drawer is also out of the tab order (visibility), but only
       after the slide-out has finished */
    .sidebar {
        z-index: 200;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform var(--transition-slow), visibility 0s linear 300ms;
    }

    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
        box-shadow: var(--shadow-xl);
        transition: transform var(--transition-slow), visibility 0s;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle,
    .sidebar-close-btn {
        display: inline-flex;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 150;
        background: var(--overlay);
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .user-dropdown-name {
        display: none;
    }

    .user-dropdown-trigger {
        padding-right: 4px;
    }

    .user-dropdown-trigger svg:last-child {
        display: none;
    }
}

@media (max-width: 640px) {
    :root {
        --gutter: 16px;
        --band-skirt: 72px;
        --band-overlap: 52px;
    }

    .top-header {
        padding-top: 16px;
        padding-bottom: 24px;
    }

    /* phones: [menu] ... [controls] on one row, the title below it */
    .top-header-inner {
        gap: 12px;
    }

    .top-header-left {
        display: contents;
    }

    .sidebar-toggle {
        order: 0;
    }

    .top-header-right {
        order: 1;
        flex: 0 1 auto;
        margin-left: auto;
    }

    .top-header-titles {
        order: 2;
        flex: 1 1 100%;
    }

    /* wide tables scroll sideways inside their wrapper instead of squashing */
    :is(.table-wrapper, .table-responsive) > :is(.data-table, .table) {
        min-width: 600px;
    }

    .top-header .page-title,
    .on-band :is(h1, .page-title),
    .d-title-in-view .page-content > .page-header :is(h1, h2, .page-title),
    .d-title-in-view .page-content > .welcome-card h2 {
        font-size: 1.625rem;
    }

    .page-content {
        padding-top: 20px;
        padding-bottom: 32px;
    }

    .card-header {
        padding: 16px 18px;
    }

    .card-body {
        padding: 18px;
    }

    .card-footer {
        padding: 14px 18px;
    }

    .modal-body {
        padding: 18px;
    }

    .modal-header,
    .modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }

    .welcome-card {
        padding: var(--space-6);
    }

    /* phones: toasts span the bottom edge */
    .toast-container {
        right: 16px;
        bottom: 16px;
        left: 16px;
        max-width: none;
    }

    .toast {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header-search {
        display: none;
    }
}

/* Coarse pointers (phones, tablets): every control at least 44px */
@media (pointer: coarse) {
    .btn-sm,
    .btn-icon,
    .pagination-btn,
    .sidebar-link,
    .dropdown-item,
    .modal-close,
    .toast-close {
        min-height: var(--touch);
    }

    .btn-icon,
    .modal-close,
    .toast-close {
        min-width: var(--touch);
        width: var(--touch);
        height: var(--touch);
    }

    .pagination-btn {
        min-width: var(--touch);
        height: var(--touch);
    }
}

/* Motion: respect the system setting */
@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;
    }
}

/* ============================================================
   PRINT — no band, no sidebar, black on white
   ============================================================ */

@media print {
    .sidebar,
    .sidebar-overlay,
    .top-header,
    .toast-container,
    .skip-link {
        display: none !important;
    }

    body,
    .main-content {
        background: #FFFFFF !important;
    }

    .main-content {
        margin: 0 !important;
        overflow: visible !important;
    }

    .page-content {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .d-title-in-view .page-content > .page-header,
    .d-title-in-view .page-content > .welcome-card {
        border-image: none !important;
        background: none !important;
        padding: 0 0 12px !important;
        color: #000000 !important;
    }

    .d-title-in-view .page-content > .page-header *,
    .d-title-in-view .page-content > .welcome-card * {
        color: #000000 !important;
    }

    .d-title-in-view .page-content > .page-header + *,
    .d-title-in-view .page-content > .welcome-card + * {
        margin-top: 0 !important;
    }

    .card,
    .stat-card {
        box-shadow: none !important;
        border: 1px solid #DDD9D1 !important;
    }
}
