/* ================================================================
   TalentPro — Global App Styles
   Clean, minimal, professional. Cool neutral greys + one blue accent.
   Single typeface (Google Sans, covers Lao); figures use tabular-nums.
   ---------------------------------------------------------------
   This file is the single source of truth for the app's look.
   Every class name used by the views is preserved; the palette,
   type and elevation are token-driven — change them here only.
   ================================================================ */

/* ─────────────────────────────────────────────────────────────
   1. Design tokens
   ───────────────────────────────────────────────────────────── */
:root {
    /* ── Surfaces & lines (cool neutrals) ─────────────────── */
    --c-bg:            #f7f8fa;   /* app background — cool near-white  */
    --c-surface:       #ffffff;   /* cards, panels, menus              */
    --c-surface-2:     #f3f4f6;   /* hover / subtle fill               */
    --c-surface-3:     #e9ebef;   /* pressed / deepest fill            */
    --c-border:        #e5e7eb;   /* default border                   */
    --c-border-dim:    #eef0f3;   /* hairline / row divider            */
    --c-border-hi:     #d3d7de;   /* emphasised border                */

    /* ── Text (cool slate) ───────────────────────────────── */
    --c-text:          #10131a;   /* primary — near-black             */
    --c-muted:         #5a616e;   /* secondary text (AA on surface)   */
    --c-muted-2:       #949aa6;   /* tertiary / placeholder          */

    /* ── Accent (professional blue) ──────────────────────── */
    --c-accent:        #2563eb;   /* primary — blue 600              */
    --c-accent-dark:   #1d4ed8;   /* hover / pressed                 */
    --c-accent-text:   #1d4ed8;   /* accent used as text on light    */
    --c-accent-dim:    color-mix(in srgb, var(--c-accent) 10%, transparent);
    --c-accent-soft:   color-mix(in srgb, var(--c-accent) 6%, transparent);
    --c-accent-glow:   color-mix(in srgb, var(--c-accent) 20%, transparent);
    --c-accent-ring:   color-mix(in srgb, var(--c-accent) 30%, transparent);

    /* ── Semantic (muted, not vivid) ─────────────────────── */
    --c-danger:        #d5342b;  --c-danger-bg:  color-mix(in srgb, #d5342b 9%, transparent);
    --c-warning:       #b26a08;  --c-warning-bg: color-mix(in srgb, #b26a08 11%, transparent);
    --c-success:       #12805c;  --c-success-bg: color-mix(in srgb, #12805c 10%, transparent);
    --c-info:          #2563eb;  --c-info-bg:    color-mix(in srgb, #2563eb 9%, transparent);
    --c-purple:        #6d40c9;  --c-purple-bg:  color-mix(in srgb, #6d40c9 9%, transparent);
    --c-orange:        #c2510c;  --c-orange-bg:  color-mix(in srgb, #c2510c 11%, transparent);
    --c-muted-bg:      color-mix(in srgb, var(--c-muted) 9%, transparent);

    /* ── Sidebar ──────────────────────────────────────────── */
    --c-nav:           #ffffff;
    --c-nav-text:      #2b2f3a;
    --c-nav-muted:     #6b7280;
    --c-nav-hover:     var(--c-surface-2);
    --c-nav-active:    var(--c-accent-dim);

    /* ── Legacy GA aliases (kept for Tailwind config + old markup) */
    --ga-blue: var(--c-accent);          --ga-blue-dark: var(--c-accent-dark);
    --ga-blue-light: var(--c-accent-dim);
    --ga-bg: var(--c-bg);                --ga-surface: var(--c-surface);
    --ga-border: var(--c-border);        --ga-text: var(--c-text);
    --ga-muted: var(--c-muted);          --ga-hover: var(--c-surface-2);
    --ga-nav: var(--c-nav);
    --ga-green: var(--c-success);        --ga-green-bg: var(--c-success-bg);
    --ga-red: var(--c-danger);           --ga-red-bg: var(--c-danger-bg);
    --ga-yellow: var(--c-warning);       --ga-yellow-bg: var(--c-warning-bg);
    --ga-purple: var(--c-purple);        --ga-orange: var(--c-orange);

    /* ── Radius scale ─────────────────────────────────────── */
    --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;

    /* ── Elevation (soft, cool) ──────────────────────────── */
    --sh-xs: 0 1px 2px rgba(16,24,40,.04);
    --sh-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.04);
    --sh-md: 0 2px 8px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
    --sh-lg: 0 8px 24px rgba(16,24,40,.10), 0 2px 8px rgba(16,24,40,.06);
    --sh-xl: 0 20px 48px rgba(16,24,40,.16), 0 6px 16px rgba(16,24,40,.08);

    /* ── Layout ───────────────────────────────────────────── */
    --sidebar-collapsed: 56px;
    --sidebar-expanded:  240px;
    --header-height:     60px;

    /* Global UI density. The app is sized in fixed px, so this replicates
       a browser-zoom step in one place. 1 = 100%, 0.9 = the old "90% zoom"
       sweet spot. Tweak here; every view follows. */
    --app-zoom: 0.9;

    /* ── Typography — one typeface ────────────────────────── */
    --font-ui:   'Google Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: var(--font-ui);   /* legacy alias — figures use tabular-nums */
    --font-sans: var(--font-ui);

    /* ── Motion ───────────────────────────────────────────── */
    --tr-fast:   130ms ease;
    --tr-normal: 200ms ease;
    --tr-slow:   300ms ease;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    /* ── Z-index scale ────────────────────────────────────── */
    --z-header: 20;
    --z-sidebar: 30;
    --z-backdrop: 40;
    --z-modal: 50;
    --z-dropdown: 60;
    --z-toast: 70;

    color-scheme: light;
}

/* ─────────────────────────────────────────────────────────────
   2. Reset & base
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

* { min-width: 0; }

html { height: 100%; -webkit-text-size-adjust: 100%; zoom: var(--app-zoom); }

body {
    /* Divided by --app-zoom so the page still fills the screen under CSS zoom
       (zoom does not scale % / vh height against the viewport). */
    min-height: calc(100% / var(--app-zoom));
    margin: 0;
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: -0.006em;
    background-color: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; color: var(--c-text); letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, svg { vertical-align: middle; }

/* Numeric alignment helper — applied wherever figures are tabulated */
.tnum, .stat-card__value, .ga-table td.num, .ga-table th.num { font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────────
   3. Accessibility primitives
   ───────────────────────────────────────────────────────────── */
:where(a, button, input, select, textarea, [tabindex], summary, .ga-tab, [role="button"]):focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}
/* Inputs get a ring instead of a hard outline */
.ga-input:focus-visible, .ga-select:focus-visible, .ga-textarea:focus-visible,
.dt-search input:focus-visible {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-ring);
}

.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: fixed;
    top: 8px; left: 8px;
    z-index: 999;
    padding: 10px 16px;
    background: var(--c-surface);
    color: var(--c-text);
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-lg);
    font-size: 13px; font-weight: 600;
    transform: translateY(-150%);
    transition: transform var(--tr-fast);
}
.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─────────────────────────────────────────────────────────────
   4. Typography helpers
   ───────────────────────────────────────────────────────────── */
.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--c-text);
    letter-spacing: -0.2px;
    line-height: 1.3;
}
.section-title { font-size: 14px; font-weight: 600; color: var(--c-text); letter-spacing: -.1px; }
.label-sm {
    font-size: 12px; font-weight: 600;
    letter-spacing: 0;
    color: var(--c-muted);
}
.mono { font-variant-numeric: tabular-nums; }

.text-accent   { color: var(--c-accent-text); }
.text-muted    { color: var(--c-muted); }
.text-danger   { color: var(--c-danger); }
.text-warning  { color: var(--c-warning); }
.text-success  { color: var(--c-success); }

.code-inline {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border-dim);
    border-radius: var(--r-xs);
    padding: 1px 6px;
    color: var(--c-accent-text);
}

/* ─────────────────────────────────────────────────────────────
   5. App shell — sidebar, header, main
   ───────────────────────────────────────────────────────────── */
/* Tailwind's h-screen gives the shell height:100vh. CSS `zoom` does NOT scale
   viewport units, so a 100vh shell only fills `100vh * --app-zoom` of the
   screen and leaves a dead strip below. Divide it back out. */
#app-shell { background: var(--c-bg); height: calc(100vh / var(--app-zoom)); }

#page-main { scroll-padding-top: 24px; }
#page-main:focus { outline: none; }

/* Page header block (new shared pattern) */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}
.page-header__meta { display: flex; flex-direction: column; gap: 4px; }
.page-header__sub { font-size: 13px; color: var(--c-muted); }
.page-header__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
    background: var(--c-nav);
    border-right: 1px solid var(--c-border);
}
/* When pinned open, the shell adds .sidebar-pinned to #app-shell */
#app-shell.sidebar-pinned #sidebar { width: var(--sidebar-expanded) !important; }
#app-shell.sidebar-pinned #sidebar .nav-label,
#app-shell.sidebar-pinned #sidebar .nav-group-label,
#app-shell.sidebar-pinned #sidebar .nav-badge,
#app-shell.sidebar-pinned #sidebar .sidebar-brand-text,
#app-shell.sidebar-pinned #sidebar .sidebar-user-meta { opacity: 1 !important; }

.sidebar-pin-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex-shrink: 0;
    border-radius: var(--r-sm);
    color: var(--c-nav-muted);
    transition: background var(--tr-fast), color var(--tr-fast);
}
.sidebar-pin-btn:hover { background: var(--c-surface-2); color: var(--c-text); }

.nav-item {
    position: relative;
    display: flex; align-items: center;
    height: 38px; margin: 1px 8px;
    padding: 0 12px;
    border-radius: var(--r-sm);
    color: var(--c-nav-text);
    transition: background var(--tr-fast), color var(--tr-fast);
    overflow: hidden;
}
.nav-item:hover { background: var(--c-nav-hover); }
.nav-item[aria-current="page"] { background: var(--c-nav-active); color: var(--c-accent-text); font-weight: 600; }
.nav-item[aria-current="page"] .nav-rail {
    position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0;
    background: var(--c-accent);
}
.nav-item .material-icons-round,
.nav-item .material-icons { font-size: 19px; flex-shrink: 0; }
.nav-label {
    margin-left: 12px;
    font-size: 13px; font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--tr-normal);
    flex: 1;
}
.nav-group-label {
    display: block;
    margin: 16px 0 4px; padding: 0 16px;
    font-size: 11px; font-weight: 600;
    letter-spacing: .01em;
    color: var(--c-muted-2);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--tr-normal);
}
.nav-badge {
    flex-shrink: 0;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-full);
    background: var(--c-danger); color: #fff;
    font-size: 10px; font-weight: 600;
    font-variant-numeric: tabular-nums;
    opacity: 0;
    transition: opacity var(--tr-normal);
}
.nav-dot {
    position: absolute; top: 6px; right: 8px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--c-danger);
}
#sidebar:hover .nav-label,
#sidebar:hover .nav-group-label,
#sidebar:hover .nav-badge,
#sidebar:hover .sidebar-brand-text,
#sidebar:hover .sidebar-user-meta,
#sidebar:focus-within .nav-label,
#sidebar:focus-within .nav-group-label,
#sidebar:focus-within .nav-badge,
#sidebar:focus-within .sidebar-brand-text,
#sidebar:focus-within .sidebar-user-meta { opacity: 1; }
#sidebar:hover .nav-dot,
#sidebar:focus-within .nav-dot,
#app-shell.sidebar-pinned .nav-dot { display: none; }

/* ── Header ───────────────────────────────────────────────── */
header.app-header {
    height: var(--header-height);
    flex-shrink: 0;
    display: flex; align-items: center;
    gap: 14px;
    padding: 0 20px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    z-index: var(--z-header);
}
.header-title { font-size: 15px; font-weight: 600; color: var(--c-text); letter-spacing: -.1px; }
.header-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 10px;
    border-radius: var(--r-sm);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    font-size: 13px; font-weight: 500; color: var(--c-text);
    transition: background var(--tr-fast), border-color var(--tr-fast);
}
.header-chip:hover { background: var(--c-surface-2); border-color: var(--c-border-hi); }

.avatar-btn {
    width: 32px; height: 32px;
    border-radius: var(--r-full);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
    background: var(--c-accent-dim);
    color: var(--c-accent-text);
    border: 1px solid transparent;
    transition: filter var(--tr-fast);
}
.avatar-btn:hover { filter: brightness(.96); }

/* Header dropdown menus */
.menu-pop {
    position: absolute;
    top: calc(100% + 6px);
    min-width: 220px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    padding: 6px;
    z-index: var(--z-dropdown);
}
.menu-pop[hidden] { display: none; }
.menu-pop__label { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0; color: var(--c-muted-2); }
.menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: 13px; color: var(--c-text);
    text-align: left;
    transition: background var(--tr-fast), color var(--tr-fast);
}
.menu-item:hover { background: var(--c-surface-2); }
.menu-item--danger:hover { background: var(--c-danger-bg); color: var(--c-danger); }
.menu-item .material-icons-round, .menu-item .material-icons { font-size: 17px; color: var(--c-muted); }

/* ─────────────────────────────────────────────────────────────
   6. Cards & surfaces
   ───────────────────────────────────────────────────────────── */
.ga-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    transition: border-color var(--tr-normal), box-shadow var(--tr-normal);
}
.ga-card:hover { border-color: var(--c-border-hi); }

.ga-card-elevated {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xs);
}

/* Section container (legacy glass classes, now flat & calm) */
.ga-glass-card,
.ga-glass-section {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    transition: border-color var(--tr-normal), box-shadow var(--tr-normal), transform var(--tr-normal);
}
.ga-glass-section { margin-bottom: 16px; overflow: hidden; }
.ga-glass-card { position: relative; overflow: hidden; }
.ga-glass-card:hover { border-color: var(--c-border-hi); box-shadow: var(--sh-sm); }
.ga-glass-card::before { content: none; }
.ga-glass-card > * { position: relative; z-index: 1; }
.ga-glass-card-accent {
    position: absolute; inset: 0;
    background: linear-gradient(140deg, var(--stat-accent, transparent) 0%, transparent 55%);
    pointer-events: none; border-radius: inherit; z-index: 0;
}
.ga-glass-dropdown {
    background: var(--c-surface) !important;
    border: 1px solid var(--c-border) !important;
    box-shadow: var(--sh-lg) !important;
    border-radius: var(--r-lg);
}

/* ─────────────────────────────────────────────────────────────
   7. Stat cards
   ───────────────────────────────────────────────────────────── */
.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 18px 20px;
    display: flex; flex-direction: column; gap: 6px;
    position: relative;
    transition: border-color var(--tr-normal);
}
.stat-card:hover { border-color: var(--c-border-hi); }
.stat-card__label {
    font-size: 12px; font-weight: 500;
    color: var(--c-muted);
    letter-spacing: 0;
}
.stat-card__value {
    font-size: 26px; font-weight: 700;
    color: var(--c-text);
    letter-spacing: -.4px; line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.stat-card__delta {
    font-size: 12px; font-weight: 500;
    display: flex; align-items: center; gap: 3px;
    font-variant-numeric: tabular-nums;
}
.stat-card__delta--up   { color: var(--c-success); }
.stat-card__delta--down { color: var(--c-danger); }

/* ─────────────────────────────────────────────────────────────
   8. Tables + data-table enhancement (search / sort / count)
   ───────────────────────────────────────────────────────────── */
.ga-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: var(--font-ui);
}
.ga-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 12px; font-weight: 500;
    letter-spacing: 0;
    color: var(--c-muted);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
    position: sticky; top: 0; z-index: 1;
}
.ga-table tbody tr {
    border-bottom: 1px solid var(--c-border-dim);
    transition: background var(--tr-fast);
}
.ga-table tbody tr:last-child { border-bottom: none; }
.ga-table tbody tr:hover { background: var(--c-surface-2); }
.ga-table tbody td { padding: 12px 16px; color: var(--c-text); vertical-align: middle; }
.ga-table tbody tr[onclick], .ga-table tbody tr.row-link { cursor: pointer; }
.ga-table tbody tr[onclick]:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: -2px;
}

/* Freeze the first column while the table scrolls horizontally.
   Needs the table to sit in a horizontal-scroll container (e.g. .overflow-x-auto). */
.ga-table--pin-first thead th:first-child,
.ga-table--pin-first tbody td:first-child,
.ga-table--pin-first tfoot td:first-child {
    position: sticky;
    left: 0;
    background: var(--c-surface);
    z-index: 2;
    box-shadow: 1px 0 0 var(--c-border);
}
.ga-table--pin-first thead th:first-child { z-index: 3; }
.ga-table--pin-first tbody tr:hover td:first-child { background: var(--c-surface-2); }
.ga-table--pin-first tfoot td:first-child { background: var(--c-surface-2); z-index: 3; }

/* Sortable header */
.ga-table th.dt-sortable {
    cursor: pointer; user-select: none;
    padding-right: 26px;
    position: sticky;
}
.ga-table th.dt-sortable::after {
    content: 'unfold_more';
    font-family: 'Material Icons Round','Material Icons';
    font-size: 14px;
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    color: var(--c-muted-2);
    opacity: .6;
    text-transform: none; letter-spacing: normal;
}
.ga-table th.dt-sortable:hover::after { opacity: 1; color: var(--c-text); }
.ga-table th.dt-sortable[aria-sort="ascending"]::after  { content: 'arrow_upward';   opacity: 1; color: var(--c-accent-text); }
.ga-table th.dt-sortable[aria-sort="descending"]::after { content: 'arrow_downward'; opacity: 1; color: var(--c-accent-text); }

/* Toolbar injected above enhanced tables */
.dt-wrap { display: block; }
.dt-toolbar {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
/* When the enhanced table sits inside a card, render the toolbar as a header band */
.ga-card-elevated > .dt-wrap > .dt-toolbar,
.ga-card > .dt-wrap > .dt-toolbar {
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--c-border-dim);
    background: var(--c-surface);
}
.ga-card-elevated > .dt-wrap > .dt-toolbar:empty,
.ga-card > .dt-wrap > .dt-toolbar:empty { display: none; }
.dt-search {
    position: relative;
    flex: 1 1 240px;
    max-width: 340px;
}
.dt-search .material-icons-round,
.dt-search .material-icons {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 18px; color: var(--c-muted-2);
    pointer-events: none;
}
.dt-search input {
    width: 100%; height: 36px;
    padding: 0 32px 0 34px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    font-family: var(--font-ui); font-size: 13px;
    color: var(--c-text);
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.dt-search input::placeholder { color: var(--c-muted-2); }
.dt-search__clear {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-full);
    color: var(--c-muted-2);
}
.dt-search__clear:hover { background: var(--c-surface-2); color: var(--c-text); }
.dt-count {
    font-size: 12px; color: var(--c-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.dt-empty td {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--c-muted);
}

/* ─────────────────────────────────────────────────────────────
   9. Empty states
   ───────────────────────────────────────────────────────────── */
.empty-state {
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    padding: 48px 24px;
    gap: 8px;
}
.empty-state__icon {
    width: 46px; height: 46px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r-full);
    background: var(--c-surface-2);
    color: var(--c-muted-2);
    margin-bottom: 4px;
}
.empty-state__icon .material-icons-round,
.empty-state__icon .material-icons { font-size: 24px; }
.empty-state__title { font-size: 14px; font-weight: 600; color: var(--c-text); }
.empty-state__text { font-size: 13px; color: var(--c-muted); max-width: 340px; }

/* ─────────────────────────────────────────────────────────────
   10. Buttons
   ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--r-sm);
    font-family: var(--font-ui);
    font-size: 13px; font-weight: 600;
    letter-spacing: 0;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none;
    transition: background var(--tr-fast), border-color var(--tr-fast),
                box-shadow var(--tr-fast), opacity var(--tr-fast);
}
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn .material-icons-round, .btn .material-icons { font-size: 16px; }

.btn-primary { background: var(--c-accent); color: #fff; }
.btn-primary:hover { background: var(--c-accent-dark); }

.btn-secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-surface-2); border-color: var(--c-border-hi); }

.btn-danger { background: var(--c-surface); color: var(--c-danger); border-color: var(--c-border); }
.btn-danger:hover { background: var(--c-danger-bg); border-color: var(--c-danger); }

.btn-ghost { background: transparent; color: var(--c-accent-text); border-color: var(--c-accent-dim); }
.btn-ghost:hover { background: var(--c-accent-dim); }

.btn-icon {
    height: 32px; width: 32px;
    padding: 0;
    border-radius: var(--r-sm);
    background: transparent;
    border: 1px solid transparent;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--c-muted);
    transition: background var(--tr-fast), border-color var(--tr-fast), color var(--tr-fast);
}
.btn-icon:hover { background: var(--c-surface-2); border-color: var(--c-border); color: var(--c-text); }
.btn-icon .material-icons-round, .btn-icon .material-icons { font-size: 17px; }
.btn-icon.btn-icon--danger:hover { background: var(--c-danger-bg); border-color: var(--c-danger); color: var(--c-danger); }

/* ─────────────────────────────────────────────────────────────
   11. Forms
   ───────────────────────────────────────────────────────────── */
.ga-input, .ga-select, .ga-textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-sm);
    font-family: var(--font-ui);
    font-size: 13.5px;
    color: var(--c-text);
    transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.ga-textarea { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.ga-input:focus, .ga-select:focus, .ga-textarea:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-ring);
}
.ga-input::placeholder, .ga-textarea::placeholder { color: var(--c-muted-2); }
.ga-input:disabled, .ga-input[readonly],
.ga-select:disabled, .ga-textarea:disabled, .ga-textarea[readonly] {
    background: var(--c-surface-2);
    color: var(--c-muted);
    cursor: not-allowed;
}
.ga-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235a616e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: 12.5px; font-weight: 500;
    color: var(--c-text);
    letter-spacing: 0;
}
.form-hint { font-size: 12px; color: var(--c-muted-2); }
.form-error { font-size: 11px; color: var(--c-danger); font-weight: 600; }

/* Native checkboxes / radios pick up the accent */
input[type="checkbox"], input[type="radio"] { accent-color: var(--c-accent); width: 15px; height: 15px; cursor: pointer; }
input[type="date"], input[type="time"], input[type="number"] { font-family: var(--font-ui); }

/* ── Searchable select (combobox) ─────────────────────────── */
.searchable-select { position: relative; }
.searchable-select .ss-dropdown {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    max-height: 240px; overflow-y: auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    box-shadow: var(--sh-lg);
    z-index: var(--z-dropdown);
    padding: 4px;
}
.searchable-select .ss-dropdown.hidden { display: none; }
.searchable-select .ss-option {
    padding: 8px 10px;
    border-radius: var(--r-xs);
    font-size: 13px; color: var(--c-text);
    cursor: pointer;
}
.searchable-select .ss-option:hover,
.searchable-select .ss-option.active { background: var(--c-surface-2); }
.searchable-select .ss-empty { padding: 8px 10px; font-size: 13px; color: var(--c-muted-2); }

/* ─────────────────────────────────────────────────────────────
   12. Badges & pills
   ───────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--r-full);
    font-size: 12px; font-weight: 500;
    letter-spacing: 0;
    white-space: nowrap;
    background: var(--c-muted-bg);
    color: var(--c-muted);
}
.badge--success { background: var(--c-success-bg); color: var(--c-success); }
.badge--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.badge--danger  { background: var(--c-danger-bg);  color: var(--c-danger); }
.badge--info    { background: var(--c-info-bg);    color: var(--c-info); }
.badge--accent  { background: var(--c-accent-dim); color: var(--c-accent-text); }

.ga-tag-pill { border-width: 1px; border-style: solid; border-radius: var(--r-full); }

/* Row / card left-edge status accent (legacy helpers) */
.ga-accent-row, .ga-accent-card {
    border-left-style: solid; border-left-width: 3px;
    transition: background var(--tr-fast), box-shadow var(--tr-fast);
}
.ga-accent-row:hover, .ga-accent-card:hover {
    background: color-mix(in srgb, var(--row-accent, var(--c-accent)) 5%, transparent) !important;
}
.ga-time-badge { transition: transform var(--tr-fast); }

/* ─────────────────────────────────────────────────────────────
   13. Toggle switch
   ───────────────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-track {
    position: absolute; inset: 0;
    background: var(--c-border-hi);
    border-radius: var(--r-full);
    transition: background var(--tr-fast);
    pointer-events: none;
}
.toggle-track::after {
    content: '';
    position: absolute; left: 3px; top: 3px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--sh-sm);
    transition: transform var(--tr-fast);
}
.toggle input:checked + .toggle-track { background: var(--c-accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--c-accent); outline-offset: 2px; }

/* ─────────────────────────────────────────────────────────────
   14. Tabs
   ───────────────────────────────────────────────────────────── */
.ga-tabs {
    display: flex; gap: 2px;
    border-bottom: 1px solid var(--c-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.ga-tabs::-webkit-scrollbar { display: none; }
.ga-tab {
    padding: 10px 16px;
    font-size: 13px; font-weight: 500;
    color: var(--c-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--tr-fast), border-color var(--tr-fast), background var(--tr-fast);
    font-family: var(--font-ui);
    border-radius: var(--r-xs) var(--r-xs) 0 0;
}
.ga-tab:hover { color: var(--c-text); background: var(--c-surface-2); }
.ga-tab.active { color: var(--c-accent-text); border-bottom-color: var(--c-accent); font-weight: 600; }

/* ─────────────────────────────────────────────────────────────
   15. Modals
   ───────────────────────────────────────────────────────────── */
.ga-modal {
    position: fixed; inset: 0;
    z-index: var(--z-modal);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 48px 16px;
    overflow-y: auto;
}
.ga-modal.hidden { display: none; }
.ga-modal__box, .ga-modal-box {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 640px;
    box-shadow: var(--sh-xl);
    animation: modal-in .18s var(--ease-out);
    position: relative;
    z-index: 1;
}
.ga-modal__box--wide   { max-width: 900px; }
.ga-modal__box--narrow { max-width: 460px; }
@keyframes modal-in {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ga-modal__header, .ga-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border-dim);
}
.ga-modal__title, .ga-modal-title { font-size: 15px; font-weight: 600; color: var(--c-text); }
.ga-modal__body, .ga-modal-body { padding: 20px; }
.ga-modal__footer, .ga-modal-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 8px;
    padding: 16px 22px;
    border-top: 1px solid var(--c-border-dim);
    background: var(--c-surface);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.ga-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.4); }
.ga-modal-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: var(--r-sm);
    color: var(--c-muted);
    transition: background var(--tr-fast), color var(--tr-fast);
}
.ga-modal-close:hover { background: var(--c-surface-2); color: var(--c-text); }

#modal-backdrop { background: rgba(15,23,42,.4); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

/* Confirm dialog (JS-generated) */
.confirm-dialog__box { max-width: 420px; }
.confirm-dialog__msg { font-size: 14px; color: var(--c-muted); line-height: 1.55; }

/* ─────────────────────────────────────────────────────────────
   16. Toasts
   ───────────────────────────────────────────────────────────── */
#toast-container {
    position: fixed; bottom: 24px; right: 24px;
    z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-left: 3px solid var(--c-info);
    box-shadow: var(--sh-lg);
    font-size: 13px; font-weight: 500;
    color: var(--c-text);
    min-width: 260px; max-width: 400px;
    pointer-events: all;
    animation: toast-in .2s ease;
}
.toast-success { border-left-color: var(--c-success); }
.toast-error   { border-left-color: var(--c-danger); }
.toast-info    { border-left-color: var(--c-info); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.toast.toast--out { animation: toast-out .18s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ─────────────────────────────────────────────────────────────
   17. Skeleton / loading
   ───────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-border-dim) 50%, var(--c-surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--r-xs);
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─────────────────────────────────────────────────────────────
   18. Scrollbars
   ───────────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--c-border-hi) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-hi); border-radius: var(--r-full); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--c-muted-2); background-clip: content-box; }

/* ─────────────────────────────────────────────────────────────
   19. Motion helpers
   ───────────────────────────────────────────────────────────── */
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-up { animation: fade-up .34s ease both; }
.stagger-children > * { animation: fade-up .3s ease both; }
.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 40ms; }
.stagger-children > *:nth-child(3) { animation-delay: 80ms; }
.stagger-children > *:nth-child(4) { animation-delay: 120ms; }
.stagger-children > *:nth-child(5) { animation-delay: 160ms; }
.stagger-children > *:nth-child(6) { animation-delay: 200ms; }
.stagger-children > *:nth-child(7) { animation-delay: 240ms; }
.stagger-children > *:nth-child(n+8) { animation-delay: 280ms; }
.glow-accent { box-shadow: 0 2px 12px var(--c-accent-glow); }

/* ─────────────────────────────────────────────────────────────
   20. Quill editor light theme
   ───────────────────────────────────────────────────────────── */
.ql-toolbar { background: var(--c-surface-2) !important; border-color: var(--c-border) !important; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.ql-container { background: var(--c-surface) !important; border-color: var(--c-border) !important; color: var(--c-text) !important; border-radius: 0 0 var(--r-sm) var(--r-sm); font-family: var(--font-ui) !important; }
.ql-editor { color: var(--c-text) !important; min-height: 160px; }
.ql-toolbar .ql-stroke { stroke: var(--c-muted) !important; }
.ql-toolbar .ql-fill { fill: var(--c-muted) !important; }
.ql-toolbar button:hover .ql-stroke { stroke: var(--c-accent) !important; }
.ql-toolbar button:hover .ql-fill { fill: var(--c-accent) !important; }

/* ─────────────────────────────────────────────────────────────
   21. Analytics / report sections (ana-*)
   ───────────────────────────────────────────────────────────── */
.ana-section-wrap { border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; background: var(--c-surface); }
.ana-section-header {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 18px;
    cursor: pointer;
    background: var(--c-surface-2);
    border-bottom: 1px solid var(--c-border-dim);
    transition: background var(--tr-fast);
    user-select: none; width: 100%; text-align: left; border: 0;
}
.ana-section-header:hover { background: var(--c-surface-3); }
.ana-section-icon { font-size: 18px; color: var(--c-accent-text); flex-shrink: 0; }
.ana-section-title { font-size: 14px; font-weight: 700; color: var(--c-text); flex: 1; }
.ana-section-sub { color: var(--c-muted-2); font-size: 10px; }
.ana-section-chevron { font-size: 18px; color: var(--c-muted-2); transition: transform var(--tr-normal); flex-shrink: 0; }
.ana-section-chevron.collapsed { transform: rotate(-90deg); }
.ana-section-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ana-section-body.hidden { display: none; }
.ana-topic-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ana-chart-wrap { position: relative; height: 230px; }
.ana-chart-wrap--tall { height: 280px; }
.ana-chart-wrap--short { height: 180px; }
.ana-toggle {
    font-size: 10px; font-weight: 700;
    color: var(--c-muted);
    text-transform: uppercase; letter-spacing: .6px;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--r-xs);
    padding: 3px 9px;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: background var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast);
    flex-shrink: 0;
}
.ana-toggle:hover { background: var(--c-surface-2); color: var(--c-text); border-color: var(--c-border-hi); }
.ana-table-wrap { overflow-x: auto; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--c-border-dim); margin-top: 8px; }
.ana-table-wrap.hidden { display: none; }
.ana-retention-pct { font-size: 42px; font-weight: 800; color: var(--c-accent-text); font-family: var(--font-mono); letter-spacing: -2px; line-height: 1; }
.rate-high { color: var(--c-danger); font-weight: 600; }
.rate-medium { color: var(--c-warning); font-weight: 600; }
.rate-low { color: var(--c-success); }
.ana-loading-bar {
    position: absolute; bottom: 0; left: 0;
    height: 2px; width: 100%;
    background: linear-gradient(90deg, transparent, var(--c-accent), var(--c-info), transparent);
    background-size: 200% 100%;
    animation: ana-bar-slide 1.2s linear infinite;
    opacity: 0; transition: opacity var(--tr-fast); pointer-events: none;
}
.ana--loading .ana-loading-bar { opacity: 1; }
@keyframes ana-bar-slide { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.ana--loading .stat-card__value,
.ana--loading .stat-card__delta,
.ana--loading .ana-section-sub {
    color: transparent !important;
    background: linear-gradient(90deg, var(--c-surface-2) 25%, var(--c-border-dim) 50%, var(--c-surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: var(--r-xs);
    pointer-events: none; user-select: none;
}
.ana--loading .ana-section-sub { min-width: 80px; display: inline-block; }
.ana--loading canvas { opacity: .25; transition: opacity var(--tr-normal); }
.ana--loading .btn-primary[data-ana-apply] { opacity: .6; pointer-events: none; cursor: wait; }
.ana-findings-banner { background: var(--c-surface); border: 1px solid var(--c-border); border-left: 3px solid var(--c-accent); border-radius: var(--r-lg); overflow: hidden; }
.ana-findings-header { display: flex; align-items: center; gap: 8px; padding: 11px 16px; background: var(--c-surface-2); border-bottom: 1px solid var(--c-border-dim); }
.ana-findings-title { font-size: 12px; font-weight: 700; color: var(--c-text); text-transform: uppercase; letter-spacing: .8px; font-family: var(--font-mono); flex: 1; }
.ana-findings-period { font-size: 10px; color: var(--c-muted-2); font-family: var(--font-mono); }
.ana-findings-list { display: flex; flex-wrap: wrap; padding: 4px 0; }
.ana-finding-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 16px; font-size: 13px; color: var(--c-text); border-bottom: 1px solid var(--c-border-dim); width: 100%; line-height: 1.4; transition: background var(--tr-fast); }
.ana-finding-item:last-child { border-bottom: none; }
.ana-finding-item:hover { background: var(--c-surface-2); }
.ana-finding-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.ana-finding-icon--up { color: var(--c-success); }
.ana-finding-icon--down { color: var(--c-danger); }
.ana-finding-icon--warning { color: var(--c-warning); }
.ana-finding-icon--neutral { color: var(--c-muted-2); }
.ana-finding-icon--info { color: var(--c-info); }
.ana-finding-text strong { font-weight: 600; }
.ana-finding-text em { font-style: normal; color: var(--c-muted); font-size: 12px; }
.ana-health-badge { font-size: 10px; font-weight: 700; font-family: var(--font-mono); letter-spacing: .5px; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; line-height: 1.6; display: none; }
.ana-health-badge.on-track { display: inline-block; background: var(--c-success-bg); color: var(--c-success); }
.ana-health-badge.watch { display: inline-block; background: var(--c-warning-bg); color: var(--c-warning); }
.ana-health-badge.action { display: inline-block; background: var(--c-danger-bg); color: var(--c-danger); }
.ana-insight-callout { background: var(--c-accent-soft); border: 1px solid var(--c-border-dim); border-left: 3px solid var(--c-accent); border-radius: var(--r-md); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.ana-insight-item { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--c-muted); line-height: 1.45; }
.ana-insight-item .material-icons { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.ana-insight-item strong { color: var(--c-text); font-weight: 600; }
.ana-trend-narrative { font-size: 11px; color: var(--c-muted-2); font-family: var(--font-mono); padding: 6px 2px 2px; display: none; gap: 4px; align-items: center; }
.ana-trend-narrative.visible { display: flex; }
.ana-trend-narrative .material-icons { font-size: 13px; }
.ana-tip-icon { font-size: 11px; color: var(--c-muted-2); cursor: help; line-height: 1; flex-shrink: 0; transition: color var(--tr-fast); }
.ana-tip-icon:hover { color: var(--c-accent-text); }
.ana-row-best td:first-child::before { content: '\1F525'; margin-right: 5px; font-size: 11px; }
.ana-row-worst td:first-child::before { content: '\26A0\FE0F'; margin-right: 4px; font-size: 11px; }
.ana-row-best { background: var(--c-success-bg) !important; }
.ana-row-worst { background: var(--c-warning-bg) !important; }

/* ─────────────────────────────────────────────────────────────
   22. Responsive
   ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    #page-main { padding: 16px !important; }
    .page-header { margin-bottom: 16px; }
}
@media (max-width: 768px) {
    .ga-modal { padding: 16px; }
    .ga-modal__box, .ga-modal-box { max-width: 100%; }
    .ga-table thead { display: none; }
    .dt-search { max-width: none; }
}

/* ─────────────────────────────────────────────────────────────
   24. Schedule / attendance grid
   ───────────────────────────────────────────────────────────── */
.sched { --sched-cell: 46px; }

.sched-toolbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 12px;
}
.sched-periodnav {
    display: inline-flex; align-items: center; gap: 2px;
    border: 1px solid var(--c-border); border-radius: var(--r-sm);
    background: var(--c-surface);
    overflow: hidden;
}
.sched-periodnav a, .sched-periodnav span {
    display: inline-flex; align-items: center; justify-content: center;
    height: 34px; padding: 0 12px;
    font-size: 13px; font-weight: 500; color: var(--c-text);
}
.sched-periodnav a:hover { background: var(--c-surface-2); }
.sched-periodnav a[aria-disabled="true"] { color: var(--c-muted-2); pointer-events: none; }
.sched-periodnav .sched-periodnav__label { border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); font-family: var(--font-mono); cursor: default; }

.sched-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 10px 14px; }
.sched-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-muted); }
.sched-legend__sw { width: 20px; height: 18px; border-radius: var(--r-xs); display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; font-family: var(--font-mono); }

.sched-scroll {
    overflow: auto;
    max-height: calc(100vh / var(--app-zoom) - 230px);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
    -webkit-overflow-scrolling: touch;
}
.sched-grid {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    width: max-content;
    min-width: 100%;
}
.sched-grid th, .sched-grid td {
    border-bottom: 1px solid var(--c-border-dim);
    border-right: 1px solid var(--c-border-dim);
}
/* Sticky layering — frozen first/last columns stay above the scrolling grid.
   body cells auto · body pinned cols 4 · header cells 5 · header corners 8 */
.sched-grid thead th {
    position: sticky; top: 0; z-index: 5;
    background: var(--c-surface-2);
    color: var(--c-muted);
    padding: 6px 2px;
    font-weight: 600;
}
.sched-col-emp {
    position: sticky; left: 0; z-index: 4;
    background: var(--c-surface);
    min-width: 210px; max-width: 260px;
    text-align: left;
    box-shadow: 1px 0 0 var(--c-border-hi);
}
.sched-grid thead .sched-col-emp { z-index: 8; }
.sched-col-sum {
    position: sticky; right: 0; z-index: 4;
    background: var(--c-surface);
    min-width: 132px;
    box-shadow: -1px 0 0 var(--c-border-hi);
}
.sched-grid thead .sched-col-sum { z-index: 8; }

.sched-day { min-width: var(--sched-cell); width: var(--sched-cell); text-align: center; line-height: 1.2; white-space: nowrap; }
.sched-day--weekend { background: var(--c-surface-3); }
.sched-day--today { box-shadow: inset 0 -3px 0 var(--c-accent); }
.sched-day__dow { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .4px; color: var(--c-muted-2); }
.sched-day__num { display: block; font-size: 13px; font-weight: 700; color: var(--c-text); }
.sched-day__evt {
    display: block; width: 5px; height: 5px; border-radius: 50%;
    background: var(--c-danger); margin: 2px auto 0;
}
.sched-day--has-event .sched-day__num { color: var(--c-danger); }

.sched-dept-row td {
    background: var(--c-surface-2);
    padding: 0;
}
/* Inner sticky span keeps the label visible while scrolling horizontally */
.sched-dept-label, .pay-dept-label {
    position: sticky; left: 0;
    display: inline-block;
    padding: 6px 14px;
    font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    font-size: 11px; color: var(--c-muted);
    background: var(--c-surface-2);
}

.sched-emp {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 12px;
    width: 100%; text-align: left;
    background: transparent; border: 0; cursor: pointer;
}
.sched-emp:hover { background: var(--c-surface-2); }
.sched-emp__avatar {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--c-accent-dim); color: var(--c-accent-text);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; font-family: var(--font-mono);
}
.sched-emp__name { font-size: 12px; font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-emp__meta { font-size: 10px; color: var(--c-muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sched-cell { padding: 0; text-align: center; height: var(--sched-cell); }
.sched-cell--weekend { background: color-mix(in srgb, var(--c-surface-3) 60%, transparent); }
.sched-cell--today { background: var(--c-accent-soft); }
/* Outside the employee's employment window — not payable, not editable */
.sched-cell--nowork {
    background: repeating-linear-gradient(-45deg, var(--c-surface-2), var(--c-surface-2) 4px, var(--c-surface-3) 4px, var(--c-surface-3) 8px);
}
.sched-cell--nowork .sched-chip { color: var(--c-muted-2); cursor: not-allowed; }
.sched-chip {
    width: 100%; height: var(--sched-cell);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; font-family: var(--font-mono);
    color: var(--c-muted-2);
    background: transparent; border: 0;
    cursor: pointer;
    transition: background var(--tr-fast), color var(--tr-fast);
}
.sched-chip:disabled { cursor: default; }
.sched-cell[data-type="shift"]   .sched-chip { color: var(--c-text); }
/* Day off + absence share a clear red; leave gets a stronger blue for contrast. */
.sched-cell[data-type="day_off"] .sched-chip { background: color-mix(in srgb, var(--c-danger) 18%, transparent); color: var(--c-danger); }
.sched-cell[data-type="leave"]   .sched-chip { background: color-mix(in srgb, var(--c-info) 22%, transparent);   color: var(--c-accent-dark); }
.sched-cell[data-type="absence"] .sched-chip { background: color-mix(in srgb, var(--c-danger) 18%, transparent); color: var(--c-danger); }
.sched-cell[data-type="pending"] .sched-chip { background: var(--c-warning-bg); color: var(--c-warning); }
.sched-chip:not(:disabled):hover { background: var(--c-accent-dim); color: var(--c-accent-text); }
.sched-cell--empty .sched-chip:not(:disabled):hover { color: var(--c-accent-text); }
.sched-cell--empty .sched-chip:not(:disabled):hover::before { content: 'add'; font-family: 'Material Icons Round'; font-size: 15px; }
.sched-cell--empty .sched-chip:not(:disabled):hover span { display: none; }

.sched-sum { display: flex; gap: 8px; padding: 6px 12px; font-family: var(--font-mono); font-size: 11px; }
.sched-sum__k { color: var(--c-muted-2); }
.sched-sum__v { color: var(--c-text); font-weight: 700; }

.sched-hint { font-size: 12px; color: var(--c-muted); display: inline-flex; align-items: center; gap: 5px; }

.sched-att-input {
    width: 46px; height: 28px;
    padding: 2px; text-align: center;
    font-size: 11px; font-family: var(--font-mono);
    border: 1px solid var(--c-border); border-radius: var(--r-xs);
    background: var(--c-surface); color: var(--c-text);
}
.sched-att-input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 2px var(--c-accent-ring); }
.sched-att-input--edited { border-color: var(--c-accent); background: var(--c-accent-soft); }

@media (max-width: 900px) {
    .sched-scroll { max-height: none; }
}

/* ─────────────────────────────────────────────────────────────
   25. Payroll matrix
   ───────────────────────────────────────────────────────────── */
.pay-scroll {
    overflow: auto;
    max-height: calc(100vh / var(--app-zoom) - 210px);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
}
.pay-grid { border-collapse: separate; border-spacing: 0; font-size: 11px; width: max-content; min-width: 100%; }
.pay-grid th, .pay-grid td { border-bottom: 1px solid var(--c-border-dim); border-right: 1px solid var(--c-border-dim); padding: 7px 10px; white-space: nowrap; }
.pay-grid td.num, .pay-grid th.num,
.pay-grid td.mono { text-align: right; font-variant-numeric: tabular-nums; }
/* Keep editable grid rows compact */
.pay-grid td .ga-input, .pay-grid td .ga-textarea {
    height: 30px; min-height: 30px;
    padding: 0 8px; font-size: 11px;
}
/* Sticky layering — keep the frozen "Employee" column above every scrolling column.
   z-index ladder: body cells 1 · body Employee col 4 · header cells 5 ·
   header Employee corner 8 · totals row 6 · totals Employee 9 */
.pay-grid thead th {
    position: sticky; z-index: 5;
    background: var(--c-surface-2); color: var(--c-muted);
    font-weight: 600;
    text-align: center;
    /* Sticky header sits over scrolling rows — force the tint tokens opaque
       (they are translucent color-mix by default) so row content never
       bleeds through and the labels stay readable. */
    --c-success-bg: color-mix(in srgb, var(--c-success) 12%, var(--c-surface));
    --c-danger-bg:  color-mix(in srgb, var(--c-danger) 12%, var(--c-surface));
    --c-accent-dim: color-mix(in srgb, var(--c-accent) 12%, var(--c-surface));
}
.pay-grid thead tr:nth-child(1) th { top: 0; }
.pay-grid thead tr:nth-child(2) th { top: 34px; }
.pay-grid thead tr:nth-child(3) th { top: 68px; }
.pay-grid thead th.pay-grp-earn { background: var(--c-success-bg); color: var(--c-success); }
.pay-grid thead th.pay-grp-ded  { background: var(--c-danger-bg);  color: var(--c-danger); }
.pay-grid thead th.pay-grp-net  { background: var(--c-accent-dim); color: var(--c-accent-text); }
.pay-grid thead th.pay-grp-att  { background: var(--c-surface-3); }
.pay-col-emp {
    position: sticky; left: 0; z-index: 4;
    background: var(--c-surface);
    text-align: left; min-width: 200px;
    box-shadow: 1px 0 0 var(--c-border-hi);
}
.pay-grid thead .pay-col-emp { z-index: 8; background: var(--c-surface); }
.pay-grid tbody tr:hover td:not(.pay-col-emp) { background: var(--c-surface-2); }
.pay-grid tbody tr:hover .pay-col-emp { background: var(--c-surface-2); }
.pay-dept-row td { background: var(--c-surface-2); padding: 0; }
.pay-total-row td { font-weight: 700; background: var(--c-surface-2); position: sticky; bottom: 0; z-index: 6; }
.pay-total-row .pay-col-emp { z-index: 9; background: var(--c-surface-2); }
.pay-net { font-weight: 700; color: var(--c-accent-text); }
.pay-adj-cell { padding: 3px 4px !important; }
.pay-adj-input {
    width: 92px; height: 26px;
    padding: 0 6px;
    font-size: 11px; text-align: right;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--c-border-hi);
    border-radius: var(--r-xs);
    background: var(--c-surface);
    color: var(--c-text);
}
.pay-adj-input:hover { border-color: var(--c-accent); }
.pay-adj-input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 2px var(--c-accent-ring); }
.pay-adj-input:disabled { opacity: .6; }
.pay-adj-input--saved { border-color: var(--c-success); background: var(--c-success-bg); transition: background .3s, border-color .3s; }
.pay-adj-input--busy {
    border-color: var(--c-accent);
    background: var(--c-accent-soft)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%232563eb' d='M12 2a10 10 0 1 0 10 10h-2a8 8 0 1 1-8-8z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.7s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") no-repeat 4px center;
    padding-left: 22px;
}
.pay-comment-cell { max-width: 190px; }
.pay-comment-btn {
    display: inline-flex; align-items: center; gap: 4px;
    max-width: 180px;
    padding: 3px 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-full);
    background: var(--c-surface);
    color: var(--c-muted);
    font-size: 11px;
    cursor: pointer;
    transition: background var(--tr-fast), border-color var(--tr-fast), color var(--tr-fast);
}
.pay-comment-btn:hover { background: var(--c-surface-2); border-color: var(--c-border-hi); color: var(--c-text); }
.pay-comment-btn .pay-comment-text { color: var(--c-text); }
.pay-comment-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 150px; display: inline-block; vertical-align: middle;
    font-size: 11px;
}

/* Workflow status bar (schedule + payroll headers) */
.workflow-bar {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 16px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.workflow-steps { display: inline-flex; align-items: center; gap: 6px; }
.workflow-step { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--c-muted-2); }
.workflow-step__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-border-hi); }
.workflow-step--done { color: var(--c-success); }
.workflow-step--done .workflow-step__dot { background: var(--c-success); }
.workflow-step--current { color: var(--c-accent-text); }
.workflow-step--current .workflow-step__dot { background: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-dim); }
.workflow-sep { width: 16px; height: 1px; background: var(--c-border-hi); }

/* ─────────────────────────────────────────────────────────────
   26. Settings sub-navigation
   ───────────────────────────────────────────────────────────── */
.settings-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
}
.settings-nav__home {
    display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px;
    border-radius: var(--r-full);
    font-size: 12px; font-weight: 600;
    color: var(--c-text);
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    margin-right: 4px;
}
.settings-nav__home:hover { background: var(--c-surface-3); }
.settings-nav__group {
    display: inline-flex; align-items: center; flex-wrap: wrap;
    gap: 4px;
}
.settings-nav__grouplabel {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0;
    color: var(--c-muted-2);
    padding: 0 6px 0 8px;
    border-left: 1px solid var(--c-border);
    margin-left: 4px;
}
.settings-nav__group:first-of-type .settings-nav__grouplabel { border-left: 0; margin-left: 0; }
.settings-nav__link {
    display: inline-flex; align-items: center;
    height: 26px; padding: 0 10px;
    border-radius: var(--r-full);
    font-size: 12px; font-weight: 500;
    color: var(--c-muted);
    white-space: nowrap;
    transition: background var(--tr-fast), color var(--tr-fast);
}
.settings-nav__link:hover { background: var(--c-surface-2); color: var(--c-text); }
.settings-nav__link--active {
    background: var(--c-accent-dim);
    color: var(--c-accent-text);
    font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────
   27. Bulk action bar + quick filter chips
   ───────────────────────────────────────────────────────────── */
.bulk-bar {
    position: sticky;
    bottom: 16px;
    z-index: 15;
    display: flex; align-items: center; gap: 12px;
    margin: 16px auto 0;
    padding: 10px 12px 10px 16px;
    max-width: 640px;
    background: var(--c-text);
    color: #fff;
    border-radius: var(--r-full);
    box-shadow: var(--sh-lg);
    animation: fade-up .2s ease;
}
.bulk-bar[hidden] { display: none; }
.bulk-bar__count { font-size: 13px; font-weight: 600; flex: 1; }
.bulk-bar .btn { height: 30px; }
.bulk-bar .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.bulk-bar .btn-secondary:hover { background: rgba(255,255,255,.12); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 12px;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    font-size: 12px; font-weight: 600;
    color: var(--c-muted);
    transition: background var(--tr-fast), color var(--tr-fast), border-color var(--tr-fast);
}
.chip:hover { background: var(--c-surface-2); color: var(--c-text); }
.chip--active { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.chip__n {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: var(--r-full);
    background: color-mix(in srgb, currentColor 15%, transparent);
}

/* Expandable group sub-row */
.row-expand-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    border-radius: var(--r-xs);
    color: var(--c-muted-2);
}
.row-expand-btn:hover { background: var(--c-surface-2); color: var(--c-text); }
.row-expand-btn .material-icons-round { font-size: 18px; transition: transform var(--tr-fast); }
.row-expand-btn[aria-expanded="true"] .material-icons-round { transform: rotate(90deg); }
.subrow > td { background: var(--c-surface-2); padding: 0 !important; }
.subrow__inner { padding: 8px 16px 8px 52px; display: flex; flex-direction: column; gap: 4px; }
.subrow__item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--c-muted); }

/* Row fading out after an optimistic action */
tr.row-done td { transition: background .3s ease; }
tr.row-removing { opacity: 0; transform: translateX(12px); transition: opacity .25s ease, transform .25s ease; }

/* Row waiting on a server round-trip */
tr.row-busy { position: relative; }
tr.row-busy > td { opacity: .55; }
tr.row-busy > td:first-child::after {
    content: '';
    position: absolute; left: 10px; top: 50%;
    width: 14px; height: 14px; margin-top: -7px;
    border: 2px solid var(--c-border-hi);
    border-top-color: var(--c-accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────────
   23. Print
   ───────────────────────────────────────────────────────────── */
@media print {
    #sidebar, header.app-header, .page-header__actions, .dt-toolbar, .settings-nav, #toast-container { display: none !important; }
    #page-main { overflow: visible !important; padding: 0 !important; }
    .ga-card-elevated, .ga-card, .stat-card { box-shadow: none !important; border-color: #ccc !important; }
    body { background: #fff; }
}

/* ─────────────────────────────────────────────────────────────
   24. Reports hub + Employee report + Org chart
   ───────────────────────────────────────────────────────────── */
.report-section-title {
    font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--c-muted); margin-bottom: 12px;
}
.report-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.report-tile {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; background: var(--c-surface);
    border: 1px solid var(--c-border); border-radius: var(--r-lg);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.report-tile:hover {
    border-color: var(--c-border-hi);
    box-shadow: 0 4px 14px rgba(28,26,23,.08), 0 1px 3px rgba(28,26,23,.05);
    transform: translateY(-1px);
}
.report-tile__icon {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--r-md);
    display: grid; place-items: center;
    background: var(--c-accent-dim); color: var(--c-accent-text);
}
.report-tile__icon .material-icons-round { font-size: 21px; }
.report-tile__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.report-tile__title { font-size: 13.5px; font-weight: 600; color: var(--c-text); }
.report-tile__text  { font-size: 12px; color: var(--c-muted); line-height: 1.45; }
.report-tile__go { margin-left: auto; color: var(--c-muted-2); flex: 0 0 auto; }
.report-tile:hover .report-tile__go { color: var(--c-accent-text); }

/* Employee report — section blocks */
.emp-report-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.emp-block { border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); overflow: hidden; }
.emp-block__head {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px; border-bottom: 1px solid var(--c-border);
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted);
}
.emp-block__head .material-icons-round { font-size: 16px; color: var(--c-accent-text); }
.emp-block__body { padding: 4px 14px 10px; }
.emp-kv { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--c-border); }
.emp-kv:last-child { border-bottom: 0; }
.emp-kv dt { color: var(--c-muted); }
.emp-kv dd { font-weight: 500; text-align: right; }
.emp-block__empty { padding: 14px; font-size: 12px; color: var(--c-muted-2); text-align: center; }

/* ── Organization chart — top-down interactive tree ─────────── */
.orgchart-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.orgchart-zoom { display: inline-flex; align-items: center; border: 1px solid var(--c-border); border-radius: var(--r-sm); background: var(--c-surface); overflow: hidden; }
.orgchart-zoom button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: var(--c-muted); }
.orgchart-zoom button:hover { background: var(--c-surface-2); color: var(--c-text); }
.orgchart-zoom span { min-width: 48px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--c-muted); }

.orgchart-scroll {
    overflow: auto; border: 1px solid var(--c-border); border-radius: var(--r-lg);
    padding: 32px 32px 40px;
    background:
        linear-gradient(var(--c-border-dim) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, var(--c-border-dim) 1px, transparent 1px) 0 0 / 24px 24px,
        var(--c-surface);
    cursor: grab; user-select: none;
}
.orgchart-scroll.is-dragging { cursor: grabbing; }
.orgchart { display: inline-block; min-width: 100%; }
.orgchart ul { display: flex; justify-content: center; padding-top: 26px; position: relative; margin: 0; padding-left: 0; list-style: none; }
.orgchart > ul { padding-top: 0; flex-wrap: wrap; row-gap: 24px; }
.orgchart li { position: relative; padding: 26px 13px 0; list-style: none; display: flex; flex-direction: column; align-items: center; }

/* connector lines */
.orgchart li::before, .orgchart li::after {
    content: ''; position: absolute; top: 0; width: 50%; height: 26px;
    border-top: 2px solid var(--c-border-hi);
}
.orgchart li::before { right: 50%; }
.orgchart li::after  { left: 50%; border-left: 2px solid var(--c-border-hi); }
.orgchart li:first-child::before, .orgchart li:last-child::after { border: 0 none; }
.orgchart li:last-child::before { border-right: 2px solid var(--c-border-hi); border-radius: 0 7px 0 0; }
.orgchart li:first-child::after { border-radius: 7px 0 0 0; }
.orgchart li:only-child::before, .orgchart li:only-child::after { display: none; }
.orgchart li:only-child { padding-top: 0; }
.orgchart ul ul::before {
    content: ''; position: absolute; top: 0; left: 50%; width: 0; height: 26px;
    border-left: 2px solid var(--c-border-hi);
}
.orgchart > ul > li { padding-top: 0; }
.orgchart > ul > li::before, .orgchart > ul > li::after { display: none; }
.orgchart li.is-collapsed > ul { display: none; }

/* node card */
.oc-card {
    position: relative; width: 214px; background: var(--c-surface);
    border: 1px solid var(--c-border); border-radius: var(--r-md);
    box-shadow: 0 1px 3px rgba(28,26,23,.08); text-align: left; overflow: hidden;
    transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.oc-card:hover { border-color: var(--c-accent); box-shadow: 0 6px 18px rgba(28,26,23,.12); transform: translateY(-1px); }
.oc-card__head { background: #5b6472; color: #fff; padding: 8px 11px; }
.oc-card__name { display: block; font-size: 12.5px; font-weight: 700; color: #fff; text-decoration: none; line-height: 1.25; }
.oc-card__name:hover { text-decoration: underline; }
.oc-card__title { display: block; font-size: 10.5px; color: rgba(255,255,255,.72); margin-top: 1px; line-height: 1.3; }
.oc-card__body { display: flex; gap: 9px; padding: 9px 11px 10px; }
.oc-card__photo {
    width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover; flex: 0 0 auto;
    background: var(--c-accent-dim); color: var(--c-accent-text);
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.oc-card__meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 10px; color: var(--c-muted); padding-top: 1px; }
.oc-card__meta span { display: flex; align-items: center; gap: 4px; min-width: 0; }
.oc-card__meta span > .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-card__meta .material-icons-round { font-size: 12px; color: var(--c-muted-2); flex: 0 0 auto; }

.oc-toggle {
    position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%);
    width: 22px; height: 22px; border-radius: var(--r-full); padding: 0;
    border: 2px solid var(--c-border-hi); background: var(--c-surface);
    color: var(--c-muted); font-size: 12px; font-weight: 700; line-height: 1;
    display: grid; place-items: center; cursor: pointer; z-index: 3;
}
.oc-toggle:hover { border-color: var(--c-accent); color: var(--c-accent-text); }
.orgchart li.is-collapsed > .oc-card .oc-toggle { border-color: var(--c-accent); background: var(--c-accent-dim); color: var(--c-accent-text); }

/* headcount-by-department mini list (kept below the chart) */
.org-dept-col { break-inside: avoid; }

/* ── Employee quick-view modal ──────────────────────────────── */
.ec-msg { padding: 24px 4px; text-align: center; font-size: 13px; color: var(--c-muted); }
.ec-head { display: flex; gap: 14px; align-items: flex-start; }
.ec-photo {
    width: 104px; height: 104px; flex: 0 0 auto; border-radius: var(--r-md); object-fit: cover;
    background: var(--c-accent-dim); color: var(--c-accent-text);
    display: grid; place-items: center; font-size: 32px; font-weight: 700;
    border: 1px solid var(--c-border);
}
.ec-name { font-size: 16px; font-weight: 700; color: var(--c-text); line-height: 1.25; }
.ec-nick { font-weight: 500; color: var(--c-muted); font-size: 14px; }
.ec-title-line { font-size: 13px; color: var(--c-muted); margin-top: 1px; }
.ec-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ec-rows { display: flex; flex-direction: column; margin-top: 16px; border-top: 1px solid var(--c-border); }
.ec-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--c-border); }
.ec-row:last-child { border-bottom: 0; }
.ec-row .material-icons-round { font-size: 17px; color: var(--c-muted-2); flex: 0 0 auto; }

/* name rendered as a clickable trigger for the modal */
.emp-peek {
    background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
    font: inherit; color: inherit; text-align: left;
}
.emp-peek:hover { color: var(--c-accent-text); text-decoration: underline; }
.oc-card__photo--peek, .emp-photo--peek { cursor: pointer; }
.oc-card__photo--peek:hover, .emp-photo--peek:hover { outline: 2px solid var(--c-accent); outline-offset: 1px; }

/* ── Salary Increase — per-row decision cell (new / % / +amount) ── */
.si-cell { display: flex; gap: 6px; }
.si-cell label {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 9px; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted-2);
}
.si-cell input {
    width: 62px; height: 30px; padding: 0 6px;
    border: 1px solid var(--c-border-hi); border-radius: var(--r-xs);
    background: var(--c-surface); color: var(--c-text);
    font-size: 12px; font-variant-numeric: tabular-nums;
}
.si-cell .si-new { width: 120px; height: 34px; font-size: 13px; font-weight: 600; }
.si-cell input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-dim); }

/* ── Payroll / Benefit history report ──────────────────────── */
.rh-seg { display: inline-flex; border: 1px solid var(--c-border-hi); border-radius: var(--r-sm); overflow: hidden; height: 38px; }
.rh-seg label {
    display: inline-flex; align-items: center; padding: 0 14px; font-size: 13px;
    color: var(--c-muted); cursor: pointer; background: var(--c-surface); white-space: nowrap;
}
.rh-seg label + label { border-left: 1px solid var(--c-border-hi); }
.rh-seg label:hover { background: var(--c-surface-2); color: var(--c-text); }
.rh-seg label.is-on { background: var(--c-accent); color: #fff; font-weight: 600; }
.rh-seg input { position: absolute; opacity: 0; pointer-events: none; }

.rh-block { border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 14px 16px 16px; background: var(--c-surface); }
.rh-block__head { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); margin-bottom: 12px; }
.rh-block__head .rh-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--c-muted-2); }

.rh-chart { width: 100%; overflow: hidden; }
.rh-svg { width: 100%; height: 260px; display: block; }
.rh-grid { stroke: var(--c-border-dim); stroke-width: 1; }
.rh-axis { fill: var(--c-muted-2); font-size: 10px; }
.rh-axis--x { text-anchor: middle; }
.rh-bar { fill: var(--c-accent); transition: fill .12s ease; }
.rh-bar:hover { fill: var(--c-accent-dark); }
.rh-line { fill: none; stroke: var(--c-text); stroke-width: 1.5; stroke-opacity: .55; }
.rh-dot { fill: var(--c-text); }
.rh-stack-seg { stroke: var(--c-surface); stroke-width: .75; transition: opacity .12s ease; }
.rh-stack-seg:hover { opacity: .82; }
.rh-net-mark { stroke: var(--c-text); stroke-width: 2; }

.rh-legend { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 10px; }
.rh-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-muted); }
.rh-sw { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.rh-sw--line { height: 3px; border-radius: 0; background: var(--c-text); }

.rh-breakdown { display: flex; flex-direction: column; gap: 3px; }
.rh-brow { display: grid; grid-template-columns: 160px 1fr 170px; align-items: center; gap: 12px; font-size: 12.5px; padding: 3px 0; }
.rh-brow__lbl { color: var(--c-muted); }
.rh-brow__bar { height: 12px; background: var(--c-surface-2); border-radius: 3px; overflow: hidden; }
.rh-brow__bar > span { display: block; height: 100%; border-radius: 3px; }
.rh-brow__val { text-align: right; font-variant-numeric: tabular-nums; color: var(--c-text); }
.rh-brow__pct { color: var(--c-muted-2); font-size: 11px; }
.rh-brow--sep { border-top: 1px solid var(--c-border); margin-top: 4px; padding-top: 7px; }
.rh-brow--sep .rh-brow__lbl { color: var(--c-text); font-weight: 600; }

.rh-tip {
    position: absolute; z-index: 60; pointer-events: none;
    background: var(--c-text); color: #fff; font-size: 11.5px; font-weight: 500;
    padding: 5px 9px; border-radius: var(--r-xs); white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,.2);
}

/* ─────────────────────────────────────────────────────────────
   HR notes book (hr-notes/show)
   ───────────────────────────────────────────────────────────── */
.hrn-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
@media (min-width: 1024px) { .hrn-layout { grid-template-columns: 220px minmax(0, 1fr); } }
.hrn-index { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.hrn-index__item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: var(--r-sm);
    font-size: 13px; color: var(--c-muted);
}
.hrn-index__item:hover { background: var(--c-surface-2); color: var(--c-text); }
.hrn-index__item .material-icons-round { font-size: 17px; }
.hrn-index__item .chip__n { margin-left: auto; }
.hrn-index__item--empty { opacity: .6; }
.hrn-section { scroll-margin-top: 80px; }
.hrn-section + .hrn-section { margin-top: 20px; }
.hrn-section__head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--c-border-dim);
}
.hrn-section__head h3 { font-size: 14px; font-weight: 600; color: var(--c-text); margin: 0; }
.hrn-topic { padding: 12px 18px 4px; }
.hrn-topic + .hrn-topic { border-top: 1px dashed var(--c-border-dim); }
.hrn-topic__head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.hrn-topic__head h4 { font-size: 13px; font-weight: 600; color: var(--c-text); margin: 0; }
.hrn-topic__actions { margin-left: auto; display: flex; gap: 2px; opacity: .55; transition: opacity var(--tr-fast); }
.hrn-topic:hover .hrn-topic__actions, .hrn-topic:focus-within .hrn-topic__actions { opacity: 1; }
.hrn-note {
    border: 1px solid var(--c-border-dim); border-left: 3px solid var(--c-warning);
    border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 10px;
    background: var(--c-surface); scroll-margin-top: 90px;
}
.hrn-note[data-status="resolved"]     { border-left-color: var(--c-success); }
.hrn-note[data-status="carried_over"] { border-left-color: var(--c-border); opacity: .8; }
.hrn-note:target, .hrn-note.is-flash { box-shadow: 0 0 0 3px var(--c-accent-ring); }
.hrn-note__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hrn-note__title { font-size: 13.5px; font-weight: 600; color: var(--c-text); }
.hrn-note__meta { font-size: 12px; color: var(--c-muted); }
.hrn-note__actions { margin-left: auto; display: flex; gap: 2px; }
.hrn-note__people { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.hrn-note__foot { margin-top: 8px; font-size: 11.5px; color: var(--c-muted-2); }
.hrn-person { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-full); background: var(--c-surface-2); font-size: 12px; color: var(--c-text); }
.hrn-person .material-icons-round { font-size: 14px; color: var(--c-muted); }
.hrn-person button { display: inline-flex; color: var(--c-muted); }
.hrn-person button:hover { color: var(--c-danger); }
.rich-text { font-size: 13.5px; line-height: 1.55; color: var(--c-text); margin-top: 6px; overflow-wrap: anywhere; }
.rich-text p { margin: 0 0 6px; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { margin: 4px 0 6px; padding-left: 20px; }
.rich-text ul { list-style: disc; }
.rich-text ol { list-style: decimal; }
.rich-text h2, .rich-text h3, .rich-text h4 { font-weight: 600; margin: 8px 0 4px; }
.rich-text blockquote { border-left: 3px solid var(--c-border); padding-left: 10px; color: var(--c-muted); }
.rich-text a { color: var(--c-accent-text); text-decoration: underline; }
