/* ==========================================================================
   JPSC theme — the Office Supplies design system, on the asset inventory.

   Provenance is deliberate: every token, radius and colour step below is the
   same one `JPSC_OfficeSuppliesSystem/OfficeSuppliesMS/wwwroot/app.css` uses,
   because the two systems are now read as one product by the same operators —
   the transition between them is what this sheet exists to make seamless. The
   inventory's own vocabulary (`.kpi`, `.panel`, `.tbl`, `.pill`, `.fld`, `.inp`,
   `.abtn`, `.seg`, `.chip`, `.timeline`, `.empty-state`, `.report-sheet`) is the
   Office Supplies vocabulary, unchanged in name as well as in look, so a
   component written here and a component written there read alike.

   What the Office Supplies sheet never had to solve is added below it, and each
   block says so: this register has nine hundred rows to page through, records
   with a movement history rather than a stock ledger, secret columns that must
   never print, four-module registers that share one screen, a printable report
   somebody signs, and dialogs of our own rather than a component library's.

   CASCADE. The head links this last among the global sheets, so an equal-specificity tie here is won
   here — which is what lets app.css and Ask.css keep the handful of lines they do without either of them
   fighting this one. Nothing else loads behind it: the legacy brand layer that used to sit in front of
   this position (SharedTheme.css, Theme.css, Accent.css, MasterPage.css) is out of the head and out of
   wwwroot, and so are the twenty module sheets, because every page has been re-authored onto this
   vocabulary. A page that still wanted its own sheet would get it through the head outlet, after this
   one — which is the deal that made the conversion safe, and no page takes it up any more.

   Bootstrap is the same story. Its names survive in the markup — `.modal`, `.modal-dialog`,
   `.modal-content`, `.btn-close`, `.fade`, `.show` — because that is the vocabulary the port's dialogs
   were authored against, and renaming forty call sites buys nothing. What does not survive is the sheet:
   the reboot's `box-sizing`, the body's 1.5 line, the form controls' inherited type, the heading and
   paragraph margins, the dialog frame's geometry and the button's whole hover/active/disabled state
   machine are written into the sections below, and `bootstrap.min.css` loads on the login route alone.
   That is also why the button states are a `--btn-*` alphabet rather than Bootstrap's `--bs-btn-*`: the
   indirection only ever worked while the vendored sheet was there to consume it, and an unset `var()`
   with no fallback makes the declaration invalid rather than merely empty.

   The login page is the one screen this sheet must never touch. `App.razor`
   keeps the whole shell stack — this file included — out of the standalone
   document, and `SystemLogin.css` goes on its own, exactly as
   `SystemLogIn.aspx` did.
   ========================================================================== */

/* ---------- 1. Tokens, shared with the Office Supplies system ---------- */
:root {
    --sb-bg: #0d1a29;
    --sb-bg-2: #0a1420;
    --sb-line: #1b2c3f;
    --gold: #eaa60f;
    --gold-2: #f6bb2c;
    --gold-dark: #a4700a;
    --gold-soft: #fdf3d8;
    --ink: #13273f;
    --ink-2: #33475c;
    --muted: #7b8a99;
    --bg: #edf1f6;
    --card: #ffffff;
    --line: #e4e9f0;
    --blue: #1668c7;
    --blue-soft: #e8f1fd;
    --green: #189a52;
    --green-soft: #e5f6ec;
    --purple: #8b5cf6;
    --purple-soft: #f1ebfe;
    --red: #e11d48;
    --red-soft: #fdeaef;
    --indigo: #6366f1;
    --indigo-soft: #eceefe;
    --teal: #0ea5e9;
    --teal-soft: #e5f5fd;
    --orange: #f59e0b;
    --orange-soft: #fef3e0;
    --pink: #ec4899;
    --pink-soft: #fdeaf3;
    --navy: var(--sb-bg);
    --sb-w: 264px;
    --sb-w-mini: 78px;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 42, 67, .05);
    /* The floating shell's gutter: the gap the sidebar, topbar and content card keep from the viewport
       edges and from one another, so the three read as cards resting on the page rather than panels
       bolted to its frame. */
    --shell-gap: 12px;

    /* The scale the two shim sheets (app.css, Ask.css) still write their sizes with. The theme itself
       rounds its cards at `--radius` and paints them with `--shadow`; a chip, a field or a pattern-lock
       dot is a smaller object and needs the steps below it, so they are named here rather than repeated
       as literals in a hundred rules. `--input-bg` and `--input-border` are the filled field the shims
       draw — the theme's own `.inp` is white on `--line`, and the difference is a point of hue. The two
       glows are the focus rings: the theme writes them inline where it needs one, and a shim rule that
       wants the same ring asks for these. They arrived from MasterPage.css, the legacy shell sheet, and
       they are the last of it — everything else in that file described a page this app no longer renders.
       The colour tokens that used to sit beside them (--brand-gold, --text-primary, --card-border and
       the rest of the old JPSC palette) are gone: the shims now read the theme's own names, and where
       the two disagreed the theme won, because the theme is the design this app is being built to. */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --shadow-sm: 0 1px 4px rgba(15, 28, 46, .07);
    --shadow-md: 0 4px 18px rgba(15, 28, 46, .10);
    --shadow-lg: 0 10px 40px rgba(15, 28, 46, .14);
    --transition: .2s ease;
    --input-bg: #f7fafd;
    --input-border: #cdd6e0;
    --gold-glow: rgba(234, 166, 15, .22);
    --blue-glow: rgba(22, 104, 199, .18);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink-2);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* The line every block in the app is measured against. Bootstrap's reboot put `line-height: 1.5` on the
   body and the whole stack inherited it — 21px under this sheet's 14px — and because it is inherited it is
   not a style any component had to ask for, which is why nothing here said it. It is also the reason a
   nav row is 38px tall rather than 36: the row's height is its content's line box, so the number is not
   decoration, it is geometry. */
body { line-height: 1.5; }

/* Form controls take their type from the page, not from the browser. Without these three lines every
   button, input, select and textarea in the register drops to the UA's 13.333px medium and its own line
   height, which is the single largest visual move in taking Bootstrap out of the head — the sidebar's
   collapse chequer, the toolbar's filters and the dialog's Save button all shrink a point at a time.
   `color: inherit` and `margin: 0` are the other two halves of what the reboot wrote, and the sheet's own
   `.inp` and `.btn` rules still set everything that is a design decision rather than a default. */
button, input, optgroup, select, textarea {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

h1, h2, h3, h4 { margin: 0; color: var(--ink); }
/* What the reboot left standing for the two heading levels this sheet never renamed. The dialog's title is
   an h5 and the register's small print is written in p and li, so their bottom margins are the reason a
   form block sits where it does; the values are Bootstrap's, not a design decision, and they are here so
   that taking the sheet out of the head moves nothing. h1–h4 keep the zero above, which the theme already
   won over the reboot by loading last. */
h5, h6 { margin-top: 0; margin-bottom: .5rem; }
p, ul, ol, dl { margin-top: 0; margin-bottom: 1rem; }
img, svg { vertical-align: middle; }
table { caption-side: bottom; border-collapse: collapse; }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; }
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- 2. Shell: sidebar, topbar, content ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sb-w);
    background: linear-gradient(180deg, #10202f 0%, var(--sb-bg) 40%, var(--sb-bg-2) 100%);
    color: #cfd9e2;
    position: fixed;
    top: var(--shell-gap); left: var(--shell-gap); bottom: var(--shell-gap);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: width .18s ease;
    overflow: hidden;
}
.sidebar::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-2));
}
.sidebar.mini { width: var(--sb-w-mini); }

.sb-brand { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; position: relative; }
/* The brand's own blue-to-gold hairline, the same seam the topbar wears, ruling the identity off the menu. */
.sb-brand::after {
    content: ''; position: absolute; left: 16px; right: 16px; bottom: 0;
    height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--blue), var(--gold));
}
/* The company mark sits on the dark rail itself — no gold plate behind gold — at a size the eye can read,
   with a soft gold glow rather than a filled tile. */
.logo-tile {
    width: 46px; height: 46px; flex: 0 0 46px;
    border-radius: 12px;
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 18px rgba(234, 166, 15, .30);
    overflow: hidden;
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.sb-title { font-weight: 800; font-size: 16px; color: #fff; line-height: 1.25; letter-spacing: .01em; }
.sb-collapse {
    margin-left: auto; flex: 0 0 34px;
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid #2b4055;
    background: #16283c;
    color: #9fb0c0;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.sb-collapse:hover { color: var(--gold-2); border-color: var(--gold); }
.sidebar.mini .sb-title, .sidebar.mini .sb-section, .sidebar.mini .sb-item span:not(.sb-ico),
.sidebar.mini .sb-group span:not(.sb-ico),
.sidebar.mini .sb-foot-info, .sidebar.mini .sb-caret, .sidebar.mini .sb-sub-label { display: none; }
.sidebar.mini .sb-item { justify-content: center; padding: 10px; }
.sidebar.mini .sb-sub { padding-left: 0; }
.sidebar.mini .sb-group { justify-content: center; padding: 10px; }
.sidebar.mini .sb-brand { flex-direction: column; align-items: center; gap: 10px; padding: 14px 8px 12px; }
.sidebar.mini .sb-brand::after { left: 10px; right: 10px; }
.sidebar.mini .logo-tile { width: 40px; height: 40px; flex: 0 0 40px; }
.sidebar.mini .sb-collapse { margin-left: 0; }
.sidebar.mini .sb-footer { justify-content: center; padding: 12px 8px; }

.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 10px; }
.sb-nav::-webkit-scrollbar { width: 5px; }
.sb-nav::-webkit-scrollbar-thumb { background: #22364b; border-radius: 4px; }

.sb-section {
    padding: 14px 20px 6px;
    font-size: 10px;
    letter-spacing: .14em;
    color: #66798c;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}
.sb-item {
    display: flex; align-items: center; gap: 11px;
    margin: 2px 10px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #b9c6d2;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    background: transparent;
    width: calc(100% - 20px);
    text-align: left;
}
.sb-item:hover { background: #16283c; color: #fff; }
.sb-item.active {
    background: linear-gradient(90deg, #f2b41c, #eaa60f);
    color: #241600;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(234, 166, 15, .35);
}
.sb-item .sb-ico { width: 18px; height: 18px; flex: 0 0 18px; display: flex; align-items: center; justify-content: center; }
.sb-item .sb-ico svg { width: 17px; height: 17px; }
.sb-caret { margin-left: auto; color: #7d8fa1; display: flex; align-items: center; }
.sb-group {
    display: flex; align-items: center; gap: 11px;
    margin: 2px 10px;
    padding: 9px 12px;
    border-radius: 9px;
    width: calc(100% - 20px);
    border: none; background: transparent;
    color: #b9c6d2; font-size: 13px; font-weight: 600;
    cursor: pointer; text-align: left; white-space: nowrap;
    font-family: inherit;
}
.sb-group:hover { background: #16283c; color: #fff; }
.sb-group.opened { color: var(--gold-2); }
.sb-group.opened .sb-caret { color: var(--gold-2); }
.sb-sub { padding-left: 22px; }
.sb-sub .sb-item { font-size: 12.5px; padding: 7px 12px; }

.sb-footer {
    border-top: 1px solid var(--sb-line);
    padding: 12px 14px 16px;
    display: flex; align-items: center; gap: 10px;
}
.sb-avatar {
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: 50%;
    background: #1d3350;
    color: #dfe7ee;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px;
    position: relative;
}
.sb-avatar .dot {
    position: absolute; right: -1px; bottom: -1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #22c55e; border: 2px solid var(--sb-bg);
}
.sb-foot-info { min-width: 0; }
.sb-foot-info .n { font-size: 12.5px; font-weight: 800; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-foot-info .r { font-size: 10px; letter-spacing: .1em; color: #7d8fa1; font-weight: 700; }

.main {
    margin-left: calc(var(--sb-w) + var(--shell-gap) * 2);
    padding: var(--shell-gap) var(--shell-gap) var(--shell-gap) 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left .18s ease;
}
.main.mini { margin-left: calc(var(--sb-w-mini) + var(--shell-gap) * 2); }

.topbar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 9px 18px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: var(--shell-gap); z-index: 50;
    min-height: 56px;
    gap: 12px;
}
/* The reference shell rules the topbar off with a blue-to-gold hairline rather than a full-width border;
   inset from the rounded corners so it reads as a line drawn on the card, not the card's own edge. */
.topbar::after {
    content: '';
    position: absolute; left: 16px; right: 16px; bottom: 0;
    height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, var(--blue), var(--gold));
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.crumb .home { display: flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 700; }
.crumb .sep { color: #b6c2ce; }
.crumb .cur { color: var(--ink); font-weight: 700; }
.top-right { display: flex; align-items: center; gap: 12px; }

/* The Office Supplies shell has no mobile menu button because its sidebar is off-canvas below 992px
   and simply cannot be opened there. This register is used on a phone by the people who deploy things,
   so the drawer needs a handle: hidden on a desktop where the sidebar is always standing, shown when it
   slides away. */
.sb-burger {
    display: none;
    width: 34px; height: 34px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 34px;
}
.sb-burger:hover { color: var(--gold-dark); border-color: #f0d896; }

.bell-btn {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: #4a5c6e;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.bell-btn:hover { color: var(--gold-dark); border-color: #f0d896; }
.bell-badge {
    position: absolute; top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 10px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--card);
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 12px 6px 7px;
    box-shadow: var(--shadow);
    cursor: pointer;
}
.user-chip .av {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, #2f80e0, #1668c7);
    color: #fff; display: flex; align-items: center; justify-content: center;
}
.user-chip .n { font-size: 12.5px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.user-chip .r { font-size: 10.5px; color: var(--muted); font-weight: 600; }

.chip-dropdown {
    position: fixed; top: calc(var(--shell-gap) + 62px); right: 22px; z-index: 80;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 14px 40px rgba(16, 42, 67, .14);
    min-width: 230px; overflow: hidden;
}
.chip-header { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.chip-name { font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.chip-role { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.chip-item {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    width: 100%; border: 0; background: transparent;
    padding: 11px 16px; cursor: pointer; text-align: left;
    font-size: 13.5px; font-weight: 600; color: #3c4f63;
    transition: background .15s; font-family: inherit;
}
.chip-item:hover { background: #f4f6f9; }
.chip-item .ico-wrap { color: #7b8fa3; flex-shrink: 0; }
.chip-form { margin: 0; }
.chip-logout { color: #c0392b; }
.chip-logout:hover { background: #fef2f2; }
.chip-logout .ico-wrap { color: #c0392b; }

/* The encapsulating container: the whole page body rests on one white card floating in the gutter, the
   way the reference master page wraps its content, instead of sitting directly on the page background. */
.content {
    margin-top: var(--shell-gap);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px 22px 26px;
    flex: 1; min-width: 0;
}

/* ---------- 3. Page head, section labels ---------- */
/* Inside the encapsulating content card the page head is a header row, not a second card: transparent,
   unbordered, ruled off below by one line — the reference master page's title band. */
.page-head {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 2px 2px 16px;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    box-shadow: none;
}
.ph-title {
    font-size: 26px; font-weight: 800; color: var(--ink);
    display: flex; align-items: center; gap: 11px;
    line-height: 1.15;
}
.ph-title::before { content: '\25C6'; color: var(--gold); font-size: 17px; }
.ph-sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; font-weight: 500; }
.ph-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ph-crumb { margin-bottom: 8px; }
.chip-updated {
    background: #f1f4f8; border: 1px solid var(--line);
    color: #5b6b7b; font-size: 11.5px; font-weight: 600;
    padding: 7px 13px; border-radius: 999px;
    display: inline-flex; gap: 7px; align-items: center;
    white-space: nowrap;
}

.sec-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
    color: #8a97a5; margin: 4px 2px 10px;
    text-transform: uppercase;
}
.sec-label::before {
    content: '';
    width: 13px; height: 11px;
    background:
        linear-gradient(var(--gold), var(--gold)) 0 4px / 3px 7px no-repeat,
        linear-gradient(var(--gold-2), var(--gold-2)) 5px 0 / 3px 11px no-repeat,
        linear-gradient(var(--gold), var(--gold)) 10px 2px / 3px 9px no-repeat;
}

/* A section label that brings its own leading element — an icon on a trail, a number on a register form —
   drops the gold bar, which is the glyph for a label that has nothing else to say it is a heading. */
.sec-label.lead::before { content: none; width: 0; height: 0; background: none; }

/* The numbered step of a long form, in the label's own small caps. A disc rather than a bare digit so it
   holds the same visual weight as the icon tiles beside the other headings. */
.sec-label > .num {
    width: 19px; height: 19px; flex: 0 0 19px; border-radius: 7px;
    background: var(--gold-soft); border: 1px solid #f0d896; color: var(--gold-dark);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10.5px; font-weight: 800; letter-spacing: 0;
}

/* The numbered step of a long form, and the only thing it owns is the gap to the next one — the label
   inside already supplies the space above its fields. */
.form-sec { margin-bottom: 18px; }
.form-sec:last-child { margin-bottom: 0; }

/* ---------- 4. KPI cards ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.kpi-grid.wide { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
/* A strip written for a page that has exactly six counts. `auto-fit` is right for a register that reads
   its own number of tiles, but it puts five in the first row and leaves the sixth alone under them, which
   reads as a card that fell off rather than a strip of six. Three over three is the same six with a shape,
   and it gives every tile the width its foot line needs — the movement ledger's total says
   "235 out · 26 back" and must not have to break it in half. */
.kpi-grid.six { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .kpi-grid.six { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .kpi-grid.six { grid-template-columns: 1fr; } }
.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    border-radius: 11px;
    padding: 15px 17px 13px;
    position: relative;
    box-shadow: var(--shadow);
    min-height: 108px;
    text-align: left;
    font-family: inherit;
    color: var(--ink-2);
    width: 100%;
    display: block;
}
button.kpi, a.kpi { cursor: pointer; }
/* A KPI that navigates is a card first and a link second: the tile paints every piece of its own text, so
   the only thing the anchor would add is an underline across the number. */
a.kpi { text-decoration: none; }
button.kpi { border-left-width: 4px; }
.kpi:hover { box-shadow: 0 4px 14px rgba(16, 42, 67, .09); }
.kpi .t { font-size: 12.5px; font-weight: 700; color: #3c4f63; padding-right: 44px; }
.kpi .v { font-size: 27px; font-weight: 800; color: var(--ink); margin-top: 7px; letter-spacing: -.01em; }
/* The dashboard's value card prints a peso total — "₱1,048,917.25" — thirteen unbroken glyphs that, at
   the strip's 27px, run wider than a card narrowed to its 215px floor on a small laptop window. Scoped to
   the dashboard so no register's short counts shrink: a touch smaller so the figure keeps one line at the
   narrowest desktop track, and `overflow-wrap: anywhere` as the hard guarantee that an even narrower phone
   track breaks the figure inside its card rather than pushing the page sideways. */
.dash-kpis .kpi .v { font-size: 23px; line-height: 1.2; overflow-wrap: anywhere; }
.kpi .f { font-size: 11px; color: var(--muted); margin-top: 9px; display: flex; gap: 6px; align-items: center; font-weight: 500; }
.kpi .ic {
    position: absolute; top: 13px; right: 13px;
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
}
.kpi .ic svg { width: 18px; height: 18px; }

/* The register's cards are filters, so one of them is always the one holding the grid.
   A card with no pressed state would leave the operator reading a number and guessing. */
.kpi.on {
    box-shadow: 0 0 0 2px var(--gold), 0 6px 18px rgba(234, 166, 15, .22);
    background: linear-gradient(180deg, #fffdf7, #fff);
}
.kpi.on .v { color: var(--gold-dark); }

.c-blue { border-left-color: var(--blue); }
.c-green { border-left-color: var(--green); }
.c-gold { border-left-color: var(--gold); }
.c-purple { border-left-color: var(--purple); }
.c-red { border-left-color: var(--red); }
.c-indigo { border-left-color: var(--indigo); }
.c-teal { border-left-color: var(--teal); }
.c-pink { border-left-color: var(--pink); }
.c-orange { border-left-color: var(--orange); }
.c-gray { border-left-color: #98a6b4; }

.ic-blue { background: var(--blue-soft); color: var(--blue); }
.ic-green { background: var(--green-soft); color: var(--green); }
.ic-gold { background: var(--gold-soft); color: var(--gold-dark); }
.ic-purple { background: var(--purple-soft); color: var(--purple); }
.ic-red { background: var(--red-soft); color: var(--red); }
.ic-indigo { background: var(--indigo-soft); color: var(--indigo); }
.ic-teal { background: var(--teal-soft); color: var(--teal); }
.ic-pink { background: var(--pink-soft); color: var(--pink); }
.ic-orange { background: var(--orange-soft); color: var(--orange); }
.ic-gray { background: #eef1f5; color: #5b6b7b; }

/* ---------- 5. Layout grids and panels ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
/* A grid track is `minmax(auto, Nfr)`, and that `auto` floor is the widest thing the column cannot
   break — a 300px canvas before Chart.js sizes it, a long unbroken number. Left at `auto`, one such
   child forces its whole track wider than its share and the page grows a horizontal scrollbar. Giving
   every grid child `min-width: 0` lets the track shrink to its fraction and makes the child clip or
   scroll inside its own card instead of pushing the page. The panels already carry this; their column
   wrappers need it too, or the panel's own `min-width: 0` never gets the chance to act. */
.grid-2 > *, .grid-2-1 > *, .grid-1-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
@media (max-width: 1200px) { .grid-2, .grid-2-1, .grid-1-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    display: flex; flex-direction: column;
    min-width: 0;
}
.panel-h {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid #eef2f6;
}
/* The title block grows to fill the row and may shrink to nothing, so the icon and title always hold the
   first line and the control cluster (`.ctrl`) is what falls to a second line when the plate is too narrow
   to seat them side by side. Without this the dashboard's right column — "Recent Activity" carries a
   "View all" link plus a three-button segment that cannot shrink below ~221px — pushed its controls past
   the page edge at laptop widths and drew a horizontal scrollbar. `min-width:0` is the same escape hatch
   the grid tracks use: it lets the block shrink past its own min-content instead of forcing the overflow. */
.panel-h > div:not(.pic):not(.ctrl) { flex: 1 1 auto; min-width: 0; }
.panel-h .pic {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 36px;
}
.panel-h .pic svg { width: 18px; height: 18px; }
.panel-h .pt { font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.panel-h .ps { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.panel-h .ctrl { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.panel-b { padding: 16px 18px; flex: 1; min-width: 0; }
.panel-b.tight { padding: 0; }

/* A segment that navigates rather than filters is still a segment. Account Management's sibling strip moves
   between three registers that are three addresses, so its tabs are links the Back button and a copied
   address can follow — and a link wears the same pill as the button beside it or the strip reads as two
   different kinds of control. */
.seg {
    display: flex; background: #f1f4f8; border: 1px solid var(--line);
    border-radius: 999px; padding: 3px; gap: 2px;
}
.seg button, .seg a {
    border: 0; background: transparent;
    padding: 5px 13px; font-size: 11.5px; font-weight: 700;
    color: #6b7a89; border-radius: 999px; cursor: pointer;
    font-family: inherit; white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
}
.seg a { text-decoration: none; }
.seg button svg, .seg a svg { width: 13px; height: 13px; flex: 0 0 13px; }
.seg button.on, .seg a.on { background: #fff; color: var(--gold-dark); box-shadow: 0 1px 3px rgba(0, 0, 0, .13); }
/* A strip that stands on its own under a page head rather than inside a bar or a header slot: it takes only
   its own width — a full-width track of pills would read as a progress bar — and the theme's rhythm below. */
.seg.tabs { width: max-content; max-width: 100%; flex-wrap: wrap; margin-bottom: 14px; }
/* The same strip when its options carry a count. The archive's scopes each say how many records they hold,
   and that number is a fact about the option rather than its name: it keeps a lighter, greyer weight so the
   label stays the thing being read, and takes the pressed colour only when the scope is the one in force. */
.seg button b, .seg a b { color: #8a97a5; font-weight: 800; font-variant-numeric: tabular-nums; }
.seg button.on b, .seg a.on b { color: var(--gold-dark); }
/* Inside a dialog or a drawer the track has to answer to the card's width, not to its own captions. The
   mode switch ("Assign to Employee" / "Add to Available Stock"), the camera device-type pills and the
   category's IT / Non-IT / Camera strip are all `.seg`, and their buttons keep `white-space:nowrap` so a
   label never breaks mid-word — which on a 320px phone pushed the second pill past the body's edge and out
   of the scroll region. Letting the track wrap drops the overflow pill onto a second line instead; at every
   width where the pair already fits, wrap never fires, so the desktop strip is unchanged. `min-width:0`
   lets a pill shrink to the track rather than hold its intrinsic width, and the rounded track reads as a
   two-row block once it wraps rather than a clipped single row. */
.modal-body .seg, .sp-body .seg { flex-wrap: wrap; max-width: 100%; }
.modal-body .seg button, .sp-body .seg button,
.modal-body .seg a, .sp-body .seg a { min-width: 0; max-width: 100%; }

.chip {
    background: #f1f4f8; border: 1px solid var(--line);
    border-radius: 999px; padding: 5px 12px;
    font-size: 11.5px; font-weight: 700; color: #5b6b7b;
    display: inline-flex; gap: 6px; align-items: center;
    white-space: nowrap;
}
.chip.gold { background: var(--gold-soft); border-color: #f0d896; color: var(--gold-dark); }
.chip.green { background: var(--green-soft); border-color: #cdead9; color: var(--green); }
.chip.red { background: var(--red-soft); border-color: #f6cfd8; color: var(--red); }
.chip.blue { background: var(--blue-soft); border-color: #cfe1f8; color: var(--blue); }
.chip button, button.chip { border: 0; cursor: pointer; font-family: inherit; }

/* ---------- 5b. Scope band ----------
   The sentence a register shows while one of its cards is holding the grid: what is on screen, what that
   slice is worth, and how to leave it. It carries the same gold left stripe as a pressed `.kpi`, because
   it is the same state read from the other end — the card says "this one is on", the band says what on
   means in numbers. Nothing here is new furniture; lead, agg and acts are the panel header's own flex
   rhythm on a smaller scale. */
.scope-band {
    display: flex; align-items: center; gap: 10px 20px; flex-wrap: wrap;
    background: #fffdf7;
    border: 1px solid #f0d896; border-left: 3px solid var(--gold);
    border-radius: 11px;
    padding: 11px 14px; margin-bottom: 14px;
}
.scope-lead { display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; min-width: 0; }
.scope-heading { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.scope-heading b { font-size: 14px; font-weight: 800; color: var(--ink); }
.scope-count { font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* The filter that is holding, wearing the dismissible shape of a chip: label plus ✕, one click to leave. */
.scope-chip {
    background: var(--gold-soft); border: 1px solid #f0d896; color: var(--gold-dark);
    border-radius: 999px; padding: 4px 10px;
    font-size: 11px; font-weight: 800; font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.scope-chip:hover { background: #fbe9bd; border-color: var(--gold); }
.scope-chip svg { width: 11px; height: 11px; }

.scope-agg { display: flex; gap: 6px 22px; flex-wrap: wrap; }
.scope-agg > div { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8a97a5; }
.scope-agg b { display: block; font-size: 14px; font-weight: 800; letter-spacing: -.2px;
    color: var(--ink); text-transform: none; }
.scope-acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 991.98px) { .scope-acts { margin-left: 0; } }

/* ---------- 5c. The register chooser ----------
   Account Management's landing: thirteen credential registers behind one address, so the landing has to say
   what each one holds and hand the operator over to it. Nothing in the supplies system was ever this shape
   — a plate you can press, carrying a three-row sample of the grid it opens — so the card is the theme's own
   `.panel` and only what a panel never needed is added here: the anchor reset, the gold ring on hover, the
   footer that says what the strip above it is worth, and a preview table whose head keeps quiet.

   The quiet head is the one deliberate departure from a register grid. `.tbl thead th` is navy with a gold
   rule because on a full grid it is the band that labels a screenful of rows and anchors the sticky top;
   inside a chooser card the same band reads as a second title above the card's own, and seven of them turn
   the landing into a wall of dark bars. The card's header already names the register, so the preview's head
   only has to separate itself from its rows — and it must stop sticking, or the first card scrolled past
   paints its column labels over the last. */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cat-grid > .cat-card.full { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .cat-grid { grid-template-columns: 1fr; } }

a.cat-card { color: inherit; text-decoration: none; }
.cat-card {
    margin-bottom: 0; cursor: pointer;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.cat-card:hover { border-color: #f0d896; box-shadow: 0 6px 18px rgba(16, 42, 67, .10); }
.cat-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-color: #f0d896; }
.cat-card .panel-h { padding: 13px 16px; }

/* Full-bleed inside the plate, so the wrap gives up its own border the way every register grid held by a
   `.panel` does, and clips its own corners rather than letting a row overflow the card's radius. */
.cat-card .tbl-wrap { border: 0; border-radius: 0; background: transparent; overflow: hidden; }
.cat-card .tbl thead th {
    position: static;
    background: #f6f9fc; color: #64748b;
    border-bottom: 1px solid var(--line);
    font-size: 9.5px; letter-spacing: .07em; padding: 8px 14px;
}
.cat-card .tbl tbody td { padding: 8px 14px; font-size: 12px; }
.cat-card .tbl tbody tr:hover { background: #fffdf7; }

/* A register whose rows live in more than one table — the cloud trio, the two renewal registers — cannot be
   sampled in three columns, so its card carries a sentence about the split instead of a fake preview. */
.cc-note {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 16px; font-size: 12.5px; font-weight: 600; color: #3c4f63;
}
.cc-note .pic {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.cc-note .pic svg { width: 18px; height: 18px; }

.cat-card .cc-foot {
    display: flex; align-items: center; gap: 10px; margin-top: auto;
    padding: 9px 16px; border-top: 1px solid #eef2f6;
    font-size: 11px; font-weight: 600; color: var(--muted);
}
.cat-card .cc-go {
    margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 800; color: var(--gold-dark);
}
.cat-card:hover .cc-go { color: var(--gold); }

/* ---------- 6. Filter toolbar ---------- */
.filter-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.filter-bar .grow { flex: 1; min-width: 180px; }
.filter-bar .right-side { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.filter-label { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a97a5; }

/* The toolbar when it lives inside the register's plate rather than standing above it as its own card — the
   IT register's filter band, seated on the top of the table and above the navy column headers. It keeps the
   same flex-wrap flow (a growing search box, auto-width selects, a right-pushed export) but gives up the card
   chrome: no border, radius, shadow or margin of its own, so it reads as one surface with the rows beneath it.
   A shade of the hover grey tints the band off the white rows, and one rule along its foot is the line between
   the filters and the table head. The selects are capped at the band's width so a long company or holder
   caption can never push the plate past the viewport. */
.filter-bar.embedded {
    background: #f8fafc;
    border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
    box-shadow: none; margin: 0; padding: 10px 14px;
    /* One row, always. The band is the plate's own toolbar line: search, every dropdown, Apply/Clear and the
       right-pushed export sit on a single baseline above the navy column headers. Controls keep their natural
       width (flex: 0 0 auto) and the search box absorbs the leftover, so at a desk the whole set reads across
       one line; when a window is genuinely too narrow to hold them, the band scrolls sideways in the theme's
       own slim scrollbar rather than wrapping to a second row or clipping a caption. */
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; gap: 5px;
    container-type: inline-size; container-name: filterband;
    scrollbar-width: thin; scrollbar-color: #c4cfdb #eef2f6;
}
.filter-bar.embedded::-webkit-scrollbar { height: 6px; }
.filter-bar.embedded::-webkit-scrollbar-track { background: #eef2f6; }
.filter-bar.embedded::-webkit-scrollbar-thumb { background: #c4cfdb; border-radius: 999px; }
.filter-bar.embedded::-webkit-scrollbar-thumb:hover { background: var(--gold); }
/* Compact control metrics so the full set fits one row at a desk: a shorter search box, tighter select and
   button padding, and a smaller caption type. The select keeps room on its right for the theme's own handle,
   and a cap stops one long company or holder option from stretching its box past the closed caption's needs. */
.filter-bar.embedded .grow { flex: 1 0 120px; min-width: 120px; }
.filter-bar.embedded .search-box { min-width: 0; padding: 5px 9px; }
.filter-bar.embedded .search-box input { font-size: 11.5px; }
.filter-bar.embedded .inp.auto { flex: 0 0 auto; min-width: 0; max-width: 126px; font-size: 11.5px; padding: 5px 24px 5px 8px; }
.filter-bar.embedded .btn-sm { flex: 0 0 auto; padding: 5px 8px; font-size: 11px; }
.filter-bar.embedded .chip { flex: 0 0 auto; font-size: 10.5px; padding: 3px 7px; }
.filter-bar.embedded .right-side { margin-left: auto; flex: 0 0 auto; flex-wrap: nowrap; gap: 5px; }
/* The holding-count chip is the one control the row can lose without losing information — the selects already
   show every value that is holding — so on a band too narrow to seat the whole set it steps out and the
   search, dropdowns, Apply/Clear and export keep the single row. Phones keep it (the band stacks there). */
@container filterband (601px <= width <= 1075px) {
    .filter-bar.embedded .chip { display: none; }
}
/* On a phone one row of eight controls is unreadable, so the band gives up the single line and stacks: the
   search takes a line of its own, the selects pair up two to a row, and the export drops its right-push to sit
   with the actions. Nothing keeps a min-width that could overflow a 320px plate. */
@media (max-width: 600px) {
    .filter-bar.embedded { flex-wrap: wrap; overflow-x: visible; padding: 12px; gap: 8px; }
    .filter-bar.embedded .grow { flex: 1 1 100%; min-width: 0; }
    .filter-bar.embedded .inp.auto { flex: 1 1 calc(50% - 4px); min-width: 0; max-width: none; }
    .filter-bar.embedded .right-side { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; }
}
/* Below 360px the two-up select is narrower than its longest closed caption ("All Departments"), and a
   native select clips that text rather than wrapping it. Giving each select the full line keeps every
   caption readable on the smallest phones; the band grows taller, which a phone scrolls vertically anyway,
   and it still seats above the column headers without pushing the plate sideways. */
@media (max-width: 360px) {
    .filter-bar.embedded .inp.auto { flex: 1 1 100%; }
}

.search-box {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #d6dee7; border-radius: 9px;
    padding: 8px 12px; min-width: 220px;
    color: #8a97a5;
}
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(234, 166, 15, .15); }
.search-box input { border: none; outline: none; font-size: 12.5px; width: 100%; font-family: inherit; color: var(--ink); background: transparent; }
/* The toolbar's own control width. `.inp` is written for a form, where a field fills its `.fld` column and
   100% is right; in a filter bar the same width makes a control take a row to itself, which is how a date
   box ended up printing full-bleed on every register that has one. `.auto` is only ever written on a
   select or a date input — never on a text field — so this is the toolbar's rule rather than a general one.
   The floor keeps a control with nothing in it ("Any action", an empty date) from shrinking under the width
   of its own placeholder. */
.inp.auto { width: auto; min-width: 150px; }

/* ---------- 7. Tables ---------- */
.tbl-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); background: #fff; scrollbar-width: thin; scrollbar-color: #c4cfdb #f1f4f8; }
/* The sideways scroll a wide register earns is drawn in the theme's own hand rather than the browser's
   default grey bar: a slim track in the page's grey, a thumb in the line colour that warms to gold under the
   pointer — the same affordance the sidebar's vertical scroll already wears. The two-property form above is
   Firefox's; the pseudo-elements below are the same idea for Chromium and Safari. */
.tbl-wrap::-webkit-scrollbar { height: 9px; }
.tbl-wrap::-webkit-scrollbar-track { background: #f1f4f8; }
.tbl-wrap::-webkit-scrollbar-thumb { background: #c4cfdb; border-radius: 999px; border: 2px solid #f1f4f8; }
.tbl-wrap::-webkit-scrollbar-thumb:hover { background: var(--gold); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl thead th {
    background: #15263b;
    color: #e8eef5;
    text-align: left;
    font-size: 10.5px;
    letter-spacing: .09em;
    font-weight: 800;
    padding: 11px 14px;
    border-bottom: 3px solid var(--gold);
    text-transform: uppercase;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.tbl thead th.sortable { cursor: pointer; user-select: none; }
.tbl thead th.sortable:hover { color: #fff; }
.tbl thead th .dir { color: var(--gold-2); margin-left: 5px; font-size: 10px; }
.tbl tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #eef2f6;
    color: var(--ink-2);
    vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl tbody tr.clickable { cursor: pointer; }

/* A ticked row keeps a tint of its own. A bulk bar that counts five selected rows the eye cannot find
   sends the operator back to the checkboxes to count them again, which is the one thing a selection is
   supposed to make unnecessary. Gold rather than the theme's blue, because blue here is what the system
   chose — a pressed card, a filter that is holding — and gold is what the person chose. */
.tbl tbody tr.sel { background: var(--gold-soft); }
.tbl tbody tr.sel:hover { background: #fdf3d8; }
.tbl tbody tr.sel td { border-bottom-color: #f0e2b6; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.tbl .nowrap { white-space: nowrap; }
/* The tick box, in the body and in the head. The select-all box sits in a `<th>` on every register that has
   a bulk action, and a rule that only reaches `<td>` leaves that one box at the browser's own 13px and the
   browser's own blue — so the control that chooses the whole page is the one control that does not match the
   pages it chooses. */
.tbl td .chk, .tbl th .chk { width: 16px; height: 16px; accent-color: var(--gold-dark); cursor: pointer; }
.cell-title { font-weight: 800; color: var(--ink); font-size: 12.5px; }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.cell-key { font-weight: 800; color: var(--ink); font-size: 12.5px; font-variant-numeric: tabular-nums; }
/* Two chips in one cell — an event verb beside its severity on the trail, a badge beside a status in a
   ledger. `.chip`, `.pill` and `.tx-type` are all inline-flex boxes carrying no margin of their own, so
   written side by side they touch and read as one shape; this gives them the rail's own 6px and lets the
   pair fold onto a second line in a narrow column instead of overflowing into its neighbour. */
.cell-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* A chip stops at its cell. On the auto table layout a chip's column grows to its widest chip, which is
   how the Activity Log spends 181px saying "System Users & Access" and nobody minds; on a fixed-layout
   register the column is whatever the page declares, and a chip that outruns it painted straight over its
   neighbour — two labels reading as one word. So both chips are capped at the cell and keep their icon's
   14px, and a page that wants the overflow shown as an ellipsis rather than a cut puts its label in a
   `.truncate` span and the whole words in the row's title. */
.mod-badge, .tx-type { max-width: 100%; overflow: hidden; }
.mod-badge > svg, .tx-type > svg { flex: 0 0 auto; }
.mono-pill {
    background: #eef2f7; border: 1px solid #dfe6ee; border-radius: 7px;
    padding: 4px 9px;
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 11.5px; font-weight: 700; color: #2a3d52;
    white-space: nowrap;
}
/* There is deliberately no holder tile in this sheet. The registers used to put a person's two initials in
   a 30px square beside their name, which repeated a name the cell had already printed in full, and a row
   with no holder had to skip the square or teach everyone to ignore it. A holder cell is `.cell-title` over
   `.cell-sub`, exactly as /employees spells a person; `.tile` below is a device-type glyph, not a letter. */

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; padding: 4px 11px;
    font-size: 11px; font-weight: 800; white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.gold { background: var(--gold-soft); color: var(--gold-dark); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: #eef1f5; color: #5b6b7b; }
.pill.purple { background: var(--purple-soft); color: var(--purple); }
.pill.teal { background: var(--teal-soft); color: #0b6f9f; }
.pill.indigo { background: var(--indigo-soft); color: var(--indigo); }
.pill.orange { background: var(--orange-soft); color: #b45309; }
.pill.nope::before { display: none; }

.abtn {
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; margin-right: 6px;
    background: #eef1f5; color: #5b6b7b;
    vertical-align: middle;
}
.abtn svg { width: 15px; height: 15px; }
.abtn.view { background: var(--blue-soft); color: var(--blue); border-color: #cfe1f8; }
.abtn.edit { background: var(--green-soft); color: var(--green); border-color: #cdead9; }
.abtn.del { background: var(--red-soft); color: var(--red); border-color: #f6cfd8; }
.abtn.warn { background: var(--gold-soft); color: var(--gold-dark); border-color: #f0d896; }
.abtn:hover { filter: brightness(.96); }
.abtn:disabled { opacity: .4; cursor: not-allowed; filter: none; }

.kebab {
    width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; color: #5b6b7b;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.kebab:hover { background: #f4f7fa; color: var(--ink); }
.menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
    background: #fff; border: 1px solid var(--line); border-radius: 11px;
    box-shadow: 0 14px 34px rgba(16, 42, 67, .16);
    min-width: 208px; overflow: hidden; padding: 4px;
}
.menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    border: 0; background: transparent; cursor: pointer;
    padding: 9px 11px; border-radius: 8px;
    font-size: 12.5px; font-weight: 700; color: #3c4f63; font-family: inherit;
    text-align: left;
}
.menu button:hover { background: #f4f7fa; }
.menu button svg { width: 15px; height: 15px; color: #7b8fa3; flex: 0 0 15px; }
.menu button.warn { color: var(--gold-dark); }
.menu button.warn svg { color: var(--gold-dark); }
.menu button.danger { color: var(--red); }
.menu button.danger svg { color: var(--red); }
.menu button:disabled { opacity: .45; cursor: not-allowed; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
/* A menu that has to explain itself before it offers its answers. The archive's restore ask names the rule
   a record is checked against — a live row holding the same identity keeps it archived — because a yes/no
   over an unexplained collision rule is a coin toss, and a paragraph that is not allowed to wrap is a
   paragraph nobody reads. */
.menu .mnote { padding: 8px 10px 7px; font-size: 11.5px; font-weight: 600; line-height: 1.45;
    color: var(--muted); white-space: normal; }
.menu .mnote strong { color: #5b6b7b; }
.menu-wrap { position: relative; display: inline-block; }

/* ---------- 7b. The device tree ----------
   One register in this app has rows that own other rows: CCTV lists each NVR and the cameras and monitors
   linked to it. The theme's `.tbl` is a flat list, so a hierarchy needs three things a table does not get by
   accident — a parent that reads as a parent before it is read as a row, an indent that survives the
   horizontal scroll the register's ten columns force, and a connector that says "this row hangs off the one
   above" without a rule a stylesheet has to keep in step with the row height.

   All of it is painted from tokens the rest of the sheet already uses. A parent's cells take a 4% wash of
   the sidebar's ink so the group sits between the header and a normal row rather than looking like a second
   header, and its hover has to be re-declared because a background on the <td> covers the one on the <tr>.
   The phantom group — the register's "Unassigned Devices" bucket, which is a placeholder rather than a
   record — is set in the theme's muted grey so nobody looks for the details of a row that has none. */
.tbl tbody tr.grp > td { background: #f3f7fb; border-bottom-color: #e2eaf2; }
.tbl tbody tr.grp:hover > td { background: #eaf1f8; }
.tbl tbody tr.grp.sel > td { background: var(--gold-soft); border-bottom-color: #f0e2b6; }
.tbl tbody tr.phantom > td, .tbl tbody tr.phantom:hover > td { background: #fafbfd; }
.tbl tbody tr.phantom .cell-title { color: var(--muted); }

/* The name's own line: a tile, then the name over whatever qualifies it. The tile is a 30px square with a
   glyph in it rather than a letter, so a device row and a holder row are the same shape and
   the same size — the registers that name a person and the register that names a recorder read as one
   alphabet. It stays the theme's neutral grey on purpose: the type column beside it already wears the
   colour, and a second chip of the same hue two cells away is the same fact said twice. */
.tree { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tree .tile { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px;
    background: #eef2f7; color: #3c4f63;
    display: inline-flex; align-items: center; justify-content: center; }
.tree .tile svg { width: 15px; height: 15px; }
.tree .txt { min-width: 0; }
.tbl tbody tr.phantom .tree .tile { background: #f4f7fa; color: #a8b4c0; }

/* The expander. The legacy page drew this as a bare 20px chevron with no box, which made it the smallest
   click target on the screen and the one a person aiming for a row's name could hit by accident; it is now
   a bordered button the size of the tile beside it. */
.tree-toggle { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px;
    border: 1px solid var(--line); background: #fff; color: #5b6b7b;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    padding: 0; font-family: inherit; }
.tree-toggle:hover { background: #f4f7fa; color: var(--ink); border-color: #b9c6d2; }
.tree-toggle svg { width: 13px; height: 13px; }

/* A parent with nothing under it still takes the 24px, so every device name in the column starts at one x
   rather than stepping with the presence of a chevron. */
.tree-spacer { width: 24px; flex: 0 0 24px; }

/* The child's elbow: one long stroke pointing at the name, wide enough that a child's tile sits further
   right than its recorder's and the depth is visible without reading the columns. It is drawn from the span
   rather than from a glyph or a pseudo-element reaching upward, because either of those has to guess the
   row's height, and this register's rows grow whenever a remark or a model name wraps. */
.branch { flex: 0 0 34px; height: 2px; border-radius: 2px; background: #d7e0ea; position: relative; }
.branch::after { content: ''; position: absolute; right: -1px; top: -4px; width: 0; height: 0;
    border-left: 5px solid #d7e0ea; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }

/* ---------- 8. Buttons (the Bootstrap names, retaken for the brand) ---------- */
/* A button is one box and four states, and this section now paints all five of them. It did not used to:
   the class names were borrowed from the framework, so its `.btn` came with the geometry and, more quietly,
   with the state machine — `.btn:hover`, `.btn:active` and `.btn:disabled` all read a matching `--bs-btn-*`
   variable, and this sheet's job was only to set those variables to the brand's colours. Taking the sheet
   off the shell routes means taking the states with it, so they are stated here against the same numbers,
   under names that say what they belong to.

    · `text-align`, `vertical-align` and `user-select` are the three properties a button needs and a `<div>`
      layout never supplies: an `<a class="btn">` in a wide footer would otherwise sit its words to the left,
      a control beside a line of prose would sit on its baseline, and double-clicking a label to select it
      would highlight the caption instead of doing nothing.
    · the transition is what makes a hover a change rather than a jump; the framework had it on `.btn` and
      every one of the register's buttons inherited it.
    · the state values live on the variant as custom properties, so four shared rules cover nine tones. That
      is also the first time the four soft tones have had a hover at all: nothing ever set their variables —
      not this sheet, and not the framework, which has no `.btn-soft-green` — so an unset `var()` made the
      declaration invalid at computed-value time and a hovered soft button lost its plate and took the page's
      text colour. `--btn-hover-*` cannot be unset, because every rule that reads it has a fallback. */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    border-radius: 9px; padding: 9px 16px;
    font-size: 12.5px; font-weight: 800; line-height: 1.5;
    border: 1px solid transparent;
    cursor: pointer; font-family: inherit;
    white-space: nowrap; text-align: center; vertical-align: middle;
    -webkit-user-select: none; user-select: none;
    transition: color .15s ease-in-out, background-color .15s ease-in-out,
                border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    --btn-hover-color: var(--ink); --btn-hover-bg: #f4f7fa; --btn-hover-border: transparent;
    --btn-active-color: var(--ink); --btn-active-bg: #eaf0f6; --btn-active-border: transparent;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover:not(:disabled) {
    color: var(--btn-hover-color); background-color: var(--btn-hover-bg);
    border-color: var(--btn-hover-border);
}
.btn:active:not(:disabled) {
    color: var(--btn-active-color); background-color: var(--btn-active-bg);
    border-color: var(--btn-active-border);
}
/* A disabled button keeps its own colour and loses its weight, which is what the register's operators read
   as "this action needs something first". `pointer-events` is the part that was framework's: a disabled
   control that still answers hover paints a state it cannot enter. */
.btn:disabled, .btn.disabled {
    opacity: .55; cursor: not-allowed; pointer-events: none;
}
.btn-primary {
    background: var(--blue); color: #fff; box-shadow: 0 3px 10px rgba(22, 104, 199, .3);
    --btn-hover-color: #fff; --btn-hover-bg: #1258a8; --btn-hover-border: #1258a8;
    --btn-active-color: #fff; --btn-active-bg: #0f4a91; --btn-active-border: #0f4a91;
}
.btn-green {
    background: var(--green); color: #fff; box-shadow: 0 3px 10px rgba(24, 154, 82, .28);
    --btn-hover-color: #fff; --btn-hover-bg: #12813f; --btn-hover-border: #12813f;
    --btn-active-color: #fff; --btn-active-bg: #0e6a34; --btn-active-border: #0e6a34;
}
.btn-red {
    background: var(--red); color: #fff; box-shadow: 0 3px 10px rgba(225, 29, 72, .25);
    --btn-hover-color: #fff; --btn-hover-bg: #be123c; --btn-hover-border: #be123c;
    --btn-active-color: #fff; --btn-active-bg: #9f1234; --btn-active-border: #9f1234;
}
.btn-gold {
    background: linear-gradient(90deg, #f6d47c, var(--gold)); color: #241600;
    box-shadow: 0 3px 12px rgba(234, 166, 15, .35);
    --btn-hover-color: #241600; --btn-hover-bg: #f6bb2c; --btn-hover-border: var(--gold-dark);
    --btn-active-color: #241600; --btn-active-bg: #eeae18; --btn-active-border: var(--gold-dark);
}
.btn-outline {
    background: #fff; border-color: #d6dee7; color: #3c4f63;
    --btn-hover-color: var(--ink); --btn-hover-bg: #f8fafc; --btn-hover-border: #b9c6d2;
    --btn-active-color: var(--ink); --btn-active-bg: #eef3f8; --btn-active-border: #a8b8c8;
}
/* The soft tones are a tinted plate with a darker word on it, so the hover deepens the plate one step rather
   than replacing it — the button must stay recognisably the same action, just answered. */
.btn-soft-green {
    background: var(--green-soft); border-color: #cdead9; color: var(--green);
    --btn-hover-color: var(--green); --btn-hover-bg: #d8f0e1; --btn-hover-border: #b5e2c4;
    --btn-active-color: var(--green); --btn-active-bg: #c7e9d4; --btn-active-border: #9dd3b1;
}
.btn-soft-gold {
    background: var(--gold-soft); border-color: #f0d896; color: var(--gold-dark);
    --btn-hover-color: var(--gold-dark); --btn-hover-bg: #f8e7bd; --btn-hover-border: #e8c877;
    --btn-active-color: var(--gold-dark); --btn-active-bg: #f3dba1; --btn-active-border: #ddba5c;
}
.btn-soft-blue {
    background: var(--blue-soft); border-color: #cfe1f8; color: var(--blue);
    --btn-hover-color: var(--blue); --btn-hover-bg: #dceafb; --btn-hover-border: #b8d3f5;
    --btn-active-color: var(--blue); --btn-active-bg: #c9e0f9; --btn-active-border: #9bc2f0;
}
.btn-soft-red {
    background: var(--red-soft); border-color: #f6cfd8; color: var(--red);
    --btn-hover-color: var(--red); --btn-hover-bg: #fbd9e1; --btn-hover-border: #f4c0cd;
    --btn-active-color: var(--red); --btn-active-bg: #f8c8d3; --btn-active-border: #eda3b5;
}
.btn-sm { padding: 6px 12px; font-size: 11.5px; border-radius: 8px; }
/* The spinner, in its own right. Buttons used to be the only place one appeared — `.btn .spin` below sizes
   it for that context — but the standalone case (a table loading in place, a panel waiting on a query) needs
   the same dish with a box model of its own: `display: inline-block` because a `<span>` with no layout of its
   own cannot rotate a zero-height line box, and currentColor because the control should be the colour of the
   text it replaced rather than a fixed grey. */
.spin {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%;
    animation: rot .7s linear infinite;
    vertical-align: -.125em;
}
.btn .spin {
    width: 14px; height: 14px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%;
    animation: rot .7s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* The ghost is the one tone written both on its own and beside `.btn` (five bare, ten paired), so it carries
   the state tokens *and* its own hover rule: the tokens answer the paired case, where `.btn:hover` is the
   more specific selector, and the rule answers the bare one, where nothing else would. */
.btn-ghost {
    background: transparent; border: 1px solid var(--line); color: var(--muted);
    border-radius: 8px; padding: 5px 8px; cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600;
    --btn-hover-color: var(--ink); --btn-hover-bg: #f8fafc; --btn-hover-border: #b9c6d2;
    --btn-active-color: var(--ink); --btn-active-bg: #eef2f6; --btn-active-border: #a8b8c8;
}
.btn-ghost:hover { background: #f8fafc; color: var(--ink); border-color: #b9c6d2; }

/* ---------- 9. Forms ---------- */
.fld { margin-bottom: 14px; min-width: 0; }
.fld > label, .fld-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 700; color: #3c4f63;
    margin-bottom: 6px;
}
.fld > label .req { color: var(--red); }
/* The same star outside a field label — a panel heading, a dialog's summary — where nothing more specific
   reaches it, so the fall-back carries the theme's own red rather than the legacy brick. */
.req { color: var(--red); }
/* A field whose label carries something on its right — the N/A box, which the asset registers put on
   every serial, brand and location box. The label keeps its own line height so the pair sits level, and
   the row takes the 6px the single-line label would have carried, because the label inside it has its own
   margin zeroed and Bootstrap's `mb-1` is no longer there to supply the gap from outside. */
.fld-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.fld-head > label { margin-bottom: 0; }
.fld-hint { font-size: 10.5px; font-weight: 600; color: #8a97a5; margin-left: 4px; }
.na-box {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: pointer;
    white-space: nowrap;
}
.na-box input { width: 15px; height: 15px; accent-color: var(--gold-dark); cursor: pointer; }
.na-box:hover { color: var(--ink-2); }

.inp, select.inp, textarea.inp {
    width: 100%;
    border: 1px solid #d6dee7;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--ink);
    background: #fff;
    font-family: inherit;
    outline: none;
}
.inp:focus, select.inp:focus, textarea.inp:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(234, 166, 15, .15);
}
.inp::placeholder { color: #a9b6c2; }
/* The grey a box the form will not accept takes. `not-allowed` is here rather than inline because the
   dialogs used to write `cursor:not-allowed` alongside Bootstrap's `--bs-secondary-bg` plate on every
   read-only field; one rule answers all of them and keeps the two halves together. */
.inp:disabled, .inp[readonly] { background: #f6f8fb; color: #6b7a89; cursor: not-allowed; }
.inp-upper { text-transform: uppercase; }
.inp-upper::placeholder { text-transform: none; }
.inp-mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .04em; }
.inp.locked { background: #f6f8fb; color: #6b7a89; }
.inp.err { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225, 29, 72, .10); }
/* One handle, kept vertical: a free corner lets a remark box be dragged sideways into the column beside it,
   and no field in the register is wider than its own grid slot. */
textarea.inp { resize: vertical; }
.err-msg { color: var(--red); font-size: 11px; font-weight: 600; margin-top: 4px; }
.hint { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 5px; }

/* The select, taken over from the browser.

   `.inp` already gave a `<select>` the field's border, radius, focus ring and disabled plate, but a select
   is not a text box: Chrome draws its own arrow in its own grey, hard against the right border, lets a long
   caption run underneath it, and keeps the text cursor on a control whose whole job is to open a list. So
   the handle is authored here — the same down-stroke the search box's magnifier is drawn with, in the same
   grey — and the padding makes room for it. The gold handle on focus is the ring's own colour, so the two
   halves of the affordance change together.

   The pager's rows-per-page box is named alongside `.inp` rather than covered by it. It is the register's
   one `<select>` written without the field class, because it sits inside a sentence of prose and takes the
   pager's smaller padding; leaving it out would put a browser-drawn arrow on the last control of every
   grid in the app. */
select.inp, .pg-size select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238a97a5' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.4 8 10.4 12 6.4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 13px 13px;
    cursor: pointer;
}
select.inp { padding-right: 34px; }
select.inp:hover:not(:disabled), .pg-size select:hover:not(:disabled) { border-color: #b9c6d4; }
select.inp:focus, .pg-size select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a4700a' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.4 8 10.4 12 6.4'/%3E%3C/svg%3E");
}
/* A select with nothing to open is not a select: it is the field the form will not accept. The handle goes
   the same way the box's own text does, and the pointer cursor goes with it, so the box cannot invite a
   click that answers nothing. */
select.inp:disabled {
    cursor: not-allowed;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23c3ccd6' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.4 8 10.4 12 6.4'/%3E%3C/svg%3E");
}
.pg-size select {
    background-position: right 7px center;
    background-size: 11px 11px;
    padding-right: 24px;
}

/* The date box, in the two ways the browser was not asked about.

   <para>The glyph first. Chrome's own calendar is a black outline that belongs to no colour in this system
   and sits at the browser's own size, so it is replaced with the theme's calendar stroke — muted grey at
   rest, gold-dark under the pointer, which is the same pair the search box's magnifier keeps. The
   indicator is Chrome's own button, so `cursor: pointer` is what tells the operator that clicking the
   picture, and not only the text, opens the month.</para>

   <para>The empty state second, and this is the one that misreads. A date box with nothing in it prints
   `mm/dd/yyyy` in exactly the ink a real date prints in, so an unfiltered archive and an archive filtered
   to one week look the same until the text is read. `::placeholder` does not reach a date input and
   `:placeholder-shown` never matches one, so the box says for itself: the field writes `.blank` while its
   value is null — see <c>DateField</c> and <c>DateFilter</c> — and this rule gives the segments the
   placeholder's own grey. A box that has been filled, or cleared back to nothing, is re-marked on the next
   render, which is the same moment its value changes.</para> */
input[type="date"].inp, input[type="time"].inp, input[type="datetime-local"].inp {
    cursor: text;
}
input[type="date"].inp::-webkit-calendar-picker-indicator,
input[type="time"].inp::-webkit-calendar-picker-indicator,
input[type="datetime-local"].inp::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
    width: 17px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a97a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}
input[type="date"].inp:hover::-webkit-calendar-picker-indicator,
input[type="time"].inp:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"].inp:hover::-webkit-calendar-picker-indicator,
input[type="date"].inp:focus::-webkit-calendar-picker-indicator,
input[type="datetime-local"].inp:focus::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a4700a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 11h18'/%3E%3C/svg%3E");
}
.inp.blank::-webkit-datetime-edit { color: #a9b6c2; }
/* The toolbar's own date width. `.auto` floors a control at 150px so a select cannot shrink under its
   caption, but a date box needs less prose and more glyph: 132px is the segments, the 17px indicator and
   the field's own padding, which is what keeps a filter bar's two dates from pushing Apply onto the next
   line on a 1366px screen. */
input[type="date"].inp.auto, input[type="datetime-local"].inp.auto { min-width: 132px; }

/* The sentence above a register form's first field, saying what every red star in it means. It belongs to
   the form rather than to a field, so it sits outside the `.fld` rhythm and closes the gap under it. */
.req-note { font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 0 0 12px; }
.req-note .req { color: var(--red); font-weight: 800; }

/* The live rule line under a password box: the policy while nothing is typed, the first refusal once
   something is, and the pass. It is feedback rather than an error, so it borrows the hint's size and
   weight and changes only colour and glyph — which is also why it is not `.err-msg` in a different coat. */
.rule-line {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 5px;
}
.rule-line svg { flex: 0 0 auto; }
.rule-line.bad { color: var(--red); }
.rule-line.good { color: var(--green); }

/* A glyph or a currency sign inside the box's left edge — the SIM register's mobile number and every
   peso amount. Bootstrap's .input-group bolted a second element to the border and gave the pair three
   different radii; this keeps one box and moves the text into it. */
.inp-icon { position: relative; display: block; }
.inp-icon > .inp { padding-left: 38px; }
.inp-icon .glyph {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: #8a97a5; display: inline-flex; align-items: center;
    font-size: 13px; font-weight: 700; pointer-events: none;
}
/* A box that carries a clear button on its right edge — the assignment picker. The glyph side already
   reserves its space; the button side has to, or a long picked name runs under the ✕. */
.inp-icon.has-clear > .inp { padding-right: 42px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.form-row > *, .form-row-3 > *, .form-row-4 > * { min-width: 0; }
.form-span { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-row, .form-row-3, .form-row-4 { grid-template-columns: minmax(0, 1fr); } }

/* The twelve-column grid, for the one form whose widths are data rather than markup: the account
   register's thirteen categories each record how wide every field's builder made it, so the grid takes a
   span from the registry instead of a hand-written row. `.form-row` and its siblings are the fixed grids
   a form author lays out by eye; this is the variable one, and it carries only the five spans the registry
   actually uses — a quarter, a third, a half, two thirds, the whole row. A field's own 14px is dropped
   inside the grid because the gap already says it, and grid items' margins do not collapse, so keeping
   both would double every row of the account form.

   Named `.form-cols` rather than the `.form-grid` the port's own app.css already owns: that one is an
   auto-fit grid for a form whose field count is free, this one is a fixed twelve parts because the
   widths here come from a registry. Two definitions of one name would let whichever sheet loads last
   restyle the other page. */
.form-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.form-cols > * { margin-bottom: 0; min-width: 0; }
.form-cols .s4 { grid-column: span 4; }
.form-cols .s3 { grid-column: span 3; }
.form-cols .s6 { grid-column: span 6; }
.form-cols .s8 { grid-column: span 8; }
.form-cols .s12 { grid-column: 1 / -1; }
@media (max-width: 900px) {
    .form-cols { grid-template-columns: minmax(0, 1fr); }
    .form-cols > * { grid-column: 1 / -1; }
}

/* The one field that is not a field: the CCTV register's pattern grid, drawn beside the password it
   belongs to and the remarks that describe it. The legacy form wrapped the three in a shaded
   <c>.cctv-pattern-section</c> so the operator reads them as one answer rather than three, and the shape
   is worth keeping — but as a card on the theme's own background step, with the grid holding its natural
   width and the boxes taking the rest. Below the same 900px the form grid folds at, the two halves stack
   and the pattern sits above its password as it always did. */
.pattern-set {
    display: grid; grid-template-columns: max-content 1fr; gap: 16px; align-items: center;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.pattern-set > .pattern-fields { min-width: 0; }
.pattern-set > .pattern-fields > .fld:last-child { margin-bottom: 0; }
@media (max-width: 900px) {
    .pattern-set { grid-template-columns: 1fr; justify-items: center; }
    .pattern-set > .pattern-fields { width: 100%; }
}

input[type=checkbox].inp, input[type=radio].inp { width: auto; }
/* The checked box used to be retaken here from Bootstrap's `.form-check-input`. Nothing on these routes
   writes that class any more — the register's ticks are the theme's own `.chk`, and the one page that
   still does write it, the login screen, never loads this sheet — so the three rules are gone rather
   than left to describe a box nobody draws. */

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: #3c4f63; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
    width: 38px; height: 22px; border-radius: 999px; background: #d9e1ea;
    position: relative; transition: background .15s ease; flex: 0 0 38px;
}
.switch .track::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 3px rgba(16, 42, 67, .25); transition: transform .15s ease;
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }

.pw-wrap { position: relative; }
.pw-wrap > input { padding-right: 44px; }
.eye-btn {
    position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 8px;
    border: none; background: transparent; color: #8a97a5;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.eye-btn:hover { background: #eef2f6; color: var(--ink); }

.fld-plus, .inp-plus { display: flex; align-items: center; gap: 8px; }
.fld-plus > .inp, .fld-plus > select.inp,
.inp-plus > .inp, .inp-plus > select.inp { flex: 1; min-width: 0; }
.plus-btn {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 9px; border: 1px solid #f0d896;
    background: var(--gold-soft); color: var(--gold-dark);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.plus-btn:hover { filter: brightness(.97); border-color: var(--gold); }
.plus-btn.on { background: var(--gold); border-color: var(--gold-dark); color: #241600; }
.del-select-btn {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 9px; border: 1px solid #f5c6c6;
    background: #fef2f2; color: var(--red);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.del-select-btn:hover { filter: brightness(.95); border-color: var(--red); }
.del-select-btn:disabled { opacity: .5; cursor: not-allowed; }
.inline-add {
    display: flex; gap: 8px; align-items: center;
    background: #fbf7ec; border: 1px dashed #e6cf95;
    border-radius: 10px; padding: 9px; margin: 8px 0 14px;
}
.inline-add > .inp { flex: 1; min-width: 0; }
.qty-input { width: 74px; text-align: center; }

.seg-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-choice button {
    border: 1px solid #d6dee7; background: #fff; border-radius: 9px;
    padding: 8px 13px; font-size: 12px; font-weight: 700; color: #3c4f63;
    cursor: pointer; font-family: inherit; display: inline-flex; gap: 7px; align-items: center;
}
.seg-choice button:hover { border-color: #b9c6d2; background: #f8fafc; }
.seg-choice button.on { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-dark); box-shadow: 0 0 0 3px rgba(234, 166, 15, .12); }

/* The same choice with an explanation attached — the Non-IT register's mode switch, where each option says
   out loud what will happen to the asset. One component, two densities: `.cards` turns each button into a
   titled tile with the icon in its own square, and keeps the identical gold pressed state so the pair reads
   as one control rather than two unrelated drawings of the same decision. */
.seg-choice.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg-choice.cards > button { align-items: flex-start; gap: 11px; padding: 12px 13px; text-align: left; }
.seg-choice.cards > button .pic {
    width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: #f1f4f8; color: #6b7a89;
}
.seg-choice.cards > button .pic svg { width: 16px; height: 16px; }
.seg-choice.cards > button.on .pic { background: #fff; color: var(--gold-dark); }
.seg-choice.cards > button b { display: block; font-size: 12.5px; font-weight: 800; }
.seg-choice.cards > button .d { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.seg-choice.cards > button > span:not(.pic) { min-width: 0; }
.seg-choice.cards > button.on .d { color: #7a5a06; }
@media (max-width: 575.98px) { .seg-choice.cards { grid-template-columns: 1fr; } }

.drop {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--line);
    border-radius: 10px; box-shadow: 0 12px 34px rgba(16, 42, 67, .16);
    max-height: 260px; overflow-y: auto; z-index: 40;
}
.drop .grp { padding: 7px 12px 3px; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: #8a97a5; text-transform: uppercase; background: #f8fafc; position: sticky; top: 0; }
.drop .opt { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.drop .opt:hover { background: var(--gold-soft); }
.drop .opt.sel { background: var(--blue-soft); color: var(--blue); }
.drop .opt.dis { opacity: .45; cursor: not-allowed; }
.drop .opt .st { font-size: 10.5px; font-weight: 800; }
/* A panel anchored to a control on the right of its row hangs from that edge instead of stretching to
   the row's width, which is what a picker needs and a column toggle does not. */
.drop.right { left: auto; right: 0; }
/* The same option row, ticked rather than chosen: a column toggle is a set of independent switches, so
   the whole row is the label and the box is the register's own gold checkbox. */
.drop .opt input[type=checkbox] { width: 15px; height: 15px; flex: 0 0 15px; accent-color: var(--gold-dark); cursor: pointer; }
.drop .opt .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The in-flight row, which replaces the list's contents while the directory is still answering. The
   spinner is the button's own, scaled down and coloured by the row's text. */
.drop .busy { display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    font-size: 12px; font-weight: 600; color: var(--muted); }
.drop .busy .spin { width: 13px; height: 13px; flex: 0 0 13px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; animation: rot .7s linear infinite; }
/* The fragment the operator typed, marked inside the row rather than rewritten — the picker's answer is
   a whole name, and only the run they searched for should be louder than the rest of it. */
.drop .opt mark { background: var(--gold-soft); color: var(--gold-dark); font-weight: 800;
    border-radius: 2px; padding: 0 1px; }
/* What a row is, on the right: an office, a store, a person. It used to be a coloured badge per type;
   one grey caption says the same thing without asking the theme for a colour per entity type. */
.drop .opt .st { color: #8a97a5; }
.drop .opt .st.emp { color: var(--blue); }
/* The last row of a picker that can make its own answer — "Add New Entity". It is separated from the
   results rather than mixed into them, because clicking it opens a form instead of choosing a row. */
.drop .make { display: flex; align-items: center; gap: 8px; padding: 9px 12px;
    border-top: 1px solid var(--line); background: #f8fafc;
    font-size: 12px; font-weight: 800; color: var(--blue); cursor: pointer; }
.drop .make:hover { background: var(--blue-soft); }
.drop .make svg { flex: 0 0 auto; }
.picker-wrap { position: relative; }
.picked {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    border: 1px solid var(--line); background: #f8fafc;
    border-radius: 10px; padding: 7px 10px; min-height: 38px;
}
/* The token field — an email group's roster, which is a list of removable answers around a search box
   rather than a single value. The chips wrap, the box is the field's border, and the whole thing rings
   red exactly where an <input> does. */
.tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 7px 9px;
    min-height: 40px; cursor: text; transition: border-color .15s, box-shadow .15s; }
.tokens:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198, 154, 43, .14); }
.tokens.err { border-color: var(--red); box-shadow: 0 0 0 3px rgba(150, 22, 54, .10); }
.tokens.resolving { animation: tokens-pulse 1.1s ease-in-out infinite; }
@keyframes tokens-pulse { 0%, 100% { border-color: var(--gold); } 50% { border-color: #e6cf94; } }
.tokens > input { flex: 1 1 160px; min-width: 0; border: 0; outline: 0; background: transparent;
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink); padding: 3px 2px; }
.tokens > input::placeholder { color: #9aa7b4; font-weight: 500; }
.tokens .glyph { display: inline-flex; align-items: center; color: #8a97a5; flex: 0 0 auto; }
.tokens .glyph.paste { transition: color .15s; }
.tokens:focus-within .glyph.paste { color: var(--gold-dark); }
.token { display: inline-flex; align-items: center; gap: 6px;
    background: var(--gold-soft); border: 1px solid #f0d896; color: #7a5a06;
    border-radius: 999px; padding: 3px 5px 3px 10px; font-size: 11.5px; font-weight: 700;
    max-width: 100%; }
.token > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token button { border: 0; background: rgba(122, 90, 6, .10); color: #7a5a06;
    width: 17px; height: 17px; flex: 0 0 17px; border-radius: 50%; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; }
.token button:hover { background: var(--red-soft); color: var(--red); }
.token.fresh { animation: token-new .6s ease-out; }
@keyframes token-new { from { background: #fff; border-color: var(--gold); transform: scale(.9); }
    to { background: var(--gold-soft); border-color: #f0d896; transform: scale(1); } }

/* ---------- 10. Callouts, notices, refusal boxes ---------- */
.callout {
    border-radius: 10px; padding: 12px 14px; font-size: 12.5px;
    font-weight: 600; display: flex; gap: 10px; align-items: flex-start;
    margin-bottom: 14px; line-height: 1.5;
}
.callout.gold { background: var(--gold-soft); color: #7a5a06; border: 1px solid #f0d896; }
.callout.green { background: var(--green-soft); color: #14663a; border: 1px solid #cdead9; }
.callout.red { background: var(--red-soft); color: #97132f; border: 1px solid #f6cfd8; }
.callout.blue { background: var(--blue-soft); color: #14487f; border: 1px solid #cfe1f8; }
.callout.gray { background: #f4f6f9; color: #4a5c6e; border: 1px solid var(--line); }

/* The corner is shared with the Assistant's launcher, which sits 22px from the same bottom-right edge and
   never leaves it. A notice is transient and the launcher is not, so the notice steps above it. This used to
   be a one-line correction in Ask.css, which could never win: Ask.css loads before this sheet, so the
   override lost the tie it was written to break and every save line painted on top of the Ask button. A
   correction belongs with the rule it corrects. */
.notice {
    position: fixed; right: 22px; bottom: 86px; z-index: 1600;
    display: flex; align-items: center; gap: 10px;
    border-radius: 11px; padding: 11px 14px;
    font-size: 12.5px; font-weight: 700;
    box-shadow: 0 12px 30px rgba(16, 42, 67, .18);
    border: 1px solid transparent; max-width: 420px;
}
.notice-ok { background: var(--green-soft); color: #14663a; border-color: #cdead9; }
.notice-bad { background: var(--red-soft); color: #97132f; border-color: #f6cfd8; }
.notice-closable { display: flex; }
.notice-closable .btn-close { margin-left: auto; }
.notice-closable .btn-close:hover { background: rgba(150, 22, 54, .08); }

.stop-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px 28px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.stop-card h1 { font-size: 18px; font-weight: 800; }
.stop-card p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ---------- 11. Detail blocks ---------- */
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .detail-grid { grid-template-columns: 1fr; } }

.meta-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.meta-list.one { grid-template-columns: 1fr; }
.meta-list .mi { display: flex; flex-direction: column; gap: 3px; }
/* The grid's escape hatch: a value that has to be read as a line of its own — a remark, a description — and
   the rule that names the section after it. A page cannot get either by writing `grid-column` inline without
   inventing a class the next register would need too, and a panel whose fields are listed by a spec rather
   than typed out needs both: the spec decides which field is wide, and the panel only has to obey. */
.meta-list .mi.full, .meta-list .sec-title { grid-column: 1 / -1; }
.meta-list .mk { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a97a5; }
.meta-list .mv { font-size: 13px; font-weight: 700; color: var(--ink); }
.sec-title {
    font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: #8a97a5; margin: 16px 0 9px;
}
.remark-box {
    background: #f8fafc; border: 1px solid var(--line); border-left: 3px solid var(--gold);
    border-radius: 8px; padding: 10px 14px; font-size: 12.5px; color: #44586c;
    font-weight: 500; line-height: 1.55;
}
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .stat-strip { grid-template-columns: 1fr 1fr; } }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat-box .sk { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #8a97a5; }
.stat-box .sv { font-size: 22px; font-weight: 900; color: var(--ink); margin-top: 4px; }
.adj-now {
    display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
    background: #f6f9fc; border: 1px solid var(--line);
    border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
    font-size: 12px; color: #5b6b7b; font-weight: 600;
}
/* Each clause of the strip is its own inline group, so its glyph hangs on the text's middle rather than
   on the baseline it sits above. */
.adj-now > span { display: inline-flex; align-items: center; gap: 6px; }
.adj-now svg { flex: 0 0 auto; color: #8a97a5; }
.adj-now b { color: var(--ink); font-size: 13px; }
.delta-up { color: var(--green); font-weight: 800; }
.delta-down { color: var(--red); font-weight: 800; }

/* ---------- 12. Bars, legends, charts ---------- */
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-row .lbl { width: 165px; font-size: 11.5px; font-weight: 700; color: #44586c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { flex: 1; height: 9px; border-radius: 999px; background: #edf1f6; overflow: hidden; }
.bar-row .fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4d97e0, #1668c7); }
.bar-row .val { width: 34px; text-align: right; font-size: 12px; font-weight: 800; color: var(--ink); }
/* A bar whose figure is a pair — "3 of 20", what is on the shelf against the level that flags it — needs
   the room for both numbers, so it stops claiming one column's width. */
.bar-row .val.auto { width: auto; white-space: nowrap; }
/* The bar that measures itself against a threshold rather than against the largest of its peers is
   always the same story — the shelf is short — so it wears the alert tone instead of the default blue. */
.bar-row .fill.warn { background: linear-gradient(90deg, #f6a5a5, var(--red)); }
.bar-scroll { max-height: 292px; overflow-y: auto; padding-right: 4px; }
/* The two plots that still need a library: the acquisition trend and the per-department bars. A canvas has
   no intrinsic height and Chart.js sizes it from the box it sits in, so the box is what says how tall the
   chart is; <c>.short</c> is the variant that shares a card with a list. */
.chart-box { position: relative; height: 236px; }
.chart-box.short { height: 188px; }
/* The department bars lie on their side, so ten rows stack down the box rather than sharing one
   baseline — it needs more height than the trend, not less. */
.chart-box.bars-h { height: 300px; }
/* A canvas is a replaced element with a default 300px width. Before Chart.js runs (prerender, or a
   machine that never reaches the library) that 300px is the box's min-content floor and can push a
   narrow column past the viewport. Capping it at the box width keeps the page from scrolling sideways
   in that window; once Chart.js sets an explicit width this is a no-op, since it already matches. */
.chart-box canvas { max-width: 100%; }
/* The hairline between the two halves of one panel — IT above Non-IT in the status card. A panel body has
   no rule of its own, because a card that needs one is usually two cards. */
.rule { border-top: 1px solid var(--line); margin: 16px 0; }

.legend-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; font-size: 12.5px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
/* The name truncates rather than wrapping: a legend is read as a column, and one long category pushing
   its row to two lines makes every row below it look misaligned. */
.legend-row .nm { font-weight: 700; color: #44586c; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row .ct { margin-left: auto; font-weight: 800; color: var(--ink); }
.legend-row .pc { color: var(--muted); font-size: 11px; font-weight: 600; width: 44px; text-align: right; }
/* What one slice cost. Its own right-aligned column, because a peso figure in a legend is only worth
   reading when the figures line up and can be compared down the list. */
.legend-row .cs { font-size: 10.5px; font-weight: 700; color: #8a97a5; width: 82px; text-align: right; }
/* "no cost" is not a price of zero, so it is printed as a gap in the record rather than as a figure:
   the same words in a lighter grey, in the same column, so the numbers above it stay lined up. */
.legend-row .cs.na { color: #b6c2ce; font-weight: 600; }
/* The folded tail is a stand-in for several categories, and its hatched swatch says so; the name is
   dimmed to match, so the row never reads as a category somebody forgot to name. */
.legend-row.other .nm { color: #8a97a5; }
.legend-scroll { max-height: 292px; overflow-y: auto; padding-right: 4px; }
.legend-more {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    width: 100%; margin-top: 6px; padding: 7px 10px;
    border: 1px dashed #d6dee7; border-radius: 9px; background: #f8fafc;
    color: #5b6b7b; font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.legend-more:hover { background: var(--gold-soft); border-color: #f0d896; color: var(--gold-dark); }
.legend-more svg { width: 13px; height: 13px; }
.stacked { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin: 6px 0 12px; }
.stacked > span { display: block; height: 100%; min-width: 2px; }

/* The composition bar — `.stacked`'s clickable sibling, and the reason it is a separate shape: an inert
   stripe answers "how is the register split", while a stripe whose slices are buttons answers "show me
   only this slice". It lives in the inspector above the filter chips for exactly that reason; a chip can
   only choose, a segment can also let go. */
.comp { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.comp-bar {
    flex: 1 1 420px; min-width: 0; max-width: 720px;
    display: flex; height: 30px; border-radius: 8px; overflow: hidden;
    background: #edf1f6;
}
.comp-seg {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    flex: 0 0 auto; min-width: 0; overflow: hidden; white-space: nowrap;
    border: 0; border-right: 1px solid rgba(255, 255, 255, .38);
    background: #b6c2ce; color: #fff;
    font-family: inherit; font-size: 11px; font-weight: 700;
    padding: 0 9px; cursor: pointer; transition: filter .15s;
}
.comp-seg:last-child { border-right: 0; }
.comp-seg:hover { filter: brightness(1.14); }
.comp-seg b { font-weight: 800; }
/* The pressed slice is ringed in the register's gold rather than filled with it, because the ring has to
   read on top of whichever status colour the segment already wears. */
.comp-seg.on { box-shadow: inset 0 0 0 2px var(--gold), inset 0 -3px 0 var(--gold); }
/* One background per tone word, in the same alphabet `.pill` and `.chip` use, so a status is the one ink
   from the KPI card to the bar to the row's pill — and a page never has to carry a hex of its own. */
.comp-seg.green { background: var(--green); }
.comp-seg.blue { background: var(--blue); }
.comp-seg.gold { background: var(--gold-dark); }
.comp-seg.red { background: var(--red); }
.comp-seg.gray { background: #5b6b7b; }
.comp-seg.purple { background: #7c3aed; }
.comp-seg.orange { background: #c2410c; }
.comp-seg.indigo { background: var(--indigo); }
.comp-seg.teal { background: #0b6f9f; }
.comp-seg.pink { background: var(--pink); }
.chart-note {
    display: flex; gap: 8px; align-items: center;
    font-size: 11px; color: var(--muted); font-weight: 500;
    margin-top: 10px;
}

/* The distribution ring, taken from the Office Supplies DonutChart and kept as it is there: one circle
   whose radius makes its circumference exactly 100, so a segment's stroke-dasharray is its percentage
   and the whole thing scales with the card. No canvas and no chart library — a ring of nine categories
   is three SVG circles, and a page that draws it while prerendering needs no JavaScript round trip. */
.dc { display: flex; align-items: center; gap: 18px; }
.dc-ring { position: relative; flex: 0 0 auto; }
.dc-ring svg { display: block; }
.dc-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
}
.dc-total { font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--ink); }
.dc-cap { margin-top: 2px; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
/* The legend absorbs whatever width the ring leaves, so the same component reads well in a full-width
   card and in a third-of-the-page one. */
.dc-legend { flex: 1 1 auto; min-width: 0; }
.dc-none { font-size: 12.5px; color: var(--muted); }
@media (max-width: 460px) {
    .dc { flex-direction: column; align-items: stretch; gap: 10px; }
    .dc-ring { align-self: center; }
}
/* The dashboard compares three registers' rings side by side. A 168px ring beside its legend leaves a
   third-of-the-page cell almost no room for the legend's count / share / cost columns, and at the narrow
   end of the desktop range the ring alone is wider than the cell — which pushes the page sideways. So in
   this grid each ring sits ABOVE its legend, giving the legend the whole cell width, and the columns flow
   by available space (three when the column is wide, two or one as it narrows) with a 220px floor that is
   wider than the legend needs. `min(100%, 220px)` keeps that floor from ever exceeding a phone-width cell.
   This rule sits after the layout-grid media query on purpose, so it owns these columns at every width. */
.donut-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.donut-grid .dc { flex-direction: column; align-items: stretch; gap: 12px; }
.donut-grid .dc-ring { align-self: center; }

/* ---------- 13. Timeline and movement vocabulary ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: #e4e9f0; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
    content: ''; position: absolute; left: -21px; top: 3px;
    width: 12px; height: 12px; border-radius: 50%;
    background: #fff; border: 3px solid var(--blue);
}
.tl-item.done::before { border-color: var(--green); background: var(--green); }
.tl-item.bad::before { border-color: var(--red); background: var(--red); }
/* A timeline row's headline carries more than words on this register: a module badge, a status pill or an
   audited-verb chip sits beside the number it describes. As a flex row they space themselves and wrap
   together when the column narrows, instead of a chip being orphaned onto its own line. */
.tl-item .tt {
    font-size: 12.5px; font-weight: 800; color: var(--ink);
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.tl-item .td { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* One chip per kind of audited event, and the alphabet is `AuditAction.BadgeFor`'s own output rather
   than a list of colours this sheet invented: the Activity Log, the movement ledger and every record's
   trail all read the same suffix off the same row, so a spelling that lives here but not there would
   print an unstyled chip on one page and a coloured one on the next. The legacy's eight tones carried
   four of these events into the same grey; these keep them apart. */
.tx-type {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 800; padding: 3px 9px;
    border-radius: 999px; white-space: nowrap;
}
.tx-add { background: var(--blue-soft); color: var(--blue); }
.tx-edit { background: var(--indigo-soft); color: var(--indigo); }
.tx-delete { background: #eef1f5; color: #5b6b7b; }
.tx-restore { background: var(--green-soft); color: var(--green); }
.tx-purge { background: var(--red-soft); color: var(--red); }
.tx-denied { background: #fff7ed; color: #c2410c; }
.tx-access { background: var(--purple-soft); color: #7c3aed; }
.tx-export { background: var(--teal-soft); color: #0b6f9f; }
.tx-login { background: var(--teal-soft); color: #0b6f9f; }
.tx-logout { background: #eef1f5; color: #5b6b7b; }
.tx-login-fail { background: var(--red-soft); color: var(--red); }
.tx-issuance { background: var(--green-soft); color: var(--green); }
.tx-return { background: var(--gold-soft); color: var(--gold-dark); }
.tx-transfer { background: var(--purple-soft); color: #7c3aed; }
.tx-default { background: #eef1f5; color: #5b6b7b; }

.ledger-row {
    display: grid;
    grid-template-columns: 132px 1fr 150px 128px minmax(220px, 1.4fr);
    gap: 14px; align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f6;
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row:hover { background: #f8fafc; }
.ledger-when { font-size: 11px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger-item { min-width: 0; }
.ledger-party { font-size: 12px; color: #5b6b7b; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ledger-arrow { color: #b6c2ce; }
.ledger-what { font-size: 12px; color: var(--ink-2); font-weight: 600; line-height: 1.45; }
.ledger-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--muted); font-weight: 600; }
@media (max-width: 1100px) { .ledger-row { grid-template-columns: 1fr; gap: 6px; } }

/* A hand-off is one fact with two names, and the ledger prints it inside a table cell: there is room for
   one line, not a panel. The contrast belongs to the two names and the mark between them stays quiet —
   and it is the second name that is bolder, because "who has it now" is the question a person scanning
   the column is actually asking.

   The pair never breaks across lines, and neither name is ever cut in the middle of a word: a holder is a
   full person's name or a device tag, and "MARK SHANE KANE LIWANAG" folded over three rows is unreadable
   in a way that "MARK SHANE KANE L…" is not. Each name takes its share of the column and ellipsizes what
   does not fit, the cell carries the whole pair as its hover text, and the drawer prints both names in
   full plates — which is the same bargain this register already makes with a long description.

   It is a bargain rather than a loss because the alternative is worse: two names that refuse to shrink set
   a minimum width on the column, the ledger then costs more than a laptop is wide, and the fact the
   operator came to read slides out from under the pinned actions rail. */
.flow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.flow .was { color: var(--muted); font-weight: 700; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow .ar { color: #b6c2ce; flex: 0 0 auto; }
.flow .ar svg { width: 14px; height: 14px; }
.flow .now { color: var(--ink); font-weight: 800; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The same pair in the drawer, where the two names get plates rather than words and each plate says what
   it is: an operator reading a drawer at 2 a.m. should not have to remember which side of an arrow the
   old holder sits on. Gold on the arrow because this sheet reserves gold for the thing that moved. */
.flow-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; margin: 14px 0 2px; }
.flow-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 0; }
.flow-box .lb { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a97a5; }
.flow-box .nm { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink); margin-top: 4px; overflow-wrap: anywhere; }
.flow-pair > .ar { color: var(--gold); display: flex; align-items: center; }
@media (max-width: 620px) {
    .flow-pair { grid-template-columns: 1fr; }
    .flow-pair > .ar { transform: rotate(90deg); justify-content: center; }
}

.trail { display: flex; flex-direction: column; }
.trail-count { margin: -2px 0 8px; }
.trail li {
    display: grid; grid-template-columns: 128px minmax(0, 1fr) 132px; gap: 12px;
    list-style: none; padding: 9px 0;
    border-bottom: 1px dashed #e7ecf2; font-size: 12px;
}
.trail li:last-child { border-bottom: none; }
.trail .when { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.trail .main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.trail .what { color: var(--ink-2); font-weight: 600; line-height: 1.5; }
.trail .who { color: #5b6b7b; font-weight: 700; text-align: right; }
/* The entry the operator is already reading in full, so they can find themselves in the list. */
.trail li.here { background: var(--gold-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
@media (max-width: 900px) { .trail li { grid-template-columns: 1fr; gap: 2px; } .trail .who { text-align: left; } }

/* The trail as a block dropped at the foot of a dialog: the rule above it says "this is a different
   question about the same record", which is exactly what it is. */
.trail-block { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.trail-more { margin-top: 8px; }

/* ---------- 14. Slide-over inspector ---------- */
/* The overlay is transparent to the pointer while it is shut — it covers the viewport even then, so a
   closed drawer would otherwise eat every click on the page behind it. Opening it is the one thing that
   has to hand the pointer back, and it has to be said here rather than by each page: the backdrop closes
   the panel on a click, and nothing inside it works without this.

   The two layers sit above the Ask launcher (1040) and below a Bootstrap modal (1055), which is the order
   that sheet's own comment argues for — "a dialog the person is answering outranks a chat launcher" — and
   the drawer is such a dialog. At the old 1000/1001 the launcher painted over the panel's bottom-right
   corner, where every drawer's Close button lives, so reading one movement meant the assistant's button
   sitting on the only way out of it. */
.sp-overlay.open { pointer-events: auto; }
.sp-overlay { position: fixed; inset: 0; z-index: 1050; pointer-events: none; }
.sp-backdrop { position: fixed; inset: 0; background: rgba(13, 26, 41, .34); opacity: 0; transition: opacity .22s ease; }
.sp-overlay.open .sp-backdrop { opacity: 1; }
.sp {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1051;
    width: min(1240px, 94vw);
    background: #f6f8fb;
    border-left: 1px solid var(--line);
    box-shadow: -18px 0 46px rgba(16, 42, 67, .22);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.32, .72, .24, 1);
    display: flex; flex-direction: column;
}
.sp-overlay.open .sp { transform: translateX(0); }
/* The page behind a drawer never scrolls. `jpscShell.slidePanelOpen` writes the second name and every
   inspector already called it, so the sheet follows the shell rather than the other way round — a lock
   the theme keeps to itself is a lock nobody applies, and the page behind the panel scrolls out from
   under it. */
body.sp-open, body.slide-panel-open { overflow: hidden; }
.sp-head {
    display: flex; flex-shrink: 0; align-items: flex-start; gap: 14px;
    padding: 14px 18px;
    background: #fff; border-bottom: 1px solid var(--line);
}
.sp-close {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
    border: 1px solid var(--line); background: #fff; color: #5b6b7b;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.sp-close:hover { background: #f4f7fa; color: var(--ink); }
.sp-title { min-width: 0; }
.sp-title h2 { font-size: 18px; font-weight: 800; color: var(--ink); line-height: 1.25; }
.sp-title .sub { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.sp-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.sp-acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sp-body { padding: 16px 18px 26px; overflow: auto; flex: 1; min-width: 0; min-height: 0; }
.sp-foot {
    padding: 12px 18px; background: #fff; border-top: 1px solid var(--line);
    display: flex; flex-shrink: 0; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap;
}
.sp-meta { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 3px; }

/* The inspector's own grid. A drawer is close to the viewport's width and its columns are known, so its
   table runs on a fixed percentage budget rather than the auto layout a register page uses — the register
   invents column names as modules are added and cannot say in advance how wide a thing will be, a
   inspector can, and it does: the widths travel with the column list in the component, which is the only
   place that knows what the columns are.
   The wrapper then stops being a scroll container, which is the whole reason a sticky head can pin: a
   horizontal scroller is a scroll container on both axes, and a head sticks to the box that scrolls, not
   to the panel. Fix the budget so the table always fits, and the box never needs to scroll sideways.
   The floor below is the escape hatch for a phone: the plan is written for a drawer the width of a
   desktop window, so on a narrow screen the table keeps its minimum readable slice and the drawer body
   — which already scrolls on both axes — takes the difference. A sticky head still works, because the
   scroller is the body and not the wrapper.
   A register page may use it too, and the movement ledger does: what makes this layout right is not the
   drawer but the fact that the column list is known and finite. The ledger measured 1,254px of columns on
   the auto layout against the 1,078px the plate gives a table on a 1,440 window, and a register that
   overruns its plate by that much buries the columns between the last one that fits and the pinned actions
   rail — which is how "Performed By" disappears on the page whose job is saying who moved the asset.
   Fixed layout is the only table mode where the declared widths are the answer rather than a preference
   the longest unbreakable name overrules. */
.tbl-fixed { table-layout: fixed; min-width: 860px; }
/* With a fixed plan, a cell that cannot fit its word used to spill it over the neighbour. Break instead:
   a serial number or a peso amount is allowed to fold inside its own column rather than paint over the
   next one, and this only ever fires on content that would have overflowed anyway. */
.tbl-fixed th, .tbl-fixed td { overflow-wrap: break-word; }
.sp-body .tbl-wrap { overflow: visible; border: 0; background: transparent; border-radius: 0; }
/* The column that holds a row's buttons. Right, because that is where a register keeps every affordance,
   and on one line, because two buttons that stack are two buttons that look like a mistake. */
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts.align-left { text-align: left; }
/* Inside the rail the tiles are a flex row rather than inline-blocks: the gap between two adjacent
   controls is then the rail's business, not each tile's margin, which is how a button that carries its own
   trailing margin ends up 6px off the right edge of every table it sits in. */
.tbl td.acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.tbl td.acts .abtn, .tbl td.acts .kebab { margin-right: 0; }

/* A nine-column register does not fit the width of a laptop, and the column a person needs most on a
   narrow screen is the one holding View / Edit / Archive: scrolling sideways to reach it means scrolling
   sideways on every row, and scrolling sideways to find the row they wanted in the first place. So the
   rail is pinned to the right edge of the scroller instead — it holds exactly its old place when the
   table fits, and stays under the thumb when it does not, which is what a data grid that carries row
   buttons does about this. Pinning costs an opaque background, because columns must pass underneath it
   invisibly, and the background has to know about the row's two other states so the pinned cell does not
   punch a white hole in a hovered or ticked row. */
.tbl th.acts, .tbl td.acts { position: sticky; right: 0; z-index: 1; }
.tbl thead th.acts { z-index: 3; }
.tbl td.acts { background: #fff; box-shadow: inset 1px 0 0 #eef2f6; }
.tbl thead th.acts { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14); }
.tbl tbody tr:hover td.acts { background: #f8fafc; }
.tbl tbody tr.sel td.acts { background: var(--gold-soft); }
.tbl tbody tr.sel:hover td.acts { background: #fdf3d8; }
/* A pinned rail hides whatever it is pinned over, and a person who cannot see that a column is being
   covered will conclude the register has fewer columns than it does. So where the scroller still has
   somewhere to go, the rail throws a soft shadow to its left: the seam stops being a column border and
   becomes "there is more table under here". Where the table fits, the condition is false and the rail
   stays a plain column with a hairline, because a shadow over nothing is a smudge over nothing.
   Older engines simply never match the query and keep the hairline — the rail still pins, only quieter. */
.tbl-wrap { container-type: scroll-state; }
@supports (container-type: scroll-state) {
    @container scroll-state(scrollable: inline-end) {
        .tbl td.acts { box-shadow: inset 1px 0 0 #eef2f6, -12px 0 12px -12px rgba(16, 42, 67, .28); }
        .tbl thead th.acts { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14), -12px 0 12px -12px rgba(16, 42, 67, .35); }
    }
}
/* The slide-over rail carries its own tables, whose wrapper explicitly does not scroll (the rail's body
   is the scroller there) and whose columns are planned to fit. A pinned cell inside a wrapper that never
   moves is just an opaque cell, so the rail opts out and keeps the plain right-aligned column. */
.sp-body .tbl th.acts, .sp-body .tbl td.acts { position: static; box-shadow: none; }

/* Where a search term is echoed back. The picker's list already marks its own match in the register's
   gold; a table cell the inspector highlighted takes the same ink, so "this is what you typed" is one
   gesture on every facet of the app rather than two. */
mark { background: var(--gold-soft); color: var(--gold-dark); font-weight: 800; border-radius: 2px; padding: 0 1px; }

/* ---------- 15. Dialog chrome ---------- */
/* The frame, which the vendored sheet drew and this section now owns. The numbers are Bootstrap's rather
   than the design's, and they have to be: the register's stacked overlays still write `z-index:1060` inline
   on the frame, so the frame sits at 1055 and its backdrop at 1050 because that is the gap those inline
   values were chosen against. `.modal` is hidden by the sheet and lifted by <c>LegacyModal</c> writing
   `display:block` on the same render that adds `show`, which is also how the component reproduces
   Bootstrap's own fade without any of its JavaScript. The dialog is 500px wide above the smallest breakpoint
   and takes the size class the caller passes; `pointer-events` is the frame's trick for letting a click that
   misses the card fall through to the backdrop rather than vanishing into a transparent box. */
.modal {
    --modal-margin: .5rem;
    position: fixed; inset: 0; z-index: 1055;
    height: 100%; height: 100dvh;
    display: none; overflow-x: hidden; overflow-y: auto; outline: 0;
}
.modal.fade { transition: opacity .15s linear; }
.modal.fade:not(.show) { opacity: 0; }
.modal-dialog { position: relative; width: auto; margin: var(--modal-margin); pointer-events: none; }
.modal.fade .modal-dialog { transform: translate(0, -50px); transition: transform .3s ease-out; }
.modal.show .modal-dialog { transform: none; }
.modal.modal-static .modal-dialog { transform: scale(1.02); }
/* Every dialog shares the viewport budget, not just callers with the old Scrollable flag.
   Short confirmations keep their natural height; only a long body's contents scroll. */
.modal-dialog-centered {
    display: flex; align-items: center;
    height: calc(100% - 2 * var(--modal-margin));
}
@media (min-width: 576px) {
    .modal { --modal-margin: 1.75rem; }
    .modal-dialog { max-width: 500px; margin: var(--modal-margin) auto; }
    .modal-dialog.modal-sm { max-width: 300px; }
}
@media (min-width: 992px) {
    .modal-dialog.modal-lg, .modal-dialog.modal-xl { max-width: 800px; }
}
@media (min-width: 1200px) {
    .modal-dialog.modal-xl { max-width: 1140px; }
}
.modal-backdrop {
    position: fixed; inset: 0; z-index: 1050;
    width: 100vw; height: 100vh; background: #000;
}
.modal-backdrop.fade { opacity: 0; }

.modal-content {
    position: relative;
    display: flex; flex-direction: column;
    width: 100%; min-width: 0; max-height: 100%; pointer-events: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 26px 60px rgba(16, 42, 67, .26);
    overflow: hidden;
    outline: 0;
}
.modal-header {
    display: flex; flex-shrink: 0; justify-content: space-between;
    border-bottom: 1px solid #eef2f6;
    padding: 15px 18px;
    align-items: flex-start; gap: 12px;
}
.modal-title { margin-bottom: 0; font-size: 16.5px; font-weight: 800; color: var(--ink); line-height: 1.3; }
/* The heading takes the row's leftover width, so the title starts against the icon tile. Without it the
   header's `justify-content: space-between` has two or three children to spread and pushes the words to the
   far side of the card — which is what every confirmation looked like, because AssetConfirmModal passes
   ShowClose="false" and left the icon alone on the left with a gap the width of the dialog between it and
   its own caption. The ✕ still lands in the corner: it grows nothing and its `margin-left: auto` simply has
   no free space left to claim once this row has absorbed it. */
.modal-heading { min-width: 0; flex: 1 1 auto; }
.modal-sub { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.modal-icon {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
    background: var(--blue-soft); color: var(--blue);
    display: flex; align-items: center; justify-content: center;
}
.modal-icon svg { width: 19px; height: 19px; }
.modal-icon.gold { background: var(--gold-soft); color: var(--gold-dark); }
.modal-icon.green { background: var(--green-soft); color: var(--green); }
.modal-icon.red { background: var(--red-soft); color: var(--red); }
.modal-icon.purple { background: var(--purple-soft); color: var(--purple); }
/* The body may shrink below its contents; the header and actions may not. Without min-height:0
   and overflow:auto, a height-capped form pushes its footer out of the card's clipping boundary. */
.modal-body {
    position: relative; flex: 1 1 auto; min-height: 0; min-width: 0;
    overflow: auto; overscroll-behavior: contain;
    padding: 18px; font-size: 13px; color: var(--ink-2);
}
/* A confirmation dialog is one band and nothing else, so the band's `margin-bottom: 14px` — which is what
   separates it from the next field in a form — landed between it and the footer instead, and the ask read as
   though it had twice the air below it as above. The margin is for spacing between siblings, so it goes when
   there is no sibling; a band that is followed by a remarks box keeps it. */
.modal-body > .callout:last-child { margin-bottom: 0; }
.modal-footer {
    display: flex; flex-shrink: 0; justify-content: flex-end;
    padding: 14px 18px; border-top: 1px solid #eef2f6;
    background: #fbfcfe; gap: 10px; flex-wrap: wrap;
}
.modal-footer .btn, .sp-foot .btn {
    min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere;
}
.modal-footer .ico-wrap, .sp-foot .ico-wrap { flex-shrink: 0; }
@media (max-width: 575.98px) {
    .modal-header, .modal-body { padding: 12px; }
    .modal-footer { padding: 10px 12px; gap: 8px; }
    .modal-footer .btn { flex: 1 1 auto; min-height: 44px; justify-content: center; }
    .sp-foot > .sp-meta { flex-basis: 100%; }
}
@media (max-height: 600px) {
    .modal { --modal-margin: .5rem; }
    .modal-header { padding-top: 10px; padding-bottom: 10px; }
    .modal-footer { padding-top: 8px; padding-bottom: 8px; }
    /* On a short landscape phone the action band can wrap to several rows (a drawer footer carries a meta
       line plus up to three verbs). Both bands are flex-shrink:0, so without a ceiling a tall wrapped footer
       would eat the whole card and clip its own last row against the frame's overflow:hidden. Cap each to
       under half the viewport and let it scroll inside itself instead: the header and the actions stay
       reachable, the body keeps the rest, and nothing is ever painted past the edge. At normal heights a
       footer is far below the cap, so this never fires on a desktop. */
    .modal-footer, .sp-foot { max-height: 45vh; overflow-y: auto; overscroll-behavior: contain; }
    /* The drawer's head is the other non-shrinking band: a long title, sub-line and chip row can wrap tall
       on a narrow phone, and head + foot alone could then exceed the fixed-height panel even with the body
       collapsed to zero. Cap it the same way — the close control is its first child, so it stays at the top
       of the scroll rather than being pushed out. 35vh + 45vh leaves the body at least a fifth of the panel
       on the shortest screen, and a real inspector head sits well under the cap, so this only ever scrolls a
       head that genuinely cannot fit. */
    .sp-head { max-height: 35vh; overflow-y: auto; overscroll-behavior: contain; }
}
.modal-backdrop.show { opacity: .38; }

/* The dialog's own ✕. Bootstrap paints its glyph through a background image and pins the control to the
   header corner with `.modal-header .btn-close { position:absolute }`, so this rule has to carry that same
   two-class weight to bring it back into the flex row — and it paints `background:#fff` with the shorthand,
   which wipes Bootstrap's image rather than layering a second ✕ behind ours. The glyph is then this app's
   own `Ico`, which is why the control needs a box the icon can sit inside. */
.btn-close, .modal-header .btn-close {
    position: static; z-index: auto; margin: 0 0 0 auto; padding: 0;
    width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
    border: 1px solid var(--line); background: #fff; color: #5b6b7b;
    opacity: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-close:hover, .modal-header .btn-close:hover { background: #f4f7fa; color: var(--ink); }
.btn-close svg { width: 14px; height: 14px; }

/* ---------- 16. Pager ---------- */
.pager {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px;
    border-top: 1px solid var(--line); background: #fff;
    border-radius: 0 0 10px 10px;
}
.pager-info { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager-btns { display: flex; gap: 4px; align-items: center; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.pg {
    min-width: 32px; height: 32px; padding: 0 8px;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    font-size: 12px; font-weight: 700; color: #5b6b7b; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-family: inherit;
}
.pg:hover:not(:disabled) { border-color: #b9c6d2; background: #f8fafc; color: var(--ink); }
.pg:disabled { opacity: .4; cursor: not-allowed; }
.pg.on { background: var(--gold); border-color: var(--gold-dark); color: #241600; font-weight: 800; cursor: default; }
.pg-gap { color: #a9b6c2; font-weight: 800; padding: 0 2px; }
.pg-size { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pg-size select { width: auto; padding: 6px 9px; font-size: 12px; border-radius: 8px; }

/* ---------- 17. Bulk bar, selection ---------- */
.bulk-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--gold-soft); border: 1px solid #f0d896; border-radius: 11px;
    padding: 10px 14px; margin-bottom: 12px;
    font-size: 12.5px; font-weight: 700; color: #7a5a06;
}
.bulk-bar b { font-variant-numeric: tabular-nums; }

/* ---------- 18. Loading, empty ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 12.5px; }
.empty-state .big { font-size: 15px; font-weight: 800; color: #55697d; margin-bottom: 6px; }
.empty-state .ico-wrap { color: #c3cedb; margin-bottom: 8px; }
.skel { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.skel-row { height: 15px; border-radius: 7px; background: linear-gradient(90deg, #edf1f6 25%, #e4e9f0 50%, #edf1f6 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skel-row.w40 { width: 40%; } .skel-row.w70 { width: 70%; } .skel-row.w90 { width: 90%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.boot-splash {
    min-height: 100vh;
    display: flex; flex-direction: column; gap: 16px;
    align-items: center; justify-content: center;
    background: var(--sb-bg);
    color: #9fb0c0; font-weight: 600;
}
.boot-splash img { width: 90px; filter: drop-shadow(0 0 24px rgba(234, 166, 15, .5)); }

/* ---------- 19. This register's own widgets ---------- */
/* A SIM/CCTV/credential register has things the supplies ledger never needed: a
   carrier chip that must not read as a status, a secret that is either stored or
   not set and never printed, a module pill naming which register a trail row came
   from, and an archive panel whose sections span the grid. */
.mod-badge {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; padding: 3px 10px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    background: #eef1f5; color: #5b6b7b; white-space: nowrap;
}
.m-it { background: var(--blue-soft); color: var(--blue); }
.m-nonit { background: var(--teal-soft); color: #0b6f9f; }
/* Camera Equipment keeps the fuchsia the WebForms Archive and Ask sheets gave it (#A21CAF on
   #F3E8FF), rather than one of this sheet's own soft tokens: it sits between Non-IT and SIM in pill
   order, and a hue the operator already learned in the old page is worth carrying over. It is not
   m-cctv's violet — a camera rig on a shelf and an installed security camera are different rows. */
.m-camera { background: #f3e8ff; color: #a21caf; }
.m-sim { background: var(--green-soft); color: var(--green); }
.m-cctv { background: var(--purple-soft); color: #7c3aed; }
.m-cat { background: var(--gold-soft); color: var(--gold-dark); }
.m-emp { background: var(--indigo-soft); color: var(--indigo); }
.m-org { background: var(--orange-soft); color: #b45309; }
.m-sys { background: #eef1f5; color: #5b6b7b; }
.m-acc { background: var(--pink-soft); color: #be185d; }
.m-api { background: #f1f3f5; color: #495057; }
.m-other { background: #eef1f5; color: #7b8a99; }

.hl-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.hl-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.cred-group { margin-bottom: 22px; }
.cred-group h3 {
    font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    color: #8a97a5; margin: 0 0 10px;
    display: flex; align-items: center; gap: 8px;
}
.pw-view {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #d6dee7; border-radius: 9px; padding: 8px 10px;
}
.pw-view .pwv {
    flex: 1; min-width: 0;
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-size: 13px; font-weight: 700; color: var(--ink);
    letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pw-view .pwv.na { font-family: inherit; letter-spacing: 0; color: var(--muted); font-weight: 600; font-style: italic; }
.pw-view button {
    width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px;
    border: 1px solid var(--line); background: #f4f7fa; color: #5b6b7b;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pw-view button:hover { background: var(--gold-soft); border-color: #f0d896; color: var(--gold-dark); }
.view-note { font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 7px; }
.acct-head {
    display: flex; align-items: center; gap: 12px;
    background: #f6f9fc; border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 14px; margin-bottom: 14px;
}
.acct-head .ah-n { font-size: 14px; font-weight: 800; color: var(--ink); }
.acct-head .ah-u { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.acct-head .ah-pills { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.arch-purge { background: #fff; border: 1px solid #f6cfd8; border-radius: 12px; padding: 14px 16px; }
/* The purge card is a bulk bar's one block child, and it wants the bar's whole width: left to a flex row it
   shrinks to its longest line, and the warnings an operator has to read before typing stack up the right
   edge of the panel instead of running across it. */
.bulk-bar .arch-purge { flex: 1 1 100%; }
.arch-purge-note, .arch-purge-warn { font-size: 12px; font-weight: 600; display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
.arch-purge-note { color: var(--muted); }
.arch-purge-warn { color: #97132f; }
.arch-purge-type { margin-top: 12px; }
.arch-purge-type label { font-size: 12px; font-weight: 700; color: #3c4f63; display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.arch-blocked { margin: 10px 0 0; padding-left: 18px; font-size: 12px; color: #5b6b7b; font-weight: 600; }
.arch-blocked li { margin-bottom: 3px; }

/* An archived credential is never printed, and a field that shows nothing reads as a field that failed to
   load rather than as a redaction someone chose. So the line is an answer — the spec's own words ("Stored —
   not shown here" / "Not set") behind a lock or an open padlock — and it is set apart from the values around
   it in the one way a page cannot fake by leaving the cell blank: italic, muted, and the body's own size, so
   an operator reads it as a statement about the value rather than the value itself. */
.secret-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; font-style: italic; color: var(--muted); }
.secret-flag .ico-wrap { color: #9aa7b4; }

/* CCTV sites are a tree, which nothing in the supplies system ever was. */
.site-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px; cursor: pointer;
    font-size: 12.5px; font-weight: 700; color: #3c4f63;
}
.site-row:hover { background: #f4f7fa; }
.site-row.on { background: var(--gold-soft); color: var(--gold-dark); }
.device-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 34px; border-radius: 9px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.device-row:hover { background: #f8fafc; }
.device-row.on { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #d5dde5; flex: 0 0 8px; }
.dot.on { background: var(--green); }
.dot.off { background: var(--red); }
/* The tone words again, so a chip that means a status can colour its dot by naming the tone instead of
   carrying a hex from the page. `.on`/`.off` stay: they mean connected, not green. */
.dot.green { background: var(--green); }
.dot.blue { background: var(--blue); }
.dot.gold { background: var(--gold); }
.dot.red { background: var(--red); }
.dot.gray { background: #94a3b8; }
.dot.purple { background: #7c3aed; }
.dot.orange { background: var(--orange); }
.dot.indigo { background: var(--indigo); }
.dot.teal { background: var(--teal); }
.dot.pink { background: var(--pink); }

/* Pattern lock: an CCTV unlock gesture cannot be a text field. */
.pl-grid { display: grid; grid-template-columns: repeat(3, 74px); gap: 10px; justify-content: center; padding: 8px 0; }
.pl-dot-ring { border-color: #d6dee7; }
.pl-dot-core { background: #eef2f7; }
.pl-grid .pl-dot-active .pl-dot-ring { border-color: var(--gold-dark); }
.pl-grid .pl-dot-active .pl-dot-core { background: var(--gold); }
.pl-line { stroke: var(--gold); stroke-width: 3; stroke-linecap: round; opacity: .85; }
.pl-readout {
    background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 14px; font-size: 12.5px; font-weight: 700; color: #5b6b7b;
    display: flex; gap: 8px; align-items: center;
}
.pl-mini { grid-template-columns: repeat(3, 32px); gap: 6px; }
.pl-mini .pl-dot-wrap { width: 32px; height: 32px; }

/* ---------- 20. Printable report ---------- */
.audit-filter-bar {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.af-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: end; }
.af-fld { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.af-fld label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.af-fld .inp { height: 38px; font-size: 13px; }
.af-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
/* The period sentence is the row's own comment, not a third verb: `.hint` was written as a caption under an
   input, so its top margin would drop it below the buttons' baseline. It takes the far end of the row and
   centres itself against them instead — which is also why it is a span in `.af-actions` rather than an
   `.af-fld` with an empty label. */
.af-actions .ar-period-hint { margin-top: 0; align-self: center; margin-left: auto; text-align: right; }
.report-sheet {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 36px 40px; box-shadow: var(--shadow);
}
.rs-header { text-align: center; margin-bottom: 20px; }
.rs-company { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: .5px; }
.rs-system { font-size: 14px; font-weight: 700; color: var(--blue); margin-top: 2px; }
.rs-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; letter-spacing: .08em; text-transform: uppercase; }
.rs-meta {
    display: flex; gap: 28px; flex-wrap: wrap;
    border-top: 2px solid var(--blue); border-bottom: 1px solid var(--line);
    padding: 12px 0; margin: 16px 0 22px; font-size: 12.5px;
}
.rs-meta b { color: var(--ink); font-weight: 700; }
.rs-meta span { color: var(--ink-2); }
.rs-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 22px; }
.rs-table th {
    background: var(--ink); color: #fff; padding: 9px 10px; text-align: left;
    font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border: none;
}
.rs-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.rs-table tr:nth-child(even) td { background: #f8f9fb; }
.rs-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rs-summary { background: #f4f6f9; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin-bottom: 28px; }
.rs-summary h4 { margin: 0 0 10px; font-size: 11.5px; font-weight: 800; color: var(--ink); text-transform: uppercase; letter-spacing: .06em; }
.rs-sum-grid { display: flex; gap: 36px; flex-wrap: wrap; }
.rs-sum-item { font-size: 12.5px; color: var(--ink-2); }
.rs-sum-item b { color: var(--ink); font-weight: 800; }
.rs-sigs { display: flex; gap: 80px; margin-top: 44px; }
.rs-sig { flex: 1; }
.rs-sig-line { border-top: 1px solid var(--ink); margin-top: 56px; padding-top: 6px; }
.rs-sig-label { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.rs-sig-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
/* The last line of the document. It is set off with a rule of its own rather than left as another caption,
   because the sheet has no card around it any more — the footnote belongs to the whole page and has to say
   so, and centring it keeps it away from the signature block's left-aligned labels directly above. */
.report-sheet .ar-foot { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--line);
    text-align: center; }
@media (max-width: 700px) { .rs-sigs { gap: 24px; flex-wrap: wrap; } }
@media (max-width: 760px) {
    /* On a narrow screen there is no room at the end of the row, so the period note stops competing with the
       buttons for width and takes a line of its own under them — left-aligned, because centring a sentence
       that wraps to three lines makes it look like a heading rather than a caution. */
    .af-actions .ar-period-hint { flex: 1 1 100%; margin-left: 0; text-align: left; }
}

/* The shell, the slide-over and the fixed notice all come off the page for a person
   who prints the register, and only the sheet they signed stays on the paper. */
@media print {
    .sidebar, .topbar, .chip-dropdown, .page-head .ph-actions, .notice,
    .sp-overlay, .sp, .filter-bar, .audit-filter-bar, .pager, .bulk-bar, .seg, .panel-h .ctrl,
    .askw-launcher, .askw-panel, .btn, .abtn, .kebab, .menu { display: none !important; }
    .main, .main.mini { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    body { background: #fff !important; font-size: 11px; }
    .panel, .report-sheet { border: none !important; box-shadow: none !important; break-inside: avoid; }
    .tbl thead th { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000 !important; position: static; }
    .tbl tbody td { color: #000 !important; }
    /* Paper has no sideways scroll, and the buttons that would have lived in this column are hidden by the
       rule above, so a pinned, shaded gutter on the page edge would be the sheet's only sin. */
    .tbl th.acts, .tbl td.acts { position: static; box-shadow: none; background: transparent !important; }
    /* The report sheet's own table. Its headers are painted ink-dark on screen, and a printer asked not to
       print background graphics would hand back white type on nothing — the sheet's column names gone from
       the only copy somebody signs. So the same inversion `.tbl` gets, and the zebra striping goes with it:
       #f8f9fb is invisible on paper anyway and only costs toner. */
    .rs-table th { background: #fff !important; color: #000 !important; border-bottom: 2px solid #000 !important; }
    .rs-table td { color: #000 !important; border-bottom: 1px solid #b6bcc6 !important; }
    .rs-table tr:nth-child(even) td { background: transparent !important; }
    .rs-summary { background: #fff !important; border: 1px solid #b6bcc6 !important; }
    .report-sheet { padding: 0 !important; }
    a[href]:after { content: none !important; }
}

/* ---------- 21. Utilities and helpers ---------- */
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.tnum { font-variant-numeric: tabular-nums; }
.up { text-transform: capitalize; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.aic { align-items: center; }
.jcb { justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.right { text-align: right; }
.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* A glyph is an inline-flex box holding an SVG, so wherever it sits in running text rather than in a
   flex row its bottom edge lands on the baseline and it reads as raised out of the line. Nudging the
   box below the baseline is what a font glyph does for free. `vertical-align` is ignored on a flex
   item, so every button, pill, nav row and chip that already centres its icon is untouched — this only
   reaches the inline cases, which is where the register's detail labels and table cells put a mark
   beside a word without a wrapper that flexes. */
.ico-wrap { vertical-align: -0.18em; }

/* A link that is a whole card (the dashboard's KPI tiles reach a filtered register
   this way) must look like the card and not like a sentence of blue text. */
a.card-link { color: inherit; display: block; }
a.card-link:hover { color: inherit; }

/* ---------- 22. Responsive shell ---------- */
.sb-overlay { position: fixed; inset: 0; background: rgba(13, 26, 41, .38); z-index: 55; }
@media (max-width: 992px) {
    .sidebar { transform: translateX(calc(-100% - var(--shell-gap) * 2)); transition: transform .22s ease; width: var(--sb-w); }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar.mini { width: var(--sb-w); }
    .sb-burger { display: flex; }
    .main, .main.mini { margin-left: 0; padding: var(--shell-gap); }
    .content { padding: 16px 14px 22px; }
    .page-head { flex-direction: column; align-items: stretch; }
    .ph-actions { justify-content: flex-start; margin-top: 12px; }
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
@media (max-width: 600px) {
    .ph-title { font-size: 21px; }
    .topbar { padding: 8px 14px; }
    .user-chip .n, .user-chip .r { display: none; }
    .chip-dropdown { right: 14px; }
    .sp { width: 100vw; border-left: none; }
}

/* ---------- 23. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .sidebar, .main { transition: none; }
}
