﻿html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ── UltraPos HQ dashboard ─────────────────────────────────────────────── */
.hq-head { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.hq-head h1 { margin:0; font-size:28px; font-weight:700; color:#0d1b2a; }
.hq-head .muted { color:#6b7a90; font-size:13px; }
.hq-head-right { display:flex; align-items:center; gap:10px; }
.hq-head-right .form-select { max-width:220px; }
.pill { background:#eef3fb; color:#274060; border-radius:999px; padding:6px 14px; font-weight:600; font-size:13px; }

.tile-row { display:flex; flex-wrap:wrap; gap:14px; margin-bottom:20px; }
.tile { flex:1 1 180px; background:#fff; border:1px solid #e6ebf2; border-radius:12px; padding:16px 18px; box-shadow:0 1px 3px rgba(16,32,64,.05); }
.tile-label { color:#6b7a90; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.tile-value { font-size:26px; font-weight:700; color:#0d1b2a; margin-top:6px; }
.tile-warn { border-color:#f5c2c7; background:#fff5f5; }
.tile-warn .tile-value { color:#c62828; }

.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:900px){ .grid-2 { grid-template-columns:1fr; } }
.card { background:#fff; border:1px solid #e6ebf2; border-radius:12px; padding:18px 20px; box-shadow:0 1px 3px rgba(16,32,64,.05); }
.card h2 { font-size:16px; font-weight:700; color:#0d1b2a; margin:0 0 12px; }
.card .table { margin:0; }
.card .table th { color:#6b7a90; font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.03em; border-bottom:2px solid #eef2f7; }
.card .table td { vertical-align:middle; }
.card .table .num { text-align:right; }
.dot { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px; }
.dot.on { background:#22c55e; } .dot.off { background:#9aa7b8; }

/* ── HQ management pages ────────────────────────────────────────────────── */
.hq-head-right .chk { color:#4b5a70; font-size:13px; display:inline-flex; align-items:center; gap:6px; }
.table.hover tbody tr { cursor:pointer; }
.table.hover tbody tr:hover { background:#f4f7fb; }
.table tbody tr.sel { background:#eaf2ff; }
.btn { border:1px solid #d6deea; background:#fff; color:#274060; border-radius:8px; padding:7px 14px; font-weight:600; cursor:pointer; font-size:13px; }
.btn:hover { background:#f4f7fb; }
.btn-primary { background:#2f6bff; border-color:#2f6bff; color:#fff; }
.btn-primary:hover { background:#255ae0; }
.btn-danger { background:#fff; border-color:#f5c2c7; color:#c62828; }
.btn-danger:hover { background:#fff5f5; }
.btn:disabled { opacity:.55; cursor:default; }

.form label { display:block; font-size:12px; color:#6b7a90; font-weight:600; margin:10px 0 0; }
.form input[type=text], .form input:not([type]), .form input[type=number] { width:100%; margin-top:4px; padding:8px 10px; border:1px solid #d6deea; border-radius:8px; font-size:14px; box-sizing:border-box; }
.form .row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form .chk { display:flex; align-items:center; gap:8px; margin-top:12px; font-size:13px; color:#274060; font-weight:600; }
.form-actions { display:flex; align-items:center; gap:10px; margin-top:16px; }
.form-actions .ok { color:#16a34a; font-weight:600; font-size:13px; }

.kv { display:flex; flex-wrap:wrap; gap:20px; margin-bottom:14px; }
.kv > div { display:flex; flex-direction:column; gap:2px; font-size:13px; }
.kv .muted, .token-box .muted { font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
code, .token { background:#f1f5fb; border:1px solid #e2e9f3; border-radius:6px; padding:3px 8px; font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px; color:#274060; }
.token-box { background:#f7faff; border:1px solid #e2e9f3; border-radius:10px; padding:12px 14px; }
.token-row { display:flex; align-items:center; gap:10px; margin:6px 0; }
.token { font-size:16px; letter-spacing:.06em; font-weight:600; }
.hint { font-size:11px; color:#8fa0b5; }

/* ── Products & Pricing ─────────────────────────────────────────────────── */
.filter-bar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:16px; }
.filter-bar .search { flex:1 1 240px; padding:8px 12px; border:1px solid #d6deea; border-radius:8px; font-size:14px; }
.filter-bar select, .form select { padding:8px 10px; border:1px solid #d6deea; border-radius:8px; font-size:14px; background:#fff; }
.form select { width:100%; margin-top:4px; box-sizing:border-box; }
.sub { color:#8fa0b5; font-size:11px; }

/* Two products carrying the same barcode. Both are shown and priced separately; the badge is what
   stops the second one looking like a duplicate row that can be ignored. */
/* A branch that has no stock record for the product at all. Deliberately not an empty editable cell:
   an empty cell means "uses the base price", which is a different thing entirely. */
td.na { background:#0b1220; }
.na-text { color:#64748b; font-size:11px; font-style:italic; }

.dupe {
    display:inline-block; margin-left:6px; padding:1px 6px; border-radius:9px;
    background:#7c2d12; color:#fed7aa; font-size:10px; font-weight:600; vertical-align:middle;
}
.num.neg, .neg strong { color:#c62828; }
.margin-pill { margin-top:10px; padding:8px 12px; background:#eefaf3; border:1px solid #cdeeda; border-radius:8px; font-size:13px; color:#166534; display:flex; gap:8px; align-items:baseline; }
.margin-pill.neg { background:#fff5f5; border-color:#f5c2c7; color:#c62828; }
.margin-pill .sub { color:inherit; opacity:.7; }

/* ── Users/Roles, Reports, Purchasing ───────────────────────────────────── */
.seg { display:inline-flex; border:1px solid #d6deea; border-radius:8px; overflow:hidden; }
.seg button { border:0; background:#fff; color:#4b5a70; padding:7px 14px; font-weight:600; font-size:13px; cursor:pointer; }
.seg button.on { background:#2f6bff; color:#fff; }
.card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.card-head h2 { margin:0; }
.card-head select { padding:7px 10px; border:1px solid #d6deea; border-radius:8px; font-size:14px; }
.filter-bar .inline { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#4b5a70; }
.filter-bar input[type=date] { padding:7px 10px; border:1px solid #d6deea; border-radius:8px; font-size:14px; }
.tile-sub { color:#8fa0b5; font-size:11px; margin-top:2px; }
.perm-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:8px; }
.perm { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid #e6ebf2; border-radius:8px; font-size:13px; color:#4b5a70; cursor:pointer; }
.perm.on { border-color:#bcd3ff; background:#f4f8ff; color:#274060; font-weight:600; }
input[type=password], .form input[type=password] { width:100%; margin-top:4px; padding:8px 10px; border:1px solid #d6deea; border-radius:8px; font-size:14px; box-sizing:border-box; }

/* ── Login + top bar ────────────────────────────────────────────────────── */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#0d1b2a,#1b2a4a); padding:20px; }
.login-card { width:100%; max-width:360px; background:#fff; border-radius:16px; padding:32px 28px; box-shadow:0 20px 60px rgba(0,0,0,.35); }
.login-brand { font-size:26px; font-weight:800; color:#0d1b2a; }
.login-brand span { color:#2f6bff; }
.login-sub { color:#6b7a90; font-size:13px; margin:2px 0 20px; }
.login-card label { display:block; font-size:12px; color:#6b7a90; font-weight:600; margin-top:12px; }
.login-card input { width:100%; margin-top:5px; padding:10px 12px; border:1px solid #d6deea; border-radius:9px; font-size:14px; box-sizing:border-box; }
.login-btn { width:100%; margin-top:20px; padding:11px; background:#2f6bff; color:#fff; border:0; border-radius:9px; font-weight:700; font-size:15px; cursor:pointer; }
.login-btn:hover { background:#255ae0; }
.login-hint { color:#8fa0b5; font-size:11px; text-align:center; margin-top:12px; }
.login-error { background:#fff5f5; border:1px solid #f5c2c7; color:#c62828; border-radius:9px; padding:9px 12px; font-size:13px; margin-bottom:4px; }
.top-row .whoami { color:#4b5a70; font-size:13px; font-weight:600; }
.top-row .whoami .role { color:#8fa0b5; font-weight:500; }
.logout-form { display:inline; margin:0; }
.logout-btn { border:1px solid #d6deea; background:#fff; color:#4b5a70; border-radius:8px; padding:6px 12px; font-size:12px; font-weight:600; cursor:pointer; }
.logout-btn:hover { background:#f4f7fb; }

/* ── Pricing matrix ─────────────────────────────────────────────────────── */
.inline-form { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:10px; }
.inline-form input { padding:8px 10px; border:1px solid #d6deea; border-radius:8px; font-size:14px; }
.inline-form input:not([style]) { flex:1 1 140px; }
.inline-form select { padding:7px 10px; border:1px solid #d6deea; border-radius:8px; font-size:14px; }
.bulk-box { margin-top:14px; padding-top:12px; border-top:1px solid #eef2f7; }
.matrix-scroll { overflow-x:auto; }
.table.matrix th, .table.matrix td { white-space:nowrap; }
.table.matrix .sticky { position:sticky; left:0; background:#fff; z-index:1; box-shadow:1px 0 0 #eef2f7; }
.table.matrix thead .sticky { background:#fff; }
.table.matrix .base { background:#f7faff; }
.pcell { width:78px; padding:5px 6px; border:1px solid #d6deea; border-radius:6px; font-size:13px; text-align:right; }
.pcell.empty { color:#9aa7b8; }
.table.matrix td.diff .pcell { border-color:#f0b429; background:#fffbeb; }

/* ── Stock / info alert ─────────────────────────────────────────────────── */
.alert-info { background:#eef5ff; border:1px solid #bcd3ff; color:#274060; border-radius:10px; padding:10px 14px; font-size:13px; margin-bottom:14px; }

/* ── Richer product form ────────────────────────────────────────────────── */
.fsec { font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:#8fa0b5; font-weight:700; margin:16px 0 2px; padding-bottom:4px; border-bottom:1px solid #eef2f7; }
.chips { display:flex; flex-wrap:wrap; gap:14px; margin-top:10px; }
.chips .chk { margin-top:0; }
.filter-bar .spacer { flex:1 1 auto; }
.bc-list { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0; }
.bc { display:inline-flex; align-items:center; gap:4px; background:#f1f5fb; border:1px solid #e2e9f3; border-radius:6px; padding:2px 4px 2px 8px; }
.bc code { background:none; border:0; padding:0; font-size:12px; }
.bc-x { border:0; background:none; color:#9aa7b8; cursor:pointer; font-size:12px; padding:0 4px; }
.bc-x:hover { color:#c62828; }

/* ── Brand logo ─────────────────────────────────────────────────────────── */
.login-logo { display:block; width:64px; height:64px; border-radius:16px; margin:0 auto 14px; box-shadow:0 6px 18px rgba(47,107,255,.35); }
.navbar-brand { display:flex; align-items:center; gap:10px; font-weight:700; }
.nav-logo { width:30px; height:30px; border-radius:8px; }
.navbar-brand .hq { color:#8ea2ff; font-weight:700; }

.login-company { background:#f4f8ff; border:1px solid #d6e2ff; border-radius:9px; padding:9px 12px; font-size:13px; color:#274060; margin-bottom:4px; }
.login-company strong { text-transform:capitalize; }

/* ── Printable documents (transfer notes, GRVs) ───────────────────────────────
   Rendered light on white regardless of the portal's dark chrome: these are
   printed on paper, and dark chrome on paper is a page of wasted toner. */
.doc-page { background:#fff; color:#0f172a; min-height:100vh; padding:24px; }
.doc { max-width:900px; margin:0 auto; font-size:13px; }
.doc-toolbar { max-width:900px; margin:0 auto 18px; display:flex; gap:8px; }

/* A copy past the first. Printed prominently on purpose: an unmarked second transfer note can be
   used to claim the same goods twice. */
.doc-reprint {
    border:2px solid #b91c1c; color:#b91c1c; font-weight:700; letter-spacing:.08em;
    text-transform:uppercase; font-size:12px; padding:4px 10px; margin-bottom:12px;
    display:inline-block; border-radius:3px;
}

.doc-head { display:flex; justify-content:space-between; align-items:flex-start;
            border-bottom:2px solid #0f172a; padding-bottom:12px; margin-bottom:16px; }
.doc-head h1 { font-size:22px; margin:0; letter-spacing:-.01em; }
.doc-no { font-family:ui-monospace,Consolas,monospace; font-size:15px; margin-top:4px; }
.doc-org { text-align:right; }
.doc-org .org-name { font-weight:700; font-size:15px; }
.doc-page .muted { color:#64748b; }

.doc-meta { display:grid; grid-template-columns:repeat(2,1fr); gap:6px 32px; margin-bottom:18px; }
.doc-meta div { border-bottom:1px dotted #cbd5e1; padding-bottom:3px; }
.doc-meta span { display:inline-block; width:130px; color:#64748b; }

.doc-table { width:100%; border-collapse:collapse; }
.doc-table th { text-align:left; border-bottom:1.5px solid #0f172a; padding:6px 8px; font-size:11px;
                text-transform:uppercase; letter-spacing:.04em; }
.doc-table td { padding:5px 8px; border-bottom:1px solid #e2e8f0; vertical-align:top; }
.doc-table .num { text-align:right; }
.doc-table tfoot td { border-top:1.5px solid #0f172a; border-bottom:none; font-weight:700; }
.doc-table tfoot tr.grand td { border-top:none; font-size:15px; }
.doc-table .mono { font-family:ui-monospace,Consolas,monospace; font-size:11px; color:#475569; }
.doc-table .sub { font-size:11px; }

.doc-note { margin-top:14px; padding:8px 10px; background:#f1f5f9; border-left:3px solid #64748b; }
.doc-sign { display:grid; grid-template-columns:repeat(2,1fr); gap:48px; margin-top:44px; }
.doc-sign .rule { display:block; border-top:1px solid #0f172a; margin-bottom:5px; }
.doc-foot { margin-top:24px; color:#64748b; font-size:11px; }

@media print {
    /* The portal chrome and anything that only makes sense on screen. */
    .no-print, .sidebar, .top-row { display:none !important; }
    .doc-page { padding:0; }
    .doc-table { font-size:11px; }
    .doc-table thead { display:table-header-group; }   /* repeat headings across pages */
    .doc-table tr { break-inside:avoid; }
    @page { margin:14mm; }
}

/* ── Branch picker chips (Pricing comparison) ─────────────────────────────────
   A chip is on or off at a glance and clears in one click; a multi-select box
   hides what is being compared behind a closed control. */
.branch-picker { align-items:center; }
.chip {
    display:inline-flex; align-items:center; gap:6px;
    border:1px solid #d6deea; background:#fff; color:#4b5a70;
    border-radius:20px; padding:6px 13px; font-weight:600; font-size:12.5px; cursor:pointer;
}
.chip:hover { background:#f4f7fb; }
.chip.on { background:#eaf1ff; border-color:#2f6bff; color:#2f6bff; }
.chip:focus-visible { outline:2px solid #2f6bff; outline-offset:1px; }
.chip-note {
    font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
    color:#6b7a90; background:#eef2f7; border-radius:8px; padding:1px 6px;
}
.chip.on .chip-note { background:#fff; color:#2f6bff; }

/* ═══════════════════════════════════════════════════════════════════════════
   HQ 2026 — dashboard, scrolling lists, icons.
   Extends the palette that was already here (#0d1b2a ink, #2f6bff accent,
   #e6ebf2 line) rather than replacing it, so existing pages keep working
   untouched while new ones draw from the tokens.
   ═══════════════════════════════════════════════════════════════════════════ */
:root{
    --hq-ground:#f4f7fb;  --hq-surface:#fff;   --hq-surface-2:#fafbfd;
    --hq-ink:#0d1b2a;     --hq-ink-2:#38465c;  --hq-muted:#6b7a90;
    --hq-line:#e6ebf2;    --hq-line-2:#d6deea;
    --hq-accent:#2f6bff;  --hq-accent-soft:#eaf1ff;
    --hq-good:#0f7a55;    --hq-good-soft:#e6f5ef;
    --hq-warn:#9a5b00;    --hq-warn-soft:#fdf1e0;
    --hq-crit:#c0392b;    --hq-crit-soft:#fdeceb;
    --hq-shadow:0 1px 3px rgba(16,32,64,.06);
}

/* ── Icons ──────────────────────────────────────────────────────────────────
   Inline SVG on currentColor. The old nav glyphs were white PNGs baked into
   this stylesheet, invisible anywhere but the dark sidebar; these inherit the
   colour of whatever they sit in, so one set serves the nav, buttons and both
   themes. */
.ico { display:inline-block; vertical-align:-.18em; flex:none; }
.nav-link .ico { margin-right:.7rem; opacity:.85; }
.nav-link.active .ico { opacity:1; }
.btn .ico, .chip .ico { margin-right:2px; }

/* ── Branch rail ────────────────────────────────────────────────────────────
   The left stripe is the branch's state. It is the only ink spent on state,
   so nothing else on the card competes with it. */
.rail { display:grid; grid-template-columns:repeat(auto-fit,minmax(215px,1fr)); gap:12px; }
.branch-card {
    background:var(--hq-surface); border:1px solid var(--hq-line); border-radius:12px;
    padding:14px 15px; box-shadow:var(--hq-shadow); position:relative; overflow:hidden;
    display:flex; flex-direction:column; gap:9px; min-width:0; text-decoration:none; color:inherit;
}
a.branch-card:hover { border-color:var(--hq-line-2); box-shadow:0 4px 14px rgba(16,32,64,.09); }
.branch-card::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--hq-good); }
.branch-card.stale::before { background:var(--hq-warn); }
.branch-card.down::before  { background:var(--hq-crit); }
.branch-card .top { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.branch-card .name {
    font-weight:600; font-size:13.5px; min-width:0;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.branch-card .take { font-size:22px; font-weight:700; letter-spacing:-.02em; line-height:1.1;
    font-variant-numeric:tabular-nums; }
.branch-card .take small { font-size:11px; font-weight:600; color:var(--hq-muted); margin-left:4px; }
.branch-card .meta { display:flex; justify-content:space-between; gap:8px; font-size:11.5px; color:var(--hq-muted); }
.branch-card .spark { display:block; width:100%; height:26px; }

/* Freshness as elapsed time, not a green dot: "when did I last hear from it"
   is the question a head office actually asks. */
.pulse { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; white-space:nowrap; }
.pulse i { width:6px; height:6px; border-radius:50%; flex:none; position:relative; background:var(--hq-good); }
.pulse.ok    { color:var(--hq-good); }
.pulse.stale { color:var(--hq-warn); } .pulse.stale i { background:var(--hq-warn); }
.pulse.down  { color:var(--hq-crit); } .pulse.down  i { background:var(--hq-crit); }
.pulse.ok i::after {
    content:""; position:absolute; inset:-4px; border-radius:50%;
    border:1px solid var(--hq-good); opacity:.55; animation:hq-ping 2.4s ease-out infinite;
}
@keyframes hq-ping { 0%{transform:scale(.6);opacity:.65} 100%{transform:scale(1.5);opacity:0} }
@media (prefers-reduced-motion:reduce){ .pulse.ok i::after{ animation:none; opacity:.35 } }

/* ── Dashboard layout ───────────────────────────────────────────────────── */
.dash-grid { display:grid; grid-template-columns:1.55fr 1fr; gap:14px; align-items:start; }
@media (max-width:900px){ .dash-grid { grid-template-columns:1fr; } }
.stack { display:flex; flex-direction:column; gap:12px; }
.eyebrow { font-weight:600; font-size:11px; letter-spacing:.09em; text-transform:uppercase; color:var(--hq-muted); }
.big-figure { font-size:26px; font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.delta { font-size:12px; font-weight:600; margin-left:7px; }
.delta.up { color:var(--hq-good); } .delta.down { color:var(--hq-crit); }

/* A chart shrunk to phone width takes its axis labels down with it, so it keeps
   a readable minimum and scrolls in its own box instead. */
.chartbox { overflow-x:auto; overscroll-behavior-x:contain; }
.chartbox svg { display:block; min-width:520px; }
.legend { display:flex; gap:14px; font-size:11.5px; color:var(--hq-muted); margin-top:10px; flex-wrap:wrap; }
.legend span { display:inline-flex; align-items:center; gap:6px; }
.legend i { width:14px; height:3px; border-radius:2px; background:var(--hq-accent); flex:none; }
.legend i.ghost { background:var(--hq-line-2); }

/* ── Needs attention ────────────────────────────────────────────────────── */
.queue { display:flex; flex-direction:column; }
.q-item { display:flex; gap:11px; padding:11px 0; border-top:1px solid var(--hq-line); align-items:flex-start;
    text-decoration:none; color:inherit; }
.q-item:first-child { border-top:0; }
a.q-item:hover .q-title { color:var(--hq-accent); }
.q-ico { width:28px; height:28px; border-radius:8px; display:grid; place-items:center; flex:none; }
.q-ico.crit { background:var(--hq-crit-soft); color:var(--hq-crit); }
.q-ico.warn { background:var(--hq-warn-soft); color:var(--hq-warn); }
.q-ico.info { background:var(--hq-accent-soft); color:var(--hq-accent); }
.q-body { flex:1; min-width:0; }
.q-title { font-weight:600; font-size:13px; }
.q-sub { color:var(--hq-muted); font-size:12px; margin-top:1px; }
.q-val { text-align:right; flex:none; }
.q-val b { display:block; font-size:14px; font-weight:700; font-variant-numeric:tabular-nums; }
.q-val span { font-size:10.5px; color:var(--hq-muted); }

/* ── Department mix ─────────────────────────────────────────────────────── */
.mix { display:flex; flex-direction:column; gap:9px; }
.mix-row { display:grid; grid-template-columns:1fr 84px; gap:10px; align-items:center; font-size:12.5px; }
.mix-label { display:flex; flex-direction:column; gap:4px; min-width:0; }
.mix-label span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mix-track { height:6px; border-radius:3px; background:var(--hq-line); overflow:hidden; }
.mix-fill { height:100%; border-radius:3px; background:var(--hq-accent); }
.mix-val { text-align:right; font-variant-numeric:tabular-nums; color:var(--hq-ink-2); font-weight:600; }

/* ── Scrolling list container ───────────────────────────────────────────────
   Sticky header, the body scrolls in its own box, totals pinned in the footer.
   The same container on every screen, so a 4,000-row catalogue behaves exactly
   like a 12-row one and the actions never scroll out of reach. */
.tablebox { border:1px solid var(--hq-line); border-radius:12px; overflow:hidden;
    background:var(--hq-surface); box-shadow:var(--hq-shadow); }
.tablebox .scroller { max-height:min(58vh, 560px); overflow:auto; overscroll-behavior:contain; }
.tablebox table { width:100%; border-collapse:collapse; margin:0; }
.tablebox thead th {
    position:sticky; top:0; z-index:2; background:var(--hq-surface-2); color:var(--hq-muted);
    font-weight:600; font-size:11px; letter-spacing:.07em; text-transform:uppercase; text-align:left;
    padding:10px 14px; border-bottom:1px solid var(--hq-line); white-space:nowrap;
}
.tablebox tbody td { padding:10px 14px; border-bottom:1px solid var(--hq-line); vertical-align:middle; }
.tablebox tbody tr:last-child td { border-bottom:0; }
.tablebox tbody tr:hover { background:var(--hq-surface-2); }
.tablebox .t-name { font-weight:600; }
.tablebox .t-sub { color:var(--hq-muted); font-size:11.5px; margin-top:1px; }
.tablebox .num, .tablebox .right { text-align:right; }
.tablefoot { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;
    padding:9px 14px; border-top:1px solid var(--hq-line); background:var(--hq-surface-2);
    font-size:12px; color:var(--hq-muted); }
.tablefoot b { color:var(--hq-ink); font-variant-numeric:tabular-nums; }
.tablebox.dense .scroller { max-height:min(52vh, 460px); }
.tablebox.dense tbody td { padding:5px 14px; }
.tablebox.dense .t-sub { display:none; }

/* ── State pills ────────────────────────────────────────────────────────── */
.pill { display:inline-flex; align-items:center; gap:5px; border-radius:20px; padding:3px 9px;
    font-weight:600; font-size:11px; line-height:1.5; white-space:nowrap; }
.pill.good { background:var(--hq-good-soft); color:var(--hq-good); }
.pill.warn { background:var(--hq-warn-soft); color:var(--hq-warn); }
.pill.crit { background:var(--hq-crit-soft); color:var(--hq-crit); }
.pill.flat { background:var(--hq-surface-2); color:var(--hq-muted); border:1px solid var(--hq-line); }

.iconbtn { border:1px solid var(--hq-line-2); background:var(--hq-surface); border-radius:7px;
    padding:5px 7px; cursor:pointer; color:var(--hq-ink-2); display:inline-grid; place-items:center; }
.iconbtn:hover { background:var(--hq-accent-soft); border-color:var(--hq-accent); color:var(--hq-accent); }

/* ── Bulk action bar ────────────────────────────────────────────────────── */
.bulkbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap;
    background:var(--hq-accent-soft); border:1px solid var(--hq-accent); border-radius:10px;
    padding:9px 13px; margin-bottom:10px; color:var(--hq-accent); font-weight:600; font-size:13px; }
.bulkbar .grow { flex:1 1 auto; min-width:0; }
.btn-ghost { background:transparent; border-color:transparent; color:var(--hq-accent); }
.btn-ghost:hover { background:var(--hq-accent-soft); }
input[type=checkbox] { accent-color:var(--hq-accent); }

.errline { font-family:ui-monospace,Consolas,monospace; font-size:11px; color:var(--hq-crit);
    background:var(--hq-crit-soft); border-radius:6px; padding:3px 8px; margin-top:4px;
    display:inline-block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

@media (max-width:460px){
    .big-figure { font-size:22px; }
    .branch-card .take { font-size:20px; }
    .tablebox .scroller { max-height:min(50vh, 380px); }
}

/* ── Insights ───────────────────────────────────────────────────────────────
   The analytics page. Everything here is additive: it reuses .card, .tile,
   .table and .filter-bar from above and only adds what those cannot express -
   a labelled bar row, a margin pill, and the categorical series slots.

   The eight series colours are the validated categorical palette, in FIXED
   order. They are assigned by position and never cycled: a filter that drops a
   department must not repaint the ones that survive, or two screenshots of the
   same shop stop being comparable. */
.ins-s1 { --s:#2a78d6; } .ins-s2 { --s:#eb6834; } .ins-s3 { --s:#1baf7a; } .ins-s4 { --s:#eda100; }
.ins-s5 { --s:#e87ba4; } .ins-s6 { --s:#008300; } .ins-s7 { --s:#4a3aa7; } .ins-s8 { --s:#e34948; }

.ins-bars { display:flex; flex-direction:column; gap:11px; }
.ins-row { display:grid; grid-template-columns:minmax(0,1fr) 96px; gap:12px; align-items:center; font-size:12.5px; }
.ins-name { display:flex; flex-direction:column; gap:5px; min-width:0; }
.ins-name > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--hq-ink-2); }
.ins-track { height:8px; border-radius:4px; background:var(--hq-line); overflow:hidden; display:flex; }
/* 4px rounded data-end anchored to the baseline; the fill carries the series colour and the
   text beside it stays in ink, so identity is never colour-alone. */
.ins-fill { height:100%; border-radius:4px; background:var(--s, var(--hq-accent)); min-width:2px; }
.ins-val { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; color:var(--hq-ink); }

/* Two measures on one row, as two thin bars rather than a second y-axis. */
.ins-track.pair { height:6px; margin-bottom:3px; }
.ins-track.pair.b .ins-fill { background:var(--hq-good); }

.ins-pill { display:inline-block; padding:1px 7px; border-radius:9px; font-size:11px; font-weight:700;
            font-variant-numeric:tabular-nums; }
.ins-pill.good { background:var(--hq-good-soft); color:var(--hq-good); }
.ins-pill.warn { background:var(--hq-warn-soft); color:var(--hq-warn); }
.ins-pill.crit { background:var(--hq-crit-soft); color:var(--hq-crit); }

.ins-swatch { width:10px; height:10px; border-radius:3px; background:var(--s); flex:none; display:inline-block; }

.ins-note { background:var(--hq-warn-soft); border:1px solid #f0dcbc; color:var(--hq-warn);
            border-radius:10px; padding:10px 14px; font-size:12.5px; margin-bottom:16px; }
.ins-note b { display:block; margin-bottom:4px; }

.ins-span { grid-column:1 / -1; }
.ins-scroll { max-height:340px; overflow:auto; }
.ins-foot { margin-top:10px; font-size:11.5px; color:var(--hq-muted); }
.ins-head-fig { font-size:13px; color:var(--hq-ink-2); margin:-4px 0 12px; }
.ins-head-fig b { color:var(--hq-ink); font-size:15px; }

/* The per-branch currency split: a thin stacked strip on the branch card, coloured from the
   same fixed palette as the dashboard's ring so a currency reads the same in both. Segments
   are sized by BASE value - by face value a 40:1 rate alone would fill the strip with ZWG. */
.ccy-mix { display:flex; gap:2px; height:4px; border-radius:2px; overflow:hidden; margin:0 0 8px; }
.ccy-mix > span { background:var(--s, var(--hq-accent)); border-radius:2px; min-width:3px; }
