/* Commander HRIS — application styles.
   Self-hosted, no CDN: the Content-Security-Policy in config/security.php
   permits scripts, styles, fonts and images from 'self' only (img-src also
   allows data:). Nothing here may become a `style` attribute in a view —
   that would force 'unsafe-inline' into style-src for the whole application.
   Anything a template needs to vary is a class, at the bottom of this file.

   Palette is taken from the company seal: the navy of the shield ring, the
   gold of the three stars, the green of the laurel. It is used sparingly —
   a payroll register is not a poster. */

:root {
    /* Tells the browser this page supplies its own light and dark
       palettes (below), so it must not silently re-theme native controls -
       inputs, checkboxes, the password dot colour - with ITS OWN internal
       dark styling on top of ours. Omitting this is the standard cause of
       "the password field shows nothing while typing" on a dark-mode OS:
       the browser paints a control using its own light-dark() logic
       underneath a transparent author background, and author `color` can
       end up matching that internal layer rather than overriding it. */
    color-scheme: light;

    /* Brand — sampled from the seal. */
    --brand:      #1b3a7a;   /* shield navy      */
    --brand-2:    #2c5aa8;   /* lighter royal    */
    --brand-3:    #12294f;   /* deepest, sidebar */
    --gold:       #e0a900;   /* the three stars  */

    /* The call to action, sampled from the sign-in button: a bright cyan
       falling into azure. It is the one high-chroma thing on any screen,
       which is what makes it read as the action to take. */
    --cta:        #00d0ff;
    --cta-2:      #0077f2;
    --cta-deep:   #0a5ed0;
    --gold-soft:  #f6c944;
    --laurel:     #2f7d4f;   /* the wreath       */

    /* Ground and surfaces */
    --ground:   #eef1f6;
    --surface:  #ffffff;
    --surface-2:#f2f5f9;
    --surface-3:#e6ebf2;

    /* Ink. Every one of these clears 4.5:1 on --surface; --ink-2 and --ink-3
       used to sit at 4.06:1 on white and 3.75:1 on the page ground — below
       AA for body text, which is why secondary copy read as washed out. */
    --ink:      #101a29;   /* 17.5:1 on white */
    --ink-2:    #35455c;   /*  9.7:1 */
    --ink-3:    #55657c;   /*  5.9:1, and 5.2:1 on --ground */

    --rule:        #d8e0ea;
    --rule-strong: #b6c3d4;

    --accent:   var(--brand);
    --accent-ink: #ffffff;

    --ok:       #1f6b4d;
    --ok-bg:    #e8f5ee;
    --warn:     #8a5410;
    --warn-bg:  #fdf3e0;
    --fail:     #a32a2a;
    --fail-bg:  #fdecec;
    /* Same amber as employee_groups.badge_color for the MANPOWER group
       (migration 0036), so the workforce reads as one colour everywhere. */
    --manpower:    #b45309;
    --manpower-bg: #fcefe0;

    /* Sidebar keeps its own scale: it is dark in both themes, so it cannot
       borrow the page tokens without inverting in one of them. */
    --side-bg:      #0f4490;
    --side-bg-2:    #072c62;
    --side-ink:     #eaf2ff;
    --side-ink-2:   #a9c4e8;
    --side-rule:    #1d5aa8;
    --side-hover:   #14539f;

    --shadow-1: 0 1px 2px rgba(16, 26, 41, .06), 0 1px 3px rgba(16, 26, 41, .04);
    --shadow-2: 0 2px 4px rgba(16, 26, 41, .06), 0 6px 16px rgba(16, 26, 41, .08);
    --shadow-3: 0 12px 32px rgba(16, 26, 41, .14);

    --r-sm: 4px;
    --r:    8px;
    --r-lg: 12px;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --ground:   #0b1220;
        --surface:  #131c2b;
        --surface-2:#182334;
        --surface-3:#1f2c40;

        --ink:      #e9eef6;   /* 14.7:1 on --surface */
        --ink-2:    #b9c6d8;   /*  9.9:1 */
        --ink-3:    #93a3ba;   /*  6.7:1 */

        --rule:        #253247;
        --rule-strong: #37475f;

        --brand-2:  #6f9be0;
        --accent:   #7ea8e8;
        --accent-ink: #0b1220;

        --gold:     #f0c14b;
        --gold-soft:#f7d67e;
        --laurel:   #5cae82;

        --ok:       #5cae82;
        --ok-bg:    #14291f;
        --warn:     #d9a860;
        --warn-bg:  #2a2216;
        --fail:     #e08484;
        --fail-bg:  #2c1a1a;
        --manpower:    #e0a85c;
        --manpower-bg: #2b2013;

        --side-bg:    #0a3068;
        --side-bg-2:  #051e44;
        --side-rule:  #14417e;
        --side-hover: #0f3d80;

        --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-2: 0 2px 4px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .35);
        --shadow-3: 0 12px 32px rgba(0, 0, 0, .5);
    }
}

* { box-sizing: border-box; }

/* The `hidden` attribute has to actually hide.

   The browser implements it as `[hidden] { display: none }` in its own
   stylesheet, which ANY class rule setting `display` outranks - `.photo-video
   { display: block }` beat it, and the camera block rendered every element and
   every button at once no matter what the script hid.

   With no JavaScript able to set a style attribute here (style-src is 'self',
   no 'unsafe-inline'), toggling `el.hidden` is how this application shows and
   hides things. That makes this rule load-bearing rather than a tidy-up. */
[hidden] { display: none !important; }

/* The rem base every component size in this file scales from. Raised from
   the 16px default to make the whole app - every nav label, table cell and
   button, all of it sized in rem - modestly larger and easier to read
   without hand-editing each of those sizes individually. */
html { font-size: 17px; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 16px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--brand-2); text-underline-offset: .15em; }
a:hover { color: var(--brand); }
@media (prefers-color-scheme: dark) { a:hover { color: #a8c6f0; } }

::selection { background: var(--gold-soft); color: #101a29; }

/* ─────────────────────────────────────────────────────────────
   Pre-authentication shell — installer, login, errors, health
   ───────────────────────────────────────────────────────────── */

.shell { max-width: 62rem; margin: 0 auto; padding: 0 1.5rem 4rem; }

.masthead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 1.75rem 0 1.25rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 2.25rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .85rem; }

/* The seal is artwork of unknown proportions - the file supplied was a
   1200x630 canvas with the shield in the middle. Capping only the height lets
   a wide file run off sideways, so both axes are capped and object-fit does
   the letterboxing. */
.brand-logo {
    display: block; height: 3rem; width: 3rem; max-width: 3rem;
    object-fit: contain; flex: none;
}

/* Fallback monogram, shown when no logo file is installed. */
.brand .mark {
    display: grid; place-items: center; width: 3rem; height: 3rem;
    background: linear-gradient(160deg, var(--brand-2), var(--brand));
    color: #fff; border-radius: var(--r);
    font-weight: 700; font-size: .95rem; letter-spacing: .04em;
    box-shadow: var(--shadow-1); flex: none;
}
.brand strong { display: block; font-size: 1.1rem; letter-spacing: -.01em; }
.brand small { display: block; color: var(--ink-3); font-size: .8rem; }
.version { color: var(--ink-3); font-size: .75rem; font-family: var(--mono); }

/* ── Typography ─────────────────────────────────────────────── */

h1 { font-size: 1.6rem; margin: 0 0 .4rem; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1.08rem; margin: 2rem 0 .8rem; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: .95rem; margin: 1.6rem 0 .65rem; font-weight: 650; }
.lede { color: var(--ink-2); margin: 0 0 1.75rem; max-width: 48rem; font-size: .98rem; }

/* Section headings earn a gold tick — the one decorative flourish, and it
   ties the page to the seal without colouring anything that carries meaning. */
.app main h2 {
    display: flex; align-items: center; gap: .6rem;
}
.app main h2::before {
    content: ""; width: 3px; height: 1em; flex: none;
    background: var(--gold); border-radius: 2px;
}

/* ── Cards ──────────────────────────────────────────────────── */

.card {
    background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r); padding: 1.4rem 1.5rem; margin-bottom: 1.25rem;
    box-shadow: var(--shadow-1);
}
.card.narrow { max-width: 28rem; }

/* photo/show.php's Place card - Leaflet needs an explicit height, or it
   collapses to zero and renders nothing. */
.place-map { height: 18rem; border-radius: var(--r-sm); margin-top: .9rem; overflow: hidden; }

/* The Coordinates row's two pieces (the raw reading, then the reverse-
   geocoded name) each need the full width of the dd, or .kv-list dd's own
   flex-wrap treats them as wrapping inline content and a plain <br> between
   them is ignored - they end up crowding onto one line instead of stacking. */
.place-coords { flex: 1 1 100%; display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .6rem; }
.place-name {
    flex: 1 1 100%; display: flex; align-items: center; gap: .4rem;
    color: var(--ink-2); font-size: .88rem;
}
.place-name .doc-icon { color: var(--ink-3); opacity: .9; }

/* M.5: a widget the reader may not see keeps its footprint, muted, rather
   than vanishing - they should know something exists there. */
.widget-muted { opacity: .6; border-style: dashed; background: var(--surface-2); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); gap: 1.1rem; }

/* ── Checks ─────────────────────────────────────────────────── */

.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
    display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem;
    padding: .8rem 0; border-bottom: 1px solid var(--rule); align-items: start;
}
.checks li:last-child { border-bottom: 0; }
.checks li:first-child { padding-top: 0; }
.checks .label { font-weight: 650; font-size: .93rem; }
.checks .detail { color: var(--ink-2); font-size: .88rem; }

.badge {
    display: inline-block; font-size: .66rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; padding: .28rem .45rem;
    border-radius: var(--r-sm); text-align: center; width: 100%;
}
.badge.ok   { color: var(--ok);   border: 1px solid var(--ok);   background: var(--ok-bg); }
.badge.warn { color: var(--warn); border: 1px solid var(--warn); background: var(--warn-bg); }
.badge.fail { color: var(--fail); border: 1px solid var(--fail); background: var(--fail-bg); }

/* ── Notices ────────────────────────────────────────────────── */

.notice {
    border: 1px solid var(--rule); border-left: 4px solid var(--rule-strong);
    padding: .95rem 1.15rem; margin: 0 0 1.25rem;
    background: var(--surface); border-radius: var(--r);
    box-shadow: var(--shadow-1);
}
/* Controllers flash 'success' / 'warning' / 'error'; they are the same three states. */
.notice.fail, .notice.error   { border-left-color: var(--fail); background: var(--fail-bg); border-color: var(--fail-bg); }
.notice.warn, .notice.warning { border-left-color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bg); }
.notice.ok,   .notice.success { border-left-color: var(--ok);   background: var(--ok-bg);   border-color: var(--ok-bg); }
.notice p { margin: 0 0 .4rem; }
.notice p:last-child { margin-bottom: 0; }
.notice strong { display: block; margin-bottom: .3rem; }

/* ── Forms ──────────────────────────────────────────────────── */

fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
legend {
    font-size: .7rem; font-weight: 700; letter-spacing: .11em;
    text-transform: uppercase; color: var(--ink-3); padding: 0; margin-bottom: .7rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1.1rem; }
.grid-centered { align-items: center; gap: 1.5rem; }
.logo-preview { max-width: 180px; max-height: 180px; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .83rem; font-weight: 650; color: var(--ink); }
.field .hint { font-size: .78rem; color: var(--ink-3); }

input, select, textarea {
    font: inherit; font-size: .93rem; padding: .6rem .7rem;
    border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
    background: var(--surface); color: var(--ink); width: 100%;
    transition: border-color .12s ease, box-shadow .12s ease;
    /* Belt and braces alongside color-scheme above: pins the actual paint
       colour and the blinking cursor to OUR tokens explicitly, so neither
       can silently resolve to a browser-internal value that happens to
       match the field's own background - which is what an invisible
       password field actually is. */
    caret-color: var(--ink);
    -webkit-text-fill-color: var(--ink);
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--brand-2); outline-offset: 2px;
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px rgba(44, 90, 168, .14);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--fail); }
.error { color: var(--fail); font-size: .8rem; font-weight: 600; }

/* ── Segmented choice (mutually exclusive, 2-4 options) ─────────────
 *
 * A plain radio list reads as an ordinary form question; a segmented
 * control reads as a decision, which is the right weight for one that
 * changes how a whole batch of pay gets computed - "who this applies to",
 * "what unit this value was stated in". Built on real <input type="radio">
 * inside each <label>, so a click anywhere in a segment selects it and the
 * whole thing keeps working with CSS disabled; :checked does the
 * highlighting, so nothing here needs a script. */
.segmented {
    display: flex; flex-wrap: wrap; border: 1px solid var(--rule-strong);
    border-radius: var(--r-sm); overflow: hidden; background: var(--surface);
}
.segmented-option {
    flex: 1 1 11rem; display: flex; position: relative; cursor: pointer;
    border-left: 1px solid var(--rule-strong);
}
.segmented-option:first-child { border-left: 0; }
/* Visually hidden, never display:none - a hidden-by-display radio drops out
   of tab order in some browsers. This keeps it focusable and clickable
   while every pixel of what's seen is the label text next to it. */
.segmented-option input {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    opacity: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.segmented-option-body {
    flex: 1; display: flex; flex-direction: column; gap: .15rem;
    padding: .65rem .9rem; text-align: center;
    transition: background .12s ease, color .12s ease;
}
.segmented-option-title { font-weight: 650; font-size: .88rem; color: var(--ink); }
.segmented-option-caption { font-size: .76rem; color: var(--ink-3); }
.segmented-option:hover .segmented-option-body { background: var(--surface-2); }
.segmented-option input:checked ~ .segmented-option-body { background: var(--accent); }
.segmented-option input:checked ~ .segmented-option-body .segmented-option-title,
.segmented-option input:checked ~ .segmented-option-body .segmented-option-caption {
    color: var(--accent-ink);
}
.segmented-option input:focus-visible ~ .segmented-option-body {
    outline: 2px solid var(--brand-2); outline-offset: -2px;
}
@media (max-width: 30rem) {
    .segmented { flex-direction: column; }
    .segmented-option { border-left: 0; border-top: 1px solid var(--rule-strong); }
    .segmented-option:first-child { border-top: 0; }
}

/* ── Buttons ────────────────────────────────────────────────────
 *
 * The complaint these sizes answer: buttons sat hard against the text next
 * to them. The margin below is on the button itself rather than on every
 * toolbar that holds one, so a button dropped into a paragraph, a table cell
 * or a form row keeps its distance without the template asking. */

a.btn, button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    font: inherit; font-weight: 650; font-size: .9rem; line-height: 1.2;
    padding: .62rem 1.25rem; border: 1px solid transparent;
    background: linear-gradient(90deg, var(--cta-deep), var(--cta-2));
    color: #fff; border-radius: var(--r-sm); cursor: pointer;
    text-decoration: none; white-space: nowrap;
    box-shadow: var(--shadow-1);
    transition: transform .1s ease, box-shadow .12s ease, filter .12s ease;
}
a.btn:hover, button:hover, .btn:hover {
    filter: brightness(1.08); box-shadow: var(--shadow-2);
    transform: translateY(-1px); color: #fff;
}
a.btn:active, button:active, .btn:active { transform: translateY(0); box-shadow: var(--shadow-1); }
button[disabled], .btn[disabled] {
    opacity: .5; cursor: not-allowed; transform: none;
    box-shadow: none; filter: none;
}

.btn-quiet {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    font: inherit; font-size: .87rem; font-weight: 650; line-height: 1.2;
    padding: .55rem 1rem; border: 1px solid var(--rule-strong);
    background: var(--surface); color: var(--ink-2);
    border-radius: var(--r-sm); cursor: pointer; text-decoration: none;
    white-space: nowrap; transition: background .12s ease, border-color .12s ease, color .12s ease;
    box-shadow: none;
}
.btn-quiet:hover {
    border-color: var(--ink-3); color: var(--ink);
    background: var(--surface-2); transform: none; filter: none;
}
button.danger, .btn-quiet.danger {
    border-color: var(--fail); background: transparent; color: var(--fail);
    box-shadow: none; filter: none;
}
button.danger:hover, .btn-quiet.danger:hover { background: var(--fail); color: #fff; filter: none; }

/* Anything holding controls gets real breathing room. */
.toolbar {
    display: flex; gap: 1rem; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem; flex-wrap: wrap;
}
.inline { display: inline-flex; gap: .6rem; align-items: center; margin: 0; }

/* A document that needs something typed before it generates (Section L):
   the button is the summary, the inputs unfold beneath it. */
.doc-ask { display: inline-block; vertical-align: top; margin: 0 .6rem .6rem 0; }
.doc-ask > summary { list-style: none; cursor: pointer; }
.doc-ask > summary::-webkit-details-marker { display: none; }
.doc-ask[open] { display: block; padding: .75rem; border: 1px solid var(--rule); border-radius: var(--r); }
.doc-ask[open] > summary { margin-bottom: .75rem; }
.toolbar > * + *, .inline > * + * { margin-left: 0; }

/* ── Logs and code ──────────────────────────────────────────── */

pre, .log {
    background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r);
    padding: 1rem 1.15rem; overflow-x: auto;
    font: 13px/1.6 var(--mono);
    margin: 0 0 1.25rem; color: var(--ink);
}
.log ol { margin: 0; padding-left: 1.4rem; }
.log li { margin-bottom: .25rem; }

ol.steps { padding-left: 1.3rem; color: var(--ink-2); }
ol.steps li { margin-bottom: .65rem; }

code {
    background: var(--surface-2); border: 1px solid var(--rule);
    border-radius: var(--r-sm); padding: .1em .35em;
    font: .86em var(--mono);
}

footer {
    margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
    color: var(--ink-3); font-size: .82rem;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    a.btn:hover, button:hover, .btn:hover { transform: none; }
}

/* ─────────────────────────────────────────────────────────────
   Authenticated application shell
   ───────────────────────────────────────────────────────────── */

.skip {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--brand); color: #fff; padding: .7rem 1.1rem;
    border-radius: 0 0 var(--r-sm) 0; font-weight: 650;
}
.skip:focus { left: 0; }

/* Screen-reader-only labels on the icon-only drawer controls. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The icon sprite is defined once and never painted itself. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell { display: grid; grid-template-columns: 16.5rem 1fr; min-height: 100vh; }

/* ── The drawer ────────────────────────────────────────────────────────
 *
 * Wide screens: the sidebar is just a grid column, and the checkbox, the
 * scrim and both labels are inert. Narrow screens: the column collapses,
 * the sidebar becomes a fixed panel parked off the left edge, and :checked
 * slides it back. It is a checkbox rather than six lines of JavaScript
 * because script-src is 'self' and a control already in the platform does
 * not need reimplementing. The input sits off-screen rather than carrying
 * `hidden`, so it stays reachable by keyboard.
 */
.nav-toggle { position: absolute; left: -9999px; }
.nav-scrim, .nav-burger, .nav-close { display: none; }

.sidebar {
    /* Read by both .sidebar-brand and .nav-group-summary below - defined
       once, here, on their common ancestor, so the two stay in step by
       construction rather than by two numbers somebody has to keep equal
       by hand. */
    --sidebar-brand-h: 4.5rem;
    background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
    border-right: 1px solid var(--side-rule);
    display: flex; flex-direction: column; padding: 0 0 1.25rem;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--side-rule) transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--side-rule); border-radius: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* The brand block stays put while ninety menu rows scroll underneath it.
   min-height matches --sidebar-brand-h (declared on .sidebar above), which
   every open group's own sticky header (.nav-group-summary) uses to park
   itself right below this bar. */
.sidebar-brand {
    display: flex; gap: .7rem; align-items: center;
    min-height: var(--sidebar-brand-h);
    padding: .95rem 1rem .85rem;
    border-bottom: 1px solid var(--side-rule);
    position: sticky; top: 0; z-index: 3;
    background: var(--side-bg);
}
.sidebar-brand .brand-logo {
    height: 2.4rem; width: 2.4rem; max-width: 2.4rem;
    object-fit: contain; flex: none;
}
/* The badge is a portrait shield, not a square seal, so a square box would
   letterbox it into something smaller than the seal it replaced. Given its
   own height and a narrower box, it reads at the same optical weight.

   No detail survives at this size and none is meant to - the wordmark beside
   it does the naming. This is the silhouette people find the sidebar by. */
.sidebar-brand .brand-logo.is-badge {
    height: 2.7rem; width: 2.2rem; max-width: 2.2rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
}
.sidebar-brand .mark {
    display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none;
    background: linear-gradient(160deg, var(--brand-2), var(--brand));
    color: #fff; border-radius: var(--r-sm);
    font-weight: 700; font-size: .78rem; letter-spacing: .04em;
}
.brand-text { min-width: 0; flex: 1; }
.brand-text strong {
    display: block; font-size: .92rem; color: var(--side-ink); letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small { display: block; color: var(--side-ink-2); font-size: .67rem; font-family: var(--mono); }

/* One group open at a time - see the <details name="nav-accordion"> comment
   in layouts/app.php. The summary IS the group header users read today; it
   just also opens and closes its own list now, and stays visible (sticky,
   directly under the brand bar) whether its group is open or not, so a
   group that has scrolled its items out of view still names itself, and a
   collapsed group that holds the active page still shows where you are -
   see .has-active. */
summary.nav-group-summary {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    font-size: .63rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--side-ink-2); padding: 1.1rem 1.35rem .35rem; opacity: .7;
    cursor: pointer; list-style: none;
    position: sticky; top: var(--sidebar-brand-h); z-index: 1;
    background: var(--side-bg);
}
summary.nav-group-summary::-webkit-details-marker { display: none; }
summary.nav-group-summary::marker { content: ""; }
summary.nav-group-summary:hover { opacity: 1; color: var(--side-ink); }
summary.nav-group-summary:focus-visible { outline: 2px solid var(--cta); outline-offset: -2px; opacity: 1; }
summary.nav-group-summary.has-active { color: var(--cta); opacity: 1; }

.nav-chevron {
    width: .75rem; height: .75rem; flex: none;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
    transition: transform .15s ease;
}
details.nav-group[open] > summary.nav-group-summary .nav-chevron { transform: rotate(180deg); }

@media (prefers-reduced-motion: reduce) {
    .nav-chevron { transition: none; }
}

.nav-group-items { padding-bottom: .3rem; }

.nav-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .5rem .75rem; margin: .08rem .6rem;
    color: var(--side-ink-2); text-decoration: none; font-size: .87rem;
    border-radius: var(--r-sm); position: relative;
    transition: background .12s ease, color .12s ease;
}
.nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon {
    width: 1.1rem; height: 1.1rem; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round; opacity: .8;
}
.nav-item:hover { background: var(--side-hover); color: var(--side-ink); }
.nav-item:hover .nav-icon { opacity: 1; }
.nav-item:focus-visible { outline: 2px solid var(--cta); outline-offset: -2px; }
.nav-item.is-active {
    background: linear-gradient(90deg, rgba(0, 208, 255, .22), var(--side-hover) 65%);
    color: #fff; font-weight: 650;
}
.nav-item.is-active .nav-icon { color: var(--cta); opacity: 1; }
.nav-item.is-active::before {
    content: ""; position: absolute; left: -.6rem; top: .3rem; bottom: .3rem;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--cta);
}

.sidebar-foot { margin-top: auto; padding: 1.5rem 1.35rem 0; }
.sidebar-foot p { font-size: .72rem; color: var(--side-ink-2); margin: 0; line-height: 1.55; opacity: .7; }

.app-main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
    padding: .8rem 1.9rem; border-bottom: 1px solid var(--rule);
    background: var(--surface); flex-wrap: wrap;
    position: sticky; top: 0; z-index: 20; box-shadow: var(--shadow-1);
}
/* "View as" - on every page while it is on, above the topbar. */
.view-as-bar {
    display: flex; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap;
    padding: .55rem 1.9rem; background: var(--manpower); color: #fff; font-size: .9rem;
}
.view-as-bar .view-as-text { flex: 1 1 18rem; min-width: 0; }
.view-as-bar .view-as-return {
    background: #fff; color: var(--manpower); border: 1px solid #fff;
    font-weight: 700; padding: .3rem .8rem; border-radius: 6px; cursor: pointer;
}
.view-as-bar .view-as-return:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.view-as-rules { margin: .25rem 0 1rem; padding-left: 1.1rem; line-height: 1.55; }
.btn-view-as { background: var(--manpower); border-color: var(--manpower); color: #fff; }
.btn-view-as-row { color: var(--manpower); border-color: var(--manpower); font-weight: 600; }
.crumbs { font-weight: 650; font-size: .98rem; letter-spacing: -.01em; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: .85rem; }

/* The Help button: opens the user-guide chapter for the page you are on. */
.topbar-help {
    display: grid; place-items: center; flex: none; width: 2.1rem; height: 2.1rem;
    border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--surface);
    color: var(--brand-2); transition: background .12s ease, border-color .12s ease;
}
.topbar-help svg {
    width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor;
    stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.topbar-help:hover { background: var(--surface-2); border-color: var(--brand-2); color: var(--brand); }
.topbar-help.is-active { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.topbar-help:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }

/* Personnel scope.
   Deliberately loud, and colour is not the only signal: the population is
   spelled out in words. A superadmin who can edit both workforces has to be
   able to tell at a glance which one an edit is about to land on, and roughly
   one in twelve men cannot rely on a red/green difference to tell them. */
.scope-badge {
    display: flex; align-items: center; gap: .4rem; flex: none;
    padding: .3rem .7rem; border-radius: 999px;
    border: 1px solid currentColor;
    font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.scope-badge .scope-badge-label {
    font-weight: 500; letter-spacing: .02em; opacity: .75; text-transform: none;
}
.scope-badge .scope-badge-note {
    font-weight: 500; letter-spacing: .02em; opacity: .8; text-transform: none;
}
.scope-badge.is-organic  { color: var(--ok);       background: var(--ok-bg); }
.scope-badge.is-guard    { color: var(--fail);     background: var(--fail-bg); }
.scope-badge.is-manpower { color: var(--manpower); background: var(--manpower-bg); }
.scope-badge.is-all      { color: var(--warn);     background: var(--warn-bg); }

.scope-switch { display: flex; align-items: center; gap: .35rem; flex: none; }
.scope-switch select { padding: .3rem .5rem; font-size: .8rem; }

.avatar {
    display: grid; place-items: center; width: 2.1rem; height: 2.1rem; flex: none;
    border-radius: 50%; background: linear-gradient(150deg, var(--cta), var(--cta-2));
    color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .03em;
}
/* A photo thumbnail fills the same circle a plain initials span already
   sits in - no structural change to .avatar itself, so the topbar's
   text-only usage is unaffected. */
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
/* The card-grid size, a little larger than a table row's. */
.avatar-md { width: 2.8rem; height: 2.8rem; font-size: .95rem; }

/* An avatar beside a name in a table cell, on any list screen that uses
   employees._avatar. */
.name-cell { display: flex; align-items: center; gap: .6rem; }

.nav-burger, .nav-close {
    align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; flex: none; cursor: pointer;
    border-radius: var(--r-sm); color: var(--ink-2);
}
.nav-burger:hover { background: var(--surface-2); color: var(--ink); }
.nav-close { color: var(--side-ink-2); margin-left: auto; }
.nav-close:hover { background: var(--side-hover); color: #fff; }
.nav-burger svg, .nav-close svg {
    width: 1.35rem; height: 1.35rem;
    fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round;
}

.who { text-align: right; }
.who strong { display: block; font-size: .86rem; line-height: 1.3; }
.who small { display: block; color: var(--ink-3); font-size: .73rem; }

.app main { padding: 1.9rem; max-width: 80rem; width: 100%; }

/* 80rem is a reading width. It suits a form or a page of prose and works
   against a page that is one wide register: the table gets a scrollbar while
   the screen still has space beside it. A page opts in with
   $view->section('layout', 'wide'). */
.app main.is-wide { max-width: none; }
/* The employee photograph.

   Square, because a 201 file photo is a portrait and a letterbox crop of one
   is nobody's idea of an ID picture. The capture canvas takes a centre square
   from the camera for the same reason. */
.photo-card { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.photo-frame { flex: none; width: 12rem; }
.photo-actions { flex: 1 1 20rem; min-width: 0; display: flex; flex-direction: column; gap: 1rem; }

/* ── Employee profile header ─────────────────────────────────────────
 *
 * Name, photo, employee number and status used to be two unrelated blocks
 * (a plain text page-head, then a full-width photo-and-upload card) - the
 * one fact a reader actually scans for first, the employee number, sat as
 * quiet monospace text inside a run-on sentence. This merges them into one
 * card read the way a person is: photo, name, the number and the status
 * next to it, everything else quieter underneath. */
.profile-header { display: flex; gap: 1.5rem; align-items: center; }
.profile-header-photo { flex: none; }
.profile-header-photo .photo { width: 6.5rem; height: 6.5rem; }
.profile-header-photo .photo-empty { font-size: 1.7rem; }
.profile-header-body { min-width: 0; }
.profile-header-body h1 { margin: 0 0 .4rem; }
.profile-header-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
    margin: 0 0 .35rem;
}
.profile-header-sub { margin: 0; color: var(--ink-3); font-size: .9rem; }

/* The one fact worth a heavier, boxed treatment than an ordinary <span> -
   the employee number is how every other system in the building (payroll,
   biometrics, the ID card itself) refers to this person, so it reads as a
   fact plate, not as incidental text. */
.id-chip {
    display: inline-flex; align-items: center; font-family: var(--mono);
    font-size: .95rem; font-weight: 650; letter-spacing: .02em; color: var(--ink);
    padding: .3rem .65rem; border-radius: var(--r-sm);
    border: 1px solid var(--rule-strong); background: var(--surface-2);
}

/* The photo editor (upload + camera) is secondary to seeing the photo that
   is already on file, so it is tucked behind a disclosure rather than
   permanently occupying a full-width card - which, on this page's wide
   layout, used to leave the upload button and a single file input stranded
   in acres of empty space to the right of a 12rem photo. `.card.narrow`
   keeps its open state from doing the same. */
.photo-editor summary {
    cursor: pointer; font-weight: 650; color: var(--brand-2); user-select: none;
}
.photo-editor summary:hover { color: var(--brand); }
.photo-editor[open] summary { margin-bottom: 1.1rem; }
.photo-editor-body { display: flex; flex-direction: column; gap: 1rem; }
.photo-editor-body .toolbar { margin: 0; }

/* ── Document generator ──────────────────────────────────────────────
 *
 * One button per document kind, from a registry that can grow past what
 * fits on one screen comfortably - previously an inline-block flow that
 * wrapped ragged rows of wildly different widths. A grid gives every
 * button the same footprint regardless of its label's length, so the
 * panel reads as one organised list rather than a pile of buttons. */
.doc-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem; margin-bottom: 1rem;
    /* Not the default (stretch): stretch forces every grid item, including
       an open <details>, to the row's tallest member - which fought the
       open state's own natural height and was the cause of the mangled
       layout below. Each item sizes to its own content instead. */
    align-items: start;
}
/* auto-fill (the first version of this) put as many 15rem columns as a
   wide screen had room for - eight, on a typical desktop - which meant
   most titles fit one line while a few long ones wrapped to two or three,
   and "uniform width" stopped being "uniform height" too. A capped column
   count keeps every column wide enough that at most two lines are ever
   needed, which the fixed height below then makes literal. */
@media (min-width: 60rem) {
    .doc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Two columns at a phone's width still squeezes the longest title past two
   lines; one full-width column keeps every title readable instead of
   letting the fixed height above clip it. */
@media (max-width: 30rem) {
    .doc-grid { grid-template-columns: 1fr; }
}
.doc-grid > form,
.doc-grid > details { margin: 0; }
/* Scoped to DIRECT children only - `.doc-grid .btn-quiet` (no `>`) also
   matched the "Generate" submit button nested inside an opened ask-form,
   forcing IT to width/height:100% too and mangling the very form this grid
   was supposed to leave alone. A fixed height (rather than min-height)
   is what actually makes every closed button the same size regardless of
   how many lines its own title wraps to - two lines' worth, which the
   column cap above keeps sufficient for the longest title this registry
   has. */
.doc-grid > form > .btn-quiet,
.doc-grid > details > summary.btn-quiet {
    display: flex; align-items: center; gap: .55rem; width: 100%; height: 4rem;
    text-align: left; white-space: normal; line-height: 1.3; overflow: hidden;
}
.doc-icon { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* Opened: a document that asks for something grows taller in place, inside
   its own grid cell - it does not take over the row (that was the earlier,
   broken attempt at this). `.doc-ask[open]`'s own border/padding/radius
   still apply; this only recolours them for this one context, and turns
   the summary from a bordered button into a plain label sitting inside the
   now-tinted box it introduces. */
.doc-grid > details[open] {
    background: #eaf1fb; border-color: var(--brand-2);
}
.doc-grid > details[open] > summary.btn-quiet {
    height: auto; overflow: visible; background: none; border: 0; padding: 0; margin-bottom: .7rem;
    color: var(--brand);
}
.doc-ask-fields { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .8rem; }
.doc-ask-actions { display: flex; justify-content: flex-end; gap: 1rem; align-items: center; }

/* ── Info badge: a hover/focus tooltip via the native title attribute,
   for the one paragraph of context a panel needs but doesn't need to
   spend permanent space on. ── */
.info-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.3rem; height: 1.3rem; flex: none; border-radius: 50%;
    background: var(--surface-3); color: var(--ink-3);
    font-size: .72rem; font-weight: 700; font-style: italic; cursor: help;
}

/* ── Button group: two or three adjacent actions read as one control ──
 *
 * Wraps existing .btn / .btn-quiet elements without touching either rule -
 * both are used everywhere else in the app exactly as they already are.
 * This only merges their corners and borders into one pill where they sit
 * next to each other, such as Edit/History atop a record. */
.btn-group {
    display: inline-flex; border: 1px solid var(--rule-strong);
    border-radius: 999px; overflow: hidden;
}
.btn-group > .btn,
.btn-group > .btn-quiet { border-radius: 0; border: 0; box-shadow: none; }
.btn-group > .btn-quiet:not(:first-child) { border-left: 1px solid var(--rule-strong); }

.photo {
    display: block; width: 12rem; height: 12rem; object-fit: cover;
    /* A 201-file photo is usually taller than it is wide - shoulders up,
       more air below the chin than above the head - so centering the crop
       (the default 50% 50%) trims the top of the head as often as it trims
       the chest. Anchoring near the top instead means a square crop loses
       shoulder, never face. */
    object-position: 50% 12%;
    border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface-2);
}

/* Initials, for the 222 records that arrived without one. */
.photo-empty {
    display: grid; place-items: center;
    font-size: 3rem; font-weight: 700; letter-spacing: .05em; color: var(--ink-3);
}

.photo-video, .photo-canvas {
    display: block; width: 12rem; height: 12rem; object-fit: cover;
    border-radius: var(--r); border: 1px solid var(--rule); background: #000;
}

/* The canvas is a scratch surface, never shown; the preview img is what the
   person checks before saving. */
.photo-canvas { display: none; }

/* The captured frame, before it is saved. Marked as provisional so it cannot
   be mistaken for the photograph already on file. */
.photo-preview { border-color: var(--cta); border-width: 2px; }

/* ── Photo DTR (Phase 4, Section I) ──────────────────────────────────── */

/* I.8's capture prompt: the phrase a guard holds up in frame. Large enough
   to be read off a phone held at arm's length, and off the thumbnail the
   reviewer sees. */
.capture-prompt {
    margin: 0 0 1rem; padding: .85rem 1rem;
    border: 1px dashed var(--cta); border-radius: var(--r); background: var(--surface-2);
}
.capture-prompt-lead { margin: 0 0 .35rem; font-size: .9rem; color: var(--ink-2); }
.capture-prompt-phrase {
    margin: 0 0 .35rem; font-size: 2rem; font-weight: 700; letter-spacing: .08em;
    font-family: var(--mono); color: var(--ink);
}

/* The field-attendance selfie camera (photo/submit.php).

   Three states, from photo-capture.js's data-capture-state on .selfie:
     idle     - a big launch tile, a thumb-sized target on a phone;
     live     - a full-screen viewfinder like the phone's own camera: black,
                mirrored, the whole uncropped frame, and a round shutter
                within reach of the thumb;
     captured - the photograph large, with Retake on it.
   No face guide and no crop: the background is the proof of place HR
   reviews, so what the camera sees is what HR sees. */
.selfie { margin: 0 0 1rem; }

.selfie-launch {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .35rem; width: 100%; max-width: 26rem; min-height: 13rem; margin: 0;
    padding: 1.5rem 1rem; white-space: normal; text-align: center;
    background: var(--surface-2); color: var(--ink);
    border: 2px dashed var(--rule-strong); border-radius: 1.25rem; box-shadow: none;
}
.selfie-launch:hover {
    background: var(--surface-3); border-color: var(--cta-2); color: var(--ink);
    transform: none; filter: none; box-shadow: none;
}
.selfie-launch:focus-visible { outline: 3px solid var(--cta-2); outline-offset: 3px; }
.selfie-launch-icon {
    display: grid; place-items: center; width: 4.25rem; height: 4.25rem; margin-bottom: .4rem;
    border-radius: 50%; color: #fff;
    background: linear-gradient(135deg, var(--cta-2), var(--cta-deep));
    box-shadow: 0 6px 18px rgba(0, 119, 242, .35);
}
.selfie-launch-title { font-size: 1.08rem; font-weight: 700; }
.selfie-launch-sub { font-size: .83rem; font-weight: 500; color: var(--ink-3); }

/* Live: the viewfinder takes the whole screen, over the sidebar and header. */
.selfie-stage { display: none; }
.selfie[data-capture-state="live"] .selfie-stage {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    background: #000; color: #fff;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
             env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
body:has(.selfie[data-capture-state="live"]) { overflow: hidden; }

.selfie-bar {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    width: 100%; max-width: 32rem; padding: .7rem 1rem; flex: none;
}
.selfie-close, .selfie-bar-spacer { flex: none; width: 2.75rem; height: 2.75rem; }
.selfie-close {
    margin: 0; padding: 0; border-radius: 50%; border: 0;
    background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none;
}
.selfie-close:hover { background: rgba(255, 255, 255, .26); transform: none; box-shadow: none; }
.selfie-slot {
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: .35rem .9rem; border-radius: 999px;
    background: rgba(255, 255, 255, .14); font-size: .85rem; font-weight: 650; letter-spacing: .02em;
}
.selfie-slot:empty { visibility: hidden; }

/* All the space between the bars. object-fit: contain shows the camera's
   WHOLE frame, uncropped - exactly what is kept, background included. */
.selfie-viewport {
    position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
    display: flex; align-items: center; justify-content: center;
}
.selfie-video {
    display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
    object-fit: contain;
    transform: scaleX(-1);   /* a mirror, as every front camera shows it */
}
@media (min-width: 33rem) { .selfie-video { border-radius: 1.25rem; } }
.selfie-phrase, .selfie-tip {
    position: absolute; left: 50%; transform: translateX(-50%); margin: 0;
    max-width: calc(100% - 1.5rem); text-align: center; pointer-events: none;
    border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff;
}
.selfie-phrase { top: .75rem; padding: .4rem .95rem; font-size: .85rem; }
.selfie-phrase strong { font-family: var(--mono); font-size: 1.05rem; letter-spacing: .06em; color: var(--cta); }
.selfie-tip { bottom: .75rem; padding: .3rem .85rem; font-size: .8rem; white-space: nowrap; }

.selfie-controls {
    display: flex; align-items: center; justify-content: center;
    width: 100%; flex: none; padding: 1rem 0 1.4rem;
}
/* The shutter: the white ring-and-disc every phone camera uses. */
.selfie-shutter {
    position: relative; width: 4.6rem; height: 4.6rem; margin: 0; padding: 0;
    border-radius: 50%; border: 4px solid #fff; background: transparent; box-shadow: none;
}
.selfie-shutter::after {
    content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff;
    transition: transform .12s ease;
}
.selfie-shutter:hover { transform: none; filter: none; box-shadow: none; }
.selfie-shutter:active::after { transform: scale(.88); }
.selfie-shutter:focus-visible { outline: 3px solid var(--cta); outline-offset: 4px; }

/* Captured: the photograph, large enough to judge. */
.selfie-result { position: relative; width: 100%; max-width: 26rem; margin: 0; }
.selfie-preview {
    display: block; width: 100%; height: auto;
    border-radius: 1.25rem; border: 3px solid var(--cta-2); background: var(--surface-2);
    box-shadow: var(--shadow-2);
    animation: selfie-flash .45s ease-out;
}
@keyframes selfie-flash { from { filter: brightness(2.2); } to { filter: none; } }
.selfie-retake {
    position: absolute; right: .8rem; bottom: .8rem; margin: 0;
    padding: .55rem 1rem; border-radius: 999px; border: 0;
    background: rgba(0, 0, 0, .6); color: #fff; box-shadow: none;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.selfie-retake:hover { background: rgba(0, 0, 0, .75); transform: none; }
.selfie-message { margin: .6rem 0 0; }

/* Submit, sized for a thumb on a phone. */
@media (max-width: 40rem) {
    .selfie-submit { width: 100%; padding: .95rem 1.25rem; font-size: 1rem; border-radius: .9rem; }
    .selfie-launch, .selfie-result { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .selfie-preview { animation: none; }
    .selfie-shutter::after { transition: none; }
}

/* Queue rows. Small enough that fifty fit on a screen, large enough to tell
   a person from a wall. */
.photo-thumb {
    display: block; width: 3.5rem; height: 3.5rem; object-fit: cover;
    border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface-2);
}

/* I.5 wants the submitted photograph SIDE BY SIDE with the enrolled one, so
   a reviewer can judge a marginal score by looking rather than by trusting
   the number. Wraps on a phone rather than shrinking both to uselessness. */
.photo-compare { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.photo-compare > * { flex: 1 1 18rem; min-width: 0; margin: 0; }

/* The submitted photograph is shown LARGE: this is the evidence, and a
   thumbnail of a face is not something anybody can make a decision from. */
.photo-submitted {
    display: block; width: 100%; max-width: 26rem; height: auto;
    border-radius: var(--r); border: 1px solid var(--rule); background: var(--surface-2);
}

/* Face enrollment coverage: the search sits left and takes the room, the two
   filters size to their options; on a phone they stack. */
.coverage-filters { justify-content: flex-start; align-items: flex-end; }
.coverage-search { flex: 1 1 18rem; max-width: 28rem; }
.coverage-filters select { width: auto; min-width: 10rem; }
.coverage-count { margin: -.5rem 0 .75rem; }
.coverage-empty { text-align: center; padding: 1.5rem .9rem; }
tbody[aria-busy="true"] { opacity: .55; transition: opacity .15s ease; }
@media (max-width: 40rem) {
    .coverage-filters > .field { flex: 1 1 100%; max-width: none; }
    .coverage-filters select { width: 100%; }
}

/* Feedback screenshots: several may be attached, so shown as a row of
   thumbnails rather than one large image - the reader opens the one that
   matters full-size rather than scrolling past every one at full width. */
.feedback-photos { display: flex; gap: 1rem; flex-wrap: wrap; }
.feedback-photo {
    display: block; width: 12rem; height: 8rem; object-fit: cover;
    border-radius: var(--r-sm); border: 1px solid var(--rule); background: var(--surface-2);
}


.page-head { margin-bottom: 1.75rem; }
.page-head h1 { margin: 0 0 .35rem; }
.page-head .lede { margin: 0; }

/* ── Checkboxes, roles, details ─────────────────────────────── */

.check { display: flex; gap: .6rem; align-items: start; padding: .4rem 0; font-size: .88rem; cursor: pointer; }
.check input { width: auto; margin-top: .25rem; flex: none; accent-color: var(--brand); }
.check.is-locked { opacity: .5; cursor: not-allowed; }

.role-grid, .perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: .4rem 1.5rem; }

/* ── Pick list: a searchable, contained checklist ────────────────────
 *
 * The problem this replaces: a bare grid of forty-plus checkboxes just runs
 * on for the height of the page, so the single toggle above it ("all
 * companies") and the list itself compete for attention and nothing about
 * the list says how big it is until you scroll past it. This gives the
 * list its own fixed-height, bordered frame with a search box and a live
 * count in the header, so the panel's size is the same whether it holds
 * five rows or five hundred. */
.pick-list {
    border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
    background: var(--surface); overflow: hidden;
}
.pick-list-toolbar {
    display: flex; align-items: center; gap: .75rem;
    padding: .55rem .75rem; border-bottom: 1px solid var(--rule);
    background: var(--surface-2);
}
.pick-list-search { flex: 1; min-width: 0; }
.pick-list-count { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.pick-list-actions { display: flex; gap: .5rem; }
.pick-list-actions button {
    background: none; border: 0; padding: 0; margin: 0; font: inherit;
    font-size: .78rem; font-weight: 650; color: var(--brand-2); cursor: pointer;
}
.pick-list-actions button:hover { text-decoration: underline; }
.pick-list-body {
    max-height: 16rem; overflow-y: auto; padding: .3rem .9rem;
    columns: 15rem; column-gap: 1.5rem;
}
.pick-list-item { break-inside: avoid; }
.pick-list-empty { padding: .75rem 0; }
/* The "nationwide" flag above the list makes every individual tick moot -
   OR'd together server-side - so this greys the list out and stops clicks
   reaching it rather than leaving forty ticks sitting there implying a
   narrower scope than the flag actually grants. */
.pick-list.is-all-selected { opacity: .5; }
.pick-list.is-all-selected .pick-list-body,
.pick-list.is-all-selected .pick-list-toolbar { pointer-events: none; }

/* Quick-add row: bulk-select shortcuts above the list itself (e.g. "every
   company with guard staff"), for a pick-list whose items carry more than
   a name - see company-access.js. Sits between the toolbar and the body,
   so it reads as "narrow the list, or just add a whole group at once". */
.pick-list-quick {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    padding: .5rem .75rem; border-bottom: 1px solid var(--rule);
    background: var(--surface);
}
.pill-button {
    display: inline-flex; align-items: center; gap: .3rem;
    font: inherit; font-size: .78rem; font-weight: 650;
    padding: .25rem .65rem; border-radius: 999px;
    border: 1px solid var(--rule-strong); background: var(--surface-2);
    color: var(--ink-2); cursor: pointer;
}
.pill-button:hover { border-color: var(--brand); color: var(--brand-2); }

/* Company access rows: one item is now a name-plus-badges line and a
   secondary edit/approve line, not the single label pick-list's default
   masonry columns were built for - a single scrolling column reads far
   better than balanced columns once a row wraps to two lines. */
.company-pick-body { columns: initial; max-height: 22rem; }
.company-row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: .5rem 1rem; padding: .5rem 0; border-bottom: 1px solid var(--rule);
}
.company-row:last-child { border-bottom: 0; }
.company-row-head { flex: 1; min-width: 14rem; }
.company-row-main { padding: 0; }
.company-row-main .pill { margin-left: .4rem; }
.company-row-verbs { display: flex; gap: 1rem; flex: none; }
.check-quiet { padding: 0; font-size: .8rem; color: var(--ink-3); }
.check-quiet input { accent-color: var(--ink-3); }

.detail-list { margin: 0; display: grid; gap: 0; }
.detail-list > div { display: grid; grid-template-columns: 14rem 1fr; gap: 1.25rem; padding: .65rem 0; border-bottom: 1px solid var(--rule); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { font-weight: 650; font-size: .85rem; }
.detail-list dd { margin: 0; color: var(--ink-2); font-size: .9rem; }
@media (max-width: 640px) { .detail-list > div { grid-template-columns: 1fr; gap: .2rem; } }

/* Two facts per row (label above value) rather than one per full-width
   row - the employee-profile tabs' own list, kept separate from
   .detail-list above since that one is shared by thirteen other pages
   this was never asked to change. `.u-span-all` (existing utility) still
   opts a long field - an address - out of the two-up layout. */
.fact-grid { margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
.fact-grid > div { padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.fact-grid > div:last-child { border-bottom: 0; }
.fact-grid dt {
    font-size: .72rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase;
    color: var(--ink-3); margin-bottom: .3rem;
}
.fact-grid dd { margin: 0; font-size: .95rem; font-weight: 650; color: var(--ink); }
@media (max-width: 640px) { .fact-grid { grid-template-columns: 1fr; } }

.setting { display: grid; grid-template-columns: 1fr 16rem; gap: 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); align-items: start; }
.setting:last-child { border-bottom: 0; }
.setting-label code { font-size: .8rem; }
.setting-label p { margin: .35rem 0 0; font-size: .82rem; color: var(--ink-2); }
@media (max-width: 700px) { .setting { grid-template-columns: 1fr; } }

.pill {
    display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; padding: .22rem .5rem; border-radius: 999px;
    border: 1px solid var(--rule-strong); color: var(--ink-3); white-space: nowrap;
    background: var(--surface-2);
}
.pill.ok       { color: var(--ok);       border-color: var(--ok);       background: var(--ok-bg); }
.pill.fail     { color: var(--fail);     border-color: var(--fail);     background: var(--fail-bg); }
.pill.part     { color: var(--warn);     border-color: var(--warn);     background: var(--warn-bg); }
.pill.manpower { color: var(--manpower); border-color: var(--manpower); background: var(--manpower-bg); }

/* Employee-group badges (Phase 4, Section G).
   A FIXED PALETTE, not a colour picker writing a hex value into a style
   attribute. The Content-Security-Policy sets style-src 'self', so an inline
   style is dropped by the browser and the badge would silently render
   colourless - see T-SEC-05. A named token stored on the group and matched to
   a rule here survives the policy, and gives the screens a consistent set of
   colours rather than twenty hand-picked blues. */
.badge-slate  { color: #334155; border-color: #94a3b8; background: #f1f5f9; }
.badge-blue   { color: #1e40af; border-color: #60a5fa; background: #eff6ff; }
.badge-green  { color: #166534; border-color: #4ade80; background: #f0fdf4; }
.badge-amber  { color: #92400e; border-color: #fbbf24; background: #fffbeb; }
.badge-red    { color: #991b1b; border-color: #f87171; background: #fef2f2; }
.badge-violet { color: #5b21b6; border-color: #a78bfa; background: #f5f3ff; }

/*
 * Two or more badges sharing one line, as compact chips rather than the
 * block-width pill a LONE badge uses.
 *
 * The base .badge rule fills its container by design - a column that shows
 * exactly one badge reads as a small, centred button, which is the right
 * look for a status column. That same width:100% is wrong the moment a
 * second badge joins it: each one still claims the full width, so instead of
 * sitting side by side they force each other onto their own line - three
 * flags in a Flags column render as three stacked banners instead of three
 * chips. Wrapping the group in this and letting its children size to their
 * content is the fix, without touching what a single badge looks like
 * anywhere else in the app.
 */
.badge-group { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.badge-group .badge { width: auto; }

/* ── Tables ─────────────────────────────────────────────────── */

.scroll {
    overflow-x: auto; border: 1px solid var(--rule); background: var(--surface);
    border-radius: var(--r); margin-bottom: 1.25rem; box-shadow: var(--shadow-1);
}
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th {
    text-align: left; font-size: .67rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink-3); padding: .7rem .9rem; background: var(--surface-2);
    border-bottom: 1px solid var(--rule); white-space: nowrap; font-weight: 700;
}
td { padding: .65rem .9rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.num-col { text-align: right; font-variant-numeric: tabular-nums; }

/* The action column stays put while the rest of a wide table scrolls.

   The employee register carries twelve columns, and the one thing somebody
   came to the page to do - open a record - was the first casualty: it sat off
   the right edge and had to be scrolled to. Pinning it means the button is
   reachable at any width, on any screen, without the table having to lose a
   column to make room.

   `right: 0` needs a background of its own, or the scrolling cells show
   through it. The inset shadow draws the separating rule, because a border on
   a sticky cell is painted at the cell's original position rather than where
   it comes to rest. */
.scroll th.action-col,
.scroll td.action-col {
    position: sticky;
    right: 0;
    background: var(--surface);
    box-shadow: inset 1px 0 0 var(--rule);
    white-space: nowrap;
    z-index: 2;
}

/* The header cell is sticky in both directions, so it outranks the body. */
.scroll th.action-col { background: var(--surface-2); z-index: 3; }

/* Without this the pinned cell keeps the resting background on hover and
   reads as a detached strip rather than part of the row. */
.scroll tbody tr:hover td.action-col { background: var(--surface-2); }

/* The same treatment, without eighty templates each needing a class.

   Across this application a table's action column is written as a trailing
   `<th></th>` - an empty header over the Edit and Open buttons. That empty
   cell is the marker, so `:has()` can find those tables and pin their last
   column with no change to the markup at all.

   Deliberately keyed on an EMPTY last header. A table whose final column has
   a heading is carrying data, not buttons, and pinning it would put a shadow
   down the middle of a figure for no reason.

   Where `:has()` is unsupported the rule simply does not apply and the column
   scrolls as it does today - the page is still usable, just less convenient,
   which is the right way for this to fail. */
.scroll table:has(thead th:last-child:empty) th:last-child,
.scroll table:has(thead th:last-child:empty) td:last-child {
    position: sticky;
    right: 0;
    background: var(--surface);
    box-shadow: inset 1px 0 0 var(--rule);
    white-space: nowrap;
    z-index: 2;
}

.scroll table:has(thead th:last-child:empty) thead th:last-child {
    background: var(--surface-2);
    z-index: 3;
}

.scroll table:has(thead th:last-child:empty) tbody tr:hover td:last-child {
    background: var(--surface-2);
}
/* A form packed inline into a table cell (a per-row "decide" action, such as
   clearance item sign-off) must not let its select/input children inherit
   the site-wide width:100% above - inside a table cell that stretches the
   cell to fill it, and once that cell is the sticky action column pinned by
   the rule above, the whole table is forced as wide as this one field asked
   to be. width:auto here lets each control size to its own content instead,
   the same way it already does outside a table. */
.row-decide { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.row-decide select, .row-decide input[type="text"] { width: auto; }

.kv { font-family: var(--mono); font-size: .81rem; }
.detail { color: var(--ink-3); font-size: .83rem; }

/* ── Stat tiles ─────────────────────────────────────────────── */

.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11.5rem, 100%), 1fr));
    gap: 1rem; margin-bottom: 1.5rem; background: none; border: 0;
}
.stats > div {
    background: var(--surface); padding: 1.1rem 1.2rem;
    border: 1px solid var(--rule); border-radius: var(--r);
    box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
/* A hairline of brand colour across the top of every tile. */
.stats > div::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--cta-2), var(--cta));
}
.stats .v {
    font-size: 1.85rem; font-weight: 700; line-height: 1.1;
    font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.stats .v.warn { color: var(--warn); }
.stats .v.fail { color: var(--fail); }
.stats .v.ok   { color: var(--ok); }
.stats .k {
    font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink-3); margin-top: .5rem; font-weight: 650;
}
/* Tiles that are carrying a problem say so in their edge, not only their ink. */
.stats > div.is-warn::before { background: linear-gradient(90deg, var(--gold-soft), var(--warn)); }
.stats > div.is-fail::before { background: linear-gradient(90deg, #d16b6b, var(--fail)); }
.stats > div.is-ok::before   { background: linear-gradient(90deg, #5cae82, var(--ok)); }

.progress {
    height: .6rem; background: var(--surface-3); border: 1px solid var(--rule);
    border-radius: 999px; overflow: hidden;
}
.progress span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--cta-2), var(--cta));
    border-radius: 999px;
}

.pager { display: flex; gap: 1.25rem; align-items: center; }
.pager a { font-size: .86rem; }

.enrol { display: grid; grid-template-columns: auto 1fr; gap: 1.75rem; align-items: start; margin-bottom: 1.5rem; }
@media (max-width: 640px) { .enrol { grid-template-columns: 1fr; } }
.enrol img { border: 1px solid var(--rule); background: #fff; padding: .5rem; border-radius: var(--r-sm); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 2px solid var(--rule); padding: 0 0 1.5rem 1.4rem; position: relative; }
.timeline li::before {
    content: ""; position: absolute; left: -.35rem; top: .35rem;
    width: .6rem; height: .6rem; background: var(--brand-2);
    border-radius: 50%; box-shadow: 0 0 0 3px var(--ground);
}
.timeline-head { display: flex; gap: .85rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .6rem; }

section + section { margin-top: 2rem; }

/* ── Tabs ───────────────────────────────────────────────────── */

.tabs {
    display: flex; gap: .35rem; flex-wrap: wrap;
    border-bottom: 1px solid var(--rule); margin-bottom: 1.25rem;
}
.tab {
    display: inline-block; padding: .55rem .9rem; font-size: .87rem; font-weight: 650;
    color: var(--ink-2); text-decoration: none;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .12s ease, border-color .12s ease;
}
.tab:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.tab.is-active { color: var(--brand-2); border-bottom-color: var(--brand-2); }

/* ── Settings > Email ───────────────────────────────────────── */

.email-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.mail-status { display: inline-flex; align-items: center; gap: .4rem; font-weight: 650; }
.mail-dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }

.mail-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .mail-grid { grid-template-columns: minmax(0, 1fr); } }
.mail-card h2 { margin: 0 0 .2rem; font-size: 1rem; }
.mail-card > .hint { margin: 0 0 1rem; }

.mail-form { display: grid; gap: .85rem; }
.mail-form .field { margin: 0; min-width: 0; }
.mail-form input:not([type="checkbox"]), .mail-form select { width: 100%; }
.mail-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .85rem; }
.mail-row-server { grid-template-columns: minmax(0, 1fr) 6.5rem 10.5rem; }
@media (max-width: 640px) {
    .mail-row, .mail-row-server { grid-template-columns: minmax(0, 1fr); }
}
.mail-form .check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; cursor: pointer; }
.mail-switch { display: flex; align-items: flex-end; gap: .5rem; padding-bottom: .55rem; flex-wrap: wrap; }
.mail-more { border-top: 1px solid var(--rule); padding-top: .75rem; }
.mail-more summary { cursor: pointer; font-weight: 650; font-size: .9rem; color: var(--ink-2); }
.mail-more[open] summary { margin-bottom: .85rem; }
.mail-more .mail-row + .mail-row { margin-top: .85rem; }
.mail-actions { display: flex; justify-content: flex-end; }

.mail-test { display: flex; gap: .6rem; }
.mail-test input { flex: 1; min-width: 0; }
.mail-result { margin-top: .85rem; padding: .55rem .8rem; border-radius: 6px; font-size: .86rem; overflow-wrap: anywhere; }
.mail-result.is-ok   { background: var(--ok-bg);   color: var(--ok); }
.mail-result.is-fail { background: var(--fail-bg); color: var(--fail); }
.mail-transcript { margin-top: .75rem; }
.mail-transcript summary { cursor: pointer; font-size: .86rem; font-weight: 600; }
.mail-transcript pre { max-height: 18rem; font-size: .78rem; margin: .5rem 0 0; }
.mail-tips { margin-top: 1rem; font-size: .84rem; color: var(--ink-2); line-height: 1.55; }
.mail-tips p { margin: 0 0 .35rem; }

/* Add / manage user: the fixed workgroup line. */
.workgroup-fixed {
    border: 1px solid var(--ok); background: var(--ok-bg); border-radius: 8px;
    padding: .65rem .9rem; display: grid; gap: .2rem; margin-bottom: .25rem;
}
.workgroup-fixed strong { color: var(--ok); }

/* Add / manage user: the read-only "Companies and permissions" preview. */
.access-box {
    border: 1px solid var(--ok); background: var(--ok-bg); border-radius: 8px;
    padding: .9rem 1rem; display: grid; gap: .75rem; min-width: 0;
}
.access-count { margin: 0 0 .5rem; }
.access-count strong { color: var(--ok); }
.access-self { margin: 0; }
.access-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.access-chips li {
    background: var(--surface); border: 1px solid var(--rule); border-radius: 999px;
    padding: .15rem .65rem; font-size: .82rem;
}
.access-more { margin-top: .5rem; }
.access-more summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--brand-2); }
.access-more[open] summary { margin-bottom: .5rem; }
.access-roles { border-top: 1px dashed var(--rule-strong); padding-top: .7rem; display: grid; gap: .45rem; min-width: 0; }
.access-table { width: 100%; background: var(--surface); }
.access-table td, .access-table th { padding: .4rem .6rem; }
.access-yes { color: var(--ok); font-weight: 650; }
.access-no  { color: var(--ink-2); }

.mail-address-card { margin-top: 1.25rem; }
.mail-address-card h2 { margin: 0 0 .2rem; font-size: 1rem; }
.mail-address { display: flex; gap: .6rem; margin-top: .75rem; max-width: 44rem; }
.mail-address input { flex: 1; min-width: 0; }
.mail-address-use { margin-top: .6rem; }
.mail-address-now { margin: .75rem 0 0; overflow-wrap: anywhere; }

/* The letterhead preview - mirrors the inline styles EmailLetterhead writes into the email. */
.mail-letterhead-card { margin-top: 1.25rem; }
.mail-letterhead-card h2 { margin: 0 0 .2rem; font-size: 1rem; }
.mail-letterhead {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
    margin-top: .9rem; padding: 1rem 1.1rem .8rem; background: #ffffff; color: #333333;
    border: 1px solid var(--rule); border-bottom: 3px solid #111111; border-radius: 4px 4px 0 0;
    font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.7;
}
.mail-letterhead-text { min-width: 0; overflow-wrap: anywhere; }
.mail-letterhead-name { font-size: 22px; line-height: 1.25; font-weight: 700; color: #111111; margin-bottom: .45rem; }
.mail-letterhead-logo { height: 64px; width: auto; flex: none; }

.mail-others { margin-top: 1.25rem; }
.mail-others > summary { cursor: pointer; font-weight: 650; }
.mail-other { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1rem; }
.mail-other h3 { margin: 0 0 .75rem; font-size: .95rem; }

/* ─────────────────────────────────────────────────────────────
   Charts
   ───────────────────────────────────────────────────────────── */

.chart-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
    gap: 1.25rem; margin-bottom: 1.5rem;
}
.chart-card {
    background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r); padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow-1);
}
.chart-card h3 { margin: 0 0 1rem; font-size: .82rem; letter-spacing: .08em;
                 text-transform: uppercase; color: var(--ink-3); font-weight: 700; }

.donut-wrap { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.donut { flex: none; }
.donut-track { fill: none; stroke: var(--surface-3); }
.donut-fill  { fill: none; stroke: var(--cta-2); stroke-linecap: round; }
.donut-fill.is-gold { stroke: var(--gold); }
.donut-fill.is-ok   { stroke: var(--ok); }
.donut-num { fill: var(--ink); font-size: 15px; font-weight: 700; font-family: var(--font); }
.donut-sub { fill: var(--ink-3); font-size: 6px; font-family: var(--font);
             letter-spacing: .1em; text-transform: uppercase; font-weight: 650; }
.donut-legend { margin: 0; padding: 0; list-style: none; font-size: .85rem; min-width: 9rem; }
.donut-legend li { display: flex; align-items: center; gap: .5rem; padding: .22rem 0; color: var(--ink-2); }
.donut-legend .swatch { width: .7rem; height: .7rem; border-radius: 3px; flex: none; background: var(--rule-strong); }
.donut-legend .swatch.is-brand { background: var(--cta-2); }
.donut-legend .swatch.is-gold  { background: var(--gold); }
.donut-legend .swatch.is-ok    { background: var(--ok); }
.donut-legend .swatch.is-track { background: var(--surface-3); border: 1px solid var(--rule); }
.donut-legend b { font-variant-numeric: tabular-nums; color: var(--ink); }

/* Horizontal bars, drawn in CSS so the row count is not capped by a
   hand-written set of width classes: the fill is an SVG rect whose width is
   a presentation attribute, which the policy allows and a `style` would not. */
.bars { margin: 0; padding: 0; list-style: none; }
.bars li {
    display: grid; grid-template-columns: minmax(6rem, 11rem) 1fr auto;
    gap: .85rem; align-items: center; padding: .4rem 0; font-size: .85rem;
}
.bars .bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar-label a { color: inherit; text-decoration: none; }
.bars .bar-label a:hover { color: var(--brand-2); text-decoration: underline; }
.bars .bar-val { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }
.bar-track { fill: var(--surface-3); }
.bar-fill  { fill: var(--cta-2); }
.bar-fill.is-warn { fill: var(--warn); }
.bar-fill.is-fail { fill: var(--fail); }
.bar-fill.is-ok   { fill: var(--ok); }
.bar-svg { display: block; width: 100%; height: .7rem; }

.spark { display: block; width: 100%; height: 2.5rem; }
.spark-line { fill: none; stroke: var(--brand-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: var(--brand-2); opacity: .12; }
.spark-dot  { fill: var(--brand-2); }

.chart-empty { color: var(--ink-3); font-size: .87rem; margin: 0; }

/* ─────────────────────────────────────────────────────────────
   Utilities
   ───────────────────────────────────────────────────────────── */

.u-m0 { margin: 0; }
.u-mt0 { margin-top: 0; }
.u-mb0 { margin-bottom: 0; }
.u-mt-06 { margin-top: .6rem; }
.u-mt-075 { margin-top: .75rem; }
.u-mt-08 { margin-top: .8rem; }
.u-mt-1 { margin-top: 1rem; }
.u-mb-05 { margin-bottom: .5rem; }
.u-mb-06 { margin-bottom: .6rem; }
.u-mb-1 { margin-bottom: 1rem; }
.u-gap-035 { margin: .35rem 0 0; }
.u-gap-05 { margin: .5rem 0 0; }
.u-gap-06 { margin: .6rem 0 0; }
.u-below-05 { margin: 0 0 .5rem; }
.u-block-025 { margin: .25rem 0 1rem; }
.u-lift-a { margin: -.3rem 0 .7rem; }
.u-lift-b { margin: -.3rem 0 .8rem; }
.u-span-all { grid-column: 1 / -1; }
.u-maxw-14 { max-width: 14rem; }
.u-maxw-20 { max-width: 20rem; }
.u-break { word-break: break-all; }
.u-mono { font-family: var(--mono); }
.u-w-13 { width: 13%; }
.u-w-14 { width: 14%; }
.u-w-15 { width: 15%; }
.u-w-16 { width: 16%; }
.u-w-18 { width: 18%; }
.u-w-20 { width: 20%; }
.u-w-22 { width: 22%; }
.u-w-46 { width: 46%; }
.u-w-50 { width: 50%; }
.u-w-56 { width: 56%; }
.u-w-62 { width: 62%; }
.u-w-80 { width: 80%; }
.u-w-100 { width: 100%; }

/* The one width in the application that is computed rather than written,
 * snapped to five per cent. See resources/views/dashboard/index.php. */
.u-fill-0 { width: 0; }
.u-fill-5 { width: 5%; }
.u-fill-10 { width: 10%; }
.u-fill-15 { width: 15%; }
.u-fill-20 { width: 20%; }
.u-fill-25 { width: 25%; }
.u-fill-30 { width: 30%; }
.u-fill-35 { width: 35%; }
.u-fill-40 { width: 40%; }
.u-fill-45 { width: 45%; }
.u-fill-50 { width: 50%; }
.u-fill-55 { width: 55%; }
.u-fill-60 { width: 60%; }
.u-fill-65 { width: 65%; }
.u-fill-70 { width: 70%; }
.u-fill-75 { width: 75%; }
.u-fill-80 { width: 80%; }
.u-fill-85 { width: 85%; }
.u-fill-90 { width: 90%; }
.u-fill-95 { width: 95%; }
.u-fill-100 { width: 100%; }

.hint { font-size: .82rem; color: var(--ink-3); }
.hint a { font-weight: 600; }
.step-up-foot { margin-top: 1.5rem; }

/* ── Last-resort pages ──────────────────────────────────────────
 *
 * The minimal error page and the development trace page used to carry their
 * own <style> blocks. Under the Content-Security-Policy this application
 * sends, those blocks are dropped, so the rules moved here. If this
 * stylesheet is itself unreachable both pages still read correctly as plain
 * HTML, which is the only guarantee either of them needs to make.
 */
.bare-error {
    max-width: 34rem; margin: 4rem auto; padding: 2rem;
    background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r); box-shadow: var(--shadow-2);
}
.bare-error h1 { margin: 0 0 .5rem; font-size: 1.25rem; }

body.trace {
    font: 14px/1.6 var(--mono);
    margin: 0; padding: 2rem; background: #131c2b; color: #e9eef6;
}
body.trace h1 { font-size: 1.1rem; color: #e08484; margin: 0 0 .25rem; }
body.trace .trace-msg { font-size: 1rem; margin: 0 0 1rem; color: #fff; }
body.trace .trace-loc { color: #7ea8e8; margin-bottom: 1.5rem; }
body.trace ol { padding-left: 1.5rem; }
body.trace li { margin-bottom: .6rem; }
body.trace small { color: #93a3ba; }
body.trace .trace-badge {
    display: inline-block; background: #8a5410; color: #fff;
    padding: .15rem .5rem; border-radius: var(--r-sm); font-size: 11px;
    letter-spacing: .08em; margin-bottom: 1rem;
}

/* ─────────────────────────────────────────────────────────────
   Narrow screens
   ───────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .app main { padding: 1.5rem; }
    .topbar { padding: .75rem 1.25rem; }
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 60;
        width: min(17.5rem, 84vw);
        transform: translateX(-100%);
        transition: transform .22s ease;
    }
    .nav-toggle:checked ~ .app-shell .sidebar { transform: none; box-shadow: var(--shadow-3); }

    .nav-scrim {
        display: block; position: fixed; inset: 0; z-index: 50;
        background: rgba(8, 16, 30, .55);
        opacity: 0; visibility: hidden;
        transition: opacity .22s ease, visibility .22s ease;
    }
    .nav-toggle:checked ~ .app-shell .nav-scrim { opacity: 1; visibility: visible; }

    .nav-burger, .nav-close { display: inline-flex; }

    .topbar { padding: .65rem 1rem; gap: .75rem; }
    .app main { padding: 1.15rem; }
    .who { display: none; }
    .crumbs { font-size: .92rem; }
}

@media (max-width: 640px) {
    body { font-size: 15.5px; }
    h1 { font-size: 1.35rem; }
    .card { padding: 1.1rem 1.15rem; }
    .chart-card { padding: 1.1rem 1.15rem; }
    .app main { padding: .9rem; }
    .page-head { margin-bottom: 1.25rem; }

    /* Label over bar over value: three columns cannot survive 360px. */
    .bars li { grid-template-columns: 1fr auto; gap: .4rem .75rem; padding: .55rem 0; }
    .bars .bar-label { grid-column: 1; }
    .bars .bar-val { grid-column: 2; }
    .bars .bar-svg { grid-column: 1 / -1; }

    .donut-wrap { gap: 1rem; }
    .checks li { grid-template-columns: 4.5rem 1fr; gap: .75rem; }
    .setting { gap: .75rem; }
    .toolbar { gap: .6rem; }
    a.btn, button, .btn { padding: .6rem 1rem; }

    /* A table that cannot fit scrolls in its own box rather than
       stretching the page and taking the layout with it. */
    .scroll { -webkit-overflow-scrolling: touch; }
    th, td { padding: .55rem .7rem; }
}


/* ─────────────────────────────────────────────────────────────
   Sign-in screens
   ─────────────────────────────────────────────────────────────
 *
 * A separate treatment from the rest of the application: full-bleed blue,
 * one floating panel, and the seal above it. These are the only pages a
 * person sees before they are anybody, so they are allowed to be the one
 * place that is styled to impress rather than to be read all day.
 *
 * layouts/auth.php supplies the panel, so the `.card` the five auth views
 * already wrap their forms in is flattened here rather than removed from
 * each of them — those templates keep working untouched.
 */

body.auth-page {
    min-height: 100vh; margin: 0;
    display: grid; place-items: center;
    padding: 2.5rem 1rem;
    color: #fff;
    background:
        radial-gradient(120% 90% at 50% 10%, rgba(38, 122, 214, .55) 0%, rgba(9, 45, 92, 0) 62%),
        linear-gradient(160deg, #0b3163 0%, #06203f 55%, #041730 100%);
}

.auth-shell { width: 100%; max-width: 25rem; }

/* The seal, ringed the way the reference art rings its mark. */
.auth-seal {
    display: grid; place-items: center;
    width: 6.5rem; height: 6.5rem; margin: 0 auto 1.6rem;
    border: 1.5px solid rgba(255, 255, 255, .38);
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}
  

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.8rem;
}

/* Company Logo Seal */
.auth-seal {
    display: grid;
    place-items: center;

    width: 8.5rem;
    height: 8.5rem;

    margin-bottom: 1rem;

    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;

    background:
        radial-gradient(
            circle at top,
            rgba(255, 255, 255, 0.14),
            rgba(255, 255, 255, 0.04)
        );

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.18),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transition: transform 0.3s ease,
                box-shadow 0.3s ease;
}

.auth-seal:hover {
    transform: translateY(-3px) scale(1.02);

    box-shadow:
        0 16px 35px rgba(0, 0, 0, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* Logo Image */
.auth-seal img {
    width: 6rem;
    height: 6rem;

    object-fit: contain;
    display: block;
}

/* Fallback Logo */
.auth-seal .mark {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 0.12em;

    color: #ffffff;
}


/* ── The HRIS badge on the sign-in panel ─────────────────────────

   No ring and no plate. The badge is already a shield with its own border,
   its own chain and its own laurel; putting it inside a circle frames a frame
   and makes it look like a sticker on a button. What it gets instead is
   light: a soft radial bloom behind it so it reads as something struck in
   metal sitting on the panel rather than an image pasted onto it.

   The bloom is a background on the wrapper, not a box-shadow on the image -
   a shadow follows the element's rectangle, and this artwork is a shield, so
   the corners would glow where there is nothing to glow. */
.auth-badge {
    display: grid; place-items: center;
    width: 100%;
    /* Holds the row open before the PNG decodes, so the card below does not
       jump. Matches the img's max-height plus the padding. */
    min-height: 11.75rem;
    margin: 0 auto .95rem;
    padding: .5rem 0 .25rem;
    background: radial-gradient(
        60% 60% at 50% 46%,
        rgba(120, 180, 255, .22) 0%,
        rgba(120, 180, 255, .07) 45%,
        rgba(120, 180, 255, 0) 72%
    );
}

.auth-badge img {
    display: block;
    width: auto; height: auto;
    /* Sized to carry the panel. With the wordmark inside the artwork rather
       than set in HTML beneath it, this IS the masthead, and a mark that has
       to do that job cannot be seal-sized. Height leads because the shield is
       portrait; the width cap only guards very narrow phones. */
    max-width: min(17rem, 82%);
    max-height: 11rem;
    object-fit: contain;
    /* Grounds the shield on the panel. Tuned to the gradient behind it: any
       heavier and the badge looks like it is hovering an inch off the page. */
    filter: drop-shadow(0 6px 14px rgba(2, 12, 28, .55));
}

/* With the badge carrying the name, the block beneath it is one quiet line,
   so the generous margin that separated three lines of type from the card
   is no longer earned. */
.auth-brand.has-badge { margin-bottom: 1.5rem; }
.auth-brand.has-badge .auth-brand-company { margin-top: 0; }

/* ============================================
   BRAND TEXT
   ============================================ */

.auth-brand-title {
    margin: 0;

    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;

    color: #ffffff;
}

.auth-brand-title span {
    color: #f4c542;
}

/* Company Name */
.auth-brand-company {
    margin: 0.4rem 0 0;

    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;

    color: rgba(255, 255, 255, 0.65);
}

/* Login System Subtitle */
.auth-brand-subtitle {
    margin: 0.65rem 0 0;

    font-size: 0.85rem;
    font-weight: 400;

    color: rgba(255, 255, 255, 0.72);
}

.auth-card {
    background: linear-gradient(155deg, rgba(29, 111, 214, .92), rgba(11, 62, 138, .92));
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--r);
    padding: 2rem 1.9rem 1.9rem;
    box-shadow: 0 24px 60px rgba(2, 12, 28, .5);
}

.auth-card h1 {
    font-size: 1.25rem; color: #fff; margin: 0 0 .35rem;
    letter-spacing: .01em; text-align: center;
}
.auth-card .lede,
.auth-card p { color: rgba(255, 255, 255, .82); }
.auth-card .lede {
    font-size: .88rem; margin: 0 0 1.5rem; text-align: center; max-width: none;
}
.auth-card a { color: #9fdcff; }
.auth-card a:hover { color: #fff; }
.auth-card .hint { color: rgba(255, 255, 255, .72); }

/* The nested .card the auth views already carry: flattened, because the
   layout is the panel now. */
.auth-card .card {
    background: none; border: 0; box-shadow: none;
    padding: 0; margin: 0 0 .25rem; max-width: none;
}
.auth-card fieldset { margin: 0; }

/* Underline fields with a leading glyph. */
.auth-field {
    display: flex; align-items: center; gap: .8rem;
    border-bottom: 1.5px solid rgba(255, 255, 255, .45);
    margin-bottom: 1.5rem;
    transition: border-color .15s ease;
}
.auth-field:focus-within { border-bottom-color: #fff; }
.auth-field svg {
    width: 1.15rem; height: 1.15rem; flex: none;
    fill: none; stroke: rgba(255, 255, 255, .8); stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
.auth-field input {
    flex: 1; min-width: 0;
    background: none; border: 0; border-radius: 0;
    color: #fff; font-size: .98rem; padding: .55rem 0;
    box-shadow: none;
    caret-color: #fff;
    -webkit-text-fill-color: #fff;
}
.auth-field input::placeholder { color: rgba(255, 255, 255, .78); }
.auth-field input:hover { border: 0; }
.auth-field input:focus, .auth-field input:focus-visible {
    outline: none; border: 0; box-shadow: none;
}
/* Chromium paints its own background on an autofilled control; the inset
   shadow is the only way to override it without an inline style. */
.auth-field input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 40rem #14539f inset;
}

/* Plain .field rows (the other four auth screens) get the same skin. */
.auth-card .field { gap: .4rem; margin-bottom: 1.35rem; }
.auth-card .field label { color: rgba(255, 255, 255, .88); font-size: .8rem; }
.auth-card .field input {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    caret-color: #fff;
    -webkit-text-fill-color: #fff;
}
.auth-card .field input::placeholder { color: rgba(255, 255, 255, .7); }
.auth-card .field input:hover { border-color: rgba(255, 255, 255, .5); }
.auth-card .field input:focus {
    border-color: #fff; outline: 2px solid rgba(255, 255, 255, .5);
    box-shadow: none;
}

.auth-meta {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin: 0 0 1.6rem; font-size: .84rem;
}
.auth-meta .check { padding: 0; font-size: .84rem; color: rgba(255, 255, 255, .9); }
.auth-meta .check input { accent-color: var(--cta); }
.auth-meta a { font-style: italic; color: rgba(255, 255, 255, .9); }
.auth-meta a:hover { color: #fff; }

/* The action, deliberately wider than the panel that holds it. */
.btn-hero {
    display: block; width: calc(100% + 3.8rem); margin: 0 0 1.5rem -1.9rem;
    padding: 1.05rem 1rem;
    border: 0; border-radius: 0;
    /* The reference art puts its brightest cyan dead centre, under the
       label - white on that is 1.8:1. The hue is kept and the bright
       stop moved into the last third, so the button still reads as
       cyan while the word sits on 5.8:1. */
    background: linear-gradient(90deg, #0a5ed0 0%, #0068dd 58%, #00a6f5 100%);
    color: #fff; font-size: .95rem; font-weight: 700;
    letter-spacing: .22em; text-transform: uppercase; text-align: center;
    cursor: pointer; white-space: nowrap;
    box-shadow: 0 14px 30px rgba(0, 132, 235, .38);
    transition: filter .14s ease, box-shadow .14s ease;
}
.btn-hero:hover {
    filter: brightness(1.08); color: #fff; transform: none;
    box-shadow: 0 18px 38px rgba(0, 132, 235, .48);
}
.btn-hero:active { filter: brightness(.97); }
.btn-hero:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }

/* Buttons on the other auth screens keep the panel's width. */
.auth-card button {
    width: 100%;
    background: linear-gradient(90deg, var(--cta-deep), var(--cta-2));
    border: 0; padding: .8rem 1.2rem; font-size: .92rem;
    letter-spacing: .04em;
}
.auth-card .btn-quiet {
    width: auto; background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .3); color: #fff;
}
.auth-card .btn-quiet:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.auth-foot {
    text-align: center; font-size: .82rem;
    letter-spacing: .06em; margin: 0;
    color: rgba(255, 255, 255, .88);
}
.auth-foot a { color: #fff; text-decoration: none; font-weight: 600; }
.auth-foot a:hover { text-decoration: underline; }

/* Notices sit inside the panel and must read on the blue ground. */
.auth-card .notice {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    border-left-width: 4px; color: #fff; box-shadow: none;
}
.auth-card .notice.fail { border-left-color: #ff9a9a; background: rgba(163, 42, 42, .3); }
.auth-card .notice.warn { border-left-color: #ffd28a; background: rgba(138, 84, 16, .3); }
.auth-card .notice.ok   { border-left-color: #8ee7bd; background: rgba(31, 107, 77, .3); }
.auth-card .notice a { color: #bfe9ff; }
.auth-card .notice a:hover { color: #fff; }

.auth-page .version { color: rgba(255, 255, 255, .55); }

@media (max-width: 420px) {
    .auth-card { padding: 1.6rem 1.35rem 1.5rem; }
    .btn-hero { width: calc(100% + 2.7rem); margin-left: -1.35rem; letter-spacing: .16em; }
    .auth-seal { width: 5.5rem; height: 5.5rem; }
    .auth-seal img { width: 3.4rem; height: 3.4rem; }
}


/* ── Password reveal ───────────────────────────────────────────────────
 *
 * The wrapper and the button are built by assets/js/app.js, so these rules
 * describe markup that only exists once that file has run. Without it the
 * field is an ordinary password input and none of this applies.
 */
.pw-wrap { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
.pw-wrap input { width: 100%; padding-right: 2.6rem; }

.pw-toggle {
    position: absolute; right: 0; top: 50%;
    transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.1rem; height: 2.1rem; padding: 0;
    background: none; border: 0; border-radius: var(--r-sm);
    color: var(--ink-3); cursor: pointer; box-shadow: none;
}
.pw-toggle:hover {
    background: var(--surface-2); color: var(--ink);
    transform: translateY(-50%); filter: none; box-shadow: none;
}
.pw-toggle:active { transform: translateY(-50%); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.pw-toggle svg {
    width: 1.15rem; height: 1.15rem;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}

/* On the sign-in screens the field is a white-on-blue underline, so the
   control follows that ink instead of the page ink. */
.auth-card .pw-toggle { color: rgba(255, 255, 255, .8); }
.auth-card .pw-toggle:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.auth-card .pw-toggle:focus-visible { outline-color: #fff; }
.auth-field .pw-wrap input { padding-right: 2.4rem; }

/* ── Employee picker ───────────────────────────────────────────────
 *
 * Built by assets/js/app.js around <input type="number" data-employee-picker>:
 * the number input itself is hidden (it stays the field that actually
 * submits) and a text search box takes its place. Without the script the
 * number input is exactly what it always was - a plain field for typing an
 * id by hand.
 */
.employee-picker { position: relative; display: block; }
.employee-picker-box { width: 100%; }
.employee-picker-list {
    position: absolute; z-index: 20; top: calc(100% + .3rem); left: 0; right: 0;
    margin: 0; padding: .3rem; list-style: none;
    background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-sm);
    box-shadow: var(--shadow-2); max-height: 16rem; overflow-y: auto;
}
.employee-picker-list li { margin: 0; padding: 0; }
.employee-picker-list button {
    display: block; width: 100%; text-align: left; padding: .5rem .6rem;
    background: none; border: 0; border-radius: var(--r-sm); box-shadow: none;
    color: var(--ink); cursor: pointer; font: inherit;
}
.employee-picker-list button:hover,
.employee-picker-list button:focus-visible {
    background: var(--surface-2); filter: none; box-shadow: none; outline: none;
}
.employee-picker-info { margin: .35rem 0 0; }
.employee-picker-message { margin: .4rem .6rem; }

/* ── Recipient picker (multi-select) ─────────────────────────────────
 *
 * Built by assets/js/memo-compose.js around
 * <input name="recipient_ids_csv" data-employee-multi-picker>: that csv
 * input is hidden but kept in sync as the value that actually submits, so
 * a page with the script blocked falls back to typing ids by hand into
 * the same field, exactly as it always did.
 */
.recipient-picker { position: relative; display: block; }
.recipient-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.recipient-chips:not(:empty) { margin: 0 0 .5rem; }
.recipient-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--surface-2); border: 1px solid var(--rule-strong); border-radius: 999px;
    padding: .25rem .4rem .25rem .7rem; font-size: .85rem;
}
.recipient-chip button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.2rem; height: 1.2rem; padding: 0; border-radius: 50%;
    background: none; border: 0; box-shadow: none; color: var(--ink-3); cursor: pointer;
    font: inherit; line-height: 1;
}
.recipient-chip button:hover, .recipient-chip button:focus-visible {
    background: var(--fail-bg); color: var(--fail); filter: none; box-shadow: none; outline: none;
}

/* ── Memo letter preview ──────────────────────────────────────────── */
.memo-preview-body {
    border: 1px solid var(--rule); border-radius: var(--r-sm); padding: .9rem 1rem;
    background: var(--surface-2);
}
.memo-preview-body p:first-child { margin-top: 0; }
.memo-preview-body p:last-child { margin-bottom: 0; }


/* ─────────────────────────────────────────────────────────────
   Key/value lists
   ─────────────────────────────────────────────────────────────
 *
 * `.kv-list` is the most-used component in the application - 22 templates,
 * from the 201 file to a payroll run header - and it had NO RULE AT ALL.
 * A <dl> with no styling is a browser-default definition list: the value
 * drops onto its own line and indents 40px under its label, which is why
 * these pages read like an unstyled document rather than a record.
 *
 * The grid is on the <dl> itself, so the flat `<dt>…</dt><dd>…</dd>` pairs
 * every one of those templates already writes fall into two columns with no
 * markup change anywhere.
 */
.kv-list {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(8rem, 13rem) 1fr;
    align-items: stretch;
}
.kv-list dt,
.kv-list dd {
    padding: .72rem 0;
    border-bottom: 1px solid var(--rule);
    display: flex; align-items: center;
    min-width: 0;
}
.kv-list dt {
    grid-column: 1;
    padding-right: 1.25rem;
    font-size: .78rem; font-weight: 650;
    letter-spacing: .02em; color: var(--ink-3);
}
.kv-list dd {
    grid-column: 2;
    margin: 0;
    font-size: .92rem; color: var(--ink);
    flex-wrap: wrap; gap: .5rem .7rem;
    overflow-wrap: anywhere;
}
/* The last pair carries no rule: the card edge is the boundary. */
.kv-list dt:nth-last-of-type(1),
.kv-list dd:nth-last-of-type(1) { border-bottom: 0; }

.kv-list dd strong { font-weight: 700; }
.kv-list dd .detail { color: var(--ink-3); }

/* "request a correction" and friends: a real affordance rather than grey
   body text that happens to be clickable. */
.kv-list dd a.detail {
    font-size: .78rem; font-weight: 600;
    color: var(--brand-2); text-decoration: none;
    padding: .16rem .5rem; border-radius: 999px;
    border: 1px solid var(--rule-strong);
    background: var(--surface-2);
    white-space: nowrap;
    transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.kv-list dd a.detail:hover {
    color: var(--brand); border-color: var(--brand-2);
    background: var(--surface); text-decoration: none;
}

/* A stacked pair is unreadable at 13rem of label; below that, stack it. */
@media (max-width: 640px) {
    .kv-list { grid-template-columns: 1fr; }
    .kv-list dt {
        grid-column: 1; padding: .7rem 0 .1rem;
        border-bottom: 0; font-size: .72rem; text-transform: uppercase;
        letter-spacing: .08em;
    }
    .kv-list dd { grid-column: 1; padding: 0 0 .7rem; }
    .kv-list dt:nth-last-of-type(1) { border-bottom: 0; }
}

/* ── Two orphans of the same kind ─────────────────────────────────────── */

/* The row the page is about, inside a table of its siblings. */
tr.is-current > td {
    background: var(--surface-2);
    box-shadow: inset 3px 0 0 var(--cta);
    font-weight: 600;
}

/* A roll-up total the report service appended after the data rows. */
tr.rollup > td {
    background: var(--surface-2);
    font-weight: 650;
    border-top: 2px solid var(--rule);
}

/* The control column of a settings row. */
.setting-input { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.setting-input input,
.setting-input select,
.setting-input textarea { width: 100%; }
.setting-input .hint { margin: 0; }

/* ── Page furniture ───────────────────────────────────────────────────── */

/* The heading block gets a rule under it, so a long page reads as titled
   sections rather than as one column of text that never restarts. */
.page-head {
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--rule);
}
.page-head .lede { color: var(--ink-2); }
.page-head .kv { color: var(--ink-3); }

/* ── The dashboard welcome, with the badge ───────────────────────

   The badge earns its place on exactly one screen: the first one after
   signing in. It is shown crisp and at a readable size rather than faded
   into a watermark - a mark worth applying is worth being able to look at,
   and a 6% ghost behind body text is a smudge, not branding.

   Text first in the source, badge second: the heading is what a screen
   reader and a narrow viewport should meet first. `wrap-reverse` then puts
   the badge visually above the text once the row no longer fits, which is
   the right order for a masthead. */
.page-head.dash-hero {
    display: flex;
    flex-wrap: wrap-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.75rem;
}
.dash-hero-text { flex: 1 1 18rem; min-width: 0; }
.dash-hero-text h1 { margin: 0 0 .35rem; }
.dash-hero-badge {
    flex: none;
    height: 4.75rem; width: auto; max-width: 40%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(16, 26, 41, .22));
}

/* On a phone the masthead is a stack, and a badge as tall as the greeting
   pushes the actual dashboard below the fold. */
@media (max-width: 40rem) {
    .page-head.dash-hero { justify-content: flex-start; }
    .dash-hero-badge { height: 3.5rem; max-width: 60%; }
}

/* A card whose only content is "there is nothing here" should look
   deliberate rather than broken. */
.card > p.detail:only-child,
.card > p.u-m0:only-child {
    text-align: center; padding: 1.25rem 0; color: var(--ink-3);
}

/* Tables inside a card sit flush to its edges rather than floating. */
.card > .scroll:last-child { margin-bottom: 0; }

/* A payslip on screen. `.card payslip` appears in payslips/show.php and in
   the token-link view; it had no rule, so a document people check figures on
   looked like every other panel. Tabular figures and a paper-ish measure. */
.card.payslip {
    max-width: 46rem;
    font-variant-numeric: tabular-nums;
}
.card.payslip table { font-size: .86rem; }
.card.payslip td.num-col,
.card.payslip .num-col { font-variant-numeric: tabular-nums; }
.card.payslip h2,
.card.payslip h3 { margin-top: 1.4rem; }
.card.payslip h2:first-child,
.card.payslip h3:first-child { margin-top: 0; }

/* The bottom line of the totals table - conventionally net pay, though the
   template is company-configurable and free to end on something else - set
   apart as the number the whole page exists to answer. Targeted by
   position, not by field identity: the template can reorder or rename any
   line here, and the summary's own last row is still the right one to
   land the reader's eye on. */
.card.payslip table.totals tbody tr:last-child td {
    background: var(--ok-bg); border-top: 2px solid var(--ok);
    font-size: 1.02rem; padding-top: .6rem; padding-bottom: .6rem;
}


/* ─────────────────────────────────────────────────────────────
   Vivid summary tiles
   ─────────────────────────────────────────────────────────────
 *
 * The saturated headline cards used above a report's results: a label, one
 * large figure, and a watermark glyph. They are deliberately louder than the
 * `.stats` tiles on the dashboard, because these sit above a table somebody
 * is about to reconcile and the totals are what they came for.
 *
 * The tones are fixed rather than themed. A number that is a total is not a
 * status, so these carry no meaning in their colour beyond telling four
 * figures apart at a glance - which is why the label is always spelled out.
 */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tile {
    position: relative; overflow: hidden;
    padding: 1.15rem 1.3rem;
    border-radius: var(--r);
    color: #fff;
    box-shadow: var(--shadow-2);
    min-width: 0;
}
.tile .tile-k {
    display: block; font-size: .72rem; font-weight: 650;
    letter-spacing: .06em; opacity: .92; margin-bottom: .5rem;
}
.tile .tile-v {
    display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.15;
    letter-spacing: -.02em; font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.tile .tile-sub {
    display: block; font-size: .72rem; opacity: .9; margin-top: .45rem;
}

/* The watermark. aria-hidden in the markup: it repeats the label, and a
   screen reader announcing "chart increasing" after the figure is noise. */
.tile svg {
    position: absolute; right: .9rem; top: 50%;
    transform: translateY(-50%);
    width: 2.6rem; height: 2.6rem;
    fill: none; stroke: currentColor; stroke-width: 1.5;
    stroke-linecap: round; stroke-linejoin: round;
    opacity: .28; pointer-events: none;
}

.tile.tone-blue   { background: linear-gradient(135deg, #1d7fe0, #135fb5); }
.tile.tone-green  { background: linear-gradient(135deg, #12996b, #0c7350); }
.tile.tone-cyan   { background: linear-gradient(135deg, #0b8ba8, #076075); }
.tile.tone-amber  { background: linear-gradient(135deg, #eeab08, #c88606); }
.tile.tone-slate  { background: linear-gradient(135deg, #566579, #3d4959); }
.tile.tone-red    { background: linear-gradient(135deg, #d24b4b, #a83232); }

/* Two of the reference tones fail white text outright: its cyan sits at
   2.98:1 and its amber at 2.47:1, both well under the 4.5:1 floor. The cyan
   is deepened until white clears it (4.9:1 at the gradient mid-point) and the
   amber keeps its colour but takes dark ink instead (6.7:1). The palette from
   the reference survives; its two contrast failures do not. */
.tile.tone-amber { color: #2a1d00; }
.tile.tone-amber .tile-k,
.tile.tone-amber .tile-sub { opacity: .8; }

@media (prefers-reduced-motion: no-preference) {
    .tile { transition: transform .12s ease, box-shadow .12s ease; }
    .tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
}

/* A figure that totals only the rows on screen must say so, or somebody
   reconciles a truncated report against a full ledger. */
.tile.is-partial .tile-sub { font-weight: 700; }

/* ── The template-editor Preview dialog ────────────────────────────────
   A specimen of the document being edited, shown as a dialog rather than
   a new tab or window - see resources/views/documents/template.php and
   assets/js/document-preview.js. The document itself renders inside the
   iframe through layouts/document.php's own stylesheet (document.css);
   this only styles the dialog's own chrome. */
dialog.preview-dialog {
    width: min(920px, 94vw); height: min(88vh, 1150px);
    max-width: 94vw; max-height: 94vh; padding: 0;
    border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow-3);
}
dialog.preview-dialog::backdrop { background: rgba(16, 26, 41, .55); }
.preview-dialog-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem; margin: 0; padding: .7rem 1rem;
    background: var(--surface-2); border-bottom: 1px solid var(--rule);
}
.preview-dialog-head strong { font-size: .95rem; }
.preview-dialog-frame { display: block; width: 100%; height: calc(100% - 3rem); border: 0; }

/* ─────────────────────────────────────────────────────────────
   Leave: the employee's history and balances, the apply form,
   the HR register and the calendar
   ─────────────────────────────────────────────────────────────
 *
 * Every leave type carries one tone, chosen by App\Support\LeaveDisplay::tone()
 * and applied as a class that sets --tone. Bars, chips and calendar entries
 * all read var(--tone), so Vacation is the same colour on every screen.
 * A class, not a style attribute: style-src has no 'unsafe-inline'. The tones
 * are dark enough to carry white text in both themes (4.5:1 or better). */
.lv-vl   { --tone: #0e7490; }
.lv-sl   { --tone: #b45309; }
.lv-el   { --tone: #b91c1c; }
.lv-sil  { --tone: #15803d; }
.lv-ml   { --tone: #7e22ce; }
.lv-pl   { --tone: #0f766e; }
.lv-spl  { --tone: #be185d; }
.lv-bl   { --tone: #475569; }
.lv-lwop { --tone: #57534e; }
.lv-t1   { --tone: #1d4ed8; }
.lv-t2   { --tone: #9333ea; }
.lv-t3   { --tone: #c2410c; }
.lv-t4   { --tone: #0369a1; }

/* A small coloured label naming a leave type. */
.lv-chip {
    display: inline-flex; align-items: center; gap: .3rem; max-width: 100%;
    padding: .18rem .55rem; border-radius: 999px;
    background: var(--tone, var(--ink-3)); color: #fff;
    font-size: .74rem; font-weight: 650; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.lv-dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--tone, var(--ink-3)); flex: none; }

/* Page head with its main action on the right. */
.lv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.lv-head .lede { margin: 0; }

/* Headline tiles: the shared .stats grid, plus a sub-line and a lead tile. */
.stats .s { font-size: .78rem; color: var(--ink-3); margin-top: .2rem; }
.stats > div.lv-lead {
    background: linear-gradient(140deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff;
}
.stats > div.lv-lead::before { background: linear-gradient(90deg, var(--gold-soft), var(--gold)); }
.stats > div.lv-lead .k, .stats > div.lv-lead .s { color: rgba(255, 255, 255, .82); }
.stats .v.lv-small { font-size: 1.25rem; line-height: 1.3; }

/* Two columns: the main content and a narrower side column. */
.lv-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
.lv-split > * { min-width: 0; }
.lv-stack { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.lv-stack > .card, .lv-split > .card { margin-bottom: 0; }
@media (max-width: 960px) { .lv-split { grid-template-columns: 1fr; } }

/* Balance by leave type: name and figures over a bar. */
.lv-balances { list-style: none; margin: 0; padding: 0; }
.lv-balance {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem 1rem;
    padding: .75rem 0; border-bottom: 1px solid var(--rule); align-items: baseline;
}
.lv-balance:last-child { border-bottom: 0; padding-bottom: 0; }
.lv-balance:first-child { padding-top: 0; }
.lv-balance-name { display: flex; align-items: center; gap: .5rem; min-width: 0; font-weight: 650; font-size: .92rem; }
.lv-balance-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-balance-fig { font-variant-numeric: tabular-nums; font-size: .9rem; white-space: nowrap; }
.lv-balance-fig strong { font-size: 1.05rem; }
.lv-balance-fig small { color: var(--ink-3); }
.lv-balance .lv-bar, .lv-balance .lv-balance-sub { grid-column: 1 / -1; }
.lv-balance-sub { font-size: .76rem; color: var(--ink-3); }

/* The bar itself: an SVG whose fill width is a presentation attribute. */
.lv-bar { display: block; width: 100%; height: .55rem; border-radius: 999px; overflow: hidden; }
.lv-bar-track { fill: var(--surface-3); }
.lv-bar-fill  { fill: var(--tone, var(--cta-2)); }

/* Usage by month: twelve columns, drawn in SVG. */
.lv-chart { display: block; width: 100%; height: auto; overflow: visible; }
.lv-chart-grid { stroke: var(--rule); stroke-width: 1; }
.lv-chart-bar  { fill: var(--cta-2); }
.lv-chart-bar.is-now { fill: var(--gold); }
.lv-chart-label { fill: var(--ink-3); font-size: 10px; font-family: var(--font); }
.lv-chart-value { fill: var(--ink-2); font-size: 10px; font-weight: 650; font-family: var(--font); }

/* Upcoming leave: one row per application. */
.lv-list { list-style: none; margin: 0; padding: 0; }
.lv-list li {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: .65rem 0; border-bottom: 1px solid var(--rule);
}
.lv-list li:first-child { padding-top: 0; }
.lv-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.lv-list strong { display: block; font-size: .9rem; }
.lv-list small { color: var(--ink-3); font-size: .78rem; }

/* The rules HR set, written as guidelines. */
.lv-rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: .9rem; }
.lv-rule { border: 1px solid var(--rule); border-left: 4px solid var(--tone, var(--rule-strong)); border-radius: var(--r-sm); padding: .7rem .85rem; background: var(--surface); }
.lv-rule h3 { margin: 0 0 .35rem; font-size: .88rem; }
.lv-rule ul { margin: 0; padding-left: 1.1rem; font-size: .82rem; color: var(--ink-2); }
.lv-rule li + li { margin-top: .2rem; }

/* Filter bar: fields in a row, buttons at the end. */
.lv-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); gap: .9rem; align-items: end; }
.lv-filters .lv-filter-actions { display: flex; gap: .5rem; }
.lv-filters .lv-filter-actions > * { flex: 1; margin: 0; }

/* Tabs with a count. */
.tab .tab-count {
    display: inline-block; min-width: 1.45rem; margin-left: .35rem; padding: 0 .4rem;
    border-radius: 999px; background: var(--surface-3); color: var(--ink-2);
    font-size: .72rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.tab.is-active .tab-count { background: var(--gold); color: #2a1d00; }

/* Register table cells. */
.lv-dates { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lv-dates small { display: block; color: var(--ink-3); }
.lv-reason { max-width: 18rem; color: var(--ink-2); font-size: .85rem; overflow-wrap: anywhere; }
.lv-age { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.lv-age.is-overdue { color: var(--fail); font-weight: 700; }

/* Quick actions: view, approve, reject, as small square buttons. */
.lv-actions { display: inline-flex; gap: .3rem; align-items: center; }
.lv-actions form { margin: 0; }
.lv-icon-btn {
    display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; margin: 0;
    border-radius: var(--r-sm); border: 1px solid var(--rule-strong); background: var(--surface);
    color: var(--ink-2); box-shadow: none; cursor: pointer; list-style: none;
}
.lv-icon-btn svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lv-icon-btn:hover { background: var(--surface-2); color: var(--ink); transform: none; filter: none; box-shadow: none; }
.lv-icon-btn.is-ok   { color: var(--ok);   border-color: var(--ok); }
.lv-icon-btn.is-fail { color: var(--fail); border-color: var(--fail); }
.lv-icon-btn.is-ok:hover   { background: var(--ok-bg); color: var(--ok); }
.lv-icon-btn.is-fail:hover { background: var(--fail-bg); color: var(--fail); }
.lv-reject { position: relative; }
.lv-reject > summary::-webkit-details-marker { display: none; }
.lv-reject[open] > .lv-reject-box {
    position: absolute; right: 0; top: calc(100% + .35rem); z-index: 30; width: 16rem;
    padding: .8rem; border: 1px solid var(--rule-strong); border-radius: var(--r);
    background: var(--surface); box-shadow: var(--shadow-3);
    display: flex; flex-direction: column; gap: .5rem; white-space: normal;
}
.lv-reject-box label { font-size: .8rem; font-weight: 650; }
.lv-reject-box button { margin: 0; }

/* The apply form's live panel. */
.lv-live {
    border: 1px solid var(--tone, var(--rule)); border-left-width: 4px; border-radius: var(--r);
    background: var(--surface-2); padding: .85rem 1rem;
}
.lv-live-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.lv-live-big { font-size: 1.6rem; font-weight: 700; color: var(--tone, var(--ink)); font-variant-numeric: tabular-nums; line-height: 1.15; }
.lv-live-meta { font-size: .8rem; color: var(--ink-3); text-align: right; }
.lv-live-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); gap: .5rem 1rem; margin: .75rem 0 0; }
.lv-live-facts div { display: flex; flex-direction: column; }
.lv-live-facts dt { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.lv-live-facts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.lv-live-notes { margin: .7rem 0 0; padding: 0; list-style: none; font-size: .82rem; }
.lv-live-notes li { padding: .3rem .55rem; border-radius: var(--r-sm); margin-top: .3rem; }
.lv-live-notes li.is-fail { background: var(--fail-bg); color: var(--fail); }
.lv-live-notes li.is-warn { background: var(--warn-bg); color: var(--warn); }
.lv-live-notes li.is-info { background: var(--surface); color: var(--ink-2); border: 1px solid var(--rule); }
.lv-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.lv-form-grid .u-span-all { grid-column: 1 / -1; }
@media (max-width: 640px) { .lv-form-grid { grid-template-columns: 1fr; } }

/* The calendar: a Sunday-first month grid. */
.lv-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.lv-cal-head h2 { margin: 0; }
.lv-cal-nav { display: flex; gap: .4rem; flex-wrap: wrap; }
.lv-cal-nav a { margin: 0; }
.lv-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.lv-cal-dow {
    padding: .5rem; text-align: center; font-size: .7rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--rule);
}
.lv-cal-day {
    min-height: 7rem; padding: .4rem; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    display: flex; flex-direction: column; gap: .2rem; min-width: 0;
}
.lv-cal-day:nth-child(7n) { border-right: 0; }
.lv-cal-day.is-weekend { background: var(--surface-2); }
.lv-cal-day.is-out .lv-cal-num { color: var(--ink-3); opacity: .55; }
.lv-cal-day.is-out .lv-cal-entry { opacity: .55; }
.lv-cal-num { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.lv-cal-day.is-today .lv-cal-num {
    display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
    background: var(--cta-2); color: #fff;
}
.lv-cal-entry {
    display: block; padding: .12rem .4rem; border-radius: 4px; background: var(--tone, var(--ink-3)); color: #fff;
    font-size: .72rem; font-weight: 600; text-decoration: none; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lv-cal-entry:hover { color: #fff; filter: brightness(1.1); }
/* Pending: striped, so it reads as "not decided" without a legend lookup. */
.lv-cal-entry.is-pending {
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .28) 0 5px, transparent 5px 10px);
    outline: 1px dashed rgba(255, 255, 255, .7); outline-offset: -2px;
}
.lv-cal-more { font-size: .72rem; }
.lv-cal-more summary { cursor: pointer; color: var(--brand-2); font-weight: 650; list-style: none; }
.lv-cal-more summary::-webkit-details-marker { display: none; }
.lv-cal-more[open] { display: flex; flex-direction: column; gap: .2rem; }
.lv-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; font-size: .82rem; }
.lv-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.lv-swatch-pending {
    display: inline-block; width: 1.4rem; height: .8rem; border-radius: 3px; background-color: var(--ink-3);
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .35) 0 4px, transparent 4px 8px);
}

/* On a phone a seven-column grid is unreadable: the month becomes a list of
   the days that have someone away. */
.lv-agenda { display: none; list-style: none; margin: 0; padding: 0; }
.lv-agenda > li { padding: .7rem 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: .3rem; }
.lv-agenda > li:last-child { border-bottom: 0; }
.lv-agenda-day { font-weight: 700; font-size: .88rem; }
.lv-agenda-day.is-today { color: var(--cta-2); }
@media (max-width: 720px) {
    .lv-cal { display: none; }
    .lv-agenda { display: block; }
}

/* The leave-types screen: filing rules as an editable table. */
.lv-band-table input { min-width: 4.5rem; }
.lv-band-table td { vertical-align: middle; }
.lv-rules-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }

/* My balances: one card per leave type. */
.lv-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); gap: 1rem; align-content: start; }
.lv-type-card {
    background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--tone, var(--rule-strong));
    border-radius: var(--r); padding: .9rem 1rem; box-shadow: var(--shadow-1);
    display: flex; flex-direction: column; gap: .5rem; min-width: 0;
}
.lv-type-card h3 { margin: 0; font-size: .95rem; }
.lv-type-card-head { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.lv-type-card-fig { font-variant-numeric: tabular-nums; }
.lv-type-card-fig strong { font-size: 1.6rem; color: var(--tone, var(--ink)); line-height: 1.1; }
.lv-type-card-fig small { color: var(--ink-3); }
.lv-type-card-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: 0; }
.lv-type-card-facts div { display: flex; flex-direction: column; }
.lv-type-card-facts dt { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.lv-type-card-facts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.lv-type-card-rule { margin: 0; font-size: .78rem; color: var(--ink-3); }
details.card > summary { cursor: pointer; }

/* ── Schedule planner (schedules/periods, schedules/period) ─────────────────
   Six swatches for shifts, in the order the company lists its shifts; rest,
   leave, blank and days owned by another schedule each have their own look so
   the grid reads at a glance. Colours come in light and dark pairs. */
:root {
    --sp-0: #dbeafe; --sp-0-ink: #1e3a8a;
    --sp-1: #dcfce7; --sp-1-ink: #14532d;
    --sp-2: #312e81; --sp-2-ink: #e0e7ff;
    --sp-3: #fde2e4; --sp-3-ink: #7f1d1d;
    --sp-4: #e0f2fe; --sp-4-ink: #075985;
    --sp-5: #f3e8ff; --sp-5-ink: #581c87;
    --sp-rest: #eef1f5; --sp-rest-ink: #64748b;
    --sp-leave: #fef3c7; --sp-leave-ink: #92400e;
}
@media (prefers-color-scheme: dark) {
    :root {
        --sp-0: #1e3a8a; --sp-0-ink: #dbeafe;
        --sp-1: #14532d; --sp-1-ink: #dcfce7;
        --sp-2: #4338ca; --sp-2-ink: #eef2ff;
        --sp-3: #7f1d1d; --sp-3-ink: #fde2e4;
        --sp-4: #075985; --sp-4-ink: #e0f2fe;
        --sp-5: #581c87; --sp-5-ink: #f3e8ff;
        --sp-rest: #1e293b; --sp-rest-ink: #94a3b8;
        --sp-leave: #4a3410; --sp-leave-ink: #fde68a;
    }
}
.sp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.sp-stats div { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: .7rem .9rem; display: flex; flex-direction: column; }
.sp-stats b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.sp-stats span { color: var(--ink-3); font-size: .78rem; }
.sp-stats .is-bad { border-color: var(--fail); background: var(--fail-bg); color: var(--fail); }
.sp-stats .is-warn { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.sp-filter { flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.sp-missing { margin: .5rem 0 0; padding-left: 1.1rem; }
.sp-presets { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .5rem 0; }
.sp-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; margin-bottom: 1rem; }
.sp-inline { display: flex; gap: .4rem; align-items: center; margin: 0; }
.sp-pop { position: relative; }
.sp-pop > summary { list-style: none; cursor: pointer; }
.sp-pop > summary::-webkit-details-marker { display: none; }
.sp-pop[open] > .card { position: absolute; z-index: 20; top: 2.4rem; left: 0; width: min(34rem, 92vw); box-shadow: var(--shadow-3); }
.sp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; align-items: start; }
.sp-board { min-width: 0; }
.sp-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.sp-palette { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; }
.sp-chip { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 6px; padding: .3rem .55rem; font-size: .8rem; cursor: pointer; }
.sp-chip.is-on { outline: 2px solid var(--brand); outline-offset: 1px; }
.sp-key { color: var(--ink-3); font-size: .7rem; border: 1px solid var(--rule); border-radius: 3px; padding: 0 .25rem; }
.sp-sw { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.4rem; border-radius: 4px; font: 600 .72rem var(--mono); padding: 0 .2rem; }
.sp-scroll { max-height: 70vh; overflow: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
.sp-grid { border-collapse: separate; border-spacing: 0; width: auto; font-size: .78rem; }
.sp-grid th, .sp-grid td { padding: 0; border-bottom: 1px solid var(--rule); text-align: center; background: var(--surface); }
.sp-grid thead th { position: sticky; top: 0; z-index: 2; }
.sp-grid .sp-emp { position: sticky; left: 0; z-index: 1; text-align: left; padding: .35rem .6rem; min-width: 14rem; border-right: 1px solid var(--rule); font-weight: 400; }
.sp-grid thead .sp-emp { z-index: 3; }
.sp-grid .sp-emp input { margin-right: .4rem; vertical-align: top; }
.sp-grid .sp-emp span { display: inline-block; }
.sp-grid .sp-emp small { display: block; color: var(--ink-3); font-size: .7rem; }
.sp-grid .sp-dt { padding: .25rem .1rem; min-width: 2.3rem; font-size: .66rem; color: var(--ink-3); font-weight: 500; }
.sp-grid .sp-dt b { display: block; font: 600 .78rem var(--mono); color: var(--ink); }
.sp-grid .sp-dt.is-sun { background: var(--surface-2); }
.sp-grid td.num-col { padding: .3rem .5rem; color: var(--ink-2); }
.sp-grid tfoot td, .sp-grid tfoot th { font-size: .74rem; padding: .35rem .2rem; color: var(--ink-2); }
.sp-grid tfoot td.is-short { background: var(--fail-bg); color: var(--fail); font-weight: 700; }
.sp-cell { width: 2.2rem; height: 1.8rem; margin: .15rem; border: 0; border-radius: 4px; font: 600 .7rem var(--mono); cursor: pointer; user-select: none; background: transparent; color: var(--ink-3); }
.sp-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.sp-cell[data-locked] { cursor: not-allowed; }
.sp-cell.is-blank { background: var(--surface-2); color: var(--ink-3); border: 1px dashed var(--rule-strong); }
.sp-cell.is-rest { background: var(--sp-rest); color: var(--sp-rest-ink); }
.sp-cell.is-leave, .sp-sw.is-leave { background: var(--sp-leave); color: var(--sp-leave-ink); }
.sp-cell.is-other { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--surface-3) 4px, var(--surface-3) 8px); color: var(--ink-3); }
.sp-cell.is-draft { box-shadow: inset 0 -2px 0 var(--rule-strong); }
.sp-cell.is-changed { box-shadow: inset 0 0 0 2px var(--gold); }
.sp-cell.has-error { outline: 2px solid var(--fail); outline-offset: -2px; }
.sp-cell.has-warning { outline: 2px dashed var(--warn); outline-offset: -2px; }
.sp-sw.is-rest { background: var(--sp-rest); color: var(--sp-rest-ink); }
.sp-sw.is-blank { background: var(--surface-2); color: var(--ink-3); border: 1px dashed var(--rule-strong); }
.sw-0 { background: var(--sp-0); color: var(--sp-0-ink); }
.sw-1 { background: var(--sp-1); color: var(--sp-1-ink); }
.sw-2 { background: var(--sp-2); color: var(--sp-2-ink); }
.sw-3 { background: var(--sp-3); color: var(--sp-3-ink); }
.sw-4 { background: var(--sp-4); color: var(--sp-4-ink); }
.sw-5 { background: var(--sp-5); color: var(--sp-5-ink); }
.sw-x { background: var(--surface-3); color: var(--ink); }
.sp-save { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem .8rem; margin-top: .6rem; background: var(--surface); border: 1px solid var(--gold); border-radius: var(--r); box-shadow: var(--shadow-2); }
.sp-save input { flex: 1 1 14rem; }
.sp-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sp-check { display: flex; gap: .55rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); font-size: .84rem; margin: 0; }
.sp-check:last-child { border-bottom: 0; }
.sp-ic { flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .75rem; }
.sp-check.is-error .sp-ic { background: var(--fail-bg); color: var(--fail); }
.sp-check.is-warning .sp-ic { background: var(--warn-bg); color: var(--warn); }
.sp-check.is-info .sp-ic { background: var(--surface-3); color: var(--ink-2); }
.sp-check.is-ok { color: var(--ok); }
.sp-remove { list-style: none; margin: .5rem 0 0; padding: 0; }
.sp-remove form { margin: 0; }
@media (max-width: 1100px) { .sp-layout { grid-template-columns: 1fr; } }

/* ── Live search on list pages (org/positions, departments, companies) ── */
.live-search { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 .9rem; }
.live-search input[type="search"] { flex: 1 1 22rem; max-width: 36rem; padding: .55rem .75rem; border: 1px solid var(--rule-strong); border-radius: var(--r); background: var(--surface); font: inherit; color: var(--ink); }
.live-search input[type="search"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.live-search.is-loading [data-live-count] { opacity: .5; }
.hint.warn { color: var(--warn); }

/* ── Database backups (system/backups) ─────────────────────────────────── */
.bk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.bk-stats div { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: .75rem .9rem; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.bk-stats span { color: var(--ink-3); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.bk-stats b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.bk-stats small { color: var(--ink-3); font-size: .78rem; }
.bk-stats .is-ok { border-color: var(--ok); }
.bk-stats .is-warn { border-color: var(--warn); background: var(--warn-bg); }
.bk-now { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.bk-now .field { flex: 1 1 20rem; margin: 0; }
.bk-actions { white-space: nowrap; display: flex; gap: .35rem; align-items: flex-start; }
.bk-confirm > summary { list-style: none; cursor: pointer; }
.bk-confirm > summary::-webkit-details-marker { display: none; }
.bk-confirm[open] form { margin-top: .35rem; }
.bk-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; margin-top: 1rem; align-items: start; }
.bk-code { margin: 0; padding: .6rem .75rem; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-sm); font: .8rem var(--mono); overflow-x: auto; white-space: pre; }
.bk-steps { margin: 0 0 .6rem; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; }

/* ── Supervisor review (My team, and the leave step tracker) ──────────────
   The Immediate head reviews first from ESS; HR decides. Classes only - the
   Content-Security-Policy drops inline styles. */

.sv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.sv-bar h2 { margin: 0; }

.sv-leave-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.sv-leave-head h2 { margin: 0; }
.sv-overlap ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.sv-decide .toolbar { margin-bottom: 0; }

.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr)); gap: .85rem; }
.sv-tile {
    display: flex; flex-direction: column; min-width: 0;
    border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); overflow: hidden;
}
.sv-tile.is-flagged { border-color: var(--warn); box-shadow: inset 0 3px 0 var(--warn); }
.sv-tile-img { position: relative; display: block; aspect-ratio: 4 / 3; max-width: 100%; background: var(--surface-3); }
.sv-tile-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sv-stamp {
    position: absolute; left: .4rem; bottom: .4rem; padding: .05rem .35rem; border-radius: var(--r-sm);
    background: rgba(0, 0, 0, .6); color: #fff; font: .72rem var(--mono); font-variant-numeric: tabular-nums;
}
.sv-tile-meta { display: flex; flex-direction: column; gap: .3rem; padding: .55rem .65rem .7rem; font-size: .84rem; min-width: 0; }

.sv-photo-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: 1.1rem; align-items: start; }
.sv-photo img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.sv-flags { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.sv-flags .badge-group { display: inline-flex; margin-right: .35rem; }
.sv-act-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr)); gap: .6rem; margin-bottom: .75rem; }
.sv-act-buttons button { width: 100%; justify-content: center; min-height: 2.75rem; }

.sv-waiting { border-color: var(--gold); }

/* The four steps of a leave application: filed, supervisor, HR, approved. */
.sv-tracker { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sv-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; padding: 0 .35rem; font-size: .84rem; color: var(--ink-3); }
.sv-step::before {
    content: ""; position: absolute; top: .6rem; right: 50%; width: 100%; height: 3px; background: var(--rule);
}
.sv-step:first-child::before { display: none; }
.sv-step strong { color: var(--ink); font-size: .86rem; }
.sv-step small { font-size: .76rem; line-height: 1.35; overflow-wrap: anywhere; }
.sv-dot {
    position: relative; z-index: 1; width: 1.35rem; height: 1.35rem; border-radius: 50%;
    border: 3px solid var(--rule-strong); background: var(--surface);
}
.sv-step.is-done::before, .sv-step.is-now::before { background: var(--ok); }
.sv-step.is-done .sv-dot { background: var(--ok); border-color: var(--ok); }
.sv-step.is-now .sv-dot { border-color: var(--gold); background: var(--warn-bg); }
.sv-step.is-stop .sv-dot { background: var(--fail); border-color: var(--fail); }
.sv-step.is-skip { opacity: .6; }

@media (max-width: 560px) {
    .sv-tracker { grid-template-columns: 1fr; gap: .6rem; }
    .sv-step { flex-direction: row; flex-wrap: wrap; text-align: left; align-items: center; gap: .5rem; }
    .sv-step::before { display: none; }
    .sv-step small { flex-basis: 100%; padding-left: 1.85rem; }
}

/* ── Supervisors module (HR) and Who is off ────────────────────────────────
   Width classes instead of style attributes: style-src has no 'unsafe-inline'. */
.sv-meter { display: inline-block; vertical-align: middle; width: 4.5rem; height: .5rem; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-right: .35rem; }
.sv-meter-fill { display: block; height: 100%; background: var(--ok); }
.sv-meter-fill.part { background: var(--warn); }
.sv-meter-fill.fail { background: var(--fail); }
.sv-w0 { width: 0%; }
.sv-w5 { width: 5%; }
.sv-w10 { width: 10%; }
.sv-w15 { width: 15%; }
.sv-w20 { width: 20%; }
.sv-w25 { width: 25%; }
.sv-w30 { width: 30%; }
.sv-w35 { width: 35%; }
.sv-w40 { width: 40%; }
.sv-w45 { width: 45%; }
.sv-w50 { width: 50%; }
.sv-w55 { width: 55%; }
.sv-w60 { width: 60%; }
.sv-w65 { width: 65%; }
.sv-w70 { width: 70%; }
.sv-w75 { width: 75%; }
.sv-w80 { width: 80%; }
.sv-w85 { width: 85%; }
.sv-w90 { width: 90%; }
.sv-w95 { width: 95%; }
.sv-w100 { width: 100%; }
.sv-act-inline { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0; }
.sv-act-inline input[type="text"] { flex: 1 1 10rem; min-width: 0; }
.sv-act-inline button { padding: .3rem .6rem; font-size: .8rem; }
.sv-scroll-tall { max-height: 32rem; overflow-y: auto; }
[data-assign-body][aria-busy="true"] { opacity: .55; transition: opacity .15s; }

.sv-off { border-collapse: collapse; font-size: .82rem; }
.sv-off th[scope="row"] { white-space: nowrap; text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.sv-off-day { text-align: center; font-variant-numeric: tabular-nums; min-width: 2.4rem; }
.sv-off-day span { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.sv-off-day.is-weekend, .sv-off td.is-weekend { background: var(--surface-2); }
.sv-off-day.is-today { color: var(--brand-2); box-shadow: inset 0 -2px 0 var(--brand-2); }
.sv-off-cell { text-align: center; padding: .25rem; }
.sv-off-cell.is-today { background: var(--surface-2); }
.sv-off-mark { display: inline-block; min-width: 2rem; padding: .1rem .3rem; border-radius: var(--r-sm); font-size: .68rem; font-weight: 700; }
.sv-off-mark.is-approved { background: var(--ok); color: #fff; }
.sv-off-mark.is-pending { border: 1.5px dashed var(--warn); color: var(--warn); background: var(--warn-bg); }

@media print {
    .sv-noprint { display: none !important; }
    .sv-record .card { box-shadow: none; break-inside: avoid; }
}

/* ── Checkboxes and radios, everywhere ───────────────────────────────────
   The global `input { width: 100%; padding: .6rem }` above is right for text
   fields and wrong for a tick box: it stretched every checkbox to the width
   of its column and squeezed its label beside it. These controls are drawn
   here instead - a fixed square, brand-filled when ticked, with the mark
   built from borders (no image, so the Content-Security-Policy has nothing
   to block). Declared last so it wins over `.check input`, `.sv-check input`
   and the global rule alike. */
input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: none; appearance: none;
    flex: none; width: 1.15rem; height: 1.15rem; min-width: 1.15rem; padding: 0; margin: 0;
    display: inline-grid; place-content: center; vertical-align: middle;
    border: 1.5px solid var(--rule-strong); border-radius: 4px;
    background: var(--surface); cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--brand-2); }
input[type="checkbox"]:checked, input[type="radio"]:checked,
input[type="checkbox"]:indeterminate {
    background: var(--brand); border-color: var(--brand);
}
input[type="checkbox"]::after, input[type="radio"]::after { content: ""; display: none; }
input[type="checkbox"]:checked::after {
    display: block; width: .3rem; height: .58rem;
    border: solid var(--surface); border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
}
input[type="checkbox"]:indeterminate::after {
    display: block; width: .55rem; height: 0; border: solid var(--surface); border-width: 0 0 2px 0;
}
input[type="radio"]:checked::after {
    display: block; width: .46rem; height: .46rem; border-radius: 50%; background: var(--surface);
}
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }

/* A tick box beside text: the existing .check row keeps its first-line alignment. */
.check input[type="checkbox"], .check input[type="radio"] { margin-top: .12rem; }

/* The labelled tick box used by filters and forms (Supervisors, bulk assign,
   approvals filters): one tidy, clickable row, highlighted when ticked. */
.sv-check {
    display: inline-flex; align-items: center; gap: .6rem; width: fit-content; max-width: 100%;
    padding: .4rem .75rem .4rem .6rem; cursor: pointer;
    border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface);
    font-size: .88rem; font-weight: 600; line-height: 1.3; color: var(--ink);
    transition: background-color .12s ease, border-color .12s ease;
}
.sv-check:hover { border-color: var(--brand-2); background: var(--surface-2); }
.sv-check:has(input:checked) { border-color: var(--brand); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand); }
.sv-check:has(input:focus-visible) { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.sv-check input { margin: 0; }
.field > .label { font-size: .83rem; font-weight: 650; color: var(--ink); }
.field .sv-check { align-self: flex-start; }
/* Inside a photo tile the name is the label: no box around it. */
.sv-tile-meta .sv-check { padding: 0; border: 0; background: none; box-shadow: none; align-items: flex-start; font-weight: 400; width: auto; }
.sv-tile-meta .sv-check:hover, .sv-tile-meta .sv-check:has(input:checked) { background: none; box-shadow: none; }
.sv-tile-meta .sv-check input { margin-top: .12rem; }

/* ── No-DTR and payroll holds ────────────────────────────────────────────── */
.sv-inline { display: inline-flex; vertical-align: middle; margin-left: .35rem; }
.sv-days { width: 5rem; flex: 0 0 5rem; }
.sv-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; }

/* ── Photo Day and ESS accounts (migration 0111) ─────────────────────────── */
.ess-checklist { list-style: none; margin: .5rem 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.ess-checklist li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* The station: the queue beside the employee being worked. */
.ess-station { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .ess-station { grid-template-columns: minmax(0, 1fr); } }
.ess-queue ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; max-height: 70vh; overflow-y: auto; }
.ess-queue li { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .35rem .5rem; border-radius: var(--r); }
.ess-queue li a { display: flex; gap: .55rem; text-decoration: none; color: var(--ink); min-width: 0; }
.ess-queue li a span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ess-queue li.is-current { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--cta-2); }
.ess-queue li.is-out a { color: var(--ink-3); }
.ess-work { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.ess-person { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ess-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; counter-reset: ess-step; }
.ess-steps > li { counter-increment: ess-step; position: relative; padding-left: 3.4rem; }
.ess-steps > li::before {
    content: counter(ess-step); position: absolute; left: 1rem; top: 1.05rem; width: 1.6rem; height: 1.6rem;
    border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
    background: var(--surface-3); color: var(--ink-2);
}
.ess-steps > li.is-done::before { content: "\2713"; background: var(--ok-bg); color: var(--ok); }
.ess-steps > li.is-now { border-color: var(--cta-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cta-2) 18%, transparent); }
.ess-steps > li.is-now::before { background: var(--cta-2); color: #fff; }
.ess-steps > li.is-locked { opacity: .7; }
.ess-steps h3 { margin: 0 0 .35rem; font-size: 1rem; }
.ess-recheck { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--rule); }
.ess-photo-row { display: flex; align-items: center; gap: .9rem; }
.ess-photo-row img { border-radius: 50%; object-fit: cover; border: 2px solid var(--rule); }

/* Credential slips: printed, folded and handed over. Only the slips print. */
.ess-slips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(24rem, 100%), 1fr)); gap: 1rem; }
.ess-slip {
    background: #fffef8; color: #1a1a1a; border: 1px dashed #9a8f6a; border-radius: 4px;
    padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; font-size: .9rem; break-inside: avoid;
}
.ess-slip header { display: flex; flex-direction: column; gap: .15rem; }
.ess-slip dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; margin: 0; }
.ess-slip dt { color: #555; }
.ess-slip dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.ess-slip-pw-label { font-size: .8rem; color: #555; }
.ess-slip-pw { font-size: 1.45rem; font-weight: 700; letter-spacing: .06em; }
.ess-slip-cut { font-size: .72rem; color: #7a6f4a; text-align: center; border-top: 1px dashed #9a8f6a; padding-top: .35rem; }
.ess-slip-sign { font-size: .8rem; margin: 0; }
@media print {
    body:has(.ess-slips) .sidebar,
    body:has(.ess-slips) .topbar,
    body:has(.ess-slips) .notice { display: none !important; }
    body:has(.ess-slips) main { padding: 0 !important; margin: 0 !important; }
    .ess-slips { grid-template-columns: 1fr 1fr; gap: 8mm; }
}

/* ─────────────────────────────────────────────────────────────────────
 * Dashboard (staff, supervisor, self-service home)
 *
 * Built from the tokens above only, so it follows the light and dark
 * palettes without rules of its own. Every bar is an SVG drawn by
 * App\Support\MiniBar with presentation attributes; nothing here relies
 * on an inline style.
 * ───────────────────────────────────────────────────────────────────── */
.dash { display: grid; gap: 1.5rem; }
.dash-head { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; justify-content: space-between; }
.dash-head > div { min-width: 0; }
.dash-eyebrow { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.dash-head h1 { margin: .2rem 0 .3rem; text-wrap: balance; }
.dash-summary { margin: 0; color: var(--ink-2); }
.dash-summary .is-fail { color: var(--fail); }
.dash-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr)); gap: .9rem; }
.dash-kpi {
    display: flex; flex-direction: column; gap: .3rem; padding: 1.05rem 1.2rem;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
    color: var(--ink); text-decoration: none; min-width: 0;
}
a.dash-kpi:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-1); }
a.dash-kpi:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.dash-kpi .k { font-size: .82rem; color: var(--ink-3); }
.dash-kpi .v { font-size: 1.8rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dash-kpi .v.is-fail { color: var(--fail); }
.dash-kpi .v.is-warn { color: var(--warn); }
.dash-kpi .s { font-size: .85rem; color: var(--ink-2); }
.dash-kpi .n { font-size: .78rem; color: var(--ink-3); }
.dash-kpi .n.is-warn { color: var(--warn); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1.25rem; align-items: start; }
.dash-col { display: grid; gap: 1.25rem; min-width: 0; }
.dash-panel {
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
    padding: 1.1rem 1.25rem; min-width: 0;
}
.dash-panel-head { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; justify-content: space-between; margin-bottom: .7rem; }
.dash-panel-head h2 { margin: 0; font-size: 1.05rem; }
.dash-panel-head .detail { margin: 0; }
.dash-panel .scroll { margin: 0; }
.dash-empty { margin: 0; color: var(--ink-3); font-size: .9rem; }
.dash-note { margin: .6rem 0 0; color: var(--ink-3); font-size: .82rem; }

.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list > li { display: flex; gap: .85rem; align-items: flex-start; padding: .75rem 0; border-top: 1px solid var(--rule); }
.dash-list > li:first-child { border-top: 0; padding-top: .15rem; }
.dash-list .body { flex: 1 1 auto; min-width: 0; }
.dash-list .body strong { display: block; }
.dash-list .body span { font-size: .85rem; color: var(--ink-3); }
.dash-list .act { flex: none; }

.dash-tag { flex: none; margin-top: .1rem; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.dash-tag.is-overdue { background: var(--fail-bg); color: var(--fail); }
.dash-tag.is-approval,
.dash-tag.is-review,
.dash-tag.is-waiting { background: var(--warn-bg); color: var(--warn); }
.dash-tag.is-watch { background: var(--surface-3); color: var(--ink-2); }

.dash-cal > li { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr); gap: .8rem; align-items: center; }
.dash-date {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 3rem; border: 1px solid var(--rule); border-radius: var(--r); line-height: 1.15;
}
.dash-date small { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.dash-date b { font-size: 1.1rem; }

.dash-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); gap: .6rem; margin-top: .7rem; }
.dash-counts b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.dash-counts b.is-fail { color: var(--fail); }
.dash-counts span { font-size: .78rem; color: var(--ink-3); }

.dash-figures > li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; }
.dash-figures .num { font-size: 1.1rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.dash-figures .num.is-fail { color: var(--fail); }
.dash-figures .num.is-warn { color: var(--warn); }

.dash-health > li { display: grid; grid-template-columns: .7rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; }
.dash-dot { width: .62rem; height: .62rem; border-radius: 50%; background: var(--ok); }
.dash-dot.is-warn { background: var(--gold); }
.dash-dot.is-fail { background: var(--fail); }

.dash-activity > li { justify-content: space-between; font-size: .88rem; }
.dash-activity time { color: var(--ink-3); white-space: nowrap; font-size: .8rem; }

.dash-barcell { display: grid; grid-template-columns: minmax(4rem, 1fr) 3rem; gap: .5rem; align-items: center; }
.dash-barcell span { text-align: right; font-size: .8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
tr.dash-row-alert td { background: var(--fail-bg); }
.dash-money { display: grid; grid-template-columns: 2.6rem minmax(3rem, 1fr) 6.5rem; gap: .25rem .5rem; align-items: center; font-size: .8rem; }
.dash-money span:nth-child(3n+1) { color: var(--ink-3); }
.dash-money span:nth-child(3n) { text-align: right; font-variant-numeric: tabular-nums; }

.dash-people > li { align-items: center; }
.dash-people .dash-who { flex: 1 1 auto; min-width: 0; }
.dash-people .dash-who span { display: block; font-size: .8rem; color: var(--ink-3); }

.dash-foot { margin: 0; font-size: .78rem; color: var(--ink-3); }

.mb { display: block; width: 100%; height: .5rem; border-radius: 4px; overflow: hidden; }
.mb-track    { fill: var(--surface-3); }
.mb-brand    { fill: var(--brand-2); }
.mb-navy     { fill: var(--brand); }
.mb-ok       { fill: var(--ok); }
.mb-warn     { fill: var(--warn); }
.mb-fail     { fill: var(--fail); }
.mb-gold     { fill: var(--gold); }
.mb-manpower { fill: var(--manpower); }
.mb-muted    { fill: var(--ink-3); }
.dash-kpi .mb { margin: .2rem 0; }

/* Self-service home */
.ess-hero {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
    padding: 1.2rem 1.4rem; border-radius: var(--r-lg); background: var(--brand); color: #fff;
}
.ess-hero h1 { margin: .15rem 0 .25rem; color: #fff; }
.ess-hero .dash-eyebrow { color: #c9d8f2; }
.ess-hero p { margin: 0; color: #eaf2ff; }
.ess-hero a.btn-quiet { background: var(--gold); border-color: var(--gold); color: #101a29; font-weight: 700; }
.ess-quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .6rem; }
.ess-quick a {
    display: flex; flex-direction: column; gap: .1rem; padding: .85rem 1rem; min-height: 2.75rem;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); color: var(--ink); text-decoration: none;
}
.ess-quick a:hover { border-color: var(--rule-strong); }
.ess-quick a span { font-size: .78rem; color: var(--ink-3); }
.ess-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .6rem; }
.ess-bal { display: flex; flex-direction: column; gap: .1rem; padding: .75rem .85rem; background: var(--surface-2); border-radius: var(--r); }
.ess-bal span { font-size: .78rem; color: var(--ink-3); }
.ess-bal b { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.ess-pay b { font-size: 1.7rem; font-variant-numeric: tabular-nums; }

/* Dashboard gap rows: the whole row opens the list of the people it counts. */
.dash-figures a { color: inherit; text-decoration: none; }
.dash-figures a.num.is-fail { color: var(--fail); }
.dash-figures a.num.is-warn { color: var(--warn); }
.dash-figures a:hover strong, .dash-figures a:focus-visible strong { text-decoration: underline; }
.dash-figures a:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; border-radius: var(--r-sm); }
.dash-figures .dash-gap-go { font-size: .8rem; color: var(--brand-2); text-decoration: underline; white-space: nowrap; }

/* ── Live bell, pop-ups and sidebar badge (live-notify.js) ─────────────── */
.live-bell {
    position: relative; display: grid; place-items: center; flex: none; width: 2.1rem; height: 2.1rem;
    border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--brand-2);
}
.live-bell svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.live-bell:hover { background: var(--surface-2); border-color: var(--brand-2); }
.live-bell:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }
.live-bell.has-unread { color: var(--brand); border-color: var(--brand-2); }
.live-count {
    position: absolute; top: -.35rem; right: -.45rem; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem;
    border-radius: 999px; background: var(--fail); color: #fff; font-size: .68rem; font-weight: 700;
    line-height: 1.15rem; text-align: center; box-shadow: 0 0 0 2px var(--surface);
}
.live-sound-off {
    font: inherit; font-size: .78rem; padding: .3rem .6rem; border-radius: 999px; cursor: pointer;
    border: 1px dashed var(--warn); background: var(--warn-bg); color: var(--warn); white-space: nowrap;
}
.nav-badge {
    margin-left: auto; min-width: 1.3rem; padding: .05rem .4rem; border-radius: 999px;
    background: var(--gold); color: #12294f; font-size: .72rem; font-weight: 700; text-align: center;
}
.live-toasts {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: grid; gap: .6rem;
    width: min(24rem, calc(100vw - 2rem));
}
.live-toast {
    background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); border-left: 4px solid var(--brand-2);
    border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: .85rem 1rem; animation: live-in .18s ease-out;
}
.live-toast p { margin: .25rem 0 0; color: var(--ink-2); font-size: .9rem; }
.live-toast.is-urgent { border-left-color: var(--fail); }
.live-toast.is-urgent strong::before { content: "Urgent · "; color: var(--fail); }
.live-toast.is-success { border-left-color: var(--ok); }
.live-toast.is-warning { border-left-color: var(--warn); }
.live-toast-actions { display: flex; gap: .5rem; margin-top: .6rem; }
.live-toast-actions .btn, .live-toast-actions .btn-quiet { padding: .3rem .75rem; font-size: .85rem; }
@keyframes live-in { from { transform: translateY(.5rem); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .live-toast { animation: none; } }

/* ── Recruitment ───────────────────────────────────────────────────────── */
.rc-queue { margin-bottom: 1.25rem; }
.rc-board {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(14rem, 1fr); gap: .8rem;
    overflow-x: auto; padding-bottom: .5rem; align-items: start;
}
.rc-col { background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: .7rem; display: grid; gap: .5rem; min-width: 0; }
.rc-col h2 { margin: 0 0 .2rem; font-size: .9rem; display: flex; justify-content: space-between; align-items: center; }
.rc-count { font-size: .75rem; font-weight: 700; color: var(--ink-3); background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: .05rem .5rem; }
.rc-card {
    display: grid; gap: .2rem; padding: .65rem .75rem; background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r); color: var(--ink); text-decoration: none; font-size: .88rem;
}
.rc-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-1); }
.rc-card:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.rc-card.is-late { border-left: 4px solid var(--warn); }
.rc-card-foot { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; justify-content: space-between; color: var(--ink-3); font-size: .78rem; }
.rc-empty { margin: 0; color: var(--ink-3); font-size: .82rem; }

.rc-steps { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.rc-steps li {
    padding: .3rem .7rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--rule);
    background: var(--surface); color: var(--ink-3);
}
.rc-steps li.is-done { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.rc-steps li.is-here { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.rc-move .grid { align-items: end; }

.rc-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.rc-checks li { display: flex; gap: .6rem; align-items: flex-start; }
.rc-mark { flex: none; display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; font-size: .8rem; font-weight: 700; }
.rc-checks .is-ok .rc-mark { background: var(--ok-bg); color: var(--ok); }
.rc-checks .is-fail .rc-mark { background: var(--fail-bg); color: var(--fail); }
.rc-checks .is-unknown .rc-mark { background: var(--surface-3); color: var(--ink-3); }

.rc-docs td { vertical-align: top; }
.rc-act { margin-top: .35rem; }
.rc-act > summary { cursor: pointer; color: var(--brand-2); font-weight: 600; font-size: .88rem; }
.rc-act form { display: grid; gap: .4rem; margin-top: .5rem; padding: .6rem; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface-2); }
.rc-act .field { margin: 0; }
.rc-list { margin: 0; padding-left: 1.2rem; display: grid; gap: .45rem; }
.rc-preview { margin: .8rem 0; padding: .8rem 1rem; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface-2); }
.rc-preview p { margin: .3rem 0; }
.rc-hire-ready { margin-top: .8rem; }

/* The walk-in form and the poster: phone first, no application chrome. */
.rc-apply { max-width: 30rem; margin: 0 auto; display: grid; gap: 1rem; padding-bottom: 2rem; }
.rc-apply-head { background: var(--brand); color: #fff; border-radius: var(--r-lg); padding: 1.2rem 1.25rem; }
.rc-apply-head h1 { color: #fff; margin: .2rem 0; font-size: 1.5rem; }
.rc-apply-head p { margin: 0; color: #eaf2ff; }
.rc-apply-company { font-weight: 700; }
.rc-apply-eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; margin-top: .5rem !important; color: #c9d8f2 !important; }
.rc-apply-form { display: grid; gap: .85rem; }
.rc-apply-form > label { display: grid; gap: .3rem; font-weight: 600; font-size: .92rem; }
.rc-apply-form input:not([type=checkbox]):not([type=radio]), .rc-apply-form select { min-height: 3rem; font-size: 1rem; }
.rc-apply-form .check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; min-height: 2.75rem; }
.rc-apply-form button[type=submit] { min-height: 3.2rem; font-size: 1.05rem; }
.rc-apply-done h2 { margin-top: 0; }
.rc-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.rc-poster { max-width: 40rem; margin: 2rem auto; text-align: center; display: grid; gap: .6rem; justify-items: center; }
.rc-poster h1 { font-size: 2.6rem; margin: 0; color: var(--brand); }
.rc-poster-company { font-weight: 700; font-size: 1.2rem; margin: 0; }
.rc-poster-eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 700; margin: 0; }
.rc-poster-where { font-size: 1.2rem; margin: 0; color: var(--ink-2); }
.rc-poster-qr { width: min(22rem, 80vw); height: auto; border: 1px solid var(--rule); border-radius: var(--r-lg); background: #fff; padding: .5rem; }
.rc-poster-how { font-size: 1.1rem; margin: .5rem 0 0; }
.rc-poster-url { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; color: var(--ink-3); word-break: break-all; }
@media print {
    .live-toasts, .live-bell, .live-sound-off { display: none !important; }
    .rc-poster { margin: 0 auto; }
}

/* Recruitment forms: even spacing, buttons kept together on the left. */
.rc-form { display: grid; gap: 1.1rem; }
.rc-form > .toolbar, .rc-form .toolbar { justify-content: flex-start; margin: 0; }
.rc-form fieldset.card { margin: 0; }
.rc-form h2 { margin: 0; }
.card .toolbar:last-child { margin-bottom: 0; }
.rc-form .check { display: flex; gap: .55rem; align-items: flex-start; }

.toolbar.rc-tools { justify-content: flex-start; }
.rc-filter { justify-content: flex-start; }
.rc-filter input[type=search] { flex: 1 1 18rem; width: auto; }
.rc-filter select { flex: 0 1 12rem; width: auto; }
.rc-filter a.btn-quiet:last-child { margin-left: auto; }
.rc-col-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
.rc-pipe li { display: grid; grid-template-columns: minmax(9rem, 12rem) 1fr 2.5rem; gap: .8rem; align-items: center; }
.rc-pipe li strong { text-align: right; }
.dash-grid > section.dash-panel, .rc-queue + .stats { margin-top: 0; }
.dash-gap-link { display: block; }

/* Recruitment, Phase 2: the GM's deployment screen. */
.rc-deploy { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1.25rem; align-items: start; margin-bottom: 1.25rem; }
@media (max-width: 900px) { .rc-deploy { grid-template-columns: 1fr; } }
.rc-pick { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.rc-pick-item { display: grid; gap: .15rem; padding: .65rem .8rem; border: 1px solid var(--rule); border-radius: var(--r); color: var(--ink); text-decoration: none; background: var(--surface); }
.rc-pick-item:hover { border-color: var(--rule-strong); }
.rc-pick-item.is-on { border-color: var(--brand-2); box-shadow: inset 4px 0 0 var(--brand-2); }
.rc-pick-item.is-late:not(.is-on) { box-shadow: inset 4px 0 0 var(--warn); }
.rc-verdict { margin: 1rem 0 .7rem; padding: .55rem .8rem; border-radius: var(--r); font-weight: 700; }
.rc-verdict.is-ok { background: var(--ok-bg); color: var(--ok); }
.rc-verdict.is-fail { background: var(--fail-bg); color: var(--fail); }
.stats .v small { font-size: .55em; color: var(--ink-3); margin-left: .15rem; }

/* Recruitment, Phase 3: the careers page and the applicant's status page. */
.rc-careers-group { font-size: 1.05rem; margin: .5rem 0; }
.rc-careers-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.rc-careers-list .card { display: grid; gap: .3rem; margin: 0; }
.rc-careers-list .btn { justify-self: start; margin-top: .3rem; }
.rc-steps-vertical { flex-direction: column; align-items: flex-start; }

/* ═══════════════════════════════════════════════════════════════════════
   Recruitment design system (rx-)
   One set of parts for every recruitment and numbering screen: the module
   header and its tabs, KPI cards, panels, tables, empty states, forms in
   sections, the stepper, the board, popover actions and switches. Built on
   the application's tokens, so dark mode and the brand follow.
   ═══════════════════════════════════════════════════════════════════════ */
.rx { --rx-gap: 1.25rem; display: grid; gap: var(--rx-gap); min-width: 0; }
.rx section + section { margin-top: 0; }
.rx h2, .rx h3 { margin: 0; }
.rx p { margin: 0; }
.rx .notice { margin: 0; }
.rx .toolbar { margin: 0; }

/* Soft tones for icons, badges and accents. */
.rx { --rx-brand-soft: color-mix(in srgb, var(--brand-2) 12%, var(--surface));
      --rx-gold-soft: color-mix(in srgb, var(--gold) 18%, var(--surface));
      --rx-violet: #6d4fc2; --rx-violet-soft: color-mix(in srgb, #6d4fc2 12%, var(--surface)); }

/* ── Header ─────────────────────────────────────────────────────────── */
.rx-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between; }
.rx-head-main { min-width: 0; flex: 1 1 28rem; }
.rx-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .74rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: var(--brand-2); margin-bottom: .35rem; }
.rx-eyebrow .pill { letter-spacing: .05em; }
.rx-eyebrow a { color: inherit; }
.rx-head h1 { margin: 0; font-size: 1.65rem; line-height: 1.2; letter-spacing: -.015em; overflow-wrap: anywhere; }
.rx-lede { margin-top: .45rem !important; color: var(--ink-2); max-width: 62rem; font-size: .95rem; }
.rx-head-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.rx-head-actions form { margin: 0; }

.rx-tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--rule); margin-top: -.25rem; scrollbar-width: thin; }
.rx-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .95rem; color: var(--ink-3); font-size: .88rem;
    font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.rx-tab svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rx-tab:hover { color: var(--ink); }
.rx-tab.is-on { color: var(--brand); border-bottom-color: var(--brand-2); }
.rx-tab .rx-count { margin-left: .1rem; }

/* ── Icons and counts ───────────────────────────────────────────────── */
.rx-ico { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rx-count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 999px;
    background: var(--surface-3); color: var(--ink-2); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rx-count.is-warn { background: var(--warn-bg); color: var(--warn); }
.rx-count.is-fail { background: var(--fail-bg); color: var(--fail); }

/* ── KPI cards ──────────────────────────────────────────────────────── */
.rx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr)); gap: 1rem; }
.rx-kpi { position: relative; display: flex; gap: .9rem; align-items: flex-start; padding: 1.05rem 1.15rem; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; min-width: 0; }
a.rx-kpi:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); }
a.rx-kpi:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.rx-kpi-ico { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .75rem; flex: none;
    background: var(--rx-brand-soft); color: var(--brand-2); }
.rx-kpi-ico svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rx-kpi-body { min-width: 0; }
.rx-kpi-v { display: block; font-size: 1.7rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rx-kpi-v small { font-size: .55em; font-weight: 600; color: var(--ink-3); margin-left: .15rem; }
.rx-kpi-k { display: block; margin-top: .2rem; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.rx-kpi-n { display: block; margin-top: .15rem; font-size: .76rem; color: var(--ink-3); }
.rx-kpi.is-ok .rx-kpi-ico { background: var(--ok-bg); color: var(--ok); }
.rx-kpi.is-warn .rx-kpi-ico { background: var(--warn-bg); color: var(--warn); }
.rx-kpi.is-warn .rx-kpi-v { color: var(--warn); }
.rx-kpi.is-fail .rx-kpi-ico { background: var(--fail-bg); color: var(--fail); }
.rx-kpi.is-fail .rx-kpi-v { color: var(--fail); }
.rx-kpi.is-gold .rx-kpi-ico { background: var(--rx-gold-soft); color: #9a6b00; }
.rx-kpi.is-violet .rx-kpi-ico { background: var(--rx-violet-soft); color: var(--rx-violet); }

/* The GM's queue: a highlighted band of KPIs. */
.rx-queue { padding: 1.1rem 1.25rem 1.25rem; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--brand-2) 30%, var(--rule));
    background: linear-gradient(180deg, var(--rx-brand-soft), var(--surface) 70%); display: grid; gap: .9rem; }
.rx-queue-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; align-items: baseline; }
.rx-queue-head h2 { font-size: 1.02rem; display: flex; align-items: center; gap: .5rem; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.rx-cols-2, .rx-cols-3, .rx-split, .rx-split-r { display: grid; gap: var(--rx-gap, 1.25rem); align-items: start; min-width: 0; }
.rx-cols-2 > *, .rx-cols-3 > *, .rx-split > *, .rx-split-r > * { min-width: 0; }
@media (min-width: 1100px) {
    .rx-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rx-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rx-split { grid-template-columns: minmax(18rem, 23rem) minmax(0, 1fr); }
    .rx-split-r { grid-template-columns: minmax(0, 1fr) minmax(19rem, 25rem); }
}
.rx-stack { display: grid; gap: var(--rx-gap, 1.25rem); align-content: start; min-width: 0; }

/* ── Panels ─────────────────────────────────────────────────────────── */
.rx-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.rx-panel-head { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between;
    padding: .95rem 1.2rem; border-bottom: 1px solid var(--rule); }
.rx-panel-head h2 { display: flex; align-items: center; gap: .55rem; font-size: 1rem; font-weight: 700; }
.rx-panel-head h2 .rx-ico { color: var(--brand-2); }
.rx-panel-head .rx-sub { font-size: .8rem; color: var(--ink-3); }
.rx-panel-head a { font-size: .84rem; font-weight: 600; }
.rx-panel-body { padding: 1.1rem 1.2rem; display: grid; gap: .9rem; }
.rx-panel-body.is-flush { padding: 0; display: block; }
.rx-panel-foot { padding: .8rem 1.2rem; border-top: 1px solid var(--rule); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg);
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; font-size: .82rem; color: var(--ink-3); }
.rx-panel.is-accent { border-top: 3px solid var(--brand-2); }
.rx-panel.is-warn { border-top: 3px solid var(--warn); }

/* ── Empty states ───────────────────────────────────────────────────── */
.rx-empty { display: grid; justify-items: center; text-align: center; gap: .45rem; padding: 2rem 1.25rem; color: var(--ink-3); }
.rx-empty-ico { display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border-radius: 50%; background: var(--surface-2);
    color: var(--ink-3); border: 1px dashed var(--rule-strong); margin-bottom: .25rem; }
.rx-empty-ico svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rx-empty strong { color: var(--ink); font-size: .95rem; }
.rx-empty p { max-width: 30rem; font-size: .86rem; }
.rx-empty .btn, .rx-empty .btn-quiet { margin-top: .4rem; }
.rx-empty.is-small { padding: 1.2rem 1rem; }

/* ── Tables ─────────────────────────────────────────────────────────── */
.rx-table-wrap { overflow-x: auto; }
.rx-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.rx-table th { text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
    padding: .65rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.rx-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.rx-table tbody tr:last-child td { border-bottom: 0; }
.rx-table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.rx-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rx-table .act { text-align: right; white-space: nowrap; width: 1%; }
.rx-table .muted-row td { opacity: .6; }
.rx-table small, .rx-meta { display: block; color: var(--ink-3); font-size: .78rem; margin-top: .15rem; }
.rx-table a { font-weight: 650; }
.rx-strong { font-weight: 650; color: var(--ink); }

/* Who: initials and name. */
.rx-who { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.rx-avatar { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; flex: none; font-size: .74rem; font-weight: 750;
    background: var(--rx-brand-soft); color: var(--brand); letter-spacing: .02em; }
.rx-avatar.is-lg { width: 3.4rem; height: 3.4rem; font-size: 1.1rem; }

/* Progress (filled / needed). */
.rx-progress { display: grid; gap: .3rem; min-width: 7rem; }
.rx-progress-bar { height: .45rem; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rx-progress-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cta-2), var(--brand-2)); }
.rx-progress-txt { font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Horizontal bars (funnel, exits). */
.rx-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.rx-bars li { display: grid; grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr) 3rem 3.2rem; gap: .8rem; align-items: center; font-size: .87rem; }
.rx-bars li a, .rx-bars li > span:first-child { color: var(--ink); text-decoration: none; font-weight: 600; }
.rx-bars li a:hover { color: var(--brand-2); text-decoration: underline; }
.rx-bar { height: .6rem; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rx-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cta-2), var(--brand-2)); }
.rx-bar.is-warn i { background: linear-gradient(90deg, var(--gold-soft), var(--warn)); }
.rx-bars .num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rx-bars .pct { text-align: right; color: var(--ink-3); font-size: .78rem; font-variant-numeric: tabular-nums; }

/* Simple rows. */
.rx-rows { list-style: none; margin: 0; padding: 0; }
.rx-rows li { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; padding: .8rem 1.2rem;
    border-bottom: 1px solid var(--rule); }
.rx-rows li:last-child { border-bottom: 0; }
.rx-rows .rx-row-main { min-width: 0; flex: 1 1 14rem; }
.rx-rows .rx-row-end { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* Definition grid. */
.rx-dl { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: .65rem 1rem; margin: 0; font-size: .88rem; }
.rx-dl dt { color: var(--ink-3); font-weight: 600; }
.rx-dl dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .rx-dl { grid-template-columns: 1fr; gap: .15rem; } .rx-dl dd { margin-bottom: .55rem; } }

/* ── Filter bar ─────────────────────────────────────────────────────── */
.rx-filter { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; padding: .75rem; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin: 0; }
.rx-filter input[type=search], .rx-filter input[type=date], .rx-filter select { width: auto; margin: 0; }
.rx-filter input[type=search] { flex: 1 1 18rem; }
.rx-filter label { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--ink-2); font-weight: 600; margin: 0; }
.rx-filter .rx-spacer { flex: 1 1 auto; }
.rx-seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.rx-seg a { padding: .5rem .85rem; font-size: .84rem; font-weight: 650; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.rx-seg a + a { border-left: 1px solid var(--rule-strong); }
.rx-seg a.is-on { background: var(--brand); color: #fff; }
.rx-seg a:not(.is-on):hover { background: var(--surface-2); }
.rx-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.rx-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--rule-strong);
    background: var(--surface); color: var(--ink-2); font-size: .84rem; font-weight: 650; text-decoration: none; }
.rx-chip:hover { border-color: var(--brand-2); color: var(--brand); }
.rx-chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rx-chip.is-on .rx-count { background: rgba(255,255,255,.2); color: #fff; }

/* ── Forms in sections ──────────────────────────────────────────────── */
.rx-form { display: grid; gap: 0; }
.rx-form-sec { display: grid; gap: 1rem 2rem; padding: 1.3rem 1.25rem; border-bottom: 1px solid var(--rule); }
@media (min-width: 1000px) { .rx-form-sec { grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr); } }
.rx-form-sec:last-of-type { border-bottom: 0; }
.rx-form-sec h3 { font-size: .95rem; margin: 0 0 .25rem; }
.rx-form-sec .rx-help { font-size: .82rem; color: var(--ink-3); }
.rx-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem 1.1rem; align-content: start; }
.rx-fields .field { margin: 0; }
.rx-fields .is-wide { grid-column: 1 / -1; }
.rx-form-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; align-items: center; padding: .9rem 1.25rem;
    border-top: 1px solid var(--rule); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.rx-form-actions .rx-hint { margin-right: auto; font-size: .8rem; color: var(--ink-3); }
.rx-inline-form { display: grid; gap: .8rem; }
.rx-inline-form .field { margin: 0; }
.rx-btn-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.rx-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; color: var(--ink-2); line-height: 1.45; }
.rx-check input { margin-top: .2rem; flex: none; }

/* Switch: a checkbox drawn as a toggle. */
.rx-switch { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .85rem; color: var(--ink-2); }
.rx-switch input { appearance: none; -webkit-appearance: none; width: 2.3rem; height: 1.3rem; border-radius: 999px; background: var(--rule-strong);
    position: relative; cursor: pointer; transition: background .15s ease; margin: 0; flex: none; border: 0; }
.rx-switch input::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease; }
.rx-switch input:checked { background: var(--ok); }
.rx-switch input:checked::after { transform: translateX(1rem); }
.rx-switch input:disabled { opacity: .55; cursor: not-allowed; }
.rx-switch input:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }

/* ── Popover actions (in tables and lists) ──────────────────────────── */
.rx-pop { position: relative; display: inline-block; }
.rx-pop > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; padding: .42rem .8rem;
    border: 1px solid var(--rule-strong); border-radius: var(--r-sm); background: var(--surface); font-size: .82rem; font-weight: 650; color: var(--ink-2); }
.rx-pop > summary::-webkit-details-marker { display: none; }
.rx-pop > summary::after { content: ""; width: .4rem; height: .4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px); margin-left: .1rem; }
.rx-pop > summary:hover { border-color: var(--ink-3); color: var(--ink); }
.rx-pop[open] > summary { border-color: var(--brand-2); color: var(--brand); }
.rx-pop.is-primary > summary { background: var(--brand); color: #fff; border-color: var(--brand); }
.rx-pop-body { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 30; width: min(22rem, 86vw); padding: 1rem; display: grid; gap: .75rem;
    background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--r-lg); box-shadow: 0 12px 32px rgba(16, 26, 41, .18); text-align: left; white-space: normal; }
.rx-pop-body .field { margin: 0; }
.rx-pop-body form { display: grid; gap: .7rem; margin: 0; }
.rx-pop-body form + form { border-top: 1px solid var(--rule); padding-top: .75rem; }
.rx-pop-title { font-weight: 700; font-size: .9rem; color: var(--ink); }
.rx-pop.is-left .rx-pop-body { right: auto; left: 0; }
.rx-actions { display: inline-flex; flex-wrap: nowrap; gap: .4rem; justify-content: flex-end; }

/* ── Stepper ────────────────────────────────────────────────────────── */
.rx-stepper { list-style: none; margin: 0; padding: 1.1rem 1.2rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(6.5rem, 1fr);
    overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.rx-stepper li { position: relative; display: grid; justify-items: center; gap: .4rem; text-align: center; font-size: .78rem; color: var(--ink-3); font-weight: 600; padding: 0 .25rem; }
.rx-stepper li::before { content: ""; position: absolute; top: .95rem; left: -50%; right: 50%; height: 2px; background: var(--rule); z-index: 0; }
.rx-stepper li:first-child::before { display: none; }
.rx-stepper .rx-step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
    border: 2px solid var(--rule-strong); background: var(--surface); font-size: .75rem; font-weight: 750; color: var(--ink-3); }
.rx-stepper li.is-done { color: var(--ok); }
.rx-stepper li.is-done::before, .rx-stepper li.is-here::before { background: var(--ok); }
.rx-stepper li.is-done .rx-step-dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.rx-stepper li.is-here { color: var(--brand); }
.rx-stepper li.is-here .rx-step-dot { border-color: var(--brand-2); background: var(--brand-2); color: #fff; box-shadow: 0 0 0 4px var(--rx-brand-soft); }
.rx-stepper.is-closed li.is-here .rx-step-dot { background: var(--ink-3); border-color: var(--ink-3); box-shadow: none; }

/* Vertical steps (approval). */
.rx-vsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.rx-vsteps li { position: relative; display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: .8rem; padding-bottom: 1rem; }
.rx-vsteps li:last-child { padding-bottom: 0; }
.rx-vsteps li::before { content: ""; position: absolute; left: .9rem; top: 1.9rem; bottom: 0; width: 2px; background: var(--rule); }
.rx-vsteps li:last-child::before { display: none; }
.rx-vsteps .rx-step-dot { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid var(--rule-strong);
    background: var(--surface); font-size: .75rem; font-weight: 750; color: var(--ink-3); position: relative; z-index: 1; }
.rx-vsteps li.is-done .rx-step-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.rx-vsteps li.is-done::before { background: var(--ok); }
.rx-vsteps li.is-here .rx-step-dot { background: var(--brand-2); border-color: var(--brand-2); color: #fff; box-shadow: 0 0 0 4px var(--rx-brand-soft); }
.rx-vsteps li.is-fail .rx-step-dot { background: var(--fail); border-color: var(--fail); color: #fff; }
.rx-vsteps strong { display: block; font-size: .9rem; }
.rx-vsteps span { display: block; font-size: .8rem; color: var(--ink-3); }

/* ── Board ──────────────────────────────────────────────────────────── */
.rx-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .4rem; align-items: start; }
.rx-col { display: grid; gap: .6rem; align-content: start; padding: .75rem; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-lg); min-height: 12rem; }
.rx-col-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .1rem .2rem .45rem; border-bottom: 2px solid var(--rx-col, var(--brand-2));
    font-weight: 700; font-size: .86rem; }
.rx-col-head span:first-child { display: inline-flex; align-items: center; gap: .45rem; }
.rx-col-head span:first-child::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--rx-col, var(--brand-2)); }
.rx-col[data-stage=new] { --rx-col: #64748b; } .rx-col[data-stage=screening] { --rx-col: #2c5aa8; }
.rx-col[data-stage=assessment] { --rx-col: #6d4fc2; } .rx-col[data-stage=background] { --rx-col: #0e7490; }
.rx-col[data-stage=requirements] { --rx-col: #b7791f; } .rx-col[data-stage=training] { --rx-col: #c2410c; }
.rx-col[data-stage=offer] { --rx-col: #1f6b4d; }
.rx-card { display: grid; gap: .45rem; padding: .75rem .8rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
    color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1); font-size: .85rem; }
.rx-card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.rx-card:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.rx-card.is-late { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-1); }
.rx-card-top { display: flex; gap: .6rem; align-items: center; }
.rx-card-top .rx-avatar { width: 1.9rem; height: 1.9rem; font-size: .7rem; }
.rx-card-name { font-weight: 700; line-height: 1.25; }
.rx-card-meta { color: var(--ink-3); font-size: .76rem; line-height: 1.35; }
.rx-card-foot { display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: center; justify-content: space-between; font-size: .74rem; color: var(--ink-3);
    border-top: 1px dashed var(--rule); padding-top: .45rem; }
.rx-col-empty { text-align: center; color: var(--ink-3); font-size: .8rem; padding: 1.4rem .4rem; border: 1px dashed var(--rule-strong); border-radius: var(--r); }

/* ── Checks list ────────────────────────────────────────────────────── */
.rx-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.rx-checks li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .65rem; align-items: start; padding: .6rem .7rem; border-radius: var(--r);
    background: var(--surface-2); }
.rx-checks .rx-mark { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-size: .8rem; font-weight: 800; }
.rx-checks .is-ok .rx-mark { background: var(--ok-bg); color: var(--ok); }
.rx-checks .is-fail { background: var(--fail-bg); }
.rx-checks .is-fail .rx-mark { background: var(--fail); color: #fff; }
.rx-checks .is-unknown .rx-mark { background: var(--surface-3); color: var(--ink-3); }
.rx-checks strong { display: block; font-size: .88rem; }
.rx-checks small { display: block; color: var(--ink-3); font-size: .78rem; }
.rx-verdict { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border-radius: var(--r); font-weight: 700; font-size: .92rem; }
.rx-verdict.is-ok { background: var(--ok-bg); color: var(--ok); }
.rx-verdict.is-fail { background: var(--fail-bg); color: var(--fail); }

/* ── Timeline ───────────────────────────────────────────────────────── */
.rx-timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.rx-timeline li { position: relative; display: grid; grid-template-columns: .9rem minmax(0, 1fr); gap: .8rem; padding: 0 0 1rem; font-size: .86rem; }
.rx-timeline li::before { content: ""; position: absolute; left: .37rem; top: 1rem; bottom: 0; width: 2px; background: var(--rule); }
.rx-timeline li:last-child::before { display: none; }
.rx-timeline li:last-child { padding-bottom: 0; }
.rx-timeline i { width: .9rem; height: .9rem; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand-2); margin-top: .2rem; position: relative; z-index: 1; }
.rx-timeline .rx-meta { margin-top: .1rem; }

/* ── Pick list (deployment) ─────────────────────────────────────────── */
.rx-pick { list-style: none; margin: 0; padding: .6rem; display: grid; gap: .5rem; }
.rx-pick a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .75rem; align-items: center; padding: .75rem .8rem; border: 1px solid var(--rule);
    border-radius: var(--r); color: var(--ink); text-decoration: none; background: var(--surface); }
.rx-pick a:hover { border-color: var(--rule-strong); background: var(--surface-2); }
.rx-pick a.is-on { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--rx-brand-soft); }
.rx-pick a.is-late:not(.is-on) { box-shadow: inset 3px 0 0 var(--warn); }
.rx-pick .rx-avatar { grid-row: span 2; }
.rx-pick .rx-pick-meta { grid-column: 2; font-size: .76rem; color: var(--ink-3); }

/* ── Big number (hire) ──────────────────────────────────────────────── */
.rx-bignum { display: grid; gap: .25rem; padding: 1rem 1.1rem; border-radius: var(--r-lg); background: var(--rx-brand-soft); border: 1px solid color-mix(in srgb, var(--brand-2) 25%, var(--rule)); }
.rx-bignum span { font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-2); }
.rx-bignum strong { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 1.6rem; letter-spacing: .02em; color: var(--brand); }
.rx-numlist { counter-reset: rx; list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.rx-numlist li { counter-increment: rx; display: grid; grid-template-columns: 1.8rem minmax(0, 1fr); gap: .7rem; font-size: .88rem; color: var(--ink-2); }
.rx-numlist li::before { content: counter(rx); display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
    background: var(--rx-brand-soft); color: var(--brand); font-weight: 750; font-size: .8rem; }

/* Mono for numbers and prefixes. */
.rx-mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .92em; }
.rx-tag { display: inline-flex; align-items: center; padding: .14rem .5rem; border-radius: .4rem; background: var(--surface-3); color: var(--ink-2);
    font-size: .72rem; font-weight: 700; }
.rx-tag.is-brand { background: var(--rx-brand-soft); color: var(--brand); }
.rx-tag.is-gold { background: var(--rx-gold-soft); color: #8a5a00; }

/* The panel title carries its own icon: no gold tick. */
.app main .rx h2::before { display: none; }
.app main .rx h2 { padding-left: 0; }

/* A collapsed panel opened on demand (closing a requisition or application). */
.rx-close > summary { list-style: none; cursor: pointer; border-bottom: 0; }
.rx-close > summary::-webkit-details-marker { display: none; }
.rx-close > summary::after { content: ""; width: .45rem; height: .45rem; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
    transform: rotate(45deg); transition: transform .15s; margin-right: .2rem; }
.rx-close[open] > summary { border-bottom: 1px solid var(--rule); }
.rx-close[open] > summary::after { transform: rotate(-135deg); }
.rx-close > summary h2 { color: var(--ink-2); }
.rx-move .field { margin: 0; }
.rx-move button { justify-self: start; }
.rx-panel-body > .field, .rx-panel-body > form > .field { margin: 0; }
form.rx-panel-body { margin: 0; }
.rx-deploy-pick { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .rx-deploy-pick { grid-template-columns: minmax(0, 2.2fr) minmax(10rem, 1fr) auto; align-items: end; } }
.rx-field-btn { display: flex; align-items: flex-end; }
@media (min-width: 900px) { .rx-checks-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rx-verdict .rx-mark { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: currentColor; }
.rx-verdict.is-ok .rx-mark, .rx-verdict.is-fail .rx-mark { color: #fff; }
.rx-verdict.is-ok .rx-mark { background: var(--ok); }
.rx-verdict.is-fail .rx-mark { background: var(--fail); }
form.rx-form-actions { margin: 0; }
.rx-checklist { gap: .7rem; }
.rx-matches ul { margin: .5rem 0; padding-left: 1.1rem; }
.rx-fields.rx-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rx-table tr.is-muted td { opacity: .55; }
.rx-inline-label { display: inline-flex; align-items: center; gap: .45rem; font-size: .84rem; font-weight: 600; color: var(--ink-2); margin: 0; }
.rx-inline-label input { width: auto; }
.rx-filter .rx-chips { margin: 0; }
/* A sortable column heading: the heading's own colour, underlined on hover. */
.rx-table th a { color: inherit; text-decoration: none; white-space: nowrap; }
.rx-table th a:hover { text-decoration: underline; }
.rx-filter-label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.rx-table th.mid, .rx-table td.mid { text-align: center; }
.rx-switch.is-bare { gap: 0; }
.rx-rules .rx-tag { margin-left: .4rem; }
.rx-days { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--ink-3); }
.rx-days input { width: 5.2rem; margin: 0; padding: .35rem .5rem; text-align: right; font-variant-numeric: tabular-nums; }
.btn-sm, button.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.rx-add { border-top: 1px solid var(--rule); }
.rx-add > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .85rem 1.2rem; font-weight: 650; font-size: .88rem; color: var(--brand-2); }
.rx-add > summary::-webkit-details-marker { display: none; }
.rx-add > summary:hover { background: var(--surface-2); }
.rx-add[open] > summary { border-bottom: 1px solid var(--rule); }
.rx-add > form { padding: 1.1rem 1.2rem; }
.rx-btn-row .rx-spacer { flex: 1 1 auto; }
.rx-table td.act { white-space: nowrap; width: 1%; }

/* Dashboard: recruitment panel */
.dash-counts b.is-warn { color: var(--warn); }
.dash-rc-counts { margin: 0 0 1.1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.dash-rc-grid { display: grid; gap: 1.25rem 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }
.dash-sub { margin: 0 0 .6rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.dash-stages > li { display: grid; grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr) 2.5rem; gap: .7rem; align-items: center; padding: .45rem 0; }
.dash-stages .body { font-size: .88rem; color: var(--ink); text-decoration: none; }
.dash-stages .body:hover { color: var(--brand-2); text-decoration: underline; }
.dash-stages strong { text-align: right; font-variant-numeric: tabular-nums; }
.dash-stage-bar { display: block; min-width: 0; }
.dash-rc-fill { flex: none; display: grid; justify-items: end; gap: .25rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.dash-rc-grid .dash-list .body .mb { display: block; margin-top: .45rem; }

/* Personnel actions */
.rx-table tr.is-changed td { background: color-mix(in srgb, var(--rx-gold-soft) 55%, transparent); }
a.rx-choice { text-decoration: none; color: inherit; }
a.rx-choice:hover .rx-kpi-k { color: var(--brand-2); }

/* Change monitor */
.rx-monitor-filter .rx-panel-body { gap: 1rem; }
.rx-feed { list-style: none; margin: 0; padding: 0; }
.rx-feed > li { padding: .9rem 1.2rem; border-bottom: 1px solid var(--rule); display: grid; gap: .35rem; box-shadow: inset 3px 0 0 transparent; }
.rx-feed > li:last-child { border-bottom: 0; }
.rx-feed > li.is-added { box-shadow: inset 3px 0 0 var(--ok); }
.rx-feed > li.is-changed { box-shadow: inset 3px 0 0 var(--warn); }
.rx-feed > li.is-deleted { box-shadow: inset 3px 0 0 var(--fail); }
.rx-feed > li.is-decision { box-shadow: inset 3px 0 0 var(--brand-2); }
.rx-feed-head { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.rx-feed-head .rx-spacer { flex: 1 1 auto; }
.rx-meta-inline { color: var(--ink-3); font-size: .8rem; }
.rx-feed-who { font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.rx-feed-reason { font-size: .84rem; color: var(--ink-2); font-style: italic; }
.rx-feed-diff > summary { cursor: pointer; font-size: .8rem; font-weight: 650; color: var(--brand-2); width: max-content; }
.rx-feed-diff .rx-table { margin-top: .4rem; font-size: .82rem; }
.rx-feed-diff .rx-table td { word-break: break-word; }
.rx-feed-diff > summary { width: auto; max-width: 100%; font-weight: 500; color: var(--ink-2); list-style: none; display: flex; gap: .4rem; align-items: baseline; }
.rx-feed-diff > summary::-webkit-details-marker { display: none; }
.rx-feed-diff > summary::before { content: "▸"; color: var(--brand-2); font-size: .75rem; }
.rx-feed-diff[open] > summary::before { content: "▾"; }
.rx-feed-line { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ── Office access (migration 0121) ───────────────────────────────────── */
.nav-item.is-locked { opacity: .62; }
.nav-item.is-locked:hover { opacity: .85; }
.nav-lock {
    width: .9rem; height: .9rem; flex: none; margin-left: auto;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.office-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
    margin: 0 0 1.25rem; padding: .75rem 1rem; border-radius: var(--r);
    background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-bg);
}
.office-banner svg { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.office-banner p { margin: 0; flex: 1 1 18rem; font-size: .9rem; }
.office-banner a { font-weight: 650; color: var(--warn); }
.oa-here p { margin: 0; }
.oa-token { border: 2px solid var(--gold); }
.oa-token-value {
    font-size: .95rem; padding: .7rem .9rem; border-radius: var(--r-sm);
    background: var(--surface-2); word-break: break-all; user-select: all;
}
.oa-token code { word-break: break-all; }
.oa-steps { margin: .5rem 0 0; padding-left: 1.2rem; line-height: 1.7; }
.oa-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); gap: .5rem 1.5rem; margin-bottom: .5rem; }
.oa-group { padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: var(--r); }
.oa-add { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.oa-add h3 { margin-top: 0; }
.oa-active { margin: 0; padding-left: 1.1rem; line-height: 1.7; }

/* The ESS app QR on a hand-over slip (migration 0122). */
.ess-slip-app { display: flex; gap: 1rem; align-items: center; margin: .75rem 0; }
.ess-slip-app img { flex: none; width: 150px; height: 150px; image-rendering: pixelated; }
.ess-slip-app p { margin: 0; font-size: .88rem; }

/* Admin › ESS App (migration 0122). */
.ea-num { font-size: 1.8rem; line-height: 1.2; }
.ea-upload { margin-top: 1rem; }
.ea-upload > summary { cursor: pointer; font-weight: 650; color: var(--brand); }
.ea-upload form { margin-top: 1rem; }
.ea-head { justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.ea-actions { white-space: nowrap; }
.ea-actions form + form { margin-left: .25rem; }

/* Bold words inside a sentence stay in the sentence. `.notice strong` is a
   block title when it stands alone; inside a paragraph it is emphasis
   ("by 31 January, or on your last day" broke onto three lines). */
.notice p strong { display: inline; margin-bottom: 0; }

/* A date range filter that fits a phone: From and To side by side, the
   button below them on a narrow screen (ESS My attendance). */
.ess-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: .75rem; align-items: end; margin: 0 0 1rem; }
.ess-filter .field { margin: 0; min-width: 0; }
.ess-filter input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 40rem) {
    .ess-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ess-filter > button { grid-column: 1 / -1; }
}

/* ── Cooperative and HMO (26 Oct 2026) ─────────────────────────────────
 * The two modules rebuilt on the rx components. Only what they need that
 * the rest of rx did not have: balance tiles that keep savings (owed to the
 * member) apart from share capital (the member's equity), a record header,
 * a notice banner, plan cards, a section menu, and tables that turn into
 * cards on a phone. */
.rx-bals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.rx-bal { display: grid; gap: .35rem; align-content: start; padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.rx-bal-lab { display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .84rem; font-weight: 650; color: var(--ink-2); }
.rx-bal-amt { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.rx-bal-amt small { font-size: .55em; font-weight: 600; color: var(--ink-3); }
.rx-bal-meta { font-size: .78rem; color: var(--ink-3); }
.rx-bal.is-equity { background: color-mix(in srgb, #6d4fc2 5%, var(--surface)); border-color: color-mix(in srgb, #6d4fc2 30%, var(--rule)); }
.pill.equity { color: #6d4fc2; border-color: #6d4fc2; background: color-mix(in srgb, #6d4fc2 10%, var(--surface)); }
@media (prefers-color-scheme: dark) { .pill.equity { color: #a58df0; border-color: #a58df0; } }

.rx-profile { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; min-width: 0; }
.rx-profile-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .3rem; font-size: .84rem; color: var(--ink-3); }

.rx-banner { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .85rem 1.1rem; border-radius: var(--r-lg);
    border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--rule)); background: var(--warn-bg); color: var(--ink); font-size: .88rem; }
.rx-banner > .rx-ico { color: var(--warn); }
.rx-banner-text { flex: 1 1 22rem; min-width: 0; }
.rx-banner-text strong { display: block; }
.rx-banner.is-info { background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); border-color: color-mix(in srgb, var(--brand-2) 35%, var(--rule)); }
.rx-banner.is-info > .rx-ico { color: var(--brand-2); }
.rx-banner.is-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, var(--rule)); }
.rx-banner.is-ok > .rx-ico { color: var(--ok); }
.rx-banner.is-fail { background: var(--fail-bg); border-color: color-mix(in srgb, var(--fail) 35%, var(--rule)); }
.rx-banner.is-fail > .rx-ico { color: var(--fail); }

.rx-sum { display: grid; margin: 0; }
.rx-sum > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--rule); font-size: .88rem; }
.rx-sum > div:last-child { border-bottom: 0; }
.rx-sum dt { color: var(--ink-3); } .rx-sum dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.rx-sum > div.is-total { font-size: 1rem; padding-top: .75rem; } .rx-sum > div.is-total dt { color: var(--ink); font-weight: 700; }

.rx-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.rx-plan { display: grid; gap: .7rem; align-content: start; padding: 1.1rem 1.15rem; background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.rx-plan-top { display: flex; justify-content: space-between; gap: .6rem; align-items: flex-start; }
.rx-plan-price { font-size: 1.35rem; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.rx-plan-price small { font-size: .62em; font-weight: 600; color: var(--ink-3); }
.rx-plan-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1rem; margin: 0; font-size: .8rem; }
.rx-plan-facts dt { color: var(--ink-3); } .rx-plan-facts dd { margin: 0; font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.rx-plan-facts div { min-width: 0; }

.rx-subnav { display: grid; gap: .15rem; padding: .5rem; }
.rx-subnav a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem .8rem; border-radius: var(--r);
    color: var(--ink-2); font-size: .88rem; font-weight: 600; text-decoration: none; }
.rx-subnav a:hover { background: var(--surface-2); color: var(--ink); }
.rx-subnav a.is-on { background: color-mix(in srgb, var(--brand-2) 12%, var(--surface)); color: var(--brand); }

/* A list table becomes cards on a phone: each cell names its column. */
@media (max-width: 640px) {
    .rx-table.is-cards thead { display: none; }
    .rx-table.is-cards, .rx-table.is-cards tbody { display: block; }
    .rx-table.is-cards tr { display: grid; gap: .3rem; padding: .85rem 1rem; border-bottom: 1px solid var(--rule); }
    .rx-table.is-cards tbody tr:last-child { border-bottom: 0; }
    .rx-table.is-cards td { display: flex; justify-content: space-between; gap: 1rem; padding: 0; border: 0; text-align: right; }
    .rx-table.is-cards td:first-child { text-align: left; }
    .rx-table.is-cards td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: .76rem; font-weight: 600; text-align: left; }
    .rx-table.is-cards td.act { width: auto; justify-content: flex-end; }
    .rx-table.is-cards td:empty { display: none; }
    .rx-table.is-cards td { flex-wrap: wrap; }
    .rx-table.is-cards td.nw { white-space: normal; }
    .rx-table.is-cards td > small { flex-basis: 100%; }
    .rx-stepper { grid-auto-columns: minmax(0, 1fr); padding-inline: .5rem; }
    .rx-stepper li { font-size: .7rem; }
}
/* Cells that read badly broken over lines: names, dates, codes. */
.rx-table td.nw, .rx-table .rx-who .rx-strong { white-space: nowrap; }
/* A visually hidden label inside a scrolling table must not escape it and widen the page. */
.rx-table-wrap { position: relative; }
/* On a phone the company and workgroup switchers shrink to the screen instead of widening it. */
@media (max-width: 640px) {
    .scope-switch { flex: 1 1 100%; min-width: 0; max-width: 100%; }
    .scope-switch select { flex: 1 1 auto; min-width: 0; width: 100%; }
}
a.rx-bal { color: inherit; text-decoration: none; }
a.rx-bal:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); }
a.rx-bal:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }

/* ── Time and attendance (26 Oct 2026) ─────────────────────────────────
 * The period bar (half-month cutoffs), punch times as chips, the day strip
 * of one employee's cutoff, a before-and-after comparison, an upload zone,
 * a three-part outcome bar and the face review cards. */
.rx-period { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: center; padding: .6rem .75rem; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin: 0; }
.rx-period-label { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.rx-period-cuts { display: inline-flex; max-width: 100%; overflow-x: auto; border: 1px solid var(--rule-strong); border-radius: var(--r); scrollbar-width: thin; }
.rx-period-cuts a { padding: .45rem .8rem; font-size: .84rem; font-weight: 650; color: var(--ink-2); text-decoration: none; white-space: nowrap; border-right: 1px solid var(--rule-strong); }
.rx-period-cuts a:last-child { border-right: 0; }
.rx-period-cuts a:hover { background: var(--surface-2); color: var(--ink); }
.rx-period-cuts a.is-on { background: var(--brand); color: #fff; }
.rx-period .rx-spacer { flex: 1 1 auto; }

.rx-times { display: inline-flex; flex-wrap: wrap; gap: .25rem; align-items: center; font-variant-numeric: tabular-nums; }
.rx-time { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .8rem; padding: .08rem .4rem; border-radius: 5px;
    background: var(--surface-2); border: 1px solid var(--rule); color: var(--ink); white-space: nowrap; }
.rx-time.is-miss { background: var(--fail-bg); border-color: color-mix(in srgb, var(--fail) 40%, var(--rule)); color: var(--fail); }
.rx-time.is-manual { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 40%, var(--rule)); color: var(--warn); }

.rx-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.3rem, 1fr)); gap: .35rem; }
.rx-strip-day { display: grid; gap: .05rem; justify-items: center; padding: .4rem .2rem; border-radius: var(--r); border: 1px solid var(--rule);
    background: var(--surface); font-size: .7rem; color: var(--ink-3); text-decoration: none; }
.rx-strip-day b { font-size: .9rem; color: var(--ink); }
.rx-strip-day.is-present { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, var(--rule)); }
.rx-strip-day.is-absent { background: var(--fail-bg); border-color: color-mix(in srgb, var(--fail) 35%, var(--rule)); }
.rx-strip-day.is-incomplete, .rx-strip-day.is-no_schedule { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, var(--rule)); }
.rx-strip-day.is-rest_day, .rx-strip-day.is-holiday, .rx-strip-day.is-none { background: var(--surface-2); }
.rx-strip-day.is-on_leave { background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); border-color: color-mix(in srgb, var(--brand-2) 30%, var(--rule)); }
a.rx-strip-day:hover { border-color: var(--brand-2); }
.rx-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .76rem; color: var(--ink-3); }
.rx-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.rx-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; border: 1px solid var(--rule-strong); }
.rx-legend .is-present { background: var(--ok-bg); border-color: var(--ok); }
.rx-legend .is-absent { background: var(--fail-bg); border-color: var(--fail); }
.rx-legend .is-incomplete { background: var(--warn-bg); border-color: var(--warn); }
.rx-legend .is-rest { background: var(--surface-2); }
.rx-legend .is-leave { background: color-mix(in srgb, var(--brand-2) 10%, var(--surface)); border-color: var(--brand-2); }
.rx-table tr.is-flag td { background: color-mix(in srgb, var(--warn) 6%, transparent); }

.rx-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .8rem; }
.rx-compare > div { display: grid; gap: .4rem; align-content: start; padding: .9rem 1rem; border: 1px solid var(--rule); border-radius: var(--r); font-size: .88rem; }
.rx-compare .is-new { border-color: color-mix(in srgb, var(--brand-2) 45%, var(--rule)); background: color-mix(in srgb, var(--brand-2) 6%, var(--surface)); }
.rx-compare-h { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }

.rx-drop { display: grid; gap: .6rem; justify-items: center; text-align: center; padding: 1.4rem 1rem; border: 2px dashed var(--rule-strong);
    border-radius: var(--r-lg); background: var(--surface); color: var(--ink-3); font-size: .88rem; }
.rx-drop strong { color: var(--ink); font-size: .98rem; }
.rx-drop .rx-btn-row { justify-content: center; }

.rx-split3 { display: flex; height: .5rem; border-radius: 999px; overflow: hidden; background: var(--surface-3); min-width: 8rem; }
.rx-split3 i { display: block; height: 100%; }
.rx-split3 .is-ok { background: var(--ok); } .rx-split3 .is-dup { background: var(--gold); } .rx-split3 .is-skip { background: var(--fail); }

.rx-caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1rem; }
.rx-capcard { display: grid; gap: .75rem; align-content: start; padding: 1rem; background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.rx-capcard-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.rx-faces { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.rx-faces figure { margin: 0; display: grid; gap: .25rem; font-size: .72rem; color: var(--ink-3); text-align: center; }
.rx-faces img, .rx-faces .rx-face-none { width: 100%; max-width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r);
    border: 1px solid var(--rule); background: var(--surface-2); display: grid; place-items: center; }
.rx-times { flex-wrap: nowrap; white-space: nowrap; }
details.rx-panel > summary { cursor: pointer; list-style: none; }
details.rx-panel > summary::-webkit-details-marker { display: none; }
details.rx-panel:not([open]) > summary { border-bottom: 0; }
.rx-break { overflow-wrap: anywhere; min-width: 12rem; }
.rx-table.is-form td { vertical-align: middle; }
.rx-table.is-form input { width: 100%; min-width: 7.5rem; }
@media (min-width: 1000px) { .rx-form-sec.is-stack { grid-template-columns: minmax(0, 1fr); } }

/* ─────────────────────────────────────────────────────────────────────
 * HMO report (/hmo/report)
 *
 * One page for the screen and for paper. On screen: a filter panel, KPI
 * cards and the listing. On paper (A4 landscape): a letter header with what
 * the report covers, the same figures in black and white, the listing with
 * its column heads repeated on every page, and signature lines.
 * ───────────────────────────────────────────────────────────────────── */
.hrep-print { display: none; }
.hrep-paper { display: none; }
/* Grid children may shrink, or the module tabs widen the page on a phone. */
.hrep > * { min-width: 0; }

.hrep-filters { padding: 1rem 1.2rem 1.1rem; display: grid; gap: .95rem; }
.hrep-filters.is-loading { opacity: .65; pointer-events: none; }
.hrep-filters-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.hrep-filters-head h2 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 700; }
.hrep-filters-head h2 .rx-ico { color: var(--brand-2); }
.hrep-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.hrep-actions .btn, .hrep-actions .btn-quiet { display: inline-flex; align-items: center; gap: .45rem; }
.hrep-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
.hrep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11.5rem), 1fr)); gap: .75rem .9rem; align-items: end; }
.hrep-field { display: grid; gap: .3rem; margin: 0; min-width: 0; }
.hrep-field > span { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.hrep-field select, .hrep-field input { width: 100%; margin: 0; min-width: 0; }
.hrep-field-wide { grid-column: span 2; }
.hrep-apply { align-self: end; }
.hrep-apply .btn-quiet { width: 100%; }
@media (max-width: 30rem) { .hrep-field-wide { grid-column: auto; } }
.hrep-quick { align-items: center; padding-top: .85rem; border-top: 1px solid var(--rule); }
.hrep-quick .rx-filter-label { margin-right: .2rem; }

.hrep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1rem; }
.hrep-kpi { display: grid; gap: .25rem; align-content: start; padding: 1rem 1.15rem; background: var(--surface);
    border: 1px solid var(--rule); border-top: 3px solid var(--brand-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.hrep-kpi.is-ok { border-top-color: var(--ok); }
.hrep-kpi.is-warn { border-top-color: var(--warn); }
.hrep-kpi.is-warn .hrep-kpi-v { color: var(--warn); }
.hrep-kpi-k { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.hrep-kpi-v { font-size: 1.55rem; font-weight: 750; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere; }
.hrep-kpi-v small { font-size: .6em; font-weight: 600; color: var(--ink-3); margin-right: .1rem; }
.hrep-kpi-n { font-size: .8rem; color: var(--ink-2); }
.hrep-bar { display: block; height: .4rem; margin-top: .35rem; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hrep-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }

.hrep-mix { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.hrep-mix .rx-filter-label:not(:first-child) { margin-left: .6rem; }
.hrep-mix-item { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .88rem; }

.hrep-table td, .hrep-table th { vertical-align: top; }
.hrep-table td.num, .hrep-table th.num { text-align: right; }
.hrep-table .hrep-no { color: var(--ink-3); width: 1%; }
.hrep-table .hrep-ids { font-size: .8rem; }
.hrep-table .pill { white-space: nowrap; }
.hrep-table tr.hrep-dim td { color: var(--ink-3); }
.hrep-owed { color: var(--warn); font-weight: 700; }
.hrep-group th { padding: .7rem 1rem; background: var(--surface-2); color: var(--brand); font-size: .82rem; font-weight: 750;
    letter-spacing: .02em; text-transform: none; border-bottom: 1px solid var(--rule); }
.hrep-group .rx-count { margin-left: .4rem; }
.hrep-sub th, .hrep-sub td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); font-weight: 700; font-size: .82rem;
    text-transform: none; letter-spacing: 0; color: var(--ink-2); border-bottom: 2px solid var(--rule-strong); }
.hrep-total th, .hrep-total td { padding: .85rem 1rem; background: var(--surface-2); font-weight: 800; color: var(--ink);
    font-size: .88rem; text-transform: none; letter-spacing: 0; border-top: 2px solid var(--brand-2); }
.rx-table tbody tr.hrep-group:hover th, .rx-table tbody tr.hrep-sub:hover td { background: inherit; }
@media (max-width: 640px) {
    .hrep-table.is-cards tfoot { display: block; }
    .hrep-table.is-cards tr.hrep-group, .hrep-table.is-cards tr.hrep-sub, .hrep-table.is-cards tr.hrep-total { display: grid; }
    .hrep-table.is-cards tr.hrep-sub th, .hrep-table.is-cards tr.hrep-total th { text-align: left; }
    .hrep-table.is-cards .hrep-no, .hrep-table.is-cards td:empty { display: none; }
}

/* ── On paper ─────────────────────────────────────────────────────── */
@media print {
    @page { size: A4 landscape; margin: 11mm 9mm 13mm; }
    @page { @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7pt sans-serif; color: #555; } }

    body:has(.hrep) { background: #fff !important; color: #000; }
    body:has(.hrep) .sidebar, body:has(.hrep) .topbar, body:has(.hrep) .notice, body:has(.hrep) .office-banner,
    body:has(.hrep) .nav-scrim, body:has(.hrep) .nav-toggle, body:has(.hrep) .view-as-bar,
    body:has(.hrep) .help-fab, body:has(.hrep) .help-panel { display: none !important; }
    body:has(.hrep) .app-shell { display: block; min-height: 0; }
    body:has(.hrep) main { padding: 0 !important; margin: 0 !important; max-width: none !important; }

    .hrep { gap: 3.5mm; font-size: 8pt; color: #000; }
    .hrep-noprint, .hrep-screen { display: none !important; }
    .hrep-print { display: block; }
    .hrep-paper { display: inline; }
    .hrep a { color: #000; text-decoration: none; }

    .hrep-letter { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; padding-bottom: 2.5mm;
        border-bottom: 1.5pt solid #000; }
    .hrep-letter-org { font-size: 9pt; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
    .hrep-letter h1 { font-size: 15pt; margin: .6mm 0 .8mm; letter-spacing: -.01em; }
    .hrep-letter-scope { font-size: 8.5pt; margin: 0; }
    .hrep-letter dl { display: grid; gap: .6mm; margin: 0; font-size: 7.5pt; text-align: right; }
    .hrep-letter dl div { display: flex; gap: 2mm; justify-content: flex-end; }
    .hrep-letter dt { color: #444; }
    .hrep-letter dd { margin: 0; font-weight: 700; }

    .hrep-kpis { grid-template-columns: repeat(5, 1fr); gap: 2mm; }
    .hrep-kpi { padding: 1.8mm 2.5mm; box-shadow: none; border: .6pt solid #999; border-top: 1.6pt solid #000; border-radius: 1.5mm;
        break-inside: avoid; }
    .hrep-kpi-k { font-size: 6.5pt; color: #333; }
    .hrep-kpi-v { font-size: 12pt; color: #000 !important; }
    .hrep-kpi-n { font-size: 7pt; color: #333; }
    .hrep-bar { display: none; }
    .hrep-mix { gap: 1mm 3mm; font-size: 7.5pt; }
    .hrep-mix-item { font-size: 7.5pt; }
    .hrep-mix .pill { padding: 0; border: 0; background: none !important; color: #000 !important; }

    .hrep .rx-panel { border: 0; box-shadow: none; background: none; }
    .hrep .rx-panel-head { padding: 1mm 0; border: 0; }
    .hrep .rx-panel-head h2 { font-size: 9.5pt; }
    .hrep .rx-panel-head .rx-ico { display: none; }
    .hrep .rx-panel-foot { padding: 1.5mm 0 0; background: none; border-top: 0; font-size: 6.5pt; color: #444; border-radius: 0; }
    .hrep .rx-table-wrap { overflow: visible; }
    .hrep-companies { break-inside: avoid; }

    .hrep-table { font-size: 7.3pt; border-collapse: collapse; }
    .hrep-table thead { display: table-header-group; }
    .hrep-table tfoot { display: table-row-group; }
    .hrep-table tr { break-inside: avoid; }
    .hrep-table th { padding: 1.2mm 1.4mm; font-size: 6.3pt; color: #000; background: #e9e9e9 !important; border-bottom: .8pt solid #000;
        -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .hrep-table td { padding: .9mm 1.4mm; border-bottom: .4pt solid #bbb; }
    .hrep-table td small { font-size: 6.4pt; color: #444; margin-top: 0; }
    .hrep-table .hrep-ids { font-size: 6.8pt; }
    .hrep-table .pill { padding: 0; border: 0; background: none !important; color: #000 !important; font-size: 7pt; font-weight: 600; }
    .hrep-table tr.hrep-dim td { color: #555; }
    .hrep-owed { color: #000; font-weight: 800; }
    .hrep-group th { background: #f1f1f1 !important; color: #000; font-size: 7.6pt; padding: 1.3mm 1.4mm; border-bottom: .6pt solid #000; }
    .hrep-group .rx-count { display: inline; background: none; color: #000; padding: 0; min-width: 0; height: auto; font-size: 7.6pt; }
    .hrep .pill { text-transform: none; letter-spacing: 0; }
    .hrep-mix .rx-filter-label { font-size: 6.5pt; color: #333; }
    .hrep-group .rx-count::before { content: "("; }
    .hrep-group .rx-count::after { content: ")"; }
    .hrep-sub th, .hrep-sub td { background: none !important; color: #000; font-size: 7.3pt; border-bottom: .9pt solid #000; }
    .hrep-total th, .hrep-total td { background: none !important; color: #000; font-size: 7.8pt; padding: 1.4mm;
        border-top: 1.2pt solid #000; border-bottom: 2.4pt double #000; }

    .hrep-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14mm; margin-top: 12mm; break-inside: avoid; font-size: 7.5pt; }
    .hrep-sign div { display: grid; gap: 1mm; text-align: center; }
    .hrep-sign-line { display: block; min-height: 4.5mm; border-bottom: .7pt solid #000; font-weight: 700; font-size: 8.5pt; }
}

/* ─────────────────────────────────────────────────────────────────────
 * Loans module (/loans, /loans/types, /loans/{id}, /loans/employee,
 * /loans/blocked, /loans/create)
 *
 * Built on the tokens and the rx-* header, tabs and panels. Bar widths are
 * the u-fill-N classes, never an inline style (T-SEC-05).
 * ───────────────────────────────────────────────────────────────────── */
.ln { --rx-gap: 1.25rem; }
.ln > * { min-width: 0; }
.ln h1, .ln h2, .ln h3, .ln p { margin: 0; }
.ln section + section { margin-top: 0; }
.ln-note { font-size: .8rem; color: var(--ink-3); line-height: 1.45; }
.ln-pad { padding: .9rem 1.2rem; }
.ln-stack { display: grid; gap: .75rem; }
.ln-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ln-ref { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .74rem; color: var(--ink-3); letter-spacing: .01em; }
.ln-crumb { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; font-size: .82rem; color: var(--ink-3); }
.ln-crumb a { color: var(--brand-2); font-weight: 650; text-decoration: none; }
.ln-crumb a:hover { text-decoration: underline; }

/* Avatars made of initials */
.ln-av { flex: none; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
    background: var(--rx-brand-soft); color: var(--brand-2); font-weight: 750; font-size: .78rem; letter-spacing: .02em; }
.ln-av.is-lg { width: 3.2rem; height: 3.2rem; font-size: 1rem; }
img.ln-av { object-fit: cover; padding: 0; }
.ln-av.is-xl { width: 3.6rem; height: 3.6rem; font-size: 1.1rem; }
.ln-titled { display: flex; gap: 1rem; align-items: center; }

/* KPI band */
.ln-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr)); gap: .9rem; }
.ln-kpis.is-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.ln-kpi { position: relative; overflow: hidden; display: grid; gap: .3rem; align-content: start; padding: 1rem 1.15rem 1rem 1.3rem;
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.ln-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand-2); }
.ln-kpi.is-ok::before { background: var(--ok); }
.ln-kpi.is-warn::before { background: var(--warn); }
.ln-kpi-k { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.ln-kpi-v { font-size: 1.55rem; font-weight: 760; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ln-kpi-v small { font-size: .58em; font-weight: 600; color: var(--ink-3); margin-right: .1rem; }
.ln-kpi.is-warn .ln-kpi-v { color: var(--warn); }
.ln-kpi-n { font-size: .8rem; color: var(--ink-2); }
.ln-kpi-n a { font-weight: 650; }

/* Loan-type strip: each type filters the register */
.ln-typestrip { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.ln-type { flex: none; display: grid; gap: .15rem; min-width: 10.5rem; padding: .7rem .95rem; border: 1px solid var(--rule);
    border-radius: var(--r-md, .75rem); background: var(--surface); color: var(--ink); text-decoration: none; }
.ln-type:hover { border-color: var(--brand-2); }
.ln-type:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.ln-type.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ln-type-k { font-size: .78rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.ln-type-v { font-weight: 760; font-variant-numeric: tabular-nums; }
.ln-type-n { font-size: .74rem; color: var(--ink-3); }
.ln-type.is-on .ln-type-k, .ln-type.is-on .ln-type-n { color: rgba(255, 255, 255, .82); }

/* Filter bar */
.ln-bar { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; padding: .75rem; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin: 0; }
.ln-bar.is-flat { padding: 0; border: 0; box-shadow: none; background: none; }
.ln-bar input[type=search] { flex: 1 1 16rem; width: auto; margin: 0; min-width: 0; }
.ln-bar select { width: auto; margin: 0; max-width: 100%; }
.ln-check { display: inline-flex; gap: .45rem; align-items: center; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin: 0; white-space: nowrap; }

/* Tables */
.ln-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.ln-table th { text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
    padding: .75rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.ln-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ln-table tbody tr:last-child td { border-bottom: 0; }
.ln-table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.ln-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ln-table .nw { white-space: nowrap; }
.ln-table .act { text-align: right; white-space: nowrap; width: 1%; }
.ln-table small { display: block; font-size: .76rem; color: var(--ink-3); margin-top: .12rem; }
.ln-table tr.is-same td { border-top: 0; }
.ln-table tr.is-same .ln-who-cell > * { visibility: hidden; }
.ln-table tr.is-last td { border-bottom: 1px solid var(--rule-strong); }
.ln-table tr.is-muted td { color: var(--ink-3); }
.ln-table tr.is-next td { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.ln-table tfoot th, .ln-table tfoot td, .ln-total th, .ln-total td { background: var(--surface-2); font-weight: 750; border-top: 1px solid var(--rule-strong); border-bottom: 0;
    text-transform: none; letter-spacing: 0; font-size: .86rem; color: var(--ink); }
.ln-sortable { color: inherit; text-decoration: none; }
.ln-sortable:hover { color: var(--brand-2); }
.ln-sortable.is-on { color: var(--brand-2); }
.ln-who { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.ln-who b, .ln-name { font-weight: 680; color: var(--ink); white-space: nowrap; text-decoration: none; }
.ln-name:hover { color: var(--brand-2); text-decoration: underline; }
.ln-open { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .5rem; color: var(--ink-3); }
.ln-open:hover { background: var(--surface-2); color: var(--brand-2); }
.ln-open svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: rotate(-90deg); }
.ln-warn { display: inline-flex; align-items: center; gap: .3rem; margin-top: .3rem; font-size: .74rem; font-weight: 650; color: var(--warn); white-space: nowrap; }
.ln-warn svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ln-warn-text { color: var(--warn); }

/* Progress */
.ln-prog { display: grid; gap: .3rem; min-width: 8rem; }
.ln-prog-t { display: flex; justify-content: space-between; gap: .5rem; font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ln-prog-b { height: .4rem; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ln-prog-b > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cta-2), var(--brand-2)); }

/* Register footer and pages */
.ln-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .8rem 1.1rem;
    border-top: 1px solid var(--rule); background: var(--surface-2); font-size: .82rem; color: var(--ink-3); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.ln-foot a { font-weight: 650; }
.ln-pages { display: flex; flex-wrap: wrap; gap: .3rem; }
.ln-pages a, .ln-pages span { min-width: 2.1rem; padding: .32rem .6rem; text-align: center; border: 1px solid var(--rule-strong); border-radius: .45rem;
    color: var(--ink-2); text-decoration: none; font-weight: 650; background: var(--surface); }
.ln-pages a:hover { border-color: var(--brand-2); color: var(--brand-2); }
.ln-pages .is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ln-pages .ln-gap { border-color: transparent; background: none; }

/* Cards */
.ln-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.ln-card.is-accent { border-top: 3px solid var(--brand-2); }
.ln-card-h { padding: .9rem 1.2rem; border-bottom: 1px solid var(--rule); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem .8rem; }
.ln-card-h h2 { font-size: .98rem; display: flex; gap: .5rem; align-items: center; }
.ln-card-h h2 .rx-ico { color: var(--brand-2); }
.ln-card-h a { font-size: .82rem; font-weight: 650; }
.ln-card-b { padding: 1rem 1.2rem; }
.ln-inline-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin: .2rem 0 .6rem; }
.ln-inline-form .field { flex: 1 1 16rem; margin: 0; }

/* Alerts */
.ln-alert { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--r-lg); border: 1px solid var(--rule);
    background: var(--surface); font-size: .88rem; color: var(--ink-2); }
.ln-alert > svg { flex: none; width: 1.25rem; height: 1.25rem; margin-top: .05rem; fill: none; stroke: var(--brand-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ln-alert b { color: var(--ink); }
.ln-alert p { margin: 0; }
.ln-alert.is-fail { background: var(--fail-bg); border-color: color-mix(in srgb, var(--fail) 35%, transparent); }
.ln-alert.is-fail > svg { stroke: var(--fail); }
.ln-alert.is-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.ln-alert.is-warn > svg { stroke: var(--warn); }
.ln-alert.is-ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.ln-alert.is-ok > svg { stroke: var(--ok); }

/* Loan detail: balance panel */
.ln-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.ln-hero-main { display: grid; gap: .45rem; align-content: center; padding: 1.4rem 1.5rem; color: #fff;
    background: linear-gradient(155deg, var(--brand) 0%, var(--brand-2) 100%); }
.ln-hero-k { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.ln-big { font-size: 2.3rem; font-weight: 780; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ln-big small { font-size: .5em; opacity: .75; margin-right: .1rem; }
.ln-hero-of { font-size: .88rem; color: rgba(255, 255, 255, .85); }
.ln-hero-main .ln-prog-b { background: rgba(255, 255, 255, .22); height: .55rem; }
.ln-hero-main .ln-prog-b > span { background: #fff; }
.ln-hero-main .ln-prog-t { color: rgba(255, 255, 255, .88); }
.ln-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ln-hero-stats > div { display: grid; gap: .2rem; align-content: start; padding: 1rem 1.25rem; border-left: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.ln-hero-stats > div:nth-last-child(-n+3) { border-bottom: 0; }
.ln-hero-stats span { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ln-hero-stats b { font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.ln-hero-stats small { font-size: .76rem; color: var(--ink-3); }

/* Two columns: main and side */
.ln-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 23.5rem); gap: 1.25rem; align-items: start; }
.ln-main, .ln-side { display: grid; gap: 1.25rem; min-width: 0; }

/* Tabs */
.ln-tabs { display: flex; gap: .2rem; padding: 0 .8rem; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.ln-tabs[hidden] { display: none; }
.ln-tabs button { display: inline-flex; gap: .4rem; align-items: center; padding: .8rem .8rem; margin: 0 0 -1px; border: 0; border-bottom: 2px solid transparent;
    border-radius: 0; background: none; color: var(--ink-3); font-size: .86rem; font-weight: 650; cursor: pointer; white-space: nowrap; }
.ln-tabs button:hover { color: var(--ink); background: none; }
.ln-tabs button.is-on { color: var(--brand); border-bottom-color: var(--brand-2); }
.ln-panel + .ln-panel { border-top: 1px solid var(--rule); }
.ln-panel-h { font-size: .98rem; padding: .9rem 1.2rem .3rem; }
.is-tabbed .ln-panel { display: none; border-top: 0; }
.is-tabbed .ln-panel.is-on { display: block; }
.is-tabbed .ln-panel-h { display: none; }
.ln-reverse { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; margin: 0; }
.ln-reverse input { width: 8.5rem; margin: 0; padding: .35rem .55rem; font-size: .8rem; }
.ln-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ln-docs li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.ln-docs svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--brand-2); stroke-width: 2; }
.ln-docs small { color: var(--ink-3); }

/* Folded action panels */
.ln-act { border-top: 1px solid var(--rule); }
.ln-act > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .9rem 1.2rem;
    font-weight: 680; font-size: .92rem; color: var(--ink); }
.ln-act > summary::-webkit-details-marker { display: none; }
.ln-act > summary::after { content: "+"; margin-left: auto; font-size: 1.2rem; line-height: 1; color: var(--ink-3); }
.ln-act[open] > summary::after { content: "–"; }
.ln-act > summary small { font-weight: 500; font-size: .8rem; color: var(--ink-3); }
.ln-act > summary svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--brand-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ln-act > summary:hover { background: var(--surface-2); }
.ln-act[open] > summary { background: var(--surface-2); border-bottom: 1px solid var(--rule); }
.ln-act.is-danger > summary svg { stroke: var(--fail); }
.ln-act-b { padding: 1rem 1.2rem 1.2rem; display: grid; gap: .8rem; margin: 0; }
.ln-act-b .toolbar { margin: 0; }

/* Definition lists and status boxes */
.ln-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .55rem 1rem; margin: 0; font-size: .86rem; }
.ln-dl dt { color: var(--ink-3); }
.ln-dl dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ln-dl dd small { display: block; font-weight: 500; font-size: .76rem; color: var(--ink-3); }
.ln-remarks { margin-top: .9rem !important; padding: .7rem .8rem; border-radius: .6rem; background: var(--surface-2); font-size: .82rem; color: var(--ink-2); overflow-wrap: anywhere; }
.ln-status { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem; border-radius: .7rem; background: var(--ok-bg); color: var(--ink-2); font-size: .84rem; }
.ln-status svg { flex: none; width: 1.15rem; height: 1.15rem; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ln-status b { display: block; color: var(--ink); }
.ln-status.is-fail { background: var(--fail-bg); }
.ln-status.is-fail svg { stroke: var(--fail); }
.ln-links { display: grid; padding: .4rem 0; }
.ln-links a { padding: .55rem 1.2rem; font-weight: 650; font-size: .86rem; text-decoration: none; }
.ln-links a:hover { background: var(--surface-2); }

/* Loan types: list beside one editor */
.ln-md { display: grid; grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ln-list { position: sticky; top: 1rem; overflow: hidden; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.ln-list-head { display: grid; gap: .6rem; padding: .85rem; border-bottom: 1px solid var(--rule); }
.ln-list-head input { margin: 0; width: 100%; }
.ln-list-head .rx-chip { cursor: pointer; font: inherit; font-size: .82rem; font-weight: 650; }
.ln-list-body { max-height: min(42rem, calc(100vh - 12rem)); overflow-y: auto; }
.ln-group { display: flex; justify-content: space-between; padding: .55rem .9rem .35rem; font-size: .68rem; font-weight: 750; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); border-top: 1px solid var(--rule); }
.ln-group[hidden], .ln-item[hidden] { display: none; }
.ln-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .6rem; padding: .6rem .9rem; border-left: 3px solid transparent;
    border-top: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); color: var(--ink); text-decoration: none; }
.ln-item:hover { background: var(--surface-2); }
.ln-item:focus-visible { outline: 2px solid var(--cta-2); outline-offset: -2px; }
.ln-item.is-on { background: var(--rx-brand-soft); border-left-color: var(--brand-2); }
.ln-item.is-off b { color: var(--ink-3); }
.ln-item b { font-weight: 650; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-meta { grid-row: 1 / span 2; grid-column: 2; display: grid; justify-items: end; align-content: center; gap: .2rem; }
.ln-code { display: inline-flex; gap: .3rem; align-items: center; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .72rem; font-weight: 600; color: var(--ink-3); }
.ln-code svg { width: .8rem; height: .8rem; fill: none; stroke: var(--warn); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ln-badge { display: inline-block; padding: .1rem .45rem; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: .7rem; font-weight: 700;
    font-variant-numeric: tabular-nums; white-space: nowrap; }
.ln-badge.is-brand { background: var(--rx-brand-soft); color: var(--brand-2); }
.ln-badge.is-me { background: var(--brand); color: #fff; }
.ln-editor { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; margin: 0; }
.ln-editor-head { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; justify-content: space-between; align-items: flex-start; padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--rule); }
.ln-editor-head h2 { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; font-size: 1.3rem; }
.ln-editor-head .ln-code { font-size: .8rem; }
.ln-editor-head .ln-note { margin-top: .3rem; }
.ln-usage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.ln-usage > div { display: grid; gap: .15rem; padding: .8rem 1.3rem; border-right: 1px solid var(--rule); min-width: 0; }
.ln-usage > div:last-child { border-right: 0; }
.ln-usage span { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ln-usage b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ln-sec { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1.2rem; padding: 1.15rem 1.3rem; border-bottom: 1px solid var(--rule); }
.ln-sec h3 { font-size: .92rem; }
.ln-help { margin-top: .3rem !important; font-size: .8rem; color: var(--ink-3); line-height: 1.45; }
.ln-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; align-content: start; }
.ln-field { display: grid; gap: .3rem; align-content: start; margin: 0; min-width: 0; }
.ln-field.is-wide, .ln-order.is-wide { grid-column: 1 / -1; }
.ln-field > label, .ln-field legend { font-size: .78rem; font-weight: 700; color: var(--ink-2); margin: 0; }
.ln-field input, .ln-field select { width: 100%; margin: 0; }
.ln-field small { font-size: .74rem; color: var(--ink-3); }
.ln-seg-field { border: 0; padding: 0; }
.ln-seg-field legend { padding: 0; margin-bottom: .3rem; text-transform: none; letter-spacing: 0; font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.ln-seg-field .ln-seg { justify-self: start; }
.ln-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule-strong); border-radius: .55rem; overflow: hidden; background: var(--surface); }
.ln-seg label { position: relative; margin: 0; }
.ln-seg label + label { border-left: 1px solid var(--rule-strong); }
.ln-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-width: 0; pointer-events: none; }
.ln-seg span { display: block; padding: .5rem .85rem; font-size: .83rem; font-weight: 650; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.ln-seg label:hover span { background: var(--surface-2); }
.ln-seg input:checked + span { background: var(--brand); color: #fff; }
.ln-seg input:focus-visible + span { outline: 2px solid var(--cta-2); outline-offset: -2px; }
.ln-toggle { position: relative; display: flex; gap: .8rem; align-items: flex-start; padding: .8rem .9rem; margin: 0; border: 1px solid var(--rule);
    border-radius: .7rem; background: var(--surface-2); cursor: pointer; }
.ln-toggle > input { position: absolute; opacity: 0; width: 1px; height: 1px; min-width: 0; pointer-events: none; }
.ln-switch { position: relative; flex: none; width: 2.5rem; height: 1.4rem; margin-top: .1rem; border-radius: 999px; background: var(--rule-strong); transition: background-color .15s ease; }
.ln-switch::after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; transition: left .15s ease; }
.ln-toggle > input:checked + .ln-switch { background: var(--ok); }
.ln-toggle > input:checked + .ln-switch::after { left: 1.3rem; }
.ln-toggle > input:focus-visible + .ln-switch { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.ln-toggle b { display: block; font-size: .88rem; color: var(--ink); }
.ln-toggle small { font-size: .78rem; color: var(--ink-3); }
.ln-order { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0; font-size: .78rem; color: var(--ink-3); }
.ln-savebar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem;
    padding: .85rem 1.3rem; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px); border-top: 1px solid var(--rule);
    border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: .84rem; color: var(--ink-3); }

/* Employee page */
.ln-person { display: flex; flex-wrap: wrap; gap: 1rem 1.3rem; align-items: center; padding: 1.2rem 1.4rem; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.ln-person-id h2 { font-size: 1.35rem; }
.ln-person-sum { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-left: auto; }
.ln-person-sum > div { display: grid; gap: .1rem; text-align: right; }
.ln-person-sum span { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ln-person-sum b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.ln-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1rem; }
.ln-lcard { display: grid; gap: .8rem; padding: 1.05rem 1.15rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg);
    box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; min-width: 0; }
.ln-lcard:hover { border-color: var(--brand-2); box-shadow: var(--shadow-2); }
.ln-lcard:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.ln-lcard-h { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.ln-lcard-h b { font-size: .95rem; }
.ln-lcard-h .ln-ref { display: block; margin-top: .1rem; }
.ln-lcard-v { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .3rem; }
.ln-lcard-v b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.ln-lcard-v span { font-size: .78rem; color: var(--ink-3); }
.ln-lcard-f { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; padding-top: .65rem; border-top: 1px solid var(--rule); font-size: .78rem; color: var(--ink-3); }
.ln-lcard-f .ln-warn { margin: 0; }

/* New loan */
.ln-steps { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; list-style: none; margin: 0; padding: 0; font-size: .85rem; font-weight: 650; color: var(--ink-3); }
.ln-steps li { display: inline-flex; gap: .5rem; align-items: center; }
.ln-steps span { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--rule-strong);
    font-size: .78rem; background: var(--surface); }
.ln-steps .is-on { color: var(--brand); }
.ln-steps .is-on span { background: var(--brand); border-color: var(--brand); color: #fff; }
.ln-steps .is-done span { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.ln-mini { list-style: none; margin: 0; padding: .3rem 0; }
.ln-mini li { display: flex; justify-content: space-between; gap: .6rem; padding: .55rem 1.2rem; font-size: .86rem; border-bottom: 1px solid var(--rule); }
.ln-mini li:last-child { border-bottom: 0; }
.ln-mini .ln-ref { display: block; }
.ln-mini b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Narrow screens */
@media (max-width: 1100px) {
    .ln-md, .ln-cols { grid-template-columns: minmax(0, 1fr); }
    .ln-list { position: static; }
    .ln-list-body { max-height: 22rem; }
    .ln-hero { grid-template-columns: minmax(0, 1fr); }
    .ln-hero-stats > div:first-child, .ln-hero-stats > div:nth-child(4) { border-left: 0; }
}
@media (max-width: 760px) {
    .ln-sec { grid-template-columns: minmax(0, 1fr); gap: .7rem; }
    .ln-fields, .ln-usage { grid-template-columns: minmax(0, 1fr); }
    .ln-usage > div { border-right: 0; border-bottom: 1px solid var(--rule); }
    .ln-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ln-hero-stats > div { border-left: 0; border-bottom: 1px solid var(--rule) !important; }
    .ln-person-sum { margin-left: 0; }
    .ln-person-sum > div { text-align: left; }
    .ln-big { font-size: 1.9rem; }
}
@media (max-width: 640px) {
    .ln-table.is-cards thead { display: none; }
    .ln-table.is-cards, .ln-table.is-cards tbody, .ln-table.is-cards tfoot { display: block; }
    .ln-table.is-cards tr { display: grid; gap: .3rem; padding: .85rem 1rem; border-bottom: 1px solid var(--rule); }
    .ln-table.is-cards td, .ln-table.is-cards th { display: flex; justify-content: space-between; gap: 1rem; padding: 0; border: 0; text-align: right; background: none; }
    .ln-table.is-cards td:first-child { text-align: left; }
    .ln-table.is-cards td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: .76rem; font-weight: 600; text-align: left; }
    .ln-table.is-cards td.act { width: auto; justify-content: flex-end; }
    .ln-table.is-cards td:empty { display: none; }
    .ln-table.is-cards td { flex-wrap: wrap; }
    .ln-table.is-cards td > small { flex-basis: 100%; }
    .ln-table.is-cards tr.is-same .ln-who-cell { display: none; }
    .ln-table.is-cards .ln-prog { min-width: 10rem; }
    .ln-reverse { flex-wrap: wrap; justify-content: flex-start; }
}
.ln-table td.ln-wide { min-width: 13rem; }
.ln-person-sum small { font-size: .74rem; color: var(--ink-3); }
.ln-table .ln-ref, .ln-lcard .ln-ref { white-space: nowrap; }
.ln-table td[data-label="Loan"] { min-width: 10.5rem; }
.ln-table th, .ln-table td { padding-left: .75rem; padding-right: .75rem; }
.ln-table th:first-child, .ln-table td:first-child { padding-left: 1rem; }
.ln-table .ln-prog { min-width: 7rem; }
.ln-who small { display: block; font-size: .76rem; color: var(--ink-3); margin-top: .1rem; }

/* ─────────────────────────────────────────────────────────────────────
   Leave administration (31 Oct 2026): Leave types & policy (lvt-) and the
   2026 upload review (lvr-). Built on the Loans master-detail parts (ln-)
   and the rx- system, so both pages read like the rest of the HR screens.
   ───────────────────────────────────────────────────────────────────── */
.lvt, .lvr { --lv-vl: #0e7490; --lv-sl: #b45309; }
a.ln-kpi.lvt-kpi-link { color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
a.ln-kpi.lvt-kpi-link:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); }
a.ln-kpi.lvt-kpi-link:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.ln-kpi.is-ok .ln-kpi-n { color: var(--ok); }
.ln-kpi .ln-prog { margin-top: .35rem; }

/* The type list: a colour dot per type, as on the leave register. */
.lvt-item b { display: flex; align-items: center; gap: .5rem; }
.lvt-item .lv-dot { width: .55rem; height: .55rem; }
.lvt-item.is-on { border-left-color: var(--tone, var(--brand-2)); }
.ln-editor-head h2 .lv-chip { font-size: .72rem; letter-spacing: .03em; }

/* The rule in plain words, under the editor's title. */
.lvt-rule { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1.3rem; border-bottom: 1px solid var(--rule);
    background: var(--rx-brand-soft); color: var(--ink); font-size: .88rem; line-height: 1.5; }
.lvt-rule .rx-ico { color: var(--brand-2); margin-top: .15rem; }
.lvt-rule p { margin: 0; }
.lvt-rule b { color: var(--brand); }
.ln-usage b small { font-size: .7em; font-weight: 600; color: var(--ink-3); }

.lvt-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.lvt-fs:disabled .ln-seg span, .lvt-fs:disabled .ln-toggle { cursor: default; }
.lvt-fs:disabled input, .lvt-fs:disabled select { background: var(--surface-2); color: var(--ink-2); }
.ln-seg-field > small { display: block; margin-top: .4rem; }

.lvt-bands .rx-table td { padding: .45rem .6rem; }
.lvt-bands .rx-table th { padding: .55rem .6rem; }
.lvt-bands input { width: 100%; min-width: 5rem; margin: 0; }
.lvt-guides { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .86rem; color: var(--ink-2); }
.lvt-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .4rem; font-size: .86rem; color: var(--ink-2); }
.lvt-steps a { font-weight: 650; }
#operations { scroll-margin-top: 1rem; }
#operations .rx-panel-foot button { margin: 0; }
.lv-unsaved { color: var(--warn); font-weight: 700; }

/* ── Upload review ─────────────────────────────────────────────────── */
.lvr .ln-kpi.lvr-kpi-vl::before { background: var(--lv-vl); }
.lvr .ln-kpi.lvr-kpi-sl::before { background: var(--lv-sl); }
.lvr .ln-bar .rx-seg { flex: none; }
.lvr .ln-bar .rx-seg .rx-ico { width: 1rem; height: 1rem; }
.lvr .ln-bar .rx-chips { flex: none; }
.lvr .ln-bar .btn-quiet { margin: 0; }
.lvr-list-head { display: flex; justify-content: space-between; gap: .6rem; font-size: .78rem; font-weight: 700; color: var(--ink-3);
    letter-spacing: .04em; text-transform: uppercase; }
.lvr-item .ln-code { font-family: inherit; font-size: .76rem; font-weight: 500; }
.lvr-state { display: inline-grid; place-items: center; min-width: 2.6rem; height: 1.5rem; padding: 0 .45rem; border-radius: 999px;
    background: var(--warn-bg); color: var(--warn); font-size: .74rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.lvr-state.is-done { background: var(--ok-bg); color: var(--ok); }
.lvr-state.is-none { background: var(--surface-3); color: var(--ink-3); }
.lvr-state svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.lvr-split { display: grid; gap: .55rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--rule); }
.lvr-split-bar { display: flex; height: .7rem; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.lvr-split-bar span { display: block; height: 100%; }
.lvr-vl-fill { background: var(--lv-vl); }
.lvr-sl-fill { background: var(--lv-sl); }
.lvr-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .84rem; color: var(--ink-2); }
.lvr-legend li { display: inline-flex; align-items: center; gap: .45rem; }
.lvr-legend i { width: .7rem; height: .7rem; border-radius: 3px; background: var(--surface-3); border: 1px solid var(--rule-strong); }
.lvr-legend .lvr-vl-dot { background: var(--lv-vl); border-color: var(--lv-vl); }
.lvr-legend .lvr-sl-dot { background: var(--lv-sl); border-color: var(--lv-sl); }
.lvr-legend b { font-variant-numeric: tabular-nums; color: var(--ink); }

.lvr-lines td { vertical-align: middle; }
.lvr-lines td b { font-weight: 700; }
.lvr-lines .lvr-in { width: 5.2rem; margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.lvr-lines .lvr-note { width: 100%; min-width: 9rem; margin: 0; }
.lvr-lines tr.is-ok td { background: color-mix(in srgb, var(--ok-bg) 45%, transparent); }
.lvr-lines tr.is-bad td { background: color-mix(in srgb, var(--fail-bg) 55%, transparent); }
.lvr-lines tr.is-bad .lvr-in { border-color: var(--fail); }
.lvr-status { display: grid; gap: .15rem; justify-items: start; }
.lvr-status small { margin: 0; }
.lvr-quick, .lvr-quick-all { display: inline-flex; flex-wrap: nowrap; gap: .3rem; align-items: center; }
.lvr-quick-all { font-size: .7rem; letter-spacing: .07em; }
.lvr-q { margin: 0; padding: .3rem .55rem; min-height: 0; border-radius: .45rem; border: 1px solid var(--rule-strong); background: var(--surface);
    color: var(--ink-2); font-size: .74rem; font-weight: 700; line-height: 1.2; cursor: pointer; box-shadow: none; white-space: nowrap; }
.lvr-q:hover { border-color: var(--brand-2); color: var(--brand); background: var(--rx-brand-soft); }
.lvr-q:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 1px; }
.lvr-q[data-lv-fill="vl"], .lvr-q[data-lv-fill-all="vl"] { border-color: color-mix(in srgb, var(--lv-vl) 45%, var(--rule)); color: var(--lv-vl); }
.lvr-q[data-lv-fill="sl"], .lvr-q[data-lv-fill-all="sl"] { border-color: color-mix(in srgb, var(--lv-sl) 45%, var(--rule)); color: var(--lv-sl); }
.lvr-q.is-clear { color: var(--ink-3); }
.lvr-table .lvr-vl { color: var(--lv-vl); font-weight: 700; }
.lvr-table .lvr-sl { color: var(--lv-sl); font-weight: 700; }
.lvr .ln-total th { text-align: left; }
#encode, #close { scroll-margin-top: 1rem; }
.lvr .rx-checks li.is-fail { background: var(--warn-bg); }
.lvr .rx-checks li.is-fail .rx-mark { background: var(--warn); }
@media (max-width: 640px) {
    .lvr-lines.is-cards td { align-items: center; }
    .lvr-lines .lvr-note { min-width: 0; flex: 1 1 10rem; }
    .lvr .ln-bar .rx-seg, .lvr .ln-bar .rx-chips { flex: 1 1 100%; }
}
/* Leave administration: fit and finish. */
.lvt .ln-fields > .ln-toggle { grid-column: 1 / -1; }
.lvt .ln-savebar, .lvr .ln-savebar { background: color-mix(in srgb, var(--surface) 98%, transparent); box-shadow: 0 -6px 16px rgba(16, 26, 41, .06); }
@media (min-width: 1101px) { .lvr .ln-md { grid-template-columns: minmax(15rem, 17rem) minmax(0, 1fr); } }
.lvr-cut { min-width: 9.5rem; }
.lvr-cut small { display: block; margin: .15rem 0 .35rem; }
.lvr-cut small strong { color: var(--ink); font-weight: 700; }
.lvr-lines th, .lvr-lines td { padding-left: .6rem; padding-right: .6rem; }
.lvr-lines .lvr-in { width: 4.6rem; }
.lvr-lines .lvr-note { min-width: 7rem; }
@media (max-width: 640px) {
    .lvr-lines.is-cards td.lvr-cut { display: block; text-align: left; padding-bottom: .3rem; }
    .lvr-lines.is-cards td.lvr-cut::before { display: none; }
    .lvr-lines.is-cards td.lvr-cut b { font-size: .95rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Apply for leave (la-) and Reports (rp-), 31 Oct 2026.
   ═══════════════════════════════════════════════════════════════════════ */
/* ── Apply for leave (la-) ───────────────────────────────────────────── */
.la-steps { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; list-style: none; margin: 0; padding: .9rem 1.2rem; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); font-size: .86rem; font-weight: 650; color: var(--ink-3); }
.la-steps li { display: inline-flex; align-items: center; gap: .55rem; }
.la-steps span { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--surface); font-size: .78rem; }
.la-steps .is-on { color: var(--brand); }
.la-steps .is-on span { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--rx-brand-soft); }
.la-steps .is-done { color: var(--ok); }
.la-steps .is-done span { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.la-steps li + li::before { content: ""; width: 2.2rem; height: 2px; background: var(--rule); margin-right: .4rem; }

.la-finder { display: grid; gap: 1rem; padding: 1.6rem; background: linear-gradient(180deg, var(--rx-brand-soft), var(--surface) 75%);
    border: 1px solid color-mix(in srgb, var(--brand-2) 25%, var(--rule)); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.la-finder h2 { font-size: 1.15rem; margin: 0; }
.la-finder p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.la-search { position: relative; }
.la-search input { width: 100%; margin: 0; padding: .95rem 1rem .95rem 3rem; font-size: 1.02rem; border-radius: .8rem; border: 1.5px solid var(--brand-2);
    box-shadow: 0 0 0 4px var(--rx-brand-soft); background: var(--surface); }
.la-search > svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--brand-2); stroke-width: 2; stroke-linecap: round; }
.la-search kbd { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); font-size: .72rem; color: var(--ink-3); border: 1px solid var(--rule-strong); border-radius: .35rem; padding: .1rem .4rem; background: var(--surface-2); }
.la-spin { position: absolute; right: 3.6rem; top: 50%; width: 1rem; height: 1rem; margin-top: -.5rem; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--brand-2); }
.la-results { list-style: none; margin: 0; padding: .4rem; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: .8rem;
    box-shadow: 0 16px 40px rgba(16, 26, 41, .16); display: grid; gap: .15rem; }
.la-results-head { display: flex; justify-content: space-between; padding: .45rem .7rem .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.la-hit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .9rem; align-items: center; padding: .7rem .75rem; border-radius: .6rem; color: var(--ink); text-decoration: none; }
.la-hit:hover, .la-hit.is-on { background: var(--rx-brand-soft); }
.la-hit.is-on { box-shadow: inset 3px 0 0 var(--brand-2); }
.la-hit .ln-av { grid-row: span 2; }
.la-hit b { font-size: .95rem; }
.la-hit mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.la-hit-meta { grid-column: 2; font-size: .78rem; color: var(--ink-3); }
.la-hit-bal { grid-row: 1 / span 2; grid-column: 3; display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; max-width: 22rem; }
.la-mini { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule);
    font-size: .74rem; font-weight: 650; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.la-mini .lv-dot { width: .5rem; height: .5rem; }
.la-mini.is-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.la-mini.is-off { background: var(--fail-bg); border-color: transparent; color: var(--fail); }
.la-results-foot { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .7rem .3rem; border-top: 1px solid var(--rule); margin-top: .2rem; font-size: .76rem; color: var(--ink-3); }
.la-recent { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .82rem; color: var(--ink-3); }

.la-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem 1.3rem; align-items: center; padding: 1.2rem 1.4rem; background: var(--surface);
    border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.la-person h2 { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; font-size: 1.35rem; margin: 0; }
.la-facts { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: .4rem 0 0; padding: 0; list-style: none; font-size: .84rem; color: var(--ink-2); }
.la-facts b { color: var(--ink); font-weight: 650; }
.la-route { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-top: .9rem; border-top: 1px solid var(--rule); font-size: .82rem; color: var(--ink-3); }
.la-route .la-node { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem .3rem .35rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule); color: var(--ink); font-weight: 650; }
.la-route .la-node .ln-av { width: 1.6rem; height: 1.6rem; font-size: .62rem; }
.la-route .la-arrow { color: var(--ink-3); }

.la-bals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .9rem; }
.la-bal { position: relative; display: grid; gap: .5rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.la-bal::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: var(--r-lg) 0 0 var(--r-lg); background: var(--tone, var(--brand-2)); }
.la-bal-h { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.la-bal-h b { font-size: .9rem; }
.la-bal-h span { font-size: .72rem; color: var(--ink-3); font-weight: 650; }
.la-bal-v { font-size: 1.75rem; font-weight: 760; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.la-bal-v small { font-size: .45em; font-weight: 600; color: var(--ink-3); margin-left: .2rem; }
.la-stack { display: flex; height: .5rem; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.la-stack i { display: block; height: 100%; }
.la-stack .u { background: color-mix(in srgb, var(--tone, var(--brand-2)) 45%, var(--surface-3)); }
.la-stack .p { background: repeating-linear-gradient(45deg, var(--gold), var(--gold) 3px, color-mix(in srgb, var(--gold) 55%, #fff) 3px, color-mix(in srgb, var(--gold) 55%, #fff) 6px); }
.la-stack .a { background: var(--tone, var(--brand-2)); }
.la-bal-f { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .76rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.la-bal-f b { color: var(--ink-2); }
.la-bal.is-event .la-bal-v { font-size: 1.05rem; color: var(--ink-2); }

.la-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 24rem); gap: 1.25rem; align-items: start; }
.la-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: .7rem; }
.la-type { position: relative; display: grid; gap: .25rem; padding: .85rem .95rem; border: 1.5px solid var(--rule); border-radius: .8rem; background: var(--surface); cursor: pointer; }
.la-type:hover { border-color: var(--rule-strong); }
.la-type.is-on { border-color: var(--tone, var(--brand-2)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--brand-2)) 18%, transparent); background: color-mix(in srgb, var(--tone, var(--brand-2)) 5%, var(--surface)); }
.la-type.is-off { opacity: .55; cursor: not-allowed; }
.la-type b { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.la-type small { font-size: .76rem; color: var(--ink-3); }
.la-type .la-type-v { font-size: .82rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.la-type .la-check { position: absolute; top: .7rem; right: .7rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 1.5px solid var(--rule-strong); }
.la-type.is-on .la-check { border-color: var(--tone, var(--brand-2)); background: var(--tone, var(--brand-2)); box-shadow: inset 0 0 0 3px #fff; }
.la-quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.la-quick .rx-chip { font-size: .78rem; padding: .3rem .7rem; }

.la-sum { position: sticky; top: 1rem; display: grid; gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden; }
.la-sum-h { padding: 1rem 1.2rem; background: var(--brand); color: #fff; }
.la-sum-h span { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.la-sum-h b { display: block; margin-top: .2rem; font-size: 2rem; font-weight: 760; letter-spacing: -.02em; line-height: 1.1; }
.la-sum-h small { font-size: .85rem; opacity: .85; }
.la-sum-sec { padding: .95rem 1.2rem; border-bottom: 1px solid var(--rule); display: grid; gap: .6rem; }
.la-sum-sec h3 { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.la-flow { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: center; text-align: center; }
.la-flow div { padding: .55rem; border-radius: .6rem; background: var(--surface-2); }
.la-flow span { display: block; font-size: .7rem; color: var(--ink-3); font-weight: 650; }
.la-flow b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.la-flow .is-after { background: var(--ok-bg); color: var(--ok); }
.la-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: .2rem; font-size: .72rem; text-align: center; }
.la-cal .dow { color: var(--ink-3); font-weight: 700; padding-bottom: .15rem; }
.la-cal i { font-style: normal; display: grid; place-items: center; height: 1.8rem; border-radius: .4rem; color: var(--ink-3); }
.la-cal i.on { background: var(--brand-2); color: #fff; font-weight: 700; }
.la-cal i.rest { background: var(--surface-3); color: var(--ink-3); text-decoration: line-through; }
.la-cal i.hol { background: var(--rx-gold-soft); color: #8a5a00; font-weight: 700; }
.la-cal i.out { opacity: .35; }
.la-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .72rem; color: var(--ink-3); }
.la-legend i { display: inline-block; width: .65rem; height: .65rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.la-sum-foot { padding: 1rem 1.2rem; display: grid; gap: .6rem; background: var(--surface-2); }
.la-sum-foot button { width: 100%; justify-content: center; }

.la-hist { display: grid; grid-template-columns: repeat(12, 1fr); gap: .35rem; align-items: end; height: 6.5rem; padding: 0 .2rem; }
.la-hist div { display: grid; gap: .2rem; justify-items: center; align-content: end; height: 100%; font-size: .66rem; color: var(--ink-3); }
.la-hist em { display: block; width: 100%; max-width: 1.6rem; border-radius: .3rem .3rem 0 0; background: var(--lv-vl, #0e7490); font-style: normal; }
.la-hist em.sl { background: #b45309; }
.la-hist em.sil { background: #15803d; }
.la-hist .bar { display: grid; width: 100%; justify-items: center; align-content: end; height: 100%; gap: 1px; }

/* ── Reports (rp-) ───────────────────────────────────────────────────── */
.rp-hero { display: grid; gap: 1rem; padding: 1.4rem 1.5rem; border-radius: var(--r-lg); background: linear-gradient(120deg, var(--brand), color-mix(in srgb, var(--brand-2) 85%, #000));
    color: #fff; box-shadow: var(--shadow-2); }
.rp-hero h1 { margin: 0; font-size: 1.6rem; color: #fff; }
.rp-hero p { margin: 0; opacity: .85; font-size: .92rem; }
.rp-hero .la-search input { border-color: transparent; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.rp-hero-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.8rem; font-size: .82rem; opacity: .9; }
.rp-hero-stats b { font-size: 1.05rem; margin-right: .25rem; }
.rp-layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.rp-nav { position: sticky; top: 1rem; display: grid; gap: .15rem; padding: .6rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.rp-nav-h { padding: .45rem .6rem .35rem; font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.rp-nav a { display: grid; grid-template-columns: 1.9rem minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .5rem .6rem; border-radius: .55rem;
    color: var(--ink-2); text-decoration: none; font-size: .87rem; font-weight: 600; }
.rp-nav a:hover { background: var(--surface-2); color: var(--ink); }
.rp-nav a.is-on { background: var(--rx-brand-soft); color: var(--brand); }
.rp-ico { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: .5rem; background: var(--tone-bg, var(--surface-2)); color: var(--tone, var(--brand-2)); }
.rp-ico svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rp-sec { display: grid; gap: .8rem; scroll-margin-top: 1rem; }
.rp-sec-h { display: flex; align-items: center; gap: .7rem; }
.rp-sec-h h2 { margin: 0; font-size: 1.08rem; }
.rp-sec-h p { margin: 0 0 0 auto; font-size: .8rem; color: var(--ink-3); }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .9rem; }
.rp-card { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: .55rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--rule);
    border-radius: var(--r-lg); box-shadow: var(--shadow-1); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rp-card:hover { border-color: var(--tone, var(--brand-2)); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.rp-card-h { display: flex; gap: .7rem; align-items: flex-start; }
.rp-card-h b { font-size: .95rem; line-height: 1.3; }
.rp-card p { margin: 0; font-size: .82rem; color: var(--ink-2); line-height: 1.45; }
.rp-card-f { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding-top: .55rem; border-top: 1px dashed var(--rule); font-size: .72rem; color: var(--ink-3); }
.rp-tag { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule); font-size: .7rem; font-weight: 650; color: var(--ink-2); }
.rp-tag.is-pay { background: var(--rx-gold-soft); border-color: transparent; color: #8a5a00; }
.rp-tag.is-conf { background: var(--fail-bg); border-color: transparent; color: var(--fail); }
.rp-tag.is-group { background: var(--rx-violet-soft); border-color: transparent; color: var(--rx-violet); }
.rp-star { position: absolute; top: .8rem; right: .8rem; color: var(--ink-3); }
.rp-star.is-on { color: var(--gold); }
.rp-star svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.9; }
.rp-star.is-on svg { fill: currentColor; }
.rp-pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .7rem; }
.rp-pin { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; background: var(--surface); border: 1px solid var(--rule); border-radius: .8rem; color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1); }
.rp-pin:hover { border-color: var(--brand-2); }
.rp-pin b { display: block; font-size: .86rem; }
.rp-pin small { display: block; font-size: .72rem; color: var(--ink-3); }

.rp-crumb { display: flex; gap: .45rem; align-items: center; font-size: .82rem; color: var(--ink-3); }
.rp-crumb a { color: var(--brand-2); font-weight: 650; text-decoration: none; }
.rp-filters { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.rp-filters-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 1rem; padding: 1.1rem 1.2rem; }
.rp-filters-body .field { margin: 0; }
.rp-filters-body .is-wide { grid-column: span 2; }
.rp-filters-foot { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; padding: .8rem 1.2rem; border-top: 1px solid var(--rule); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.rp-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: .4rem; align-items: center; }
.rp-range span { color: var(--ink-3); font-size: .8rem; }
.rp-applied { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .8rem; color: var(--ink-3); }
.rp-applied .rp-tag { background: var(--rx-brand-soft); color: var(--brand); border-color: transparent; }
.rp-sumrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .8rem; }
.rp-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--rule); }
.rp-tools input[type=search] { flex: 1 1 14rem; margin: 0; width: auto; }
.rp-tools .rx-spacer { flex: 1 1 auto; }
.rp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.rp-table th { position: sticky; top: 0; z-index: 1; text-align: left; padding: .6rem .8rem; background: var(--surface-2); border-bottom: 1px solid var(--rule-strong);
    font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.rp-table th a { color: inherit; text-decoration: none; display: inline-flex; gap: .25rem; align-items: center; }
.rp-table th.is-sorted { color: var(--brand-2); }
.rp-table td { padding: .6rem .8rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.rp-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.rp-table tbody tr:hover td { background: var(--rx-brand-soft); }
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-table tfoot td, .rp-table tfoot th { position: sticky; bottom: 0; background: var(--surface); border-top: 2px solid var(--rule-strong); font-weight: 750; padding: .7rem .8rem; }
.rp-scroll { max-height: 34rem; overflow: auto; }
.rp-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .7rem 1rem; border-top: 1px solid var(--rule); font-size: .82rem; color: var(--ink-3); }

.tone-people { --tone: #2c5aa8; --tone-bg: color-mix(in srgb, #2c5aa8 12%, var(--surface)); }
.tone-ops { --tone: #0e7490; --tone-bg: color-mix(in srgb, #0e7490 12%, var(--surface)); }
.tone-att { --tone: #6d4fc2; --tone-bg: color-mix(in srgb, #6d4fc2 12%, var(--surface)); }
.tone-leave { --tone: #15803d; --tone-bg: color-mix(in srgb, #15803d 12%, var(--surface)); }
.tone-pay { --tone: #b7791f; --tone-bg: color-mix(in srgb, #b7791f 14%, var(--surface)); }
.tone-stat { --tone: #b91c1c; --tone-bg: color-mix(in srgb, #b91c1c 10%, var(--surface)); }
.tone-loan { --tone: #c2410c; --tone-bg: color-mix(in srgb, #c2410c 11%, var(--surface)); }
.tone-coop { --tone: #0f766e; --tone-bg: color-mix(in srgb, #0f766e 12%, var(--surface)); }
.tone-hmo { --tone: #be185d; --tone-bg: color-mix(in srgb, #be185d 10%, var(--surface)); }
.tone-photo { --tone: #1d4ed8; --tone-bg: color-mix(in srgb, #1d4ed8 10%, var(--surface)); }
.tone-client { --tone: #475569; --tone-bg: color-mix(in srgb, #475569 12%, var(--surface)); }
.tone-sep { --tone: #57534e; --tone-bg: color-mix(in srgb, #57534e 12%, var(--surface)); }

@media (max-width: 1100px) { .la-grid, .rp-layout { grid-template-columns: minmax(0, 1fr); } .rp-nav, .la-sum { position: static; } .la-person { grid-template-columns: auto minmax(0,1fr); } }
.ln-fields > .ln-toggle.is-wide { grid-column: 1 / -1; }
.ln-sec.la-full { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
.la-full .la-types { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }

/* ── Apply for leave and Reports: the working version (31 Oct 2026) ──── */
.la, .rp { --rx-gap: 1.25rem; }
.la-steps a { color: inherit; }
.la-search { margin: 0; }
.la-search button { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); margin: 0; }
.la-spin { animation: la-spin .7s linear infinite; }
@keyframes la-spin { to { transform: rotate(360deg); } }
.la-results { max-height: 30rem; overflow-y: auto; }
.la-results-empty { padding: 1rem .9rem; color: var(--ink-3); font-size: .88rem; }
.la-hit { cursor: pointer; }
.la-bal.is-off { opacity: .6; }
.la-bal.is-off::before { background: var(--rule-strong); }
.la-stack .u-fill-0 { display: none; }

/* Leave-type cards are real radios: the card shows the state. */
.la-type input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.la-type:has(input:checked) { border-color: var(--tone, var(--brand-2)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone, var(--brand-2)) 18%, transparent);
    background: color-mix(in srgb, var(--tone, var(--brand-2)) 5%, var(--surface)); }
.la-type:has(input:checked) .la-check { border-color: var(--tone, var(--brand-2)); background: var(--tone, var(--brand-2)); box-shadow: inset 0 0 0 3px #fff; }
.la-type:has(input:focus-visible) { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.la-type.is-off { opacity: .55; cursor: not-allowed; }
.la-type.is-off .la-type-v { color: var(--fail); }
.la-quick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.la-quick .rx-chip { cursor: pointer; font: inherit; font-size: .78rem; font-weight: 650; padding: .3rem .75rem; margin: 0; }
.la-sum.lv-vl .la-sum-h, .la-sum[class*="lv-"] .la-sum-h { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--tone, var(--brand-2)) 70%, var(--brand))); }
.la-flow .is-after.is-neg { background: var(--fail-bg); color: var(--fail); }
.la-cal i.today { box-shadow: inset 0 0 0 2px var(--gold); }
.la-legend .lg-on { background: var(--brand-2); }
.la-legend .lg-rest { background: var(--surface-3); }
.rx-checks .is-warn { background: var(--warn-bg); }
.rx-checks .is-warn .rx-mark { background: var(--warn); color: #fff; }
.rx-checks li > div { min-width: 0; }
.la-mobile-submit { display: none; }
.la-rules > summary { cursor: pointer; list-style: none; }
.la-rules > summary::-webkit-details-marker { display: none; }
.la-rules:not([open]) > summary { border-bottom: 0; }
a.la-mini { text-decoration: none; }
.la .lv-chart { max-width: 100%; }

/* Reports */
.rp-card-h { padding-right: 1.6rem; }
.rp-card-link { color: var(--ink); font-weight: 700; font-size: .95rem; line-height: 1.3; text-decoration: none; }
.rp-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.rp-card-link:focus-visible { outline: none; }
.rp-card:has(.rp-card-link:focus-visible) { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.rp-card[hidden], .rp-sec[hidden] { display: none; }
button.rp-star { position: absolute; z-index: 1; top: .7rem; right: .7rem; display: grid; place-items: center; width: 2rem; height: 2rem; margin: 0; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); cursor: pointer; box-shadow: none; min-height: 0; }
button.rp-star:hover { background: var(--surface-2); color: var(--gold); }
button.rp-star:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 1px; }
button.rp-star.is-inline { position: static; flex: none; }
.rp-star.is-on { color: var(--gold); }
.rp-star.is-on svg { fill: currentColor; }
.rp-cols { white-space: nowrap; }
.rp-card-f.is-flat { border-top: 0; padding-top: .3rem; }
.rp-ico.is-lg { width: 2.8rem; height: 2.8rem; border-radius: .8rem; }
.rp-ico.is-lg svg { width: 1.45rem; height: 1.45rem; }
.rp .rx-head h1 { margin: 0; }
.rp-filters-body select[multiple] { min-height: 0; }
.rp-presets { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.rp-presets button { margin: 0; padding: .28rem .65rem; min-height: 0; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--surface);
    color: var(--ink-2); font-size: .76rem; font-weight: 650; box-shadow: none; cursor: pointer; }
.rp-presets button:hover, .rp-presets button.is-on { border-color: var(--brand-2); color: var(--brand); background: var(--rx-brand-soft); }
.rp-colpick { display: grid; gap: .45rem; max-height: 18rem; overflow-y: auto; }
.rp-count { font-size: .82rem; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.rp-tools .rx-pop > summary { white-space: nowrap; }
.rp-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.rp-sort::after { content: "↕"; opacity: .35; font-size: .85em; }
.rp-table th[aria-sort="ascending"] .rp-sort::after { content: "▲"; opacity: 1; }
.rp-table th[aria-sort="descending"] .rp-sort::after { content: "▼"; opacity: 1; }
.rp-sort:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; border-radius: 3px; }
.rp-table th.num .rp-sort { justify-content: flex-end; }
.rp-table.is-dense td { padding-top: .32rem; padding-bottom: .32rem; font-size: .8rem; }
.rp-table tr.rollup td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--rule-strong); }
.rp-table [hidden] { display: none; }
.rp-none { margin: 0; padding: 1.2rem; text-align: center; color: var(--ink-3); font-size: .88rem; }
.rp-perpage { display: inline-flex; gap: .45rem; align-items: center; margin: 0; font-weight: 500; }
.rp-perpage select { width: auto; margin: 0; }
.rp-sumrow .ln-kpi.is-cyan::before { background: #0e7490; }
.rp-results { overflow: hidden; }

@media (max-width: 1100px) {
    .la-mobile-submit { display: flex; }
    .la-sum-foot button { display: none; }
}
@media (max-width: 760px) {
    .la-person { grid-template-columns: minmax(0, 1fr); }
    .la-hit { grid-template-columns: auto minmax(0, 1fr); }
    .la-hit-bal { grid-row: auto; grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
    .rp-filters-body .is-wide { grid-column: auto; }
    .rp-layout .rp-nav { display: flex; overflow-x: auto; padding: .4rem; }
    .rp-nav-h { display: none; }
    .rp-nav a { grid-template-columns: auto auto auto; white-space: nowrap; }
    .rp-hero { padding: 1.1rem; }
    .rp-hero h1 { font-size: 1.35rem; }
}
@media print {
    .rp-noprint, .sidebar, .topbar, .rp-tools, .rp-pager { display: none !important; }
    .rp-scroll { max-height: none; overflow: visible; }
    .rp-table th { position: static; }
    .rp-table tfoot td, .rp-table tfoot th { position: static; }
    .rp-sumrow .ln-kpi { box-shadow: none; }
}
@media (max-width: 760px) {
    .la-steps { flex-direction: column; gap: .5rem; }
    .la-steps li + li::before { display: none; }
    .la-search kbd, .la-spin { display: none; }
    .la-search input { padding-right: 1rem; }
    .la-finder { padding: 1.1rem; }
}

/* ── Printed reports: the company letterhead on paper (31 Oct 2026) ──── */
.rp-print-head { display: none; }
@media print {
    body, .app-main, main { background: #fff !important; }
    .rp-print-head { display: block; margin-bottom: 8pt; }
    .rp-lh { padding-bottom: 6pt; margin-bottom: 8pt; border-bottom: 2.2pt double #1b2430; }
    .rp-lh-co { font-size: 15pt; font-weight: 800; color: #10233f; letter-spacing: .3pt; }
    .rp-lh-meta { font-size: 8pt; color: #444; line-height: 1.4; }
    .rp-print-info { width: 100%; border-collapse: collapse; border: .5pt solid #c9d1dc; background: #f4f6f9; font-size: 8pt; margin-bottom: 6pt; }
    .rp-print-info td { padding: 3pt 6pt; vertical-align: top; }
    .rp-print-info b { display: block; font-size: 6.5pt; letter-spacing: .4pt; text-transform: uppercase; color: #6a7585; }
    .rp .rx-head { margin: 4pt 0 6pt; }
    .rp .rx-head h1 { font-size: 15pt; }
    .rp .rp-ico.is-lg, .rp .rp-card-f.is-flat .rp-cols, .rp .notice:not(.warn):not(.fail) { display: none; }
    .rp .rx-lede { font-size: 8.5pt; }
    .rp-sumrow { gap: 6pt; }
    .rp-sumrow .ln-kpi { padding: 5pt 8pt; border: .5pt solid #c9d1dc; }
    .rp-sumrow .ln-kpi-v { font-size: 12pt; }
    .rp-results { border: 0; box-shadow: none; }
    .rp-table { font-size: 7.5pt; }
    .rp-table th { background: #10233f !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; padding: 3pt 4pt; }
    .rp-table td { padding: 2.5pt 4pt; white-space: normal; }
    .rp-table thead { display: table-header-group; }
    .rp-table tfoot { display: table-row-group; }
    .rp-table tfoot th, .rp-table tfoot td { background: #e2e8f0 !important; color: #000 !important; border-top: 1pt solid #10233f; }
    .rp-table tr { break-inside: avoid; }
    .rp-table .rp-sort::after { content: none; }
    .rp.is-wide-print .rp-table { font-size: 6.6pt; }
}
@media print {
    body:has(.rp[data-rp-report]) { background: #fff !important; color: #000; }
    body:has(.rp[data-rp-report]) .sidebar, body:has(.rp[data-rp-report]) .topbar, body:has(.rp[data-rp-report]) .office-banner,
    body:has(.rp[data-rp-report]) .nav-scrim, body:has(.rp[data-rp-report]) .nav-toggle, body:has(.rp[data-rp-report]) .view-as-bar,
    body:has(.rp[data-rp-report]) .help-fab, body:has(.rp[data-rp-report]) .help-panel,
    body:has(.rp[data-rp-report]) .flash, body:has(.rp[data-rp-report]) .flashes { display: none !important; }
    body:has(.rp[data-rp-report]) .app-shell { display: block; min-height: 0; }
    body:has(.rp[data-rp-report]) .app-main { margin: 0 !important; padding: 0 !important; }
    body:has(.rp[data-rp-report]) main { padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; }
    .rp[data-rp-report] { gap: 3mm; }
    .rp-print-head ~ .rx-head .rx-lede { margin-top: 1mm !important; }
    .rp-sumrow { grid-template-columns: repeat(5, 1fr); }
    .rp-sumrow .ln-kpi { break-inside: avoid; }
    .rp-lh { break-after: avoid; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Documents (dc-), 31 Oct 2026: the register, document types, requests,
   the template library and the visual wording editor.
   ═══════════════════════════════════════════════════════════════════════ */
.dc { --rx-gap: 1.25rem; }
.dc .ln-bar .rx-chips { flex: 0 1 auto; min-width: 0; }
.dc .ln-bar .btn-quiet { margin: 0; }
.dc-clear { font-size: .82rem; font-weight: 650; }
.dc-icon-btn { padding-left: .55rem; padding-right: .55rem; }
.dc-table .ln-who .rp-ico, .dc-table .ln-who .ln-av { flex: none; }
.dc-table .ln-ref { font-size: .72rem; }
.dc-dl { grid-template-columns: auto minmax(0, 1fr); font-size: .82rem; }
.dc-doc { min-width: 15rem; max-width: 28rem; white-space: normal; }
.dc-doc small { line-height: 1.4; }
.dc-doc .rp-tag { margin-left: .3rem; }
.dc-linkbtn { all: unset; cursor: pointer; color: var(--brand-2); font-weight: 650; text-decoration: underline; margin-left: .3rem; }
.dc-linkbtn:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.dc .rx-panel[class*="tone-"] .rx-panel-head h2 .rp-ico { width: 1.7rem; height: 1.7rem; }
.dc-rfind { width: auto; flex: 0 1 15rem; margin: 0; }
.ln-prog-b span.is-late { background: var(--fail); }
.ln-prog-b span.is-soon { background: var(--warn); }
.dc-requests .pill { margin-top: .35rem; }
.dc-requests .rx-actions form { margin: 0; }
.dc-requests .rx-pop-body form { display: grid; gap: .55rem; }
.dc-emp { margin: 0; }
.dc-emp input { padding: .62rem .8rem .62rem 2.6rem; font-size: .92rem; border-width: 1px; box-shadow: none; }
.dc-emp > svg { left: .8rem; width: 1.05rem; height: 1.05rem; }
.dc-emp-list { margin-top: .35rem; max-height: 18rem; }
.dc-emp-list .la-hit { grid-template-columns: auto minmax(0, 1fr); }

/* Library */
.dc-libtitle { display: block; font-size: .95rem; line-height: 1.3; }
.dc-libuse { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; justify-content: space-between; padding-top: .55rem; border-top: 1px dashed var(--rule); }
.dc-libuse .ln-note { flex: 1 1 12rem; }
.dc-libuse .btn, .dc-libuse .btn-quiet { margin: 0; }
.dc-read > summary { cursor: pointer; font-size: .82rem; font-weight: 650; color: var(--brand-2); position: relative; z-index: 1; }
.dc-read[open] > summary { margin-bottom: .6rem; }
.dc-paper { background: #fff; color: #1b2430; padding: 1.2rem 1.4rem; border: 1px solid var(--rule); border-radius: .4rem;
    box-shadow: 0 6px 18px rgba(16, 26, 41, .07); font-family: Georgia, serif; font-size: .84rem; line-height: 1.6; max-height: 28rem; overflow: auto; }
.dc-paper p { margin: 0 0 .7rem; }
.dc-paper table { border-collapse: collapse; width: 100%; }
.dc-paper td, .dc-paper th { border: 1px solid #c9d1dc; padding: .25rem .4rem; }

/* The wording editor */
.dc-editor { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.dc-title { display: grid; gap: .3rem; padding: .9rem 1.2rem 0; }
.dc-title label { font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.dc-title input { margin: 0; }
.dc-mode a { padding: .38rem .8rem; }
.dc-toolbar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .9rem;
    padding: .5rem 1.2rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--surface-2); }
.dc-tool { margin: 0; min-width: 2.1rem; height: 2.1rem; min-height: 0; padding: 0 .55rem; border: 1px solid var(--rule-strong); border-radius: .45rem;
    background: var(--surface); color: var(--ink-2); font-size: .8rem; font-weight: 700; box-shadow: none; cursor: pointer; line-height: 1; }
.dc-tool:hover { border-color: var(--brand-2); color: var(--brand); }
.dc-tool.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.dc-tool:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 1px; }
.dc-tool-bold { font-weight: 900; }
.dc-tool-italic { font-style: italic; font-family: Georgia, serif; }
.dc-tool-underline { text-decoration: underline; }
.dc-sep { width: 1px; height: 1.4rem; background: var(--rule-strong); margin: 0 .2rem; }
.dc-toolbar .ln-note { font-size: .74rem; }
.dc-text { min-height: 24rem; max-height: 62vh; overflow-y: auto; padding: 1.4rem 1.6rem; outline: none; background: #fff; color: #1b2430;
    font-family: Georgia, serif; font-size: 1rem; line-height: 1.7; }
.dc-text:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-2) 35%, transparent); }
.dc-text p { margin: 0 0 .85rem; }
.dc-text h1, .dc-text h2, .dc-text h3, .dc-text h4 { font-family: inherit; margin: 1rem 0 .6rem; line-height: 1.3; }
.dc-text h2 { font-size: 1.2rem; }
.dc-text h3 { font-size: 1.05rem; }
.dc-text ul, .dc-text ol { margin: 0 0 .85rem 1.4rem; padding: 0; }
.dc-text blockquote { margin: 0 0 .85rem 1.4rem; padding-left: .8rem; border-left: 3px solid var(--rule-strong); }
.dc-text table { border-collapse: collapse; width: 100%; margin: 0 0 .85rem; }
.dc-text td, .dc-text th { border: 1px solid #c9d1dc; padding: .3rem .5rem; min-width: 3rem; }
.dc-text hr { border: 0; border-top: 1px solid #8a96a8; margin: 1rem 0; }
.dc-source { display: block; width: 100%; min-height: 24rem; margin: 0; border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding: 1rem 1.2rem; font-size: .82rem; line-height: 1.55; resize: vertical; }
.dc-placeholders { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .7rem 1.2rem; border-top: 1px solid var(--rule); background: var(--surface-2); }
.dc-placeholders .rx-chip { cursor: pointer; font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: .72rem; padding: .25rem .55rem; margin: 0; }
.dc-allph > summary { font-size: .76rem; padding: .3rem .65rem; }
.dc-allph .rx-pop-body { width: min(28rem, 90vw); left: 0; right: auto; max-height: 24rem; overflow-y: auto; }
.dc-phlist { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.dc-phbtn { all: unset; box-sizing: border-box; display: grid; gap: .1rem; width: 100%; padding: .4rem .5rem; border-radius: .45rem; cursor: pointer; }
.dc-phbtn:hover, .dc-phbtn:focus-visible { background: var(--rx-brand-soft); }
.dc-phbtn code { font-size: .76rem; color: var(--brand); }
.dc-phbtn small { font-size: .74rem; color: var(--ink-3); }
.dc-phstatus { flex-basis: 100%; font-size: .76rem; color: var(--ink-3); }
.dc-phstatus.is-bad { color: var(--fail); font-weight: 650; }
.dc-form .ln-sec { border-top: 1px solid var(--rule); border-bottom: 0; }
.dc-preview-panel { overflow: hidden; }
.dc-frame { display: block; width: 100%; height: 40rem; border: 0; background: #fff; }
.dc-pad { padding: .7rem 1.2rem; margin: 0; }
.dc-versions { padding: 1rem 1.2rem; }
.dc-versions .pill { margin-left: .3rem; }
.dc-activate { margin: .35rem 0 0; }
.dc-activate .btn-quiet { margin: 0; padding: .3rem .7rem; font-size: .78rem; }
@media (max-width: 1100px) {
    .dc-editor { grid-template-columns: minmax(0, 1fr); }
    .dc-frame { height: 30rem; }
}
@media (max-width: 640px) {
    .dc-text { padding: 1rem; min-height: 18rem; }
    .dc-toolbar { padding: .45rem .6rem; }
    .dc-toolbar .ln-note { display: none; }
    .dc-form .ln-savebar { position: static; }
    .dc-form .ln-savebar > span { font-size: .8rem; }
}

/* Settings > Company profile: the letterhead preview and its badges (31 Oct 2026). */
.lh-preview { margin: .9rem 0 1rem; padding: 1.1rem 1.3rem; background: #fff; color: #111; border: 1px solid var(--rule); border-radius: .5rem; box-shadow: 0 4px 14px rgba(16, 26, 41, .06); overflow-x: auto; }
.lh-badge-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .8rem; }
.lh-badge-list li { display: grid; justify-items: center; gap: .5rem; padding: .7rem .9rem; border: 1px solid var(--rule); border-radius: .55rem; background: var(--surface); }
.lh-badge-list img { height: 3.4rem; width: auto; }
.lh-badge-actions { display: flex; gap: .35rem; }
.lh-badge-actions form { margin: 0; }
.lh-badge-actions .btn-quiet { margin: 0; padding: .3rem .6rem; font-size: .78rem; }

/* ═══════════════════════════════════════════════════════════════════════
   Recruitment > applicant > Job offer (of-), 31 Oct 2026: the offer's
   progress, its terms, the printed offer letters and the answer.
   ═══════════════════════════════════════════════════════════════════════ */
.of-track { list-style: none; margin: 0; padding: .9rem 1.2rem; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem;
    border-bottom: 1px solid var(--rule); background: var(--surface-2); counter-reset: of; }
.of-track li { counter-increment: of; display: grid; gap: .15rem; padding: .45rem .6rem .45rem 2.1rem; position: relative; border-radius: .55rem; font-size: .8rem; color: var(--ink-3); }
.of-track li::before { content: counter(of); position: absolute; left: .45rem; top: .5rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: grid; place-items: center;
    font-size: .7rem; font-weight: 800; background: var(--surface); border: 1px solid var(--rule-strong); }
.of-track li b { color: var(--ink-2); font-size: .82rem; }
.of-track li small { font-size: .72rem; }
.of-track li.is-done::before { content: "✓"; background: var(--ok, #1f8a4c); border-color: transparent; color: #fff; }
.of-track li.is-here { background: var(--surface); box-shadow: inset 0 0 0 2px var(--brand-2); }
.of-track li.is-here::before { background: var(--brand); color: #fff; border-color: transparent; }
.of-terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.of-terms > div { display: grid; gap: .15rem; padding: .75rem .9rem; border: 1px solid var(--rule); border-radius: .6rem; background: var(--surface); }
.of-terms span { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.of-terms b { font-size: 1.02rem; color: var(--ink); }
.of-terms b em { font-style: normal; font-weight: 600; font-size: .8rem; color: var(--ink-3); }
.of-terms small { font-size: .76rem; color: var(--ink-3); }
.of-more { margin-top: .8rem; font-size: .86rem; }
.of-more summary { cursor: pointer; font-weight: 650; color: var(--brand-2); }
.of-more p { margin: .5rem 0 0; color: var(--ink-2); }
.of-letter { margin: 0 1.2rem 1rem; border: 1px solid color-mix(in srgb, var(--brand-2) 30%, var(--rule)); border-radius: .7rem; background: color-mix(in srgb, var(--brand-2) 5%, var(--surface)); }
.of-letter-h { display: flex; gap: .7rem; align-items: center; padding: .75rem .9rem; border-bottom: 1px solid var(--rule); }
.of-letter-h b { display: block; }
.of-letter-h small { color: var(--ink-3); font-size: .78rem; }
.of-letter-h .btn { margin: 0 0 0 auto; }
.of-docs { list-style: none; margin: 0; padding: 0; }
.of-docs li { display: flex; gap: .8rem; align-items: center; justify-content: space-between; padding: .65rem .9rem; border-top: 1px solid var(--rule); }
.of-docs li:first-child { border-top: 0; }
.of-docs li small { display: block; font-size: .76rem; color: var(--ink-3); margin-top: .15rem; }
.of-docs li.is-old { opacity: .7; }
.of-docs .btn-quiet { margin: 0; padding: .35rem .75rem; font-size: .8rem; }
.of-answer { padding: 1rem 1.2rem 1.2rem; border-top: 1px solid var(--rule); display: grid; gap: .8rem; }
.of-answer h3, .of-h3 { margin: 0; font-size: .95rem; }
.of-h3 { margin: 1rem 0 .55rem; padding-top: .9rem; border-top: 1px dashed var(--rule); }
.of-form .of-h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.of-h3 .hint { font-weight: 500; font-size: .76rem; color: var(--ink-3); margin-left: .4rem; }
.of-answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.of-choice { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--rule-strong); border-radius: .6rem; cursor: pointer; }
.of-choice input { width: auto; margin: .2rem 0 0; }
.of-choice b { display: block; }
.of-choice small { color: var(--ink-3); font-size: .78rem; }
.of-choice.is-on { border-color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); background: color-mix(in srgb, var(--brand-2) 6%, var(--surface)); }
.of-how { margin: 0 0 .6rem 1.1rem; padding: 0; display: grid; gap: .35rem; font-size: .86rem; }
.of-allow { display: grid; gap: .5rem; justify-items: start; }
.of-allow-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 8rem; gap: .5rem; width: 100%; }
.of-allow-row input, .of-allow-row select { margin: 0; }
.of-x { margin: 0; padding: .4rem .7rem; }
.of-summary { margin-top: 1.1rem; padding: .8rem 1rem; border-radius: .6rem; background: color-mix(in srgb, var(--ok, #1f8a4c) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok, #1f8a4c) 30%, var(--rule)); font-size: .88rem; }
.of-form .rx-btn-row { margin-top: 1rem; align-items: center; }
.of-print { margin: 0 0 0 auto; }
.of-print button { margin: 0; }
.of-warn { margin: 0; padding: .65rem .9rem; border-top: 1px solid var(--rule); font-size: .84rem; color: var(--ink-2);
    background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
.of-empty { margin: 0; padding: .65rem .9rem; font-size: .84rem; color: var(--ink-3); }
.of-note { margin: .7rem 0 0; font-size: .86rem; color: var(--ink-2); }
.of-conforme { margin: 0 1.2rem 1rem; }
.of-conforme p { margin: 0; font-size: .86rem; }
.of-revise { border-top: 1px solid var(--rule); }
.of-revise > summary { cursor: pointer; padding: .9rem 1.2rem; font-weight: 650; color: var(--brand-2); }
.of-revise > .rx-meta { margin: 0 1.2rem; }
@media (max-width: 900px) {
    .of-track { grid-template-columns: 1fr 1fr; }
    .of-terms { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .of-track, .of-terms, .of-answer-grid { grid-template-columns: minmax(0, 1fr); }
    .of-allow-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .of-allow-row input:first-of-type { grid-column: 1 / -1; }
    .of-docs li { flex-wrap: wrap; }
    .of-letter-h { flex-wrap: wrap; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Payroll (pr-), 31 Oct 2026: runs, periods, holds, disbursement,
   statutory tables, premium rules, 13th month, annualization, BIR 2316.
   ═══════════════════════════════════════════════════════════════════════ */
.pr-tabs { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; border-bottom: 1px solid var(--rule); }
.pr-tabgroup { display: flex; align-items: flex-end; gap: .15rem; }
.pr-tabgroup-h { align-self: center; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-right: .35rem; }
.pr-tabs .rx-tab { margin-bottom: -1px; }
.pr-steps { list-style: none; margin: 0; padding: .9rem 1.2rem; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .5rem; border-bottom: 1px solid var(--rule); background: var(--surface-2); }
.pr-steps.is-bar { border: 1px solid var(--rule); border-radius: .8rem; background: var(--surface); }
.pr-steps li { display: grid; grid-template-columns: auto 1fr; column-gap: .55rem; align-items: center; padding: .5rem .6rem; border-radius: .55rem; font-size: .8rem; color: var(--ink-3); }
.pr-steps li b { color: var(--ink-2); font-size: .84rem; }
.pr-steps li small { grid-column: 2; font-size: .72rem; }
.pr-dot { grid-row: span 2; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .74rem; background: var(--surface); border: 1px solid var(--rule-strong); }
.pr-steps li.is-done .pr-dot { background: #1f8a4c; border-color: transparent; color: #fff; }
.pr-steps li.is-here { background: var(--surface); box-shadow: inset 0 0 0 2px var(--brand-2); }
.pr-steps li.is-here .pr-dot { background: var(--brand); color: #fff; border-color: transparent; }
.pr-current-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.2rem; padding: 1.1rem 1.2rem; }
.pr-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.pr-figs > div { display: grid; gap: .1rem; padding: .7rem .85rem; border: 1px solid var(--rule); border-radius: .6rem; }
.pr-figs span { font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.pr-figs b { font-size: 1.12rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.pr-figs small { font-size: .74rem; color: var(--ink-3); }
.pr-next { display: grid; gap: .6rem; align-content: start; padding: .9rem 1rem; border-radius: .7rem; background: color-mix(in srgb, #b42318 6%, var(--surface)); border: 1px solid color-mix(in srgb, #b42318 25%, var(--rule)); }
.pr-next-h { margin: 0; font-weight: 700; font-size: .9rem; }
.pr-issues { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .84rem; }
.pr-issues a { margin-left: .3rem; font-weight: 650; }
.pr-table td.num, .pr-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pr-table td small { display: block; font-size: .74rem; color: var(--ink-3); }
.pr-pager { font-size: .82rem; color: var(--ink-3); }
.pr-split { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.25rem; align-items: start; }
.pr-split.is-even { grid-template-columns: 1fr 1fr; }
.pr-exc-list { list-style: none; margin: 0; padding: 0; }
.pr-exc-list li { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .75rem 1.2rem; border-top: 1px solid var(--rule); font-size: .86rem; }
.pr-exc-list li:first-child { border-top: 0; }
.pr-exc-list li.is-block { background: color-mix(in srgb, #b42318 4%, var(--surface)); }
.pr-exc-list small { display: block; color: var(--ink-3); font-size: .78rem; margin-top: .15rem; }
.pr-exc-list .btn-quiet { margin: 0; }
.pr-neg { color: #b42318 !important; }
.pr-pos { color: #1f6b3e; }
.ln-table tr.is-late td { background: color-mix(in srgb, #b42318 4%, transparent); }
.pr-sum { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.pr-sum td { padding: .3rem 0; }
.pr-sum td + td { text-align: right; }
.pr-sum td small { display: block; color: var(--ink-3); font-size: .72rem; }
.pr-sum-h td { padding-top: .8rem; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.pr-sum-t td { border-top: 1px solid var(--rule); font-weight: 700; }
.pr-sum-net td { border-top: 2px solid var(--ink); font-weight: 800; font-size: 1rem; padding-top: .5rem; }
.pr-var { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .85rem; }
.pr-var li { display: grid; grid-template-columns: 1fr auto; }
.pr-var li small { grid-column: 1 / -1; color: var(--ink-3); font-size: .74rem; }
.pr-var b.up { color: #1f6b3e; }
.pr-legend { display: inline-flex; gap: .9rem; align-items: center; font-size: .78rem; color: var(--ink-3); margin-left: auto; }
.pr-legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: .2rem; margin-right: .3rem; vertical-align: -1px; background: var(--c); }
.pr-legend i.is-closed, .pr-cut.is-closed { --c: #1f8a4c; }
.pr-legend i.is-open, .pr-cut.is-open { --c: #c27803; }
.pr-legend i.is-future, .pr-cut.is-future { --c: #8a96a8; }
.pr-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.pr-month { background: var(--surface); border: 1px solid var(--rule); border-radius: .8rem; padding: .85rem .9rem; display: grid; gap: .4rem; align-content: start; }
.pr-month.is-now { box-shadow: 0 0 0 2px var(--brand-2); }
.pr-month h3 { margin: 0 0 .2rem; font-size: .98rem; display: flex; align-items: center; gap: .4rem; }
.pr-group { font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: .2rem; }
.pr-cut { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .45rem .6rem; border-radius: .5rem; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); text-decoration: none; color: var(--ink); font-size: .8rem; }
.pr-cut span { font-size: .72rem; font-weight: 700; color: var(--c); text-align: right; }
.pr-cut small { grid-column: 1 / -1; color: var(--ink-3); font-size: .7rem; }
.pr-ok, .pr-note, .pr-alert { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; padding: .8rem 1rem; border-radius: .7rem; font-size: .88rem; border: 1px solid var(--rule); background: var(--surface); }
.pr-ok { background: color-mix(in srgb, #1f8a4c 7%, var(--surface)); border-color: color-mix(in srgb, #1f8a4c 30%, var(--rule)); }
.pr-alert { align-items: flex-start; flex-wrap: nowrap; background: color-mix(in srgb, #b42318 6%, var(--surface)); border-color: color-mix(in srgb, #b42318 30%, var(--rule)); }
.pr-alert small { display: block; margin-top: .3rem; color: var(--ink-2); }
.pr-alert .btn { margin: 0 0 0 auto; white-space: nowrap; }
.pr-note-tax { flex-basis: 100%; font-size: .8rem; color: var(--ink-3); }
.pr-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.pr-stat .rx-panel-head h2 .rp-ico { width: 1.9rem; height: 1.9rem; }
.pr-law { margin: 0 0 .7rem; font-size: .78rem; color: var(--ink-3); }
.pr-facts { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .4rem .8rem; margin: 0; font-size: .84rem; }
.pr-facts dt { color: var(--ink-3); font-weight: 600; }
.pr-facts dd { margin: 0; }
.pr-hist { margin-top: .8rem; font-size: .82rem; }
.pr-hist summary { cursor: pointer; font-weight: 650; color: var(--brand-2); }
.pr-hist ul { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .4rem; }
.pr-hist small { display: block; color: var(--ink-3); }
.pr-calc .rx-fields { margin-bottom: .8rem; }
.pr-watch { margin: 0; padding-left: 1.1rem; display: grid; gap: .45rem; font-size: .84rem; }
.pr-matrix th[scope=row] { text-align: left; font-weight: 700; white-space: nowrap; }
.pr-matrix td { padding: .45rem .5rem; }
.pr-cell { display: grid; gap: .05rem; padding: .5rem .7rem; border-radius: .55rem; text-decoration: none; color: var(--ink); border: 1px solid var(--rule); min-width: 7.5rem; }
.pr-cell b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.pr-cell small { font-size: .7rem; }
.pr-cell.is-ok small { color: #1f6b3e; }
.pr-cell.is-bad { background: color-mix(in srgb, #b42318 8%, var(--surface)); border-color: color-mix(in srgb, #b42318 40%, var(--rule)); }
.pr-cell.is-bad small { color: #b42318; font-weight: 700; }
.pr-cell.is-missing { border-style: dashed; color: var(--ink-3); }
.pr-off { font-size: .78rem; color: var(--ink-3); max-width: 12rem; }
.pr-months { display: grid; grid-template-columns: repeat(12, .55rem); gap: 2px; }
.pr-months i { height: .8rem; border-radius: 2px; background: var(--rule); }
.pr-months i.is-on { background: var(--brand-2); }
.pr-tick { color: #1f8a4c; font-weight: 800; }
.pr-cross { color: #b42318; font-weight: 800; }
.pr-legend i.is-late, .pr-cut.is-late { --c: #b42318; }
.pr-pad { padding: .7rem 1.2rem; margin: 0; }
.pr-inline { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .5rem 0 0; }
.pr-inline input, .pr-inline select { width: auto; flex: 1 1 10rem; margin: 0; }
.pr-inline button { margin: 0; }
td.act .pr-inline { justify-content: flex-end; margin: 0; }
.pr-next-step { display: grid; gap: .7rem; }
.pr-next-step form { margin: 0; display: grid; gap: .5rem; }
.pr-next-step button { margin: 0; justify-self: start; }
.pr-next-step .field { margin: 0; }
.pr-cancel > summary { cursor: pointer; font-size: .82rem; font-weight: 650; color: var(--ink-3); }
.pr-cancel[open] > summary { margin-bottom: .5rem; }
.pr-details > summary { cursor: pointer; list-style: none; }
.pr-details > summary::-webkit-details-marker { display: none; }
.pr-next.is-clear { background: color-mix(in srgb, #1f8a4c 6%, var(--surface)); border-color: color-mix(in srgb, #1f8a4c 25%, var(--rule)); }
.pr-var b.down { color: #b42318; }
.pr-cut { display: block; padding: 0; }
.pr-cut > summary { display: grid; grid-template-columns: 1fr auto; gap: 0 .5rem; padding: .45rem .6rem; cursor: pointer; list-style: none; }
.pr-cut > summary::-webkit-details-marker { display: none; }
.pr-cut > summary span { font-size: .72rem; font-weight: 700; color: var(--c); text-align: right; }
.pr-cut > summary small { grid-column: 1 / -1; color: var(--ink-3); font-size: .7rem; }
.pr-cut[open] { box-shadow: 0 6px 16px rgba(16, 26, 41, .08); }
.pr-cut-body { padding: .2rem .6rem .6rem; font-size: .8rem; display: grid; gap: .4rem; }
.pr-cut-body p { margin: 0; color: var(--ink-2); }
.pr-cut-body .rx-btn-row { gap: .35rem; }
.pr-cut-body .btn, .pr-cut-body .btn-quiet { margin: 0; padding: .3rem .65rem; font-size: .76rem; }
.pr-cut-body .pr-inline select { flex: 1 1 6rem; }
.pr-rules { display: grid; gap: .6rem; }
.pr-rulegroup { border: 1px solid var(--rule); border-radius: .7rem; background: var(--surface); }
.pr-rulegroup > summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; padding: .7rem .9rem; }
.pr-rulegroup[open] > summary { border-bottom: 1px solid var(--rule); }
.pr-rule { padding: .8rem .9rem; border-top: 1px dashed var(--rule); display: grid; gap: .6rem; }
.pr-rule:first-of-type { border-top: 0; }
.pr-rule-h { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.pr-rule-h small { flex-basis: 100%; color: var(--ink-3); font-size: .76rem; }
.pr-rule .rx-btn-row { align-items: center; justify-content: space-between; }
.pr-check { display: inline-flex; gap: .4rem; align-items: center; font-size: .84rem; }
.pr-check input { width: auto; margin: 0; }
.pr-compute { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0; }
.pr-compute button { margin: 0; }
.pr-limits { display: block; }
.pr-limits > summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; font-weight: 650; }
.pr-limits[open] > summary { margin-bottom: .6rem; }
.pr-findings { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .82rem; }
.pr-findings a { font-weight: 650; margin-left: .2rem; }
.pr-item { display: inline-block; min-width: 2.6rem; margin-right: .45rem; padding: .05rem .4rem; border-radius: .35rem; font-size: .7rem; font-weight: 800; text-align: center; background: color-mix(in srgb, #c27803 14%, var(--surface)); color: #8a5a00; }
.pr-item.is-block { background: color-mix(in srgb, #b42318 12%, var(--surface)); color: #b42318; }
.pr-exc-list li > .ln-ref { white-space: nowrap; }
@media (max-width: 1100px) {
    .pr-split, .pr-split.is-even { grid-template-columns: minmax(0, 1fr); }
    .pr-year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pr-stat-grid { grid-template-columns: minmax(0, 1fr); }
    .pr-current-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .pr-year { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pr-steps { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pr-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pr-tabs { gap: .2rem .8rem; }
    .pr-tabgroup { flex-wrap: wrap; min-width: 0; }
    .pr-tabgroup-h { flex-basis: 100%; margin: .45rem 0 0; }
    .pr-tabs .rx-tab { padding: .5rem .55rem; font-size: .84rem; }
    .pr-exc-list li { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
    .pr-facts { grid-template-columns: minmax(0, 1fr); gap: .1rem .8rem; }
    .pr-facts dd { margin-bottom: .4rem; }
}
@media (max-width: 480px) {
    .pr-year { grid-template-columns: minmax(0, 1fr); }
    .pr-steps { grid-template-columns: minmax(0, 1fr); }
    .pr-figs { grid-template-columns: minmax(0, 1fr); }
    .pr-alert { flex-wrap: wrap; }
}

/* ── Settings > Signatories ────────────────────────────────────────────
   One document's signatories at a time: the list on the left says which
   documents print a name today, the panel on the right is the chosen one. */
.sg-i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sg-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.sg-head h1 { margin: 0; }
.sg-head .lede { margin: .3rem 0 0; color: var(--ink-3); max-width: 64ch; }
.sg-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.sg-btn, button.sg-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .95rem; border-radius: var(--r); font-weight: 650; font-size: .875rem; line-height: 1.2; border: 1px solid var(--cta-2); background: var(--cta-2); color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap; }
.sg-btn:hover { background: var(--cta-deep); border-color: var(--cta-deep); color: #fff; }
.sg-btn.ghost, button.sg-btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.sg-btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.sg-btn.danger, button.sg-btn.danger { background: var(--surface); color: var(--fail); border-color: var(--rule-strong); }
.sg-btn.danger:hover { background: var(--fail); border-color: var(--fail); color: #fff; }
.sg-btn.sm { padding: .35rem .65rem; font-size: .8rem; }

.sg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.sg-kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: .9rem 1rem; box-shadow: var(--shadow-1); display: flex; gap: .8rem; align-items: center; color: inherit; text-decoration: none; min-width: 0; }
a.sg-kpi:hover { border-color: var(--rule-strong); box-shadow: var(--shadow-2); }
.sg-kpi .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.sg-kpi .ic .sg-i { width: 20px; height: 20px; }
.sg-kpi .ic.ok { background: var(--ok-bg); color: var(--ok); }
.sg-kpi .ic.fail { background: var(--fail-bg); color: var(--fail); }
.sg-kpi .ic.warn { background: var(--warn-bg); color: var(--warn); }
.sg-kpi .ic.brand { background: var(--surface-3); color: var(--accent); }
.sg-kpi .n { font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: var(--ink); }
.sg-kpi .n small { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.sg-kpi .l { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.sg-meter { height: 6px; background: var(--surface-3); border-radius: 99px; margin-top: .4rem; overflow: hidden; width: 140px; max-width: 100%; }
.sg-meter i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

.sg-alert { display: flex; gap: .7rem; align-items: flex-start; background: var(--fail-bg); border: 1px solid var(--fail-bg); border-left: 4px solid var(--fail); border-radius: var(--r); padding: .75rem 1rem; margin-bottom: 1rem; color: var(--ink-2); font-size: .875rem; }
.sg-alert > .sg-i { width: 20px; height: 20px; color: var(--fail); margin-top: 1px; }
.sg-alert strong { color: var(--fail); }
.sg-alert a { color: var(--fail); font-weight: 700; }
.sg-alert.warn { background: var(--warn-bg); border-color: var(--warn-bg); border-left-color: var(--warn); }
.sg-alert.warn > .sg-i, .sg-alert.warn strong, .sg-alert.warn a { color: var(--warn); }

.sg-split { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.sg-main { min-width: 0; }

.sg-nav { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.sg-nav > summary { display: none; }
.sg-nav .search { padding: .85rem; border-bottom: 1px solid var(--rule); margin: 0; }
.sg-search { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 0 .65rem; background: var(--surface); color: var(--ink-3); position: relative; margin: 0; }
.sg-search:focus-within { border-color: var(--cta-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cta-2) 25%, transparent); }
.sg-search input { border: 0; outline: 0; box-shadow: none; padding: .5rem 0; background: transparent; width: 100%; min-width: 0; font-size: .875rem; color: var(--ink); }
.sg-chips { display: flex; gap: .35rem; margin-top: .6rem; flex-wrap: wrap; }
.sg-chip { font-size: .75rem; font-weight: 650; padding: .25rem .6rem; border-radius: 99px; border: 1px solid var(--rule-strong); color: var(--ink-2); background: var(--surface); text-decoration: none; }
.sg-chip:hover { background: var(--surface-2); }
.sg-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.sg-chip b { font-weight: 700; margin-left: .25rem; opacity: .85; }
.sg-group { padding: .35rem 0; border-bottom: 1px solid var(--rule); }
.sg-group:last-of-type { border-bottom: 0; }
.sg-group h3 { margin: 0; padding: .55rem 1rem .3rem; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; border: 0; }
.sg-group h3::before { display: none; }
.sg-doc { display: flex; align-items: center; gap: .65rem; padding: .5rem 1rem .5rem calc(1rem - 3px); text-decoration: none; color: var(--ink); font-size: .86rem; border-left: 3px solid transparent; }
.sg-doc:hover { background: var(--surface-2); }
.sg-doc.on { background: var(--surface-3); border-left-color: var(--cta-2); font-weight: 650; }
.sg-doc .t { flex: 1; min-width: 0; }
.sg-doc .t span { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sg-dot.ok   { background: var(--ok);   box-shadow: 0 0 0 3px var(--ok-bg); }
.sg-dot.miss { background: var(--fail); box-shadow: 0 0 0 3px var(--fail-bg); }
.sg-dot.ref  { background: var(--rule-strong); box-shadow: 0 0 0 3px var(--surface-3); }
.sg-count { font-size: .72rem; font-weight: 700; color: var(--ink-3); background: var(--surface-3); border-radius: 99px; padding: .05rem .5rem; flex: none; }
.sg-count.miss { color: var(--fail); background: var(--fail-bg); }
.sg-none { padding: 1rem; margin: 0; font-size: .85rem; color: var(--ink-3); }

.sg-panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1); margin: 0; }
.sg-panel + .sg-panel { margin-top: 1.25rem; }
.sg-panel-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.sg-panel-h h2 { margin: 0; font-size: 1.2rem; }
.sg-panel-h h2.sg-h3 { font-size: 1rem; }
.sg-panel-h .crumb { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; margin-bottom: .25rem; }
.sg-panel-b { padding: 1.1rem 1.25rem; }
.sg-note { margin: .3rem 0 0; font-size: .82rem; color: var(--ink-3); max-width: 70ch; }
.sg-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .55rem; }
.sg-tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 650; padding: .2rem .55rem; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--rule); }
.sg-tag .sg-i { width: 12px; height: 12px; }
.sg-tag.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-bg); }
.sg-tag.miss { background: var(--fail-bg); color: var(--fail); border-color: var(--fail-bg); }
.sg-tag.code { font-family: var(--mono); }
.sg-sub { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 0 0 .75rem; }

.sg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: .9rem; }
.sg-card { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1rem; position: relative; background: var(--surface); box-shadow: var(--shadow-1); }
.sg-card .ord { position: absolute; top: .85rem; right: .9rem; font-size: .7rem; font-weight: 700; color: var(--ink-3); }
.sg-person { display: flex; gap: .75rem; align-items: center; min-width: 0; }
.sg-person .nm { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.sg-card .sg-person .nm { padding-right: 4.5rem; }
.sg-person .rl { font-size: .8rem; color: var(--ink-3); }
.sg-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; }
.sg-avatar.muted { background: var(--surface-3); color: var(--ink-2); }
.sg-facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: .85rem 0 .9rem; font-size: .8rem; }
.sg-facts dt { color: var(--ink-3); }
.sg-facts dd { margin: 0; color: var(--ink); font-weight: 600; }
.sg-card .acts { display: flex; gap: .4rem; flex-wrap: wrap; border-top: 1px dashed var(--rule); padding-top: .75rem; }
.sg-empty-slot { border: 2px dashed var(--rule-strong); border-radius: var(--r-lg); display: grid; place-items: center; text-align: center; padding: 1.25rem; color: var(--ink-3); font-size: .85rem; min-height: 190px; text-decoration: none; }
.sg-empty-slot:hover { border-color: var(--cta-2); background: var(--surface-2); color: var(--ink-2); }
.sg-empty-slot .plus { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto .5rem; color: var(--cta-2); }
.sg-empty-slot .plus .sg-i { width: 20px; height: 20px; }
.sg-empty-slot strong { display: block; color: var(--ink); margin-bottom: .2rem; }

/* The paper stays white in dark mode: it is a picture of the printout. */
.sg-preview { margin-top: 1.25rem; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.sg-preview .bar { background: var(--surface-2); padding: .55rem 1rem; font-size: .78rem; color: var(--ink-3); font-weight: 650; display: flex; justify-content: space-between; border-bottom: 1px solid var(--rule); }
.sg-paper { background: #fff; padding: 1.6rem 2rem 1.8rem; font-family: Georgia, "Times New Roman", serif; color: #1a1a1a; }
.sg-paper.small { border: 1px solid var(--rule); border-radius: var(--r); padding: 1.25rem 1.5rem; }
.sg-paper .lines { height: 8px; background: #eef0f3; border-radius: 3px; margin: .45rem 0; }
.sg-paper .lines.s { width: 72%; }
.sg-paper .lines.xs { width: 45%; }
.sg-paper-note { margin: 1.4rem 0 0; font-size: .85rem; font-style: italic; color: #8a1c1c; }
.sg-sigs { display: flex; gap: 1.5rem 2.5rem; margin-top: 2.6rem; flex-wrap: wrap; }
.sg-paper.small .sg-sigs { margin-top: 1.8rem; }
.sg-sig { width: 30%; min-width: 180px; }
.sg-sig .ln { border-top: 1px solid #222; padding-top: .3rem; font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; }
.sg-sig .ps { font-size: .8rem; }
.sg-sig.is-new { outline: 2px dashed var(--cta-2); outline-offset: 6px; border-radius: 2px; }

.sg-help { font-size: .8rem; color: var(--ink-3); display: flex; gap: .5rem; align-items: flex-start; background: var(--surface-2); border-radius: var(--r); padding: .7rem .85rem; margin: 1rem 0 0; }
.sg-panel-b > .sg-help:first-child { margin: 0 0 1rem; }
.sg-help > .sg-i { color: var(--accent); margin-top: 1px; }

.sg-also { list-style: none; margin: 0; padding: 0; display: flex; gap: .5rem; flex-wrap: wrap; }
.sg-also li { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .3rem .65rem; border: 1px solid var(--rule); border-radius: 6px; color: var(--ink-2); background: var(--surface-2); font-weight: 600; }
.sg-also li .sg-i { width: 14px; height: 14px; color: var(--ink-3); }

.sg-table-wrap { overflow-x: auto; position: relative; }
.sg-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: 0; }
.sg-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; padding: .55rem .75rem; border-bottom: 1px solid var(--rule); background: var(--surface-2); white-space: nowrap; }
.sg-table td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.sg-table tr:last-child td { border-bottom: 0; }
.sg-table tr.is-open td { background: var(--surface-2); }
.sg-table .sg-who { font-weight: 650; min-width: 9rem; }
.sg-table .sg-who-sub span, .sg-table .mono span { display: block; font-size: .76rem; color: var(--ink-3); }
.sg-table .sg-who span { display: block; font-weight: 400; font-size: .76rem; color: var(--ink-3); }
.sg-table .mono { font-family: var(--mono); font-size: .8rem; white-space: nowrap; }
.sg-table td.sg-row-acts { text-align: right; }
.sg-row-acts > * { margin: .15rem 0 .15rem .3rem; vertical-align: middle; }
.sg-row-acts .btn-quiet, .sg-row-acts button.btn-quiet { padding: .3rem .55rem; font-size: .78rem; }
.sg-warn-text { color: var(--warn) !important; }
.sg-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 99px; white-space: nowrap; }
.sg-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sg-status.force { background: var(--ok-bg); color: var(--ok); }
.sg-status.sched { background: var(--surface-3); color: var(--accent); }
.sg-status.ended { background: var(--surface-3); color: var(--ink-3); }
.sg-status.off   { background: var(--fail-bg); color: var(--fail); }

/* Segmented choices: signature order (radios) and the history filter. */
.sg-seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--r); overflow: hidden; position: relative; flex-wrap: wrap; align-self: flex-start; }
.sg-seg label, .sg-seg button { padding: .45rem .85rem; font-size: .8rem; font-weight: 650; color: var(--ink-2); background: var(--surface); border: 0; border-right: 1px solid var(--rule-strong); border-radius: 0; cursor: pointer; margin: 0; box-shadow: none; }
.sg-seg > :last-child { border-right: 0; }
.sg-seg label:hover, .sg-seg button:hover { background: var(--surface-2); color: var(--ink); }
.sg-seg input:checked + label, .sg-seg button.on, .sg-seg button.on:hover { background: var(--brand); color: #fff; }
.sg-seg input:focus-visible + label { outline: 2px solid var(--cta-2); outline-offset: -2px; }

.sg-form .sg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sg-form .sg-full { grid-column: 1 / -1; }
.sg-form .field label i { font-style: normal; color: var(--fail); }
.sg-label { font-size: .83rem; font-weight: 650; color: var(--ink); }
.sg-step { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: .92rem; margin: 1.5rem 0 .8rem; color: var(--ink); border: 0; padding: 0; }
.sg-step::before { display: none; }
.sg-panel-b > .sg-step:first-child { margin-top: 0; }
.sg-step b { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .75rem; flex: none; }
.sg-step .sg-tag { margin-left: auto; }
.sg-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1rem; border: 1px solid var(--rule); border-radius: var(--r); padding: .7rem .9rem; margin: 0; min-width: 0; }
.sg-checks .ck { display: flex; gap: .5rem; align-items: center; font-size: .84rem; color: var(--ink-2); padding: .2rem 0; cursor: pointer; font-weight: 500; min-width: 0; }
.sg-checks .ck input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--cta-2); }
.sg-checks .ck input:checked + span { color: var(--ink); font-weight: 650; }
.sg-checks .ck em { font-style: normal; font-size: .7rem; color: var(--ok); font-weight: 700; margin-left: auto; white-space: nowrap; }
.sg-checks .ck em.m { color: var(--fail); }
.sg-checks .ck em.r { color: var(--ink-3); }
.sg-check-tools { display: flex; gap: .5rem; margin-top: .5rem; }
.sg-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--rule); padding: 1rem 1.25rem; background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }
.sg-foot .note { font-size: .78rem; color: var(--ink-3); }

.sg-handover { display: flex; align-items: center; gap: 1.25rem; padding: 1rem; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--surface-2); margin-bottom: 1.25rem; flex-wrap: wrap; }
.sg-arrow { font-size: 1.4rem; color: var(--ink-3); }
.sg-what { margin: 0; font-size: .85rem; color: var(--ink-2); }
.sg-also-box { display: flex; gap: .6rem; align-items: flex-start; margin-top: 1.25rem; padding: .8rem 1rem; border: 1px solid var(--rule); border-radius: var(--r); font-size: .85rem; color: var(--ink-2); cursor: pointer; font-weight: 400; }
.sg-also-box input { margin-top: .2rem; width: 16px; height: 16px; flex: none; accent-color: var(--cta-2); }
.sg-also-box strong { color: var(--ink); }

@media (max-width: 1180px) {
    .sg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sg-split { grid-template-columns: 1fr; }
    .sg-nav > summary { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; cursor: pointer; font-weight: 700; list-style: none; }
    .sg-nav > summary::-webkit-details-marker { display: none; }
    .sg-nav > summary::after { content: "\25BE"; color: var(--ink-3); }
    .sg-nav[open] > summary { border-bottom: 1px solid var(--rule); }
    .sg-nav-current { color: var(--accent); font-weight: 650; margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 640px) {
    .sg-kpis { gap: .5rem; }
    .sg-kpi { padding: .7rem; }
    .sg-kpi .ic { display: none; }
    .sg-form .sg-row, .sg-checks { grid-template-columns: 1fr; }
    .sg-panel-h, .sg-panel-b, .sg-foot { padding-left: 1rem; padding-right: 1rem; }
    .sg-paper { padding: 1.2rem; }
    .sg-sig { width: 100%; }
    .sg-card .sg-person .nm { padding-right: 0; }
    .sg-card .ord { position: static; display: block; margin-bottom: .5rem; }
}

/* The history table stacks into cards whenever the panel is narrow - on a
   phone, and beside the document list on a laptop - not only by screen width. */
.sg-main { container-type: inline-size; container-name: sg-main; }
@container sg-main (max-width: 720px) {
    .sg-table thead { display: none; }
    .sg-table tr { display: block; border-bottom: 1px solid var(--rule); padding: .6rem 0; }
    .sg-table tr:last-child { border-bottom: 0; }
    .sg-table td { display: flex; gap: .75rem; border: 0; padding: .2rem 1.25rem; align-items: baseline; }
    .sg-table td[data-label]::before { content: attr(data-label); color: var(--ink-3); font-size: .75rem; font-family: var(--font); min-width: 5.5rem; flex: none; }
    .sg-table .sg-who-sub span, .sg-table .mono span { display: inline; margin-left: .35rem; }
    .sg-table td.sg-row-acts { text-align: left; flex-wrap: wrap; gap: .3rem; padding-top: .4rem; }
    .sg-row-acts > * { margin: 0; }
    .sg-table .sg-who { min-width: 0; display: block; }
}

/* Pay group: cutoffs and pay days (5 Nov 2026). */
.pd-cutoffs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .8rem; margin: .8rem 0; }
.pd-cut { border: 1px solid var(--rule); border-radius: .6rem; padding: .6rem .9rem .8rem; margin: 0; min-width: 0; }
.pd-cut legend { font-weight: 700; font-size: .85rem; padding: 0 .3rem; }
.pd-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.pd-trio .field input, .pd-trio .field select { width: 100%; min-width: 0; box-sizing: border-box; }
.pd-k { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.pd-v { display: block; padding: .45rem 0; }
.pd-says { margin: .5rem 0 0; font-size: .85rem; }
.pd-over { color: var(--warn); }
.pd-impact { margin: .9rem 0; padding: .7rem 1rem; border-left: 4px solid var(--warn); background: var(--warn-bg); border-radius: .4rem; font-size: .86rem; }
.pd-table td small { display: block; }
/* Periods: why a pay date is what it is. */
.pr-cut small .pr-why { display: block; }

/* ═══════════════════════════════════════════════════════════════════════
   Compensation (cp-): Pay & rates, the employee pay profile, wage
   increases, pay groups, allowance types. Theme variables only, so dark
   mode follows; no inline style anywhere (CSP).
   ═══════════════════════════════════════════════════════════════════════ */
.cp { display: grid; gap: 1.1rem; align-content: start; min-width: 0; }
.cp-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-end; justify-content: space-between; }
.cp-eyebrow { font: 700 .72rem/1.3 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-2); }
.cp-eyebrow a { color: inherit; text-decoration: none; }
.cp-eyebrow a:hover { text-decoration: underline; }
.cp-head h1 { margin: .35rem 0 .3rem; font-size: 1.85rem; letter-spacing: -.01em; }
.cp-lede { margin: 0; color: var(--ink-3); max-width: 64ch; }
.cp-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.cp-actions form { margin: 0; }
.cp-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1rem; border-radius: 10px; font-weight: 600; font-size: .92rem;
          border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); text-decoration: none; white-space: nowrap; cursor: pointer; font-family: inherit; line-height: 1.2; min-height: 0; }
.cp-btn:hover { border-color: var(--brand-2); color: var(--brand-2); }
.cp-btn.is-pri { background: var(--cta-2); border-color: var(--cta-2); color: #fff; box-shadow: 0 4px 12px rgba(0, 119, 242, .25); }
.cp-btn.is-pri:hover { background: var(--cta-deep); color: #fff; }
.cp-btn.is-danger { color: var(--fail); border-color: var(--fail); }
.cp-btn.is-sm { padding: .38rem .7rem; font-size: .82rem; border-radius: 8px; }
.cp-btn svg { width: 16px; height: 16px; flex: none; }
.cp-btn svg, .cp-tab svg, .cp-note svg, .cp-search svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cp-go { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--rule); color: var(--ink-3); text-decoration: none; font-size: 1.1rem; font-weight: 700; }
.cp-go:hover { border-color: var(--brand-2); color: var(--brand-2); }
.cp-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: thin; }
.cp-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .7rem .9rem; color: var(--ink-3); font-weight: 600; font-size: .92rem;
          border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.cp-tab:hover { color: var(--brand-2); }
.cp-tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }
.cp-tab svg { width: 16px; height: 16px; }
.cp-tab .cp-n { font: 700 .72rem/1 system-ui, sans-serif; padding: .22rem .45rem; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.cp-tab .cp-n.is-warn { background: var(--warn-bg); color: var(--warn); }
.cp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.cp-kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 1rem 1.1rem; display: grid; gap: .3rem; align-content: start; position: relative; overflow: hidden; text-decoration: none; color: inherit; }
.cp-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand-2); }
.cp-kpi.is-ok::before { background: var(--laurel); }
.cp-kpi.is-warn::before { background: #d97706; }
.cp-kpi.is-violet::before { background: #7c3aed; }
a.cp-kpi:hover { border-color: var(--brand-2); }
.cp-k { font: 700 .7rem/1.25 system-ui, sans-serif; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.cp-v { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.cp-v small { font-size: .9rem; color: var(--ink-3); font-weight: 700; margin-right: .1rem; }
.cp-kn { font-size: .82rem; color: var(--ink-3); }
.cp-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; min-width: 0; }
.cp-card-h { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; padding: 1rem 1.2rem; border-bottom: 1px solid var(--rule); }
.cp-card-h h2, .cp-card-h h3 { margin: 0; font-size: 1.02rem; }
.cp-card-b { padding: 1.1rem 1.2rem; }
.cp-card-b > :first-child { margin-top: 0; }
.cp-card-b > :last-child { margin-bottom: 0; }
.cp-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; margin: 0; }
.cp-search { flex: 1 1 260px; display: flex; align-items: center; gap: .5rem; border: 1px solid var(--rule-strong); border-radius: 10px; padding: 0 .75rem; color: var(--ink-3); background: var(--surface); }
.cp-search input { border: 0; outline: 0; background: transparent; padding: .6rem 0; width: 100%; font: inherit; color: var(--ink); box-shadow: none; min-height: 0; margin: 0; }
.cp-search:focus-within { border-color: var(--cta-2); box-shadow: 0 0 0 3px rgba(0, 119, 242, .15); }
.cp-search svg { width: 18px; height: 18px; flex: none; }
.cp-bar select { width: auto; max-width: 100%; border: 1px solid var(--rule-strong); border-radius: 10px; padding: .55rem .75rem; font-size: .9rem; background: var(--surface); color: var(--ink-2); margin: 0; }
.cp-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.cp-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .7rem; border-radius: 999px; border: 1px solid var(--rule-strong); font-size: .82rem; font-weight: 600; color: var(--ink-2); background: var(--surface); text-decoration: none; white-space: nowrap; }
.cp-chip:hover { border-color: var(--brand-2); color: var(--brand-2); }
.cp-chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cp-chip.is-warn { border-color: #f0c27a; background: var(--warn-bg); color: var(--warn); }
.cp-chip.is-warn.is-on { background: var(--warn); border-color: var(--warn); color: #fff; }
.cp-chip b { font-weight: 800; }
.cp-table-wrap { overflow-x: auto; position: relative; }
table.cp-t { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0; }
.cp-t th { font: 700 .68rem/1.2 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: .75rem .9rem; background: var(--surface-2); border-bottom: 1px solid var(--rule); white-space: nowrap; }
.cp-t th a { color: inherit; text-decoration: none; }
.cp-t th a.is-on { color: var(--accent); }
.cp-t td { padding: .75rem .9rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.cp-t tbody tr:last-child td { border-bottom: 0; }
.cp-t .cp-r { text-align: right; font-variant-numeric: tabular-nums; }
.cp-t tbody tr:hover { background: var(--surface-2); }
.cp-t tr.is-muted td { opacity: .62; }
.cp-who { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.cp-t .cp-who { min-width: 15rem; }
.cp-t td:first-child { min-width: 11rem; }
.cp-warn-text { color: var(--warn); font-weight: 600; max-width: 22rem; }
.cp-t td.cp-r .cp-sub, .cp-t td.cp-r .cp-amt { white-space: nowrap; }
.cp-name { font-weight: 700; color: var(--ink); text-decoration: none; }
a.cp-name:hover { color: var(--brand-2); text-decoration: underline; }
.cp-sub { display: block; font-size: .78rem; color: var(--ink-3); margin-top: .15rem; }
.cp-mono { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.cp-stack-cell { display: grid; gap: .3rem; justify-items: start; }
.cp-pill { display: inline-flex; align-items: center; gap: .3rem; font: 700 .68rem/1.1 system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; padding: .32rem .55rem; border-radius: 999px;
           border: 1px solid var(--rule-strong); color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.cp-pill.is-ok { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.cp-pill.is-warn { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); }
.cp-pill.is-fail { color: var(--fail); border-color: var(--fail); background: var(--fail-bg); }
.cp-pill.is-blue { color: #1e40af; border-color: #9cc3fb; background: #eff6ff; }
.cp-pill.is-violet { color: #5b21b6; border-color: #c4b5fd; background: #f5f3ff; }
.cp-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-up { font-size: .78rem; font-weight: 700; color: var(--ok); white-space: nowrap; }
.cp-down { font-size: .78rem; font-weight: 700; color: var(--fail); white-space: nowrap; }
.cp-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .8rem 1rem; color: var(--ink-3); font-size: .85rem; border-top: 1px solid var(--rule); }
.cp-pager { display: flex; gap: .3rem; flex-wrap: wrap; }
.cp-pager a, .cp-pager span { min-width: 32px; height: 32px; padding: 0 .5rem; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 8px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.cp-pager .is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cp-empty { padding: 2.2rem 1.2rem; text-align: center; color: var(--ink-3); }
.cp-empty b { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: .25rem; }
.cp-note { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; background: #eff6ff; border: 1px solid #c7dcfb; color: #1e3a8a; font-size: .86rem; }
.cp-note.is-warn { background: var(--warn-bg); border-color: #f0c27a; color: var(--warn); }
.cp-note.is-fail { background: var(--fail-bg); border-color: var(--fail); color: var(--fail); }
.cp-note.is-ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.cp-note b { display: block; margin-bottom: .1rem; }
.cp-note p { margin: .2rem 0 0; }
.cp-note a { color: inherit; font-weight: 700; }
.cp-note svg { width: 18px; height: 18px; flex: none; margin-top: .1rem; }
.cp-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cp-grid.is-wide-left { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.cp-side { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.cp > *, .cp-side > *, .cp-grid > *, .cp-pgs > *, .cp-md > * { margin-top: 0; margin-bottom: 0; }
.cp-sub.is-inline { display: inline; margin: 0; }
/* Employee pay profile */
.cp-prof { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; padding: 1.2rem 1.3rem; background: linear-gradient(120deg, #12294f, #1b3a7a 55%, #2c5aa8); color: #fff; border-radius: 16px; }
.cp-prof .avatar { width: 64px; height: 64px; font-size: 1.3rem; border: 3px solid rgba(255, 255, 255, .35); flex: none; }
.cp-prof h1 { margin: .2rem 0 0; font-size: 1.5rem; color: #fff; }
.cp-prof .cp-eyebrow { color: #9cc3fb; }
.cp-prof-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: #cfdcf3; font-size: .88rem; margin-top: .35rem; }
.cp-prof-meta a { color: #fff; }
.cp-prof-main { flex: 1 1 320px; min-width: 0; }
.cp-prof .cp-btn { border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); color: #fff; }
.cp-prof .cp-btn:hover { background: rgba(255, 255, 255, .16); }
.cp-prof .cp-btn.is-pri { background: #fff; color: #1b3a7a; border-color: #fff; box-shadow: none; }
.cp-big { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cp-big small { font-size: 1.1rem; color: var(--ink-3); }
.cp-stack { display: block; width: 100%; height: 14px; margin: .9rem 0 .6rem; border-radius: 999px; overflow: hidden; }
.cp-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--ink-2); margin: 0; padding: 0; list-style: none; }
.cp-legend li { display: inline-flex; align-items: center; gap: .35rem; }
.cp-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cp-sw0 { background: #1b3a7a; fill: #1b3a7a; } .cp-sw1 { background: #7c3aed; fill: #7c3aed; } .cp-sw2 { background: #0f766e; fill: #0f766e; }
.cp-sw3 { background: #d97706; fill: #d97706; } .cp-sw4 { background: #be123c; fill: #be123c; } .cp-sw5 { background: #0369a1; fill: #0369a1; }
.cp-sw6 { background: #94a3b8; fill: #94a3b8; } .cp-sw7 { background: #047857; fill: #047857; } .cp-sw8 { background: #9333ea; fill: #9333ea; }
.cp-derived { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; }
.cp-derived div { background: var(--surface-2); border-radius: 12px; padding: .7rem .8rem; }
.cp-derived b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.cp-derived span { font-size: .74rem; color: var(--ink-3); }
.cp-tl { list-style: none; margin: 0; padding: 0; }
.cp-tl li { position: relative; padding: 0 0 1.1rem 1.6rem; }
.cp-tl li::before { content: ""; position: absolute; left: .38rem; top: .3rem; bottom: -.2rem; width: 2px; background: var(--rule); }
.cp-tl li:last-child { padding-bottom: 0; }
.cp-tl li:last-child::before { display: none; }
.cp-tl li::after { content: ""; position: absolute; left: 0; top: .2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand-2); }
.cp-tl li.is-now::after { border-color: var(--laurel); background: var(--laurel); }
.cp-tl li.is-next::after { border-color: #7c3aed; border-style: dashed; }
.cp-tl-d { font-size: .78rem; color: var(--ink-3); }
.cp-tl-h { font-weight: 700; margin: .15rem 0; font-variant-numeric: tabular-nums; }
.cp-rows { display: grid; margin: 0; }
.cp-rows > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--rule); font-size: .9rem; }
.cp-rows > div:last-child { border-bottom: 0; }
.cp-rows dt { color: var(--ink-2); }
.cp-rows dd { margin: 0; font-weight: 700; text-align: right; }
/* Side panel. Opens by itself when the URL asks for it, so it works without script. */
.cp-scrim { position: fixed; inset: 0; background: rgba(16, 26, 41, .45); z-index: 60; display: block; }
.cp-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100%); background: var(--surface); z-index: 61; box-shadow: var(--shadow-3); display: flex; flex-direction: column; margin: 0; }
.cp-drawer[hidden], .cp-scrim[hidden] { display: none; }
.cp-drawer > header { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.cp-drawer > header h2 { margin: .2rem 0 0; font-size: 1.15rem; }
.cp-drawer-body { padding: 1.1rem 1.3rem; overflow: auto; display: grid; gap: .9rem; flex: 1; align-content: start; }
.cp-drawer > footer { padding: .9rem 1.3rem; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; gap: .5rem; background: var(--surface-2); }
.cp-x { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--rule); color: var(--ink-3); text-decoration: none; font-size: 1.1rem; background: var(--surface); cursor: pointer; flex: none; }
.cp-f { display: grid; gap: .3rem; min-width: 0; }
.cp-f label, .cp-f .cp-label { font-size: .8rem; font-weight: 700; color: var(--ink-2); margin: 0; }
.cp-f input, .cp-f select, .cp-f textarea { width: 100%; margin: 0; }
.cp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; align-items: start; }
.cp-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; align-items: start; }
.cp-f { align-content: start; }
.cp-seg { display: flex; border: 1px solid var(--rule-strong); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.cp-seg label { flex: 1 1 auto; text-align: center; padding: .5rem .6rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); cursor: pointer; margin: 0; position: relative; }
.cp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cp-seg label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.cp-seg label:has(input:focus-visible) { outline: 2px solid var(--cta-2); outline-offset: -2px; }
.cp-preview { border: 1px solid #c4b5fd; background: #faf7ff; border-radius: 12px; padding: .9rem 1rem; }
.cp-preview h4 { margin: 0 0 .5rem; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #7c3aed; }
.cp-cmp { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: .35rem .9rem; font-size: .88rem; font-variant-numeric: tabular-nums; }
.cp-cmp .cp-hd { font-size: .68rem; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; text-align: right; }
.cp-cmp > :nth-child(4n+2), .cp-cmp > :nth-child(4n+3), .cp-cmp > :nth-child(4n) { text-align: right; }
/* Wage increases */
.cp-steps { display: flex; align-items: center; flex-wrap: wrap; row-gap: .4rem; margin: 0; padding: 0; list-style: none; }
.cp-step { display: flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.cp-step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .7rem; border: 2px solid var(--rule-strong); background: var(--surface); }
.cp-step.is-done i { background: var(--laurel); border-color: var(--laurel); color: #fff; }
.cp-step.is-cur i { border-color: var(--cta-2); color: var(--cta-2); }
.cp-step.is-cur { color: var(--cta-2); }
.cp-step.is-done { color: var(--ink-2); }
.cp-step.is-stop i { background: var(--fail); border-color: var(--fail); color: #fff; }
.cp-step.is-stop { color: var(--fail); }
.cp-line { width: 26px; height: 2px; background: var(--rule-strong); margin: 0 .35rem; }
.cp-line.is-done { background: var(--laurel); }
.cp-steps.is-mini .cp-step:not(.is-cur):not(.is-stop) b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cp-steps.is-mini .cp-line { width: 14px; margin: 0 .2rem; }
.cp-inc { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.7fr) repeat(3, minmax(0, .8fr)) auto; gap: 1rem; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--rule); }
.cp-inc:last-child { border-bottom: 0; }
.cp-lab { font-size: .7rem; color: var(--ink-3); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.cp-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-act { display: grid; gap: .6rem; }
.cp-act form { margin: 0; display: grid; gap: .6rem; }
.cp-act + .cp-act { border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 1rem; }
.cp-act h3 { margin: 0; font-size: .95rem; }
.cp-act p { margin: 0; font-size: .85rem; color: var(--ink-3); }
details.cp-more { border-top: 1px solid var(--rule); }
details.cp-more > summary { cursor: pointer; padding: .8rem 1.2rem; font-weight: 600; color: var(--brand-2); list-style: none; }
details.cp-more > summary::-webkit-details-marker { display: none; }
details.cp-more > summary::before { content: "▸ "; }
details.cp-more[open] > summary::before { content: "▾ "; }
.cp-inline-form { display: flex; gap: .35rem; align-items: center; margin: 0; flex-wrap: wrap; }
.cp-inline-form input[type=text] { width: 9rem; padding: .35rem .5rem; font-size: .82rem; margin: 0; }
/* Pay groups */
.cp-pgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.cp-pg { background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 1.1rem 1.2rem; display: grid; gap: .85rem; align-content: start; }
.cp-pg.is-shared { border: 2px solid var(--brand-2); box-shadow: 0 8px 24px rgba(27, 58, 122, .12); }
.cp-pg.is-off { opacity: .72; background: var(--surface-2); }
.cp-pg h3 { margin: .1rem 0 0; font-size: 1.05rem; }
.cp-pg h3 a { color: inherit; text-decoration: none; }
.cp-pg h3 a:hover { color: var(--brand-2); text-decoration: underline; }
.cp-pg-top { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; }
.cp-cal { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cp-cal div { border: 1px solid var(--rule); border-radius: 10px; padding: .55rem .65rem; font-size: .8rem; color: var(--ink-3); }
.cp-cal b { display: block; color: var(--ink); font-size: .95rem; }
.cp-facts { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-3); }
.cp-facts b { display: block; color: var(--ink); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.cp-pg-foot { display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; }
/* Allowance types */
.cp-md { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.cp-at { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.cp-at:last-child { border-bottom: 0; }
.cp-at .cp-r { text-align: right; font-variant-numeric: tabular-nums; }
.cp fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cp-at:hover { background: var(--surface-2); }
.cp-at.is-on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--brand-2); }
.cp-at.is-off { opacity: .62; }
.cp-at[hidden] { display: none; }
.cp-at-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font: 800 .68rem/1 system-ui, sans-serif; color: #fff; }
.cp-use { display: block; height: 6px; border-radius: 999px; background: var(--surface-3); margin-top: .35rem; overflow: hidden; }
.cp-use i { display: block; height: 100%; background: var(--brand-2); }
.cp-slip { border: 1px dashed var(--rule-strong); border-radius: 12px; padding: .8rem 1rem; background: var(--surface-2); font-size: .85rem; }
.cp-slip div { display: flex; justify-content: space-between; padding: .2rem 0; }
.cp-slip .is-hl { background: #fff7d6; margin: 0 -.4rem; padding: .2rem .4rem; border-radius: 6px; font-weight: 700; color: #3b2f00; }
.cp-toggle { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--rule); font-size: .9rem; margin: 0; cursor: pointer; font-weight: 400; }
.cp-toggle input { width: 40px; height: 22px; flex: none; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--rule-strong); position: relative; cursor: pointer; margin: 0; border: 0; padding: 0; transition: background .15s; }
.cp-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.cp-toggle input:checked { background: var(--laurel); }
.cp-toggle input:checked::after { left: 21px; }
.cp-toggle input:focus-visible { outline: 2px solid var(--cta-2); outline-offset: 2px; }
.cp-problems { margin: 0; padding-left: 1.1rem; }
@media (prefers-color-scheme: dark) {
    .cp-pill.is-blue { color: #9cc3fb; border-color: #3b5f9c; background: #142037; }
    .cp-pill.is-violet { color: #c4b5fd; border-color: #5b4a9c; background: #1d1733; }
    .cp-note { background: #142037; border-color: #2b4a7c; color: #b9d3f7; }
    .cp-preview { background: #1d1733; border-color: #5b4a9c; }
    .cp-sw0 { background: #6f9be0; fill: #6f9be0; }
}
/* Pay group detail: its working sections, framed like the rest of Compensation. */
.cp-legacy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.1rem; }
.cp-legacy > .card, .cp-legacy > form.card { min-width: 0; overflow-x: auto; }
.cp-legacy > .card, .cp-legacy > form.card, .cp-legacy > .notice { margin: 0; }
.cp-legacy > .card, .cp-legacy > form.card { border-radius: 14px; border: 1px solid var(--rule); box-shadow: none; padding: 1.1rem 1.2rem; scroll-margin-top: 1rem; }
.cp-legacy > .card > h2:first-child, .cp-legacy > form.card > h2:first-of-type { margin-top: 0; font-size: 1.05rem; padding-bottom: .7rem; border-bottom: 1px solid var(--rule); }
@media (max-width: 960px) {
    .cp-grid, .cp-grid.is-wide-left, .cp-md { grid-template-columns: 1fr; }
    .cp-inc { grid-template-columns: 1fr 1fr; }
    .cp-inc > :first-child, .cp-inc > :nth-child(2) { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .cp-head h1 { font-size: 1.5rem; }
    .cp-derived { grid-template-columns: 1fr 1fr; }
    .cp-row2, .cp-row3 { grid-template-columns: 1fr; }
    .cp-hide-m { display: none; }
    table.cp-t.is-cards thead { display: none; }
    table.cp-t.is-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .6rem; padding: .75rem .9rem; border-bottom: 1px solid var(--rule); }
    table.cp-t.is-cards td { border: 0; padding: 0; }
    table.cp-t.is-cards td.cp-hide-m { display: none; }
    .cp-prof { padding: 1rem; }
    .cp-big { font-size: 1.9rem; }
    .cp-cmp { gap: .3rem .5rem; font-size: .8rem; }
}
