/* ============================================================================
   opsyte.css — the Opsyte design system ("On the Floor+", October 2026)
   ----------------------------------------------------------------------------
   ONE stylesheet for the whole portal, written from the design canvas
   (Documentation/UI/README.md explains every section and names the artboards).
   Anything Bootstrap already has is written with Bootstrap's class names and
   re-skinned in section 6; the canvas's own names remain for compositions
   Bootstrap has no equivalent of. A page's one-off layout belongs in its
   scoped .razor.css, not here.

   Sections
     1. Tokens            custom properties + the Bootstrap variable bridge
     2. Base              html/body, type, links, utilities
     3. Shell             sidebar (.sb*), top bar (.tb*), page frame (.pg)
     4. Primitives        buttons, cards, inputs, tags, tables, modals, menus…
     5. Compositions      KPI tiles, report rail, record modals, chart cards…
     6. Re-skin           Bootstrap + Havit (Hx*) + Blazored + alertify
     7. Responsive        phone-width rules
        then the top-bar menus, the stock kit (sk-*) and smaller shared pieces,
        each under its own ---- heading (after section 7 because some of them
        refine rules above)
     8. Third-party editors   sceditor (contract templates)

   Rules of the road (see the guide for the long version):
     - Never add a hex colour to a page: use a token.
     - Pills are 999px. Cards are 18px. Inputs are 12px. Modals are 22px.
     - Status colours (ok/warn/bad/info/nu) are tonal: tinted fill + deep text.
   ============================================================================ */

/* ============================================================================
   1. TOKENS
   Light values on :root and on anything marked data-bs-theme="light" (the sidebar, legacy pages), dark values
   under data-bs-theme="dark" (set on <html> by wwwroot/js/theme.js from the user's light / dark / system choice).
   Everything else in this file reads these tokens, so it follows the theme.
   ============================================================================ */
:root, [data-bs-theme="light"] {
    /* brand greens */
    --ui-green: #1F6B4A;
    --ui-green-deep: #164F37;
    /* deep green as text (on a tint or the page); --ui-green-deep is the fill of bands and heads */
    --ui-green-ink: #164F37;
    /* green and red as a fill behind white text (buttons, badges, avatars); a shade deeper in dark mode */
    --ui-green-fill: #1F6B4A;
    --ui-danger-fill: #B3261E;
    --ui-green-mid: #2E8B62;
    --ui-mint: #7DC8A5;
    --ui-mint-tint: #DDF1E6;
    --ui-mint-line: #B9E0CB;
    --ui-mint-line-2: #CFE6D9;
    --ui-mint-line-3: #BFDFCD;
    --ui-green-wash: #F1F8F4;
    --ui-green-wash-2: #F2FAF5;

    /* sidebar */
    --ui-sb-bg: #13231B;
    --ui-sb-hover: #1D3328;
    --ui-sb-ai: #1A2E24;
    --ui-sb-text: #C9D6CF;
    --ui-sb-muted: #7E9188;
    --ui-sb-section: #6E8278;
    --ui-sb-rule: #2A4035;
    --ui-sb-w: 248px;
    --ui-sb-mini-w: 72px;

    /* surfaces */
    --ui-bg: #F7F5F0;
    --ui-surface: #FFFFFF;
    --ui-surface-2: #FBFAF6;
    --ui-panel: #F3F0E8;
    --ui-ghost: #ECE8DF;

    /* lines */
    --ui-line: #E2DED4;
    --ui-line-2: #ECE8DF;
    --ui-line-3: #F0ECE3;
    --ui-line-4: #F3F0E8;
    --ui-line-5: #E9E5DB;
    --ui-line-hover: #C9C3B5;
    --ui-dash: #D8D2C4;
    --ui-chip: #DDD8CC;

    /* ink */
    --ui-ink: #1B2620;
    --ui-ink-2: #2D3832;
    --ui-ink-3: #45504A;
    --ui-muted: #5E6A63;
    --ui-muted-2: #8A948E;
    --ui-muted-3: #9C9585;
    --ui-muted-4: #7E8A83;
    /* text on a fill: --ui-on-fill on saturated green / red / blue / the sidebar (white in both themes),
       --ui-on-ink on an ink fill (selected segments, tooltips, btn-dark), which inverts with the ink */
    --ui-on-fill: #FFFFFF;
    --ui-on-ink: #FFFFFF;

    /* status (tonal fill / deep text) */
    --ui-ok-bg: #DDF1E6;     --ui-ok: #164F37;
    --ui-warn-bg: #FFF1D6;   --ui-warn: #7A4D00;
    --ui-bad-bg: #FCE4E2;    --ui-bad: #8C1D18;
    --ui-nu-bg: #ECE8DF;     --ui-nu: #45504A;
    --ui-info-bg: #DCE7FA;   --ui-info: #17306B;
    --ui-danger: #B3261E;    --ui-danger-line: #F2C6C1;  --ui-danger-wash: #FFF4F2;  --ui-danger-wash-2: #FFF7F6;
    --ui-warn-wash: #FFF6E0; --ui-info-wash: #EEF3FB; --ui-warn-ring: #F0D9A0; --ui-warn-card: #FFF8E6;
    --ui-amber: #E39A3B;     --ui-gold: #A0782C;
    --ui-c1-bg: #E6E8FA; --ui-c1: #2F3A8F;
    --ui-c5-bg: #F3E8FA; --ui-c5: #5B2A7A;

    /* AI */
    --ui-ai-gradient: linear-gradient(90deg, #6FA8F5, #7DC8A5, #E7C66B);

    /* charts (see guide §Charts) */
    --ui-chart-ink: #1B2620;
    --ui-chart-amber: #E39A3B;
    --ui-chart-mint: #DDF1E6;
    --ui-chart-purple: #8B6FC9;
    --ui-chart-green: #7FB24A;
    --ui-chart-orange: #F0A35E;
    --ui-chart-pink: #E77C8E;
    --ui-chart-blue: #4F8FD8;
    --ui-chart-grid: #EEEAE1;
    --ui-chart-axis: #C9C3B5;

    /* radii */
    --ui-r-pill: 999px;
    --ui-r-modal: 22px;
    --ui-r-card: 18px;
    --ui-r-box: 16px;
    --ui-r-inner: 14px;
    --ui-r-input: 12px;
    --ui-r-sm: 10px;
    --ui-r-xs: 9px;

    /* shadows */
    --ui-shadow-card: 0 1px 0 #E9E5DB;
    --ui-shadow-dd: 0 20px 50px rgba(0, 0, 0, .18);
    --ui-shadow-modal: 0 24px 60px rgba(0, 0, 0, .25);
    --ui-shadow-fab: 0 6px 18px rgba(0, 0, 0, .18);
    --ui-shadow-sb: 12px 0 32px rgba(0, 0, 0, .22);
    --ui-scrim: rgba(19, 35, 27, .45);

    /* report heat (lo → hi) */
    --ui-heat-lo: #F2C6C1; --ui-heat-mid: #F3F0E8; --ui-heat-hi: #7DC8A5;
    --ui-star: #E0A526;
    /* leave colours (Holiday / My Holiday month grid): the canvas values, data-meaningful */
    --ui-leave-pending: #D9D6CE; --ui-leave-holiday: #E3D4F3; --ui-leave-unpaid: #D4E6F7; --ui-leave-lieu: var(--ui-ok-bg);
    --ui-leave-restricted: #E5484D; --ui-leave-restricted-cell: #F5B5B2; --ui-day-weekend: #F3F1EC; --ui-day-today: #FFF7D6;
    /* tile tones used by Staff Overview / Manage Staff / Contracts */
    --ui-tile-blue: #3F7FC4; --ui-tile-blue-deep: #2D639E; --ui-tile-grey: #6B746F; --ui-tile-grey-deep: #535B56;
    --ui-tile-purple: #6E55A6; --ui-tile-purple-deep: #563F87; --ui-purple: #5B2A86; --ui-purple-bg: #EFE4FA;
    --ui-purple-tile: #EAE1F8; --ui-purple-tile-ink: #3F2373; --ui-body: #45504A;
    /* rota leave chips and rank medals */
    --ui-lv-holiday: #8E2F55; --ui-lv-holiday-bg: #FBE0EA; --ui-lv-sick: #8A4A1C; --ui-lv-sick-bg: #FDE6D6;
        --ui-lv-lieu: #5B3D8C; --ui-lv-lieu-bg: #ECE3F7; --ui-lv-unpaid: #1F4E80; --ui-lv-unpaid-bg: #DCEBFA;
        --ui-gold-rank: #E0A526; --ui-silver-rank: #A9B0AC; --ui-bronze-rank: #C47A3D;
    --ui-ai-gold: #E8C36A;
    /* Global Admin landing section bands (S-GlobalAdmin) */
    --ui-ga-staffing: #6FBF92; --ui-ga-companies: #98B9E3; --ui-ga-marketing: #3E4A59; --ui-ga-integrations: #FF6B6B;
    --ui-ga-reports: #A48AD4; --ui-ga-invoice: #C7B7E4; --ui-ga-dot: #E7A93B;

    /* rota shift states (artboard Rota-ShiftColours; week grid and day view) and rota accents */
    --ui-shift-own-bg: #FFF1BF;   --ui-shift-own-bar: #E6B422;
    --ui-shift-apr-bg: #DDF1E6;   --ui-shift-apr-bar: #1F6B4A;  --ui-shift-apr-ink: #164F37;
    --ui-shift-oth-bg: #EFE3CF;   --ui-shift-oth-ink: #5A4630;
    --ui-shift-nw-bg: #ECE8DF;    --ui-shift-nw-ink: #45504A;
    --ui-shift-sd-line: #E2DED4;
    --ui-shift-hol-bg: #F6E3EF;   --ui-shift-hol-bar: #B8508F;  --ui-shift-hol-ink: #7A2A5B;
    --ui-shift-ssl-bg: #FDE3CC;   --ui-shift-ssl-bar: #D9731F;  --ui-shift-ssl-ink: #7A3E0A;
    --ui-shift-lieu-bg: #ECE4FA;  --ui-shift-lieu-bar: #7A55C7; --ui-shift-lieu-ink: #4B2F8A;
    --ui-shift-unp-bg: #DCEFF8;   --ui-shift-unp-bar: #2F86B5;  --ui-shift-unp-ink: #174D6B;
    --ui-shift-ntd-bg: #FDF0F1;   --ui-shift-ntd-cell: #FBEDED;
    --ui-shift-hover: #1F6B4A;
    --ui-rota-note: #2F5FC4;      --ui-rota-note-line: #9DB8E8;
    --ui-rota-pie: #C46A1A;       --ui-rota-pie-line: #F2B26B;
    --ui-rota-flex-bg: #FFEBDD;   --ui-rota-label: #16736A;

    /* hover shades of the tonal buttons */
    --ui-mint-hover: #CBE9D8; --ui-info-hover: #C9D8F5; --ui-warn-hover: #FBE4B8; --ui-danger-deep: #9E211A;

    /* type */
    --ui-font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ui-ease: cubic-bezier(.2, .7, .2, 1);

    /* ---- Bootstrap bridge: Havit (Hx*) components render Bootstrap markup; these make them ours ---- */
    --bs-body-font-family: var(--ui-font);
    --bs-body-font-size: 1rem;
    --bs-body-line-height: 1.5;
    --bs-body-color: var(--ui-ink);
    --bs-body-color-rgb: 27, 38, 32;
    --bs-body-bg: var(--ui-bg);
    --bs-body-bg-rgb: 247, 245, 240;
    --bs-emphasis-color: var(--ui-ink);
    --bs-emphasis-color-rgb: 27, 38, 32;
    --bs-secondary-color: var(--ui-muted);
    --bs-secondary-color-rgb: 94, 106, 99;
    --bs-secondary-bg: var(--ui-surface-2);
    --bs-tertiary-color: var(--ui-muted-2);
    --bs-tertiary-bg: var(--ui-panel);
    --bs-heading-color: var(--ui-ink);
    --bs-link-color: var(--ui-green);
    --bs-link-color-rgb: 31, 107, 74;
    --bs-link-hover-color: var(--ui-green-ink);
    --bs-link-hover-color-rgb: 22, 79, 55;
    --bs-border-color: var(--ui-line);
    --bs-border-color-translucent: rgba(27, 38, 32, .08);
    --bs-border-radius: var(--ui-r-input);
    --bs-border-radius-sm: var(--ui-r-sm);
    --bs-border-radius-lg: var(--ui-r-card);
    --bs-border-radius-xl: var(--ui-r-modal);
    --bs-border-radius-pill: var(--ui-r-pill);
    --bs-primary: var(--ui-green);
    --bs-primary-rgb: 31, 107, 74;
    --bs-primary-text-emphasis: var(--ui-green-ink);
    --bs-primary-bg-subtle: var(--ui-mint-tint);
    --bs-primary-border-subtle: var(--ui-mint-line);
    --bs-secondary: var(--ui-muted);
    --bs-secondary-rgb: 94, 106, 99;
    --bs-secondary-text-emphasis: var(--ui-ink-3);
    --bs-secondary-bg-subtle: var(--ui-panel);
    --bs-secondary-border-subtle: var(--ui-line);
    --bs-success: var(--ui-green);
    --bs-success-rgb: 31, 107, 74;
    --bs-success-text-emphasis: var(--ui-ok);
    --bs-success-bg-subtle: var(--ui-ok-bg);
    --bs-success-border-subtle: var(--ui-mint-line);
    --bs-info: var(--ui-info);
    --bs-info-rgb: 23, 48, 107;
    --bs-info-text-emphasis: var(--ui-info);
    --bs-info-bg-subtle: var(--ui-info-bg);
    --bs-info-border-subtle: #C5D4F2;
    --bs-warning: var(--ui-amber);
    --bs-warning-rgb: 227, 154, 59;
    --bs-warning-text-emphasis: var(--ui-warn);
    --bs-warning-bg-subtle: var(--ui-warn-bg);
    --bs-warning-border-subtle: #F3DDAE;
    --bs-danger: var(--ui-danger);
    --bs-danger-rgb: 179, 38, 30;
    --bs-danger-text-emphasis: var(--ui-bad);
    --bs-danger-bg-subtle: var(--ui-bad-bg);
    --bs-danger-border-subtle: var(--ui-danger-line);
    --bs-light: var(--ui-bg);
    --bs-light-rgb: 247, 245, 240;
    --bs-light-bg-subtle: var(--ui-surface);
    --bs-dark: var(--ui-ink);
    --bs-dark-rgb: 27, 38, 32;
    --bs-dark-bg-subtle: var(--ui-ink-3);
    --bs-focus-ring-color: rgba(var(--bs-primary-rgb), .25);
    --bs-form-valid-color: var(--ui-green);
    --bs-form-valid-border-color: var(--ui-green);
    --bs-form-invalid-color: var(--ui-danger);
    --bs-form-invalid-border-color: var(--ui-danger);

    /* Havit calendar (HxInputDate / HxCalendar) */
    --hx-calendar-day-selected-background: var(--ui-green-fill);
    --hx-calendar-day-selected-color: var(--ui-on-fill);
    --hx-calendar-day-selected-border: 0;
    --hx-calendar-day-hover-background: var(--ui-mint-tint);

    /* ---- legacy aliases still referenced by un-migrated pages; remove with the last reference ---- */
    --operator-ai-gradient: var(--ui-ai-gradient);
    --operator-ai-gradient-subtle: var(--ui-ai-gradient);
    --operator-background: var(--ui-surface);
    --table-heading-colour: var(--ui-mint-tint);
    --table-outline-colour: var(--ui-line);
    --rota-danger: var(--ui-danger);
    --scrollbar-width: 16px;
    --holiday-lilac: 200, 127, 182;
    --holiday-light-blue: 145, 215, 236;
    --holiday-light-grey: 175, 188, 200;
    --holiday-light-green: 140, 230, 180;
}

/* Dark theme. Surfaces and lines take the sidebar's green-black; ink turns light; tonal status pairs become a dark
   tinted fill with light text; green is a touch brighter so it reads as a fill and as link text. Data colours
   (tiles, Global Admin bands, chart series, rank medals) keep their light-theme values. */
[data-bs-theme="dark"] {
    color-scheme: dark;

    --ui-green: #3A9A6D;
    --ui-green-deep: #1E5C41;
    --ui-green-ink: #8FD3B0;
    --ui-green-fill: #2F8560;
    --ui-danger-fill: #C0392F;
    --ui-green-mid: #48A97B;
    --ui-mint-tint: #1E3A2D;
    --ui-mint-line: #2E5B45;
    --ui-mint-line-2: #2A4A3B;
    --ui-mint-line-3: #2E5444;
    --ui-green-wash: #16241D;
    --ui-green-wash-2: #172820;

    --ui-bg: #101613;
    --ui-surface: #171F1B;
    --ui-surface-2: #1B2420;
    --ui-panel: #212B26;
    --ui-ghost: #28332D;

    --ui-line: #344039;
    --ui-line-2: #2B3631;
    --ui-line-3: #26302B;
    --ui-line-4: #222C27;
    --ui-line-5: #2B3631;
    --ui-line-hover: #4C5952;
    --ui-dash: #3D4943;
    --ui-chip: #3A4640;

    --ui-ink: #E6ECE8;
    --ui-ink-2: #D2DAD5;
    --ui-ink-3: #B5C0BA;
    --ui-muted: #96A29B;
    --ui-muted-2: #7F8B85;
    --ui-muted-3: #8F9890;
    --ui-muted-4: #8A958F;
    --ui-on-ink: #101613;

    --ui-ok-bg: #1C3A2C;     --ui-ok: #9ADBB8;
    --ui-warn-bg: #3B2F15;   --ui-warn: #F0C46E;
    --ui-bad-bg: #3E201E;    --ui-bad: #F4A8A0;
    --ui-nu-bg: #28332D;     --ui-nu: #C1CBC5;
    --ui-info-bg: #1D2B45;   --ui-info: #AAC3F3;
    --ui-danger: #E0625A;    --ui-danger-line: #5C2F2B;  --ui-danger-wash: #2A1A18;  --ui-danger-wash-2: #2D1C1A;
    --ui-warn-wash: #2B2414; --ui-info-wash: #19223A; --ui-warn-ring: #6A5122; --ui-warn-card: #2E2714;
    --ui-amber: #E8A54C;     --ui-gold: #D8B064;
    --ui-c1-bg: #252A4D; --ui-c1: #B9C0F6;
    --ui-c5-bg: #33223F; --ui-c5: #DCB9F2;

    --ui-chart-ink: #E6ECE8;
    --ui-chart-mint: #2E5B45;
    --ui-chart-grid: #2B3631;
    --ui-chart-axis: #5A6760;

    --ui-shadow-card: 0 1px 0 rgba(0, 0, 0, .4);
    --ui-shadow-dd: 0 20px 50px rgba(0, 0, 0, .55);
    --ui-shadow-modal: 0 24px 60px rgba(0, 0, 0, .65);
    --ui-shadow-fab: 0 6px 18px rgba(0, 0, 0, .5);
    --ui-scrim: rgba(0, 0, 0, .6);

    --ui-heat-lo: #5C2F2B; --ui-heat-mid: #222C27; --ui-heat-hi: #2E7A57;
    --ui-leave-pending: #3A403C; --ui-leave-holiday: #3A2D4D; --ui-leave-unpaid: #213448;
    --ui-leave-restricted-cell: #5C2F2B; --ui-day-weekend: #1D2520; --ui-day-today: #3A3418;
    --ui-purple: #C9A9EE; --ui-purple-bg: #33223F; --ui-purple-tile: #2E2440; --ui-purple-tile-ink: #D6C2F5; --ui-body: #B5C0BA;
    --ui-lv-holiday: #F0A3C2; --ui-lv-holiday-bg: #3F1F2D; --ui-lv-sick: #F2B68A; --ui-lv-sick-bg: #3D2818;
    --ui-lv-lieu: #C9B3F0; --ui-lv-lieu-bg: #2E2442; --ui-lv-unpaid: #9EC4EE; --ui-lv-unpaid-bg: #1C2E44;
    --ui-mint-hover: #264A39; --ui-info-hover: #263759; --ui-warn-hover: #4A3B1A; --ui-danger-deep: #C24A42;

    --ui-shift-own-bg: #3A3215;   --ui-shift-own-bar: #E6B422;
    --ui-shift-apr-bg: #1C3A2C;   --ui-shift-apr-bar: #3A9A6D;  --ui-shift-apr-ink: #9ADBB8;
    --ui-shift-oth-bg: #3A2F22;   --ui-shift-oth-ink: #E2C9A6;
    --ui-shift-nw-bg: #28332D;    --ui-shift-nw-ink: #C1CBC5;
    --ui-shift-sd-line: #3D4943;
    --ui-shift-hol-bg: #3D2233;   --ui-shift-hol-bar: #D46AA9;  --ui-shift-hol-ink: #F0A3C9;
    --ui-shift-ssl-bg: #3D2818;   --ui-shift-ssl-bar: #E08A3E;  --ui-shift-ssl-ink: #F2B68A;
    --ui-shift-lieu-bg: #2E2442;  --ui-shift-lieu-bar: #9C7BE0; --ui-shift-lieu-ink: #C9B3F0;
    --ui-shift-unp-bg: #1C2E44;   --ui-shift-unp-bar: #4FA3D1;  --ui-shift-unp-ink: #9EC4EE;
    --ui-shift-ntd-bg: #2E1D1F;   --ui-shift-ntd-cell: #2B1C1D;
    --ui-shift-hover: #8FD3B0;
    --ui-rota-note: #6E95E6;      --ui-rota-note-line: #3A5590;
    --ui-rota-pie: #E8A055;       --ui-rota-pie-line: #6B4A22;
    --ui-rota-flex-bg: #3B2A1C;   --ui-rota-label: #6FD0C3;

    /* Bootstrap's -rgb triplets are literals in the bridge above; these are the dark ones */
    --bs-body-color-rgb: 230, 236, 232;
    --bs-body-bg-rgb: 16, 22, 19;
    --bs-emphasis-color-rgb: 230, 236, 232;
    --bs-secondary-color-rgb: 150, 162, 155;
    --bs-link-color-rgb: 58, 154, 109;
    --bs-link-hover-color-rgb: 143, 211, 176;
    --bs-primary-rgb: 58, 154, 109;
    --bs-success-rgb: 58, 154, 109;
    --bs-secondary-rgb: 150, 162, 155;
    --bs-info-rgb: 170, 195, 243;
    --bs-warning-rgb: 232, 165, 76;
    --bs-danger-rgb: 224, 98, 90;
    --bs-light-rgb: 16, 22, 19;
    --bs-dark-rgb: 230, 236, 232;
    --bs-border-color-translucent: rgba(230, 236, 232, .1);
    --bs-focus-ring-color: rgba(var(--bs-primary-rgb), .35);
    --bs-info-border-subtle: #2C3E66;
    --bs-warning-border-subtle: #5A4720;
}

/* ============================================================================
   2. BASE
   ============================================================================ */
html { font-size: 14px; }
body {
    margin: 0;
    background: var(--ui-bg);
    color: var(--ui-ink);
    font-family: var(--ui-font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--ui-green); text-decoration: none; }
a:hover { color: var(--ui-green-ink); }
h1, h2, h3, h4, h5, h6 { color: var(--ui-ink); font-weight: 600; }
*, *::before, *::after { box-sizing: border-box; }
svg, .fa-light { flex: none; }
/* Icon sizes in px (icons are Font Awesome Pro light: <i class="fa-light fa-NAME ico-16">). The canvas uses 18 in
   navigation, 16 in buttons, 14 in pills and tabs, 12 in tags. Without an ico-* class an icon takes the text size. */
.ico-11 { font-size: 11px; } .ico-12 { font-size: 12px; } .ico-13 { font-size: 13px; } .ico-14 { font-size: 14px; }
.ico-15 { font-size: 15px; } .ico-16 { font-size: 16px; } .ico-17 { font-size: 17px; } .ico-18 { font-size: 18px; }
.ico-20 { font-size: 20px; } .ico-22 { font-size: 22px; } .ico-24 { font-size: 24px; } .ico-26 { font-size: 26px; }
.ico-28 { font-size: 28px; } .ico-30 { font-size: 30px; } .ico-34 { font-size: 34px; } .ico-36 { font-size: 36px; }
.ico-40 { font-size: 40px; } .ico-46 { font-size: 46px; } .ico-48 { font-size: 48px; } .ico-96 { font-size: 96px; }
/* Weather icons (<WeatherIcon Code="10d">): Font Awesome Pro light shapes with each part in its weather colour.
   Sized like a Font Awesome icon (1.25em wide, 1em tall, the ico-* class sets the size). */
.wx { --cloud: #7A8C99; --sun: #E0A526; --dark-cloud: #475159; --rain: #5095C7; display: inline-block; width: 1.25em; height: 1em; vertical-align: -.125em; flex: none; overflow: visible; }
.wx .wx-cloud { fill: var(--cloud); }
.wx .wx-sun { fill: var(--sun); }
.wx .wx-dark { fill: var(--dark-cloud); }
.wx .wx-rain { fill: var(--rain); }
button { font-family: inherit; }
::selection { background: var(--ui-mint-tint); }

.tn { font-variant-numeric: tabular-nums; }
.dis, .sk-dis { opacity: .45; cursor: not-allowed; }
.dk { background: var(--ui-ink); border-color: var(--ui-ink); color: var(--ui-on-ink); }
.rowlink { cursor: pointer; }
.rowlink:hover { background: var(--ui-surface-2); }
.wrap { max-width: 1040px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.nw { max-width: 340px; }
.modern-scrollbar { scrollbar-width: thin; scrollbar-color: var(--ui-line-hover) transparent; }
.modern-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
.modern-scrollbar::-webkit-scrollbar-thumb { background: var(--ui-line-hover); border-radius: 999px; }

/* Utilities Bootstrap doesn't have. Our 14px root makes Bootstrap's gap-1/2/3 3.5/7/14px, so gap-3 is the page
   rhythm and these are the canvas's other gaps. !important like Bootstrap's own utilities. */
.gap-2px { gap: 2px !important; }
.gap-4px { gap: 4px !important; }
.gap-6px { gap: 6px !important; }
.gap-8px { gap: 8px !important; }
.gap-10px { gap: 10px !important; }
.gap-12px { gap: 12px !important; }
.gap-16px { gap: 16px !important; }
/* a flex child that may shrink below its content (ellipsis, long words) */
.min-w-0 { min-width: 0 !important; }

/* ============================================================================
   3. SHELL  —  artboards: Shell-Sidebar-Mini, D-* (top bar), every page's frame
   ============================================================================ */
#page-container.shell {
    display: block;
    min-height: 100vh;
    padding-left: var(--ui-sb-w);
    background: var(--ui-bg);
    position: relative;
    transition: padding-left .22s var(--ui-ease);
}
#page-container.shell.sb-mini { padding-left: var(--ui-sb-mini-w); }

/* ---- sidebar ---- */
.sb {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 40;
    width: var(--ui-sb-w);
    background: var(--ui-sb-bg);
    color: var(--ui-sb-text);
    /* the scrollbar's gutter is always kept, so opening a group that makes the sidebar scroll doesn't narrow its
       contents (which shrank the logo and nudged everything up); a thin scrollbar's gutter is 10px, so 2px of
       right padding matches the left's 12px */
    padding: 14px 2px 16px 12px;
    display: flex; flex-direction: column; gap: 6px;
    overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin; scrollbar-color: var(--ui-sb-rule) transparent; scrollbar-gutter: stable;
    transition: width .22s var(--ui-ease), box-shadow .22s var(--ui-ease), transform .22s var(--ui-ease);
}
.sbh { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0 14px; }
.sbpin { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: var(--ui-r-sm); border: 0; background: transparent; color: var(--ui-sb-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sbpin:hover { background: var(--ui-sb-hover); color: var(--ui-on-fill); }
.sbclose { position: absolute; right: 0; top: 0; display: none; }
/* Opsyte word mark: the white text logo, "stock" under it in the Stock workspace */
.sbword { width: 50%; margin-top: 8px; margin-bottom: 16px; display: flex; flex-direction: column; align-items: center; text-decoration: none; transition: transform .25s var(--ui-ease); }
.sbword:hover { transform: scale(1.05); }
.sbword img { width: 100%; height: auto; display: block; }
.sbstock { margin-top: -3px; font: 800 22px/1 var(--ui-font); letter-spacing: -.02em; color: var(--ui-on-fill); }
.sbgrp { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-sb-section); text-align: center; }
.sbsite { font-size: 13px; font-weight: 600; color: var(--ui-mint); text-align: center; line-height: 1.3; }
.sbl { display: flex; flex-direction: column; gap: 2px; }
.sbai { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; margin: 0 0 6px; border-radius: var(--ui-r-input); border: 1.5px solid transparent; background: linear-gradient(var(--ui-sb-ai), var(--ui-sb-ai)) padding-box, var(--ui-ai-gradient) border-box; color: var(--ui-on-fill); font: 600 13px var(--ui-font); cursor: pointer; text-align: left; width: 100%; }
.sbai:hover { background: linear-gradient(var(--ui-sb-hover), var(--ui-sb-hover)) padding-box, var(--ui-ai-gradient) border-box; }
.sbg { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-radius: var(--ui-r-input); color: var(--ui-sb-text); text-decoration: none; font-size: 13px; font-weight: 500; cursor: pointer; background: transparent; border: 0; width: 100%; text-align: left; font-family: var(--ui-font); white-space: nowrap; }
.sbg:hover { background: var(--ui-sb-hover); color: var(--ui-on-fill); }
.sbg.on, .sbg.active { background: var(--ui-bg); color: var(--ui-sb-bg); font-weight: 600; }
.sbg > span:not(.sbch):not(.badge):not(.sbprev):not(.sblock):not(.stock-nav-alert-count) { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.sbg > .fa-light { font-size: 16px; width: 22px; }
.sbai > .fa-light { font-size: 15px; width: 22px; }
.sbch { margin-left: auto; opacity: .6; display: flex; transition: transform .18s var(--ui-ease); }
.sbch.up { transform: rotate(180deg); }
/* an open group: the card starts exactly where the closed row sat (same box, same corners), so its icon and top-left
   corner stay put; only the sub-items are inset from the card's sides */
.sbcard { background: var(--ui-bg); border-radius: var(--ui-r-input); padding: 0 0 8px; }
.sbcard .sbi { margin: 0 4px; }
.sbcard .sbg { color: var(--ui-sb-bg); font-weight: 600; }
.sbcard .sbg:hover { background: transparent; }
.sbi { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 42px; border-radius: var(--ui-r-xs); font-size: 12.5px; color: var(--ui-ink-3); text-decoration: none; }
.sbi:hover { background: var(--ui-ghost); color: var(--ui-ink); }
.sbi.on, .sbi.active { background: var(--ui-mint-tint); color: var(--ui-sb-bg); font-weight: 600; }
.sbprev { margin-left: 6px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--ui-r-pill); background: var(--ui-warn-bg); color: var(--ui-warn); }
.sbsec { display: block; padding: 12px 12px 4px; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ui-sb-section); }
/* Collapsible sections (SidebarSectionToggle.razor): the small-caps heading is a button and a closed section shows only
   this row. Row-sized (36px) so it folds to a tile on the rail without moving. Stock's workspace link (.sblink) shares
   the look. The .sbmi icon only shows on the rail, standing in for a closed section's modules. */
.sbsec.sbtog { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; margin-top: 4px; padding: 0 12px; border: 0; border-radius: var(--ui-r-input); background: none; cursor: pointer; text-align: left; font-family: var(--ui-font); text-decoration: none; }
.sbsec.sbtog > span:first-of-type { flex: 1; }
.sbsec.sbtog.open { color: var(--ui-sb-text); }
.sbsec.sbtog.on:not(.open) { color: var(--ui-mint); }
.sbsec.sbtog:hover { color: var(--ui-on-fill); background: var(--ui-sb-hover); }
.sbsec.sbtog:focus-visible { outline: 2px solid var(--ui-mint); outline-offset: 2px; }
.sbsec.sbtog .sbch { opacity: .8; }
.sbsec.sblink:hover .sbch { transform: translateX(2px); }
.sbsec.sbtog .sbmi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 22px; font-size: 16px; color: var(--ui-sb-text); opacity: 0; pointer-events: none; }
.sbf { margin-top: auto; padding-top: 18px; text-align: center; font-size: 11px; line-height: 1.5; color: var(--ui-sb-muted); }
.sbf .heart { color: #E06C75; display: inline-flex; vertical-align: -2px; }
.sb-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 7px; border-radius: var(--ui-r-pill); background: var(--ui-danger-fill); color: var(--ui-on-fill); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sb-count.info { background: var(--ui-info-bg); color: var(--ui-info); }
/* the "Stock" section label at the top of the Stock workspace nav */
.sbl > .sbsec.sbws { margin-top: 2px; }
/* Locked sidebar rows: modules the group hasn't switched on, shown to admins; they open a Discover page. */
.sblock { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ui-sb-hover); color: var(--ui-sb-muted); flex: none; }
.sbg:hover .sblock, .sbg.active .sblock { color: var(--ui-mint); }
/* the group / site name under the logo goes to the dashboard, like the logo */
a.sbhome { text-decoration: none; cursor: pointer; }
a.sbhome:hover, a.sbhome:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
a.sbsite.sbhome, a.sbsite.sbhome:hover { color: var(--ui-mint); }
a.sbgrp.sbhome, a.sbgrp.sbhome:hover { color: var(--ui-sb-section); }

/* Collapsed icon rail (sidebar unpinned, desktop). The rail is the full sidebar clipped to 72px: everything keeps its
   expanded layout, so the icons sit in the same place in both states and hovering only widens the panel and fades the
   labels in, after a short hover-intent delay. An open section shows one icon per module (the current module
   highlighted) under a short rule; a closed section is one tile with the section's icon. Artboard "Shell-Sidebar-Mini". */
.sb .sbpin.pin-on { display: none; }
.sb-mini .sb .sbpin.pin-off { display: none; }
.sb-mini .sb:hover .sbpin.pin-on { display: flex; }
.sb-backdrop { display: none; }
@media (min-width: 992px) {
    .sb-mini .sb { width: var(--ui-sb-mini-w); transition: width .2s var(--ui-ease), box-shadow .2s var(--ui-ease); }
    .sb-mini .sb:hover { width: var(--ui-sb-w); box-shadow: var(--ui-shadow-sb); transition-delay: .12s; }
    .sb-mini .sb > * { width: calc(var(--ui-sb-w) - 24px); flex: none; }
    .sb-mini .sb :is(.sbword, .sbgrp, .sbsite, .sbf, .sbg > span, .sbai > span, .sbsec > span, .sbi) { transition: opacity .12s var(--ui-ease); }
    .sb-mini .sb:hover :is(.sbword, .sbgrp, .sbsite, .sbf, .sbg > span, .sbai > span, .sbsec > span, .sbi) { transition: opacity .16s var(--ui-ease) .22s; }
    .sb-mini .sb:not(:hover) :is(.sbword, .sbgrp, .sbsite, .sbf, .sbg > span, .sbai > span, .sbsec > span) { opacity: 0; }
    .sb-mini .sb:not(:hover) .sbsec { color: transparent; }
    /* rows shrink to a 48px tile, so hover and the current module read as rounded squares */
    .sb-mini .sb:not(:hover) :is(.sbg, .sbai) { width: 48px; }
    /* a group opened while hovering folds to a tile on the rail: light if it holds the current page, as when closed */
    .sb-mini .sb:not(:hover) .sbcard { background: transparent; }
    .sb-mini .sb:not(:hover) .sbcard > .sbg { color: var(--ui-sb-text); background: var(--ui-sb-hover); }
    .sb-mini .sb:not(:hover) .sbcard > .sbg.on { color: var(--ui-sb-bg); background: var(--ui-bg); }
    .sb-mini .sb:not(:hover) .sbcard .sbi { display: none; }
    /* section headings: a closed one folds to its icon tile (light if it holds the current page), an open one to a rule */
    .sb-mini .sb:not(:hover) .sbsec.sbtog { width: 48px; }
    .sb-mini .sb .sbsec.sbtog .sbmi { transition: opacity .12s var(--ui-ease); }
    .sb-mini .sb:not(:hover) .sbsec.sbtog:not(.open) .sbmi { opacity: 1; }
    .sb-mini .sb:not(:hover) .sbsec.sbtog.on:not(.open) { background: var(--ui-bg); }
    .sb-mini .sb:not(:hover) .sbsec.sbtog.on:not(.open) .sbmi { color: var(--ui-sb-bg); }
    .sb-mini .sb:not(:hover) .sbsec.sbtog.open::after { content: ""; position: absolute; left: 12px; top: 50%; width: 24px; height: 1px; background: var(--ui-sb-rule); }
}

/* pages not yet on the new system render inside .legacy-ui, pinned to the light theme (MainLayout) */
.legacy-ui { background: var(--ui-bg); color: var(--ui-ink); }

/* ---- main column ---- */
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }

/* ---- top bar ---- */
.tb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 24px; background: var(--ui-bg); border-bottom: 1px solid var(--ui-line-2); position: sticky; top: 0; z-index: 30; }
.tbt { margin: 0; font-size: 15px; font-weight: 600; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
/* FocusOnNavigate (Routes.razor) focuses the first h1, which is the top-bar title; Chrome draws a focus ring
   round it on every navigation. The canvas shows none. Keep a ring for real keyboard focus elsewhere. */
.tbt:focus, .tbt:focus-visible, h1[tabindex="-1"]:focus { outline: none; }
/* top-bar menus hang from the bar's bottom edge; Popper's 2px offset left them overlapping it */
.tb .dropdown-menu.show { margin-top: 12px !important; }
.tbsp { flex: 1; }
.tbclock { height: 38px; padding: 0 14px; border-radius: var(--ui-r-pill); background: var(--ui-surface); box-shadow: 0 0 0 1.5px var(--ui-line) inset; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; }
.tbs { display: inline-flex; align-items: center; gap: 8px; height: 38px; width: 240px; padding: 0 14px; border-radius: var(--ui-r-pill); background: var(--ui-surface); box-shadow: 0 0 0 1.5px var(--ui-line) inset; color: var(--ui-muted); cursor: text; }
.tbs input { border: 0; outline: 0; font: inherit; font-size: 13px; flex: 1; min-width: 0; background: transparent; color: var(--ui-ink); -webkit-appearance: none; appearance: none; }
.tbs input::-webkit-search-cancel-button, .tbs input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.tbs:focus-within { box-shadow: 0 0 0 2px var(--ui-green) inset; }
.tbb { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ui-surface); box-shadow: 0 0 0 1.5px var(--ui-line) inset; color: var(--ui-ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; position: relative; padding: 0; flex: none; }
.tbb:hover { color: var(--ui-ink); box-shadow: 0 0 0 1.5px var(--ui-line-hover) inset; }
.tbb.tbon, .tbb.show, .tbb[aria-expanded="true"], .tbon { background: var(--ui-ink); color: var(--ui-on-ink); box-shadow: none; }
.tbb.dropdown-toggle::after, .tbav.dropdown-toggle::after { display: none; }
.tbbadge { position: absolute; top: -7px; right: -12px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--ui-green-fill); color: var(--ui-on-fill); font-size: 10px; font-weight: 700; display: flex; align-items: center; }
/* the avatar is a solid disc, so it reads larger than the outlined 38px buttons at the same size */
.tbav { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ui-green-deep); color: var(--ui-on-fill); font: 600 12px var(--ui-font); cursor: pointer; padding: 0; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tbav img { width: 100%; height: 100%; object-fit: cover; }
/* the avatar's .dropdown wrapper is a block, so the button sits on its text baseline; with a photo (no text) that is
   the button's bottom edge, which lifted it 3px above the round buttons beside it */
.tb .dropdown { display: flex; }
.tbav.tbon, .tbav.show, .tbav[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--ui-mint); }
.tbback { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; margin-left: 10px; border-radius: var(--ui-r-pill); background: var(--ui-mint-tint); color: var(--ui-green-ink); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tbmenu { display: none; }
.ic { position: fixed; left: 18px; bottom: 18px; width: 52px; height: 52px; border-radius: 50%; background: var(--ui-green-fill); color: var(--ui-on-fill); display: flex; align-items: center; justify-content: center; box-shadow: var(--ui-shadow-fab); z-index: 35; }

/* top-bar date / week picker (.td family, 52 artboards) */
/* a white pill with round arrow buttons either side of a tappable value */
.td { display: inline-flex; align-items: center; gap: 2px; height: 40px; margin-left: 12px; padding: 3px; border-radius: var(--ui-r-pill); background: var(--ui-surface); border: 1.5px solid var(--ui-line); box-shadow: 0 1px 0 var(--ui-line-2); overflow: visible; }
.tdx { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--ui-ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.tdx:hover { background: var(--ui-mint-tint); color: var(--ui-green-ink); }
.tdv { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border: 0; border-radius: var(--ui-r-pill); background: transparent; color: var(--ui-ink); font: 600 13.5px var(--ui-font); cursor: pointer; white-space: nowrap; }
.tdv:hover { background: var(--ui-mint-tint); }
.tdv:focus-visible, .tdx:focus-visible { outline: 2px solid var(--ui-green); outline-offset: 1px; }
.tdi { color: var(--ui-green); flex: none; }
.tdl { padding: 2px 7px; border-radius: var(--ui-r-pill); background: var(--ui-mint-tint); color: var(--ui-green-ink); font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.tdn { color: var(--ui-ink); }
.td .hx-input-date { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.td .hx-input-date .dropdown-menu { pointer-events: auto; }

/* ---- page frame ---- */
.pg { padding: 20px 28px 32px; display: flex; flex-direction: column; gap: 14px; }
/* half the frame, for pages that need every pixel (the rota week grid; MainLayout sets it by route) */
.pg.tight { padding: 10px 14px 16px; }
.ph { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* line-height: Bootstrap's reboot gives .h1-.h6 1.2; the canvas leaves headings at Poppins' normal (~1.5) */
.h1 { margin: 0 8px 0 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: normal; }
.h2 { margin: 0; font-size: 16px; font-weight: 600; line-height: normal; }
.h3 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.01em; line-height: normal; }
.h2.h2-lg { font-size: 20px; }
.sub { font-size: 13px; color: var(--ui-muted); }
p.sub { margin: 0; }
.sub.sm { font-size: 12px; }
/* body copy: an intro or explanation paragraph */
p.copy { margin: 0; font-size: 14px; line-height: 1.6; }
ul.bullets { margin: 0; padding-left: 18px; }
/* a centred "nothing here" line inside a list or panel (with .sub) */
.nil { padding: 22px; text-align: center; }
.cap { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-muted); }
.cap.lt { font-size: 11px; text-transform: none; color: var(--ui-muted-2); }
.lbl { font-size: 12px; font-weight: 600; color: var(--ui-muted); }
.eyb { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-green); }
.ct { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-ink); margin: 0; }
.hint { font-size: 12px; color: var(--ui-warn); font-weight: 500; }
.lk { font-size: 13px; font-weight: 600; text-decoration: none; }
.sep { height: 1px; background: var(--ui-line-3); margin: 6px 0; }
.sep-in { color: var(--ui-line-hover); margin: 0 6px; }
.tools, .ft, .ctl, .sk-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acts { display: flex; gap: 6px; justify-content: flex-end; }
.sec { display: flex; flex-direction: column; gap: 8px; }

/* ============================================================================
   4. PRIMITIVES
   ============================================================================ */

.splitb { display: inline-flex; }
.splitb .btn:first-child { border-radius: 999px 0 0 999px; }
/* the second pill, not :last-child: inside a .dropdown the menu is the last child */
.splitb > .btn + .btn { border-radius: 0 999px 999px 0; border-left: 0; padding: 0 10px; }
.splitb > .btn:first-child { border-right: 1.5px solid var(--ui-line); }
.sk-bug { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--ui-r-pill); border: 1.5px solid var(--ui-danger-line); background: var(--ui-danger-wash-2); color: var(--ui-danger); font: 600 13px var(--ui-font); cursor: pointer; white-space: nowrap; }

.ibt { width: 34px; height: 34px; border-radius: var(--ui-r-sm); border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; }
.ib-info { background: var(--ui-info-bg); color: var(--ui-info); }
.ib-nu { background: var(--ui-nu-bg); color: var(--ui-nu); }
.ib-bad { background: var(--ui-bad-bg); color: var(--ui-bad); }
.ib-pri { background: var(--ui-ok-bg); color: var(--ui-ok); }
.ibx { width: 32px; height: 32px; border-radius: var(--ui-r-sm); border: 1.5px solid var(--ui-danger-line); background: var(--ui-bad-bg); color: var(--ui-danger); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.iinfo { width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--ui-muted-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.qm { display: inline-flex; vertical-align: middle; color: var(--ui-muted); margin-left: 4px; cursor: help; }
.mono { width: 38px; height: 38px; border-radius: 11px; background: var(--ui-ink); color: var(--ui-on-ink); display: inline-flex; align-items: center; justify-content: center; font: 700 12px var(--ui-font); flex: none; }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--ui-green-fill); color: var(--ui-on-fill); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }

/* ---- segmented control (.seg, ink selected) and pager ---- */
.seg { display: inline-flex; padding: 3px; border-radius: var(--ui-r-pill); background: var(--ui-panel); gap: 2px; }
.seg button, .seg a { height: 32px; padding: 0 14px; border-radius: var(--ui-r-pill); border: 0; background: transparent; font: 500 13px var(--ui-font); color: var(--ui-ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.seg button.on, .seg a.on { background: var(--ui-ink); color: var(--ui-on-ink); }
.seg.gr { background: var(--ui-surface); border: 1.5px solid var(--ui-line); padding: 4px; }
.seg.gr button.on, .seg.gr a.on { background: var(--ui-green-fill); color: var(--ui-on-fill); font-weight: 600; }
/* theme switch (ThemeSwitch.razor): spans the profile menu with labels; icons only in a header bar */
.dd-theme { display: flex; flex-direction: column; gap: 8px; padding: 6px 18px 10px; }
.dropdown-menu .dd-theme .cap { padding: 0; }
.dd-theme .theme-seg { display: flex; }
.dd-theme .theme-seg button { flex: 1; justify-content: center; }
.theme-seg.compact button { padding: 0 10px; }
/* ink-track segmented control, cream "on" (Maintenance, Lost property status tabs); scrolls rather than clips */
.pager { display: inline-flex; gap: 4px; }
.pager button, .pager a { min-width: 34px; height: 34px; padding: 0 8px; border-radius: var(--ui-r-sm); border: 1.5px solid var(--ui-line); background: var(--ui-surface); font: 500 13px var(--ui-font); cursor: pointer; color: var(--ui-ink-3); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pager button.on, .pager a.on { background: var(--ui-ink); border-color: var(--ui-ink); color: var(--ui-on-ink); }
.pager.round button, .pager.round a { border-radius: var(--ui-r-pill); }

/* Labelled tab groups (InvoicesTabStrip): <div class="nav nav-tabs tgroups"> holding .tgrp groups split by .tsep.
   Each group's tabs scroll sideways inside it rather than push a phone-width page wider. */
.nav-tabs.tgroups { border-bottom: 0; }
.nav-tabs.tgroups > .tgrp { padding-top: 12px; }
.inv-tools + .nav-tabs.tgroups { border-top: 1px solid var(--ui-line-4); margin-top: 2px; }
.inv-tools + .nav-tabs.tgroups > .tgrp { padding-top: 10px; }
.card > .nav-tabs.tgroups:only-child { padding: 2px 6px 0; }
.tsep { width: 1px; align-self: stretch; background: var(--ui-line-2); margin: 18px 0 8px; }
.tgrp { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; }
.tgrp > span { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ui-muted-2); padding-left: 4px; }
.tgrp > div { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tgrp > div > .nav-link { flex: none; }
.stab { display: inline-flex; border: 1.5px solid var(--ui-line); border-radius: var(--ui-r-inner); overflow: hidden; background: var(--ui-surface); }
.stab > button, .stab > a { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 0; border-left: 1.5px solid var(--ui-line-2); background: transparent; font: 500 13.5px var(--ui-font); color: var(--ui-ink-3); cursor: pointer; white-space: nowrap; text-decoration: none; }
.stab > button:first-child, .stab > a:first-child { border-left: 0; }
.stab > button.on, .stab > a.on { background: var(--ui-green-wash-2); color: var(--ui-green-ink); font-weight: 600; box-shadow: inset 0 -3px 0 var(--ui-green); }
.stab .n { min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--ui-r-pill); background: var(--ui-ghost); color: var(--ui-ink-3); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.stab > .on .n { background: var(--ui-green-fill); color: var(--ui-on-fill); }

/* ---- cards & boxes ---- */
.card { background: var(--ui-surface); border-radius: var(--ui-r-card); padding: 18px; box-shadow: var(--ui-shadow-card); min-width: 0; border: 0; }
.cz, .cardp { padding: 0; overflow: hidden; }
.cbody { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.cbd { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
/* inside a padded card: keep the 16px stack, with 2px so focus rings aren't clipped */
.cbd.flush { padding: 2px; }
.ch { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.band { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; background: var(--ui-green-deep); color: var(--ui-on-fill); }
.band .h2 { color: var(--ui-on-fill); font-size: 17px; }
.box { border: 1.5px solid var(--ui-line-2); border-radius: var(--ui-r-box); overflow: hidden; background: var(--ui-surface); }
.lines { border: 1.5px solid var(--ui-line-2); border-radius: var(--ui-r-inner); overflow: hidden; }
.box .tr:first-child, .lines .tr:first-child { border-top: 0; }
/* Havit makes every <form> a column with a 1.25em gap: a .box that is a form keeps its rows touching, and a
   .tools that is a form stays a row */
form.box { gap: 0; }
form.tools { flex-direction: row; }
.pc { border: 1.5px solid var(--ui-line-2); border-radius: var(--ui-r-inner); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; }
.pc b { display: block; color: var(--ui-ink); }
.prm { font-size: 12.5px; line-height: 1.5; color: var(--ui-ink-2); }
.ro { background: var(--ui-panel); border-color: var(--ui-line-2); }
.roh { padding: 12px 18px; background: var(--ui-green-deep); color: var(--ui-on-fill); }
.roh :is(h1, h2, h3, .h2) { color: inherit; }
.rob { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.g2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.g2.fixed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sk-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* ---- lists ---- */
.lst { display: flex; flex-direction: column; }
.lr { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--ui-line-4); text-decoration: none; color: var(--ui-ink); font-size: 14px; font-weight: 500; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font-family: var(--ui-font); cursor: pointer; }
.lr:first-child { border-top: 0; }
.lr:hover { background: var(--ui-bg); color: var(--ui-ink); }
.lr .lic { width: 34px; height: 34px; border-radius: var(--ui-r-sm); background: var(--ui-mint-tint); color: var(--ui-green-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.lr .chv { margin-left: auto; color: var(--ui-muted-3); display: flex; }
.acc { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--ui-line-4); font-size: 14px; font-weight: 600; cursor: pointer; background: var(--ui-surface); border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font-family: var(--ui-font); color: var(--ui-ink); }
.acc .chv { margin-left: auto; color: var(--ui-muted); display: flex; }
.mi { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--ui-r-input); font-size: 14px; font-weight: 500; color: var(--ui-ink); text-decoration: none; border: 0; background: transparent; width: 100%; text-align: left; font-family: var(--ui-font); cursor: pointer; }
.mi:hover { background: var(--ui-bg); color: var(--ui-ink); }
.mi .fa-light { color: var(--ui-muted); flex: none; }

/* ---- tags / status chips ---- */
.smp { background: var(--ui-warn-bg); color: var(--ui-warn); border-radius: var(--ui-r-pill); font-size: 11px; font-weight: 600; padding: 3px 9px; }
.sk-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--ui-r-pill); font-size: 12px; font-weight: 600; background: var(--ui-panel); color: var(--ui-ink-3); }
.sa { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--ui-r-pill); border: 0; font: 700 10px var(--ui-font); letter-spacing: .04em; cursor: pointer; }
.sa-ok { background: var(--ui-ok-bg); color: var(--ui-ok); }
.st { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-green-fill); display: inline-block; }
.c1 { background: var(--ui-c1-bg); color: var(--ui-c1); }
.c2 { background: var(--ui-info-bg); color: var(--ui-info); }
.c3 { background: var(--ui-ok-bg); color: var(--ui-ok); }
.c4 { background: var(--ui-bad-bg); color: var(--ui-bad); }
.c5 { background: var(--ui-c5-bg); color: var(--ui-c5); }
.c6 { background: var(--ui-warn-bg); color: var(--ui-warn); }

/* ---- forms ---- */
.cbr { width: 18px; height: 18px; accent-color: var(--ui-danger); margin: 0; }
.tw { display: inline-flex; width: 40px; height: 24px; border-radius: 12px; background: var(--ui-line-hover); position: relative; flex: none; border: 0; cursor: pointer; padding: 0; transition: background .18s var(--ui-ease); }
.tw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ui-on-fill); transition: left .18s var(--ui-ease); }
.tw.on, .tw[aria-checked="true"] { background: var(--ui-green-fill); }
.tw.on::after, .tw[aria-checked="true"]::after { left: 19px; }
.tgl { display: flex; flex-direction: column; }
.tg { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--ui-line-4); font-size: 13.5px; line-height: 1.5; color: var(--ui-ink-2); cursor: pointer; }
.tg .tw { margin-top: 1px; }
.tg b { color: var(--ui-ink); font-weight: 600; }
.srch, .sk-srch, .ivs { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--ui-r-pill); border: 1.5px solid var(--ui-line); background: var(--ui-surface-2); color: var(--ui-muted); width: 340px; max-width: 100%; font-size: 13px; }
.ivs { width: 230px; background: var(--ui-surface); }
.srch input, .sk-srch input, .ivs input { border: 0; outline: 0; background: transparent; font: 500 13px var(--ui-font); flex: 1; min-width: 0; color: var(--ui-ink); }
.sk-sel { height: 40px; border: 1.5px solid var(--ui-line); border-radius: var(--ui-r-pill); padding: 0 14px; font: 500 13px var(--ui-font); color: var(--ui-ink); background: var(--ui-surface); }
.dpw { position: relative; }
.dpw .form-control { padding-right: 46px; }
.dt { width: 150px; height: 36px; }
.flt { position: relative; display: block; }
.flt span { position: absolute; left: 14px; top: 8px; font-size: 11px; font-weight: 500; color: var(--ui-muted); }
.flt input { height: 58px; padding: 22px 14px 6px; }

/* ---- tables (grid rows; see guide §Tables) ---- */
.tbl { overflow-x: auto; }
/* A row reads its columns from --cols, set once on the table (the page's scoped CSS: .x-cols { --cols: 1fr 90px }). */
.tr { display: grid; grid-template-columns: var(--cols, none); gap: 10px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--ui-line-4); font-size: 13px; }
.tr.sm { padding: 6px 18px; }
.tr.lg { padding: 14px 18px; font-size: 14px; }
.th { font-size: 12px; color: var(--ui-muted); background: var(--ui-surface-2); font-weight: 500; }
.srt { display: inline-flex; align-items: center; gap: 4px; }
.tfoot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--ui-line-4); font-size: 13px; color: var(--ui-muted); flex-wrap: wrap; }
.tfoot select { height: 34px; border: 1.5px solid var(--ui-line); border-radius: var(--ui-r-sm); font: 500 13px var(--ui-font); padding: 0 8px; background: var(--ui-surface); }
/* the background shorthand above drops .form-select's chevron: use the native arrow */
.tfoot select.form-select { appearance: auto; -webkit-appearance: auto; padding-right: 6px; }

/* ---- alerts & empty states ---- */
.sk-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--ui-r-inner); background: var(--ui-info-bg); color: var(--ui-info); font-size: 13px; line-height: 1.5; }
.sk-ok { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--ui-r-inner); background: var(--ui-green-wash); color: var(--ui-ok); font-size: 13px; font-weight: 500; }
.empty { padding: 28px; border-radius: var(--ui-r-box); border: 1.5px dashed var(--ui-dash); text-align: center; color: var(--ui-muted); font-size: 13px; }
.empty.cta { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.emp { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 24px; border-radius: var(--ui-r-box); background: linear-gradient(var(--ui-green-wash), var(--ui-surface) 70%); border: 1.5px solid var(--ui-line-2); text-align: center; }
/* a spinner centred in the space the content will take */
.loading { display: flex; justify-content: center; padding: 24px; }
.emp .eic { width: 40px; height: 40px; border-radius: 50%; background: var(--ui-mint-tint); color: var(--ui-green-ink); display: flex; align-items: center; justify-content: center; }
.emp b { font-size: 15px; color: var(--ui-ink); }
.emp p { margin: 0; max-width: 560px; font-size: 13px; line-height: 1.55; color: var(--ui-muted); }
/* inside a modal section an empty note is the small dashed one, not the big panel (calendar event editor) */
.mdl .sec .emp { display: block; padding: 12px 14px; background: none; border: 1.5px dashed var(--ui-line); border-radius: var(--ui-r-inner); text-align: left; font-size: 13px; color: var(--ui-muted); }
.sk-es { position: relative; display: flex; align-items: center; justify-content: center; min-height: 220px; border-radius: var(--ui-r-box); border: 1.5px dashed var(--ui-dash); background: var(--ui-surface-2); overflow: hidden; padding: 28px; }
.sk-esb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; max-width: 540px; background: rgba(251, 250, 246, .92); padding: 14px 18px; border-radius: var(--ui-r-inner); }
.sk-esi { width: 44px; height: 44px; border-radius: 50%; background: var(--ui-mint-tint); color: var(--ui-green-ink); display: flex; align-items: center; justify-content: center; }
.sk-est { font-size: 15px; font-weight: 700; color: var(--ui-ink); }
.sk-esd { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ui-muted); }
.sk-ghost { position: absolute; inset: 18px; display: flex; flex-direction: column; gap: 10px; opacity: .55; }
.sk-ghost span { display: block; height: 14px; border-radius: 7px; background: var(--ui-ghost); }
.sk-ghost span:first-child { height: 22px; background: var(--ui-line); }
.sk-hint { font-size: 12px; color: var(--ui-muted); }
.sk-nil { padding: 18px; text-align: center; font-size: 13px; color: var(--ui-muted); }

/* ---- modals & menus ---- */
.scrim { position: fixed; inset: 0; background: var(--ui-scrim); display: flex; align-items: flex-start; justify-content: center; padding: 56px 24px; z-index: 1050; overflow: auto; }
.mdl { background: var(--ui-surface); border-radius: var(--ui-r-modal); box-shadow: var(--ui-shadow-modal); display: flex; flex-direction: column; max-width: 100%; }
/* No overflow: hidden on a modal: it would clip a date picker or menu dropping out of it. Its first and last parts
   round their own corners instead (Bootstrap's scrollable modal still clips, as its body scrolls). */
:is(.mdl, .modal-content, .blazored-modal) > :first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
:is(.mdl, .modal-content, .blazored-modal) > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.mh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--ui-line-3); }
.mh.gh { background: var(--ui-green-deep); border-bottom: 0; }
.mh.gh .mt { color: var(--ui-on-fill); }
.mh.gh .mx { background: rgba(255, 255, 255, .12); color: var(--ui-on-fill); }
.mh:has(.mhh, .mhs) { align-items: flex-start; }
.mhh { display: flex; flex-direction: column; gap: 2px; }
.mhs { margin: 2px 0 0; font-size: 13px; color: var(--ui-muted); }
.mt { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.mx { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ui-bg); color: var(--ui-ink-3); font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.mx:hover { background: var(--ui-ghost); color: var(--ui-ink); }
.mb { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.mf { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--ui-line-3); background: var(--ui-surface-2); flex-wrap: wrap; }
/* a footer written inside .mb reaches the modal's edges */
.mf.bleed { margin: 6px -22px -20px; border-radius: 0 0 var(--ui-r-modal) var(--ui-r-modal); }
.sk-mh { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--ui-line-3); }
.sk-mh .mt { margin-top: 2px; }
.sk-mh p { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--ui-muted); }
.sk-stack { display: flex; flex-direction: column; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--ui-line-3); background: var(--ui-surface-2); }
.sk-stack .btn { width: 100%; justify-content: center; }
.dd { position: absolute; z-index: 1040; background: var(--ui-surface); border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow-dd); overflow: hidden; }
.dd .mi { padding: 10px 18px; border-radius: 0; font-size: 13.5px; }
.dd .mi .fa-light { color: var(--ui-green); }
.dd .cap { padding: 16px 18px 8px; display: block; }

/* top-bar popovers (D-* artboards) */
.stabs { display: flex; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--ui-line-3); }
.stabs .stab { height: 34px; min-width: 38px; padding: 0 10px; border-radius: var(--ui-r-sm); border: 0; background: transparent; color: var(--ui-muted); font: 500 13px var(--ui-font); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-bottom: 2.5px solid transparent; overflow: visible; }
.stabs .stab:hover { background: var(--ui-bg); color: var(--ui-ink); }
.stabs .stab.on { color: var(--ui-ink); font-weight: 700; border-bottom-color: var(--ui-green); border-radius: 10px 10px 0 0; background: transparent; box-shadow: none; }
.slist { max-height: 520px; overflow: auto; padding-bottom: 6px; }
.srow { display: block; padding: 10px 18px; border-top: 1px solid var(--ui-line-4); font-size: 13.5px; font-weight: 600; color: var(--ui-ink); text-decoration: none; }
.srow:hover { background: var(--ui-bg); color: var(--ui-ink); }
.rrow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 4px 10px; padding: 11px 18px; border-top: 1px solid var(--ui-line-4); text-decoration: none; color: var(--ui-ink); align-items: start; cursor: pointer; }
/* Company results use <button> to switch the active site. Reset browser button chrome
   so they occupy the same full-width result row as the <a> results. */
.slist > button.rrow {
    width: 100%;
    box-sizing: border-box;
    border: 0;
    border-top: 1px solid var(--ui-line-4);
    border-radius: 0;
    background: transparent;
    font: inherit;
    text-align: left;
}
.rrow:hover { background: var(--ui-bg); color: var(--ui-ink); }
.slist > button.rrow:hover { background: var(--ui-bg); }
.slist > button.rrow:focus-visible {
    outline: 2px solid var(--ui-green);
    outline-offset: -2px;
}
.rrow > .fa-light, .rrow .av { color: var(--ui-green); margin-top: 2px; grid-row: span 2; }
.rrow .rt { font-size: 13.5px; font-weight: 600; margin: 0; letter-spacing: 0; }
.rrow .rd { grid-column: 2; font-size: 12px; color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .rm { grid-column: 3; grid-row: span 2; font-size: 12px; color: var(--ui-muted-2); text-align: right; white-space: nowrap; }
.nt { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--ui-line-4); text-decoration: none; color: var(--ui-ink); cursor: pointer; }
.nt:hover { background: var(--ui-surface-2); color: var(--ui-ink); }
.ntic { width: 48px; height: 48px; border-radius: var(--ui-r-inner); background: var(--ui-mint-tint); color: var(--ui-green); display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer; }
.nt.read .ntic { background: var(--ui-panel); color: var(--ui-muted-2); }
.ntic.del { background: var(--ui-bad-bg) !important; color: var(--ui-danger) !important; }
.nts { font-size: 11.5px; color: var(--ui-muted); }
.ntt { display: block; font-size: 13.5px; font-weight: 600; color: var(--ui-green-ink); margin: 1px 0 3px; }
.nt.read .ntt { color: var(--ui-muted); }
.ntb { display: block; font-size: 12.5px; color: var(--ui-ink-3); line-height: 1.5; }
.ntm { font-size: 11.5px; font-style: italic; color: var(--ui-muted-2); white-space: nowrap; }
.swg { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 18px; border: 0; background: transparent; font: 700 13.5px var(--ui-font); color: var(--ui-ink); text-align: left; cursor: pointer; }
.swg:hover { background: var(--ui-bg); }
.swg .fa-light { margin-left: auto; color: var(--ui-muted-2); }
.sws { display: block; padding: 7px 18px 7px 32px; font-size: 13px; color: var(--ui-green); text-decoration: none; cursor: pointer; background: transparent; border: 0; width: 100%; text-align: left; font-family: var(--ui-font); }
.sws:hover { background: var(--ui-bg); }
.imp { display: flex; align-items: center; gap: 12px; padding: 9px 18px; text-decoration: none; color: var(--ui-ink); font-size: 13.5px; font-weight: 500; cursor: pointer; background: transparent; border: 0; width: 100%; text-align: left; font-family: var(--ui-font); }
.imp:hover { background: var(--ui-bg); color: var(--ui-ink); }
.imp .id { font-size: 12px; color: var(--ui-muted); }
.scol { display: flex; flex-direction: column; gap: 18px; flex: 1 1 360px; min-width: 0; }
.sh { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; color: var(--ui-green); }
.lg { border: 1.5px solid var(--ui-mint-line-2); border-radius: var(--ui-r-box); overflow: hidden; background: var(--ui-surface); }
.lg.ai { border: 1.5px solid transparent; background: linear-gradient(var(--ui-surface), var(--ui-surface)) padding-box, var(--ui-ai-gradient) border-box; }
.lg .lr { padding: 12px 16px; font: 500 13.5px var(--ui-font); gap: 12px; border-top: 1px solid var(--ui-line-3); }
.lg .lr:first-child { border-top: 0; }
.lg .lr .fa-light { color: var(--ui-green); }

/* ============================================================================
   5. COMPOSITIONS
   ============================================================================ */

/* KPI tiles (reports) */
.kp { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.k { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.kt { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--ui-muted); font-weight: 500; }
.ki { width: 30px; height: 30px; border-radius: var(--ui-r-sm); display: inline-flex; align-items: center; justify-content: center; }
.kv { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.kd { font-size: 12px; color: var(--ui-muted); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--ui-surface); border-radius: var(--ui-r-card); padding: 16px; box-shadow: var(--ui-shadow-card); display: flex; flex-direction: column; gap: 8px; }
.kico { width: 38px; height: 38px; border-radius: var(--ui-r-input); display: flex; align-items: center; justify-content: center; }
.top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.sk-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sk-k { display: flex; flex-direction: column; gap: 4px; }
.sk-kl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-muted); }
.sk-kv { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }

/* report rail (Stock reports, Insytes) */
.rl { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 18px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; position: sticky; top: 76px; }
.rg { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ui-muted-2); padding: 10px 10px 4px; text-transform: uppercase; }
.ri { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--ui-r-input); font-size: 13px; color: var(--ui-ink); text-decoration: none; font-weight: 500; }
.ri:hover { background: var(--ui-bg); color: var(--ui-ink); }
.ri .fa-light { color: var(--ui-muted); flex: none; }
.ri.on, .ri.active { background: var(--ui-mint-tint); color: var(--ui-green-ink); font-weight: 600; box-shadow: 0 0 0 1.5px var(--ui-mint) inset; }
.ri.on .fa-light, .ri.active .fa-light { color: var(--ui-green); }
.rc { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rh { display: flex; flex-direction: column; gap: 14px; }
.rt { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }

/* profile header (staff details) */
.phd { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ph1 { width: 96px; height: 96px; border-radius: 50%; background: var(--ui-mint-tint); color: var(--ui-green-ink); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; flex: none; overflow: hidden; }
.ph1 img { width: 100%; height: 100%; object-fit: cover; }
.pnm { font-size: 30px; font-weight: 700; color: var(--ui-gold); letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.pcol { display: flex; flex-direction: column; gap: 12px; }

/* years / map / misc */
.yrs { display: flex; flex-wrap: wrap; gap: 8px; }
.yr { min-width: 84px; justify-content: center; }
.map { position: relative; height: 300px; border-radius: var(--ui-r-box); overflow: hidden; background: var(--ui-panel); border: 1.5px solid var(--ui-line-2); }

/* onboarding steps */
.stl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; position: relative; }
.ostp { display: flex; gap: 14px; align-items: flex-start; padding: 0 0 22px; position: relative; }
.ostp:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: var(--ui-chip); }
.stm { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ui-line-hover); color: var(--ui-muted); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; background: var(--ui-surface); }
.stm.ok { background: var(--ui-green-fill); border-color: var(--ui-green); color: var(--ui-on-fill); }
.snum { width: 28px; height: 28px; border-radius: 50%; background: var(--ui-mint-tint); color: var(--ui-green-ink); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }

/* stock kit (sk-*) — shared by the /stock pages */
.sk-band { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--ui-line-3); }
.sk-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.sk-eb { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ui-green); }
.sk-cap { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-green-ink); display: flex; align-items: center; gap: 8px; }
.sk-hd { display: flex; flex-direction: column; gap: 4px; }
.sk-hd p { margin: 0; font-size: 14px; color: var(--ui-muted); }
.sk-q { display: inline-flex; color: var(--ui-muted); cursor: help; }
.sk-pills, .sk-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--ui-r-pill); background: var(--ui-panel); flex-wrap: wrap; }
.sk-pills button, .sk-seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: var(--ui-r-pill); border: 0; background: transparent; font: 500 13px var(--ui-font); color: var(--ui-ink-3); cursor: pointer; }
.sk-seg button { height: 34px; padding: 0 16px; }
.sk-pills button.on, .sk-seg button.on { background: var(--ui-ink); color: var(--ui-on-ink); }
.sk-ib { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.sk-coll { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 18px; border: 0; background: transparent; font: 600 14px var(--ui-font); color: var(--ui-ink); cursor: pointer; text-align: left; }
.sk-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ui-line-2); flex-wrap: wrap; }
.sk-tabs > button:not(.btn), .sk-tabs > a:not(.btn) { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border: 0; border-bottom: 2.5px solid transparent; background: transparent; font: 500 13px var(--ui-font); color: var(--ui-muted); cursor: pointer; margin-bottom: -1px; text-decoration: none; }
.sk-tabs > button:not(.btn).on, .sk-tabs > a:not(.btn).on { color: var(--ui-green-ink); border-bottom-color: var(--ui-green); font-weight: 600; }
.sk-panel { border: 1.5px solid var(--ui-line-2); border-radius: var(--ui-r-box); background: var(--ui-surface); min-width: 0; overflow: hidden; }
.sk-ph { padding: 14px 16px; border-bottom: 1px solid var(--ui-line-3); font-size: 14px; font-weight: 600; margin: 0; }

/* w7 family (Reports / Staff) */
.w7b { border-radius: var(--ui-r-card); overflow: hidden; border: 1.5px solid var(--ui-line-2); background: var(--ui-surface); }
.w7band { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; background: var(--ui-green-deep); color: var(--ui-on-fill); }
.w7band .h2 { color: var(--ui-on-fill); }
.w7av { width: 32px; height: 32px; border-radius: 50%; background: var(--ui-ghost); color: var(--ui-muted-4); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.w7ib { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; }
.w7ib.dg { color: var(--ui-danger); border-color: var(--ui-danger-line); }
.w7ok { color: var(--ui-green); display: inline-flex; }
.w7no { color: var(--ui-danger); display: inline-flex; }
.w7pg { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.w7pg a, .w7pg span { min-width: 34px; height: 34px; border-radius: var(--ui-r-pill); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; text-decoration: none; color: var(--ui-ink); border: 1.5px solid var(--ui-line); background: var(--ui-surface); padding: 0 10px; }
.w7pg .on { background: var(--ui-ink); color: var(--ui-on-ink); border-color: var(--ui-ink); }
.w7pg span { border: 0; background: transparent; }
.w7lnk { background: none; border: 0; padding: 0; font: 600 13px var(--ui-font); color: var(--ui-green); cursor: pointer; text-decoration: underline; }
.w7tg { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--ui-ink); }
.w7hlp { font-size: 13px; color: var(--ui-muted); margin: 0; line-height: 1.55; }
.w7sec { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); margin: 0; }
.w7tabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* Record pages and modals (Maintenance, Lost property, Incidents): boxed sections with a thin band head, a details
   list, image previews over a drop zone (.dz, below), and a full-width Save / Back footer. */
.sec.boxed { gap: 0; background: var(--ui-surface); border: 1.5px solid var(--ui-line-2); border-radius: var(--ui-r-box); overflow: hidden; }
.sec.boxed > .band { display: block; padding: 10px 16px; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
/* a box holding a popover (the assignee PersonPicker) lets it overflow, so the band rounds its own corners */
.sec.boxed.ovis { overflow: visible; }
.sec.boxed.ovis > .band { border-radius: calc(var(--ui-r-box) - 1.5px) calc(var(--ui-r-box) - 1.5px) 0 0; }
.dlist { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.dlist b { font-weight: 600; color: var(--ui-muted); margin-right: 4px; }
.dbody { padding: 14px 16px; max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.dtl { margin: 0; font-size: 17px; font-weight: 600; }
.imgs { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; }
.imgs img { display: block; max-width: 175px; max-height: 200px; object-fit: contain; border-radius: var(--ui-r-sm); }
.previews { display: flex; flex-wrap: wrap; gap: 14px; }
.preview { position: relative; }
.preview img { display: block; max-width: 200px; max-height: 200px; border-radius: var(--ui-r-sm); object-fit: contain; }
.preview img.dim { opacity: .4; }
.preview .ibx { position: absolute; top: -10px; right: -10px; }
.shots { display: flex; flex-wrap: wrap; gap: 12px; }
.shot { position: relative; width: 160px; height: 120px; border-radius: var(--ui-r-input); overflow: hidden; background: var(--ui-ghost); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .ibx { position: absolute; top: 6px; right: 6px; }
.shot.dim img { opacity: .4; }
/* green-tinted sub panel with its own heading (Incidents: person involved) */
.gsub { border-radius: var(--ui-r-box); overflow: hidden; border: 1.5px solid var(--ui-mint-tint); }
.gsub > .gh { background: var(--ui-mint-tint); color: var(--ui-green-ink); padding: 10px 16px; font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.gsb { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 16px; }
@media (max-width: 767.98px) { .gsb { grid-template-columns: 1fr; gap: 6px; } }
.cap.gr { color: var(--ui-green-ink); font-weight: 700; letter-spacing: .05em; margin-top: 4px; }
/* full-width footer of two big buttons: .sv saves, the other goes back */
.mfull { display: flex; border-top: 1px solid var(--ui-line-3); border-radius: 0 0 var(--ui-r-modal) var(--ui-r-modal); overflow: hidden; }
.mfull > button { flex: 1; height: 52px; border: 0; font: 600 14px var(--ui-font); cursor: pointer; background: var(--ui-ghost); color: var(--ui-ink); }
.mfull > button:hover { background: var(--ui-line); }
.mfull > .sv { background: var(--ui-green-fill); color: var(--ui-surface); }
.mfull > .sv:hover { background: var(--ui-green-deep); }
.mfull > .sv[disabled] { opacity: .45; cursor: not-allowed; }
.imgb { border: 0; background: none; padding: 0; color: var(--ui-ink); cursor: pointer; display: inline-flex; }

/* Chart cards (Cash Up, Forecast): a row of cards each holding a value, a small bar chart and a legend. The pages set
   their own column counts and series colours. */
.chg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.chc { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.chc > .ch { margin-bottom: 0; }
.chval { font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--ui-ink); }
.chs { font-size: 12px; color: var(--ui-muted); }
.bars { position: relative; display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 6px; border-bottom: 1.5px solid var(--ui-line-2); background: repeating-linear-gradient(to top, transparent 0 37px, var(--ui-line-4) 37px 38px); }
.bcol { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.cbar { flex: 1; min-width: 4px; border-radius: 4px 4px 0 0; }
.bx { display: flex; gap: 8px; }
.bx span { flex: 1; text-align: center; font-size: 11px; color: var(--ui-muted); font-weight: 500; }
.clg { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ui-muted); }
.clg span { display: inline-flex; align-items: center; gap: 6px; }
.clg i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }

/* a padded strip under a table head for its loading, empty or error state */
.epad { padding: 14px 18px; border-top: 1px solid var(--ui-line-4); }
/* a centred single column (account pages: change password, signature, confirm email) */
.page-col { max-width: 690px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* ============================================================================
   6. RE-SKIN — Bootstrap, Havit (Hx*), Blazored, alertify
   Plumbing stays; every visible style becomes the canvas's. Keep this layer
   lean: when a page migrates it uses the primitives above directly.
   ============================================================================ */

/* buttons. Markup uses Bootstrap's own classes; these set them to the canvas look.
   btn-primary = canvas .bp (42px), btn-outline-secondary = .pill (40px), btn-outline-danger = .bd,
   btn-sm = .sm (34px), btn-xs = the 30px link pills, .active = selected (ink). */
.btn { --bs-btn-font-family: var(--ui-font); --bs-btn-font-size: 14px; --bs-btn-font-weight: 500; --bs-btn-line-height: 1.2; --bs-btn-padding-x: 16px; --bs-btn-padding-y: 0; --bs-btn-border-width: 1.5px; --bs-btn-border-radius: var(--ui-r-pill); --bs-btn-box-shadow: none; --bs-btn-focus-box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .2); --bs-btn-disabled-opacity: .45; --bs-btn-disabled-color: var(--bs-btn-color, var(--ui-ink)); --bs-btn-disabled-bg: var(--bs-btn-bg, var(--ui-surface)); --bs-btn-disabled-border-color: var(--bs-btn-border-color, var(--ui-line)); height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.btn-primary, .btn-dark, .btn-danger, { --bs-btn-padding-x: 20px; --bs-btn-font-weight: 600; height: 42px; }
.btn.btn-sm, .btn-group-sm > .btn { --bs-btn-padding-x: 12px; --bs-btn-font-size: 13px; height: 34px; }
.btn-primary.btn-sm, .btn-dark.btn-sm, .btn-danger.btn-sm, .btn-outline-light.btn-sm { --bs-btn-padding-x: 14px; }
.btn.btn-xs { --bs-btn-padding-x: 10px; --bs-btn-font-size: 12px; height: 30px; gap: 6px; }
.btn.btn-lg, .btn-group-lg > .btn { --bs-btn-padding-x: 24px; --bs-btn-font-size: 14px; height: 46px; }
.btn.btn-square { width: 42px; padding: 0; }
.btn.disabled, .btn:disabled { cursor: not-allowed; }
/* Busy buttons (aria-busy="true", which BusyButton sets while its handler runs): a spinner takes the icon's place, or
   leads the label when there is no icon, and the button stays readable rather than fading like a disabled one. */
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]:disabled { opacity: .8; }
.btn[aria-busy="true"] > .fa-light { display: none; }
.btn[aria-busy="true"]::before { content: ""; flex: none; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ui-spin .7s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::before { animation-duration: 1.6s; } }
.btn-primary, .btn-success { --bs-btn-color: var(--ui-on-fill); --bs-btn-bg: var(--ui-green-fill); --bs-btn-border-color: var(--ui-green); --bs-btn-hover-color: var(--ui-on-fill); --bs-btn-hover-bg: var(--ui-green-deep); --bs-btn-hover-border-color: var(--ui-green-ink); --bs-btn-active-color: var(--ui-on-fill); --bs-btn-active-bg: var(--ui-green-deep); --bs-btn-active-border-color: var(--ui-green-ink); --bs-btn-disabled-color: var(--ui-on-fill); --bs-btn-disabled-bg: var(--ui-green-fill); --bs-btn-disabled-border-color: var(--ui-green); --bs-btn-font-weight: 600; }
.btn-secondary, .btn-outline-secondary, .btn-outline-dark, .btn-outline-info, .btn-outline-warning { --bs-btn-color: var(--ui-ink); --bs-btn-bg: var(--ui-surface); --bs-btn-border-color: var(--ui-line); --bs-btn-hover-color: var(--ui-ink); --bs-btn-hover-bg: var(--ui-surface); --bs-btn-hover-border-color: var(--ui-line-hover); --bs-btn-active-color: var(--ui-on-ink); --bs-btn-active-bg: var(--ui-ink); --bs-btn-active-border-color: var(--ui-ink); --bs-btn-disabled-color: var(--ui-ink); --bs-btn-disabled-bg: var(--ui-surface); --bs-btn-disabled-border-color: var(--ui-line); }
/* green outline: the canvas's small .lnk link pill (btn btn-outline-primary btn-xs) */
.btn-outline-primary { --bs-btn-color: var(--ui-green); --bs-btn-bg: var(--ui-surface); --bs-btn-border-color: var(--ui-mint-line); --bs-btn-hover-color: var(--ui-green-ink); --bs-btn-hover-bg: var(--ui-green-wash); --bs-btn-hover-border-color: var(--ui-mint-line); --bs-btn-active-color: var(--ui-on-fill); --bs-btn-active-bg: var(--ui-green-fill); --bs-btn-active-border-color: var(--ui-green); --bs-btn-disabled-color: var(--ui-green); --bs-btn-disabled-bg: var(--ui-surface); --bs-btn-disabled-border-color: var(--ui-mint-line); --bs-btn-font-weight: 600; }
/* mint tonal (canvas .pill.gr); Bootstrap's outline-success is the nearest meaning */
.btn-outline-success, .btn-mint { --bs-btn-color: var(--ui-green-ink); --bs-btn-bg: var(--ui-mint-tint); --bs-btn-border-color: var(--ui-mint-tint); --bs-btn-hover-color: var(--ui-green-ink); --bs-btn-hover-bg: var(--ui-mint-hover); --bs-btn-hover-border-color: var(--ui-mint-hover); --bs-btn-active-color: var(--ui-on-fill); --bs-btn-active-bg: var(--ui-green-fill); --bs-btn-active-border-color: var(--ui-green); }
/* on dark green bands (canvas .bo / .pill.wpill) */
.btn-outline-light { --bs-btn-color: var(--ui-on-fill); --bs-btn-bg: transparent; --bs-btn-border-color: var(--ui-mint); --bs-btn-hover-color: var(--ui-on-fill); --bs-btn-hover-bg: rgba(255, 255, 255, .08); --bs-btn-hover-border-color: var(--ui-mint); --bs-btn-active-color: var(--ui-green-deep); --bs-btn-active-bg: var(--ui-on-fill); --bs-btn-active-border-color: var(--ui-on-fill); --bs-btn-disabled-color: var(--ui-on-fill); --bs-btn-disabled-bg: transparent; --bs-btn-disabled-border-color: var(--ui-mint); --bs-btn-font-weight: 600; }
/* grey ghost (canvas .pill.gst) */
.btn-light { --bs-btn-color: var(--ui-ink); --bs-btn-bg: var(--ui-ghost); --bs-btn-border-color: var(--ui-ghost); --bs-btn-hover-color: var(--ui-ink); --bs-btn-hover-bg: var(--ui-line); --bs-btn-hover-border-color: var(--ui-line); --bs-btn-active-color: var(--ui-on-ink); --bs-btn-active-bg: var(--ui-ink); --bs-btn-active-border-color: var(--ui-ink); }
.btn-outline-danger { --bs-btn-color: var(--ui-danger); --bs-btn-bg: var(--ui-surface); --bs-btn-border-color: var(--ui-danger-line); --bs-btn-hover-color: var(--ui-danger); --bs-btn-hover-bg: var(--ui-danger-wash-2); --bs-btn-hover-border-color: var(--ui-danger-line); --bs-btn-active-color: var(--ui-on-fill); --bs-btn-active-bg: var(--ui-danger-fill); --bs-btn-active-border-color: var(--ui-danger); --bs-btn-disabled-color: var(--ui-danger); --bs-btn-disabled-bg: var(--ui-surface); --bs-btn-disabled-border-color: var(--ui-danger-line); --bs-btn-font-weight: 600; }
.btn-danger { --bs-btn-color: var(--ui-on-fill); --bs-btn-bg: var(--ui-danger-fill); --bs-btn-border-color: var(--ui-danger); --bs-btn-hover-color: var(--ui-on-fill); --bs-btn-hover-bg: var(--ui-danger-deep); --bs-btn-hover-border-color: var(--ui-danger-deep); --bs-btn-active-color: var(--ui-on-fill); --bs-btn-active-bg: var(--ui-danger-deep); --bs-btn-active-border-color: var(--ui-danger-deep); --bs-btn-disabled-color: var(--ui-on-fill); --bs-btn-disabled-bg: var(--ui-danger-fill); --bs-btn-disabled-border-color: var(--ui-danger); }
.btn-dark { --bs-btn-color: var(--ui-on-ink); --bs-btn-bg: var(--ui-ink); --bs-btn-border-color: var(--ui-ink); --bs-btn-hover-color: var(--ui-on-ink); --bs-btn-hover-bg: var(--ui-ink-3); --bs-btn-hover-border-color: var(--ui-ink-3); --bs-btn-active-color: var(--ui-on-ink); --bs-btn-active-bg: var(--ui-ink-3); --bs-btn-active-border-color: var(--ui-ink-3); --bs-btn-disabled-color: var(--ui-on-ink); --bs-btn-disabled-bg: var(--ui-ink); --bs-btn-disabled-border-color: var(--ui-ink); }
.btn-info { --bs-btn-color: var(--ui-info); --bs-btn-bg: var(--ui-info-bg); --bs-btn-border-color: var(--ui-info-bg); --bs-btn-hover-color: var(--ui-info); --bs-btn-hover-bg: var(--ui-info-hover); --bs-btn-hover-border-color: var(--ui-info-hover); --bs-btn-active-bg: var(--ui-info-hover); }
.btn-warning { --bs-btn-color: var(--ui-warn); --bs-btn-bg: var(--ui-warn-bg); --bs-btn-border-color: var(--ui-warn-bg); --bs-btn-hover-color: var(--ui-warn); --bs-btn-hover-bg: var(--ui-warn-hover); --bs-btn-hover-border-color: var(--ui-warn-hover); }
/* icon-only buttons (canvas .ib): round 36px; btn-square makes them 32px squares */
.btn.btn-icon { width: 36px; height: 36px; padding: 0; flex: none; }
.btn-outline-secondary.btn-icon { --bs-btn-color: var(--ui-ink-3); }
.btn.btn-icon.btn-square { width: 32px; height: 32px; border-radius: var(--ui-r-sm); }
.btn-outline-danger.btn-icon { --bs-btn-bg: var(--ui-bad-bg); --bs-btn-hover-bg: var(--ui-bad-bg); }
.btn-link { --bs-btn-color: var(--ui-green); --bs-btn-hover-color: var(--ui-green-ink); --bs-btn-font-weight: 600; text-decoration: none; height: auto; padding: 0; }
.btn-close { width: 38px; height: 38px; border-radius: 50%; background: var(--ui-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2345504A' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 16px no-repeat; opacity: 1; padding: 0; }
.btn-close:hover { background-color: var(--ui-ghost); opacity: 1; }
[data-bs-theme="dark"] .btn-close { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B5C0BA' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E"); }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child, .btn-group > .btn-group:first-child > .btn { border-top-left-radius: var(--ui-r-pill); border-bottom-left-radius: var(--ui-r-pill); }
.btn-group > .btn:last-child, .btn-group > .btn-group:last-child > .btn, .btn-group > .btn.dropdown-toggle-split:last-child { border-top-right-radius: var(--ui-r-pill); border-bottom-right-radius: var(--ui-r-pill); }
/* the last button whose dropdown menu follows it (Havit's toggle has no .dropdown-toggle); .btn.btn outweighs
   Bootstrap's .btn-group > .btn:not(:last-child):not(.dropdown-toggle) */
.btn-group > .btn.btn:not(:has(~ .btn)) { border-top-right-radius: var(--ui-r-pill); border-bottom-right-radius: var(--ui-r-pill); }
.btn-group > .btn:not(:first-child) { margin-left: -1.5px; }

/* forms */
.form-control, .form-select { min-height: 42px; border: 1.5px solid var(--ui-line); border-radius: var(--ui-r-input); padding: 0 12px; font: 500 14px var(--ui-font); color: var(--ui-ink); background-color: var(--ui-surface-2); line-height: 39px; box-shadow: none; }
.form-select { background-repeat: no-repeat; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235E6A63' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-position: right 12px center; background-size: 16px; padding-right: 36px; }
.form-control:focus, .form-select:focus { border-color: var(--ui-green); background-color: var(--ui-surface); box-shadow: none; outline: 0; }
/* Havit paints its multi-select's read-only input from its own variable. */
.hx-multi-select { --hx-multi-select-background-color: var(--ui-surface-2); }
.hx-multi-select:focus-within { --hx-multi-select-background-color: var(--ui-surface); }
.form-control::placeholder { color: var(--ui-muted-2); }
.form-control:disabled, .form-select:disabled { background-color: var(--ui-panel); color: var(--ui-ink-3); }
.form-control[readonly], .form-control.ro { background-color: var(--ui-panel); }
textarea.form-control { min-height: 84px; line-height: 1.5; padding: 10px 12px; }
/* .tinted: a colour the user picked for their own data (a Snapshot heading's tint), passed in as --tint and shown as
   picked in either theme. The text follows the tint, not the theme: the light theme's ink (L .25) on a light tint, the
   dark theme's (L .94) on a dark one, switching at L .62. Browsers without relative colours keep --ui-ink. */
.tinted, .form-control.tinted, .form-control.tinted:focus { background-color: var(--tint); color: oklch(from var(--tint) clamp(.25, (.62 - l) * 1000, .94) .012 160); }
.form-control.tinted::placeholder { color: inherit; opacity: .6; }
:where(input).form-control, .form-select { height: 42px; }
:where(input).form-control-sm, .form-select-sm { height: 34px; }
:where(input).form-control-lg { height: 48px; }
/* a list box (multiple, or size > 1) has no dropdown chevron */
select.form-select[multiple], select.form-select[size]:not([size="1"]) { height: auto; background-image: none; padding-right: 12px; line-height: 1.5; padding-top: 6px; padding-bottom: 6px; }
.form-control-sm, .form-select-sm { min-height: 34px; line-height: 31px; padding: 0 12px; border-radius: var(--ui-r-sm); font-size: 13px; }
.form-select-sm { padding: 0 26px 0 10px; background-position: right 8px center; background-size: 14px; }
.form-control-lg { min-height: 48px; line-height: 45px; }
.form-control-plaintext { line-height: 1.5; }
select.form-control[size], select.form-control[multiple] { line-height: 1.5; padding: 6px; }
.form-label, label.col-form-label { font-size: 12px; font-weight: 500; color: var(--ui-muted); margin-bottom: 6px; }
/* label text stacks over whatever the label wraps (canvas .fl); a label that wraps its control needs no margin */
.form-label { display: flex; flex-direction: column; gap: 6px; }
.form-label:has(input, select, textarea, button, > div) { margin-bottom: 0; }
/* inside a Bootstrap stack the stack's gap does the spacing */
:is(.vstack, .hstack) > :is(.form-label, .form-text) { margin: 0; }
.form-text { font-size: 12.5px; color: var(--ui-muted); line-height: 1.45; }
.input-group-text { border: 1.5px solid var(--ui-line); background: var(--ui-surface-2); color: var(--ui-muted); border-radius: var(--ui-r-input); font-size: 13px; }
.input-group > .form-control, .input-group > .form-select { line-height: 1.5; padding-top: 0; padding-bottom: 0; }
.input-group > span:has(> .clear-button) {
    display: flex !important;
    margin-left: -1.5px;
}

/* Style both wrapped and unwrapped clear buttons */
.input-group > span > .btn.clear-button,
.input-group > .btn.clear-button {
    --bs-btn-border-radius: 0 var(--ui-r-input) var(--ui-r-input) 0;
    height: auto;
    align-self: stretch;
    min-width: 42px;
    padding: 0 12px;
}

/* Match the 1.5px borders used by the beta inputs */
.input-group > .btn.clear-button {
    margin-left: -1.5px;
}
.form-check-input { width: 18px; height: 18px; border: 1.5px solid var(--ui-line-hover); margin-top: .15em; background-color: var(--ui-surface); flex: none; }
/* Bootstrap's 1.5em gutter barely clears the 18px box; give the label the canvas's 10px */
.form-check:not(.form-switch, .form-check-reverse):has(> .form-check-label) { padding-left: 28px; }
.form-check:not(.form-switch, .form-check-reverse):has(> .form-check-label) > .form-check-input { margin-left: -28px; }
/* a bare checkbox (not inside .form-check) sits in a flex row: no baseline nudge */
:not(.form-check) > .form-check-input { margin-top: 0; vertical-align: middle; }
.form-check-input:checked { background-color: var(--ui-green-fill); border-color: var(--ui-green); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .2); border-color: var(--ui-green); }
.form-check-label { font-size: 13.5px; color: var(--ui-ink-2); }
.form-switch .form-check-input { width: 40px; height: 24px; border-radius: 12px; background-color: var(--ui-line-hover); border: 0; margin-top: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E"); background-size: 18px; background-position: 3px center; transition: background-position .18s var(--ui-ease), background-color .18s var(--ui-ease); }
.form-switch .form-check-input:checked { background-color: var(--ui-green-fill); background-position: 19px center; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E"); }
.form-switch .form-check-label { padding-left: 6px; line-height: 24px; }
.form-range::-webkit-slider-thumb { background: var(--ui-green-fill); }
.form-range::-moz-range-thumb { background: var(--ui-green-fill); }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: var(--ui-danger); background-image: none; }
.invalid-feedback { font-size: 12px; color: var(--ui-danger); }
.valid-feedback { font-size: 12px; color: var(--ui-ok); }
/* a native file picker: its "Choose file" button is a small pill */
input.form-control[type="file"] { padding-top: 5px !important; padding-bottom: 5px; line-height: 28px; color: var(--ui-muted); font: 500 13px var(--ui-font); }
input.form-control[type="file"]::file-selector-button { height: 28px; margin: 0 10px 0 0; padding: 0 12px; border: 1.5px solid var(--ui-line); border-radius: var(--ui-r-pill); background: var(--ui-surface); color: var(--ui-ink); font: 500 13px var(--ui-font); cursor: pointer; }
input.form-control[type="file"]::file-selector-button:hover { border-color: var(--ui-green); color: var(--ui-green); }

/* cards (HxCard) */
.card > .card-header { background: transparent; border-bottom: 1px solid var(--ui-line-3); padding: 0 0 14px; margin: 0 0 14px; font-size: 16px; font-weight: 600; color: var(--ui-ink); }
.card > .card-header.bg-primary { background: var(--ui-green-deep) !important; color: var(--ui-on-fill); margin: -18px -18px 14px; padding: 14px 18px; }
.card > .card-body { padding: 0; }
.card > .card-footer { background: var(--ui-surface-2); border-top: 1px solid var(--ui-line-3); margin: 14px -18px -18px; padding: 14px 18px; border-radius: 0 0 var(--ui-r-card) var(--ui-r-card); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.card-subtitle { font-size: 13px; color: var(--ui-muted); }

/* modals (HxModal) */
.modal-content { border: 0; border-radius: var(--ui-r-modal); box-shadow: var(--ui-shadow-modal); background: var(--ui-surface); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--ui-line-3); align-items: center; gap: 10px; }
.modal-header:has(.mhh, .mhs) { align-items: flex-start; }
/* Bootstrap's ".modal-header .btn-close" adds padding and margin around the 38px circle */
.modal-header .btn-close { box-sizing: border-box; padding: 0; margin: 0 0 0 auto; flex: none; }
.modal-header.bg-primary, .modal-header.gh, .modal-header.bg-success { background: var(--ui-green-deep) !important; color: var(--ui-on-fill); border-bottom: 0; }
.modal-header.bg-primary .btn-close, .modal-header.gh .btn-close { background-color: rgba(255, 255, 255, .12); filter: brightness(10); }
.modal-title, .modal-header h4, .modal-header h5 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: inherit; }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--ui-line-3); background: var(--ui-surface-2); gap: 8px; }
.modal-footer > * { margin: 0; }
.modal-backdrop { --bs-backdrop-bg: var(--ui-sb-bg); --bs-backdrop-opacity: .45; }
.modal-dialog-scrollable .modal-body { scrollbar-width: thin; }
/* dialogs sit 56px down, as the canvas .scrim puts them; the canvas sizes Havit has no name for */
@media (min-width: 576px) { .modal-dialog:not(.modal-dialog-centered) { margin-top: 56px; margin-bottom: 56px; } }
.modal-dialog.modal-640 { --bs-modal-width: 640px; }
.modal-dialog.modal-900 { --bs-modal-width: 900px; max-width: min(900px, calc(100vw - 48px)); }

/* dropdowns (HxDropdown, Bootstrap data-bs-toggle) */
.dropdown-menu { --bs-dropdown-bg: var(--ui-surface); --bs-dropdown-border-width: 0; --bs-dropdown-border-radius: var(--ui-r-card); --bs-dropdown-box-shadow: var(--ui-shadow-dd); --bs-dropdown-padding-y: 8px; --bs-dropdown-padding-x: 0; --bs-dropdown-min-width: 240px; --bs-dropdown-font-size: 13.5px; --bs-dropdown-color: var(--ui-ink); --bs-dropdown-link-color: var(--ui-ink); --bs-dropdown-link-hover-color: var(--ui-ink); --bs-dropdown-link-hover-bg: var(--ui-bg); --bs-dropdown-link-active-color: var(--ui-green-ink); --bs-dropdown-link-active-bg: var(--ui-mint-tint); --bs-dropdown-item-padding-x: 18px; --bs-dropdown-item-padding-y: 10px; --bs-dropdown-header-color: var(--ui-muted); --bs-dropdown-divider-bg: var(--ui-line-3); --bs-dropdown-divider-margin-y: 6px; box-shadow: var(--ui-shadow-dd); overflow: hidden; }
.dropdown-item { display: flex; align-items: center; gap: 12px; font-weight: 500; white-space: normal; }
.dropdown-item i { color: var(--ui-green); width: 18px; text-align: center; }
.dropdown-header { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 16px 18px 8px; }
.dropdown-subheader { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ui-muted); padding: 10px 18px 6px; }
.dropdown-menu hr { margin: 6px 0; border-color: var(--ui-line-3); opacity: 1; }

/* badges → tags */
/* .badge is the canvas's .tag: a tonal pill. The text-bg-* tones are tinted fill + deep text wherever
   they appear (status is tonal, never white on a saturated fill). */
.badge { --bs-badge-font-size: 11px; --bs-badge-font-weight: 600; --bs-badge-padding-x: 10px; --bs-badge-padding-y: 3px; --bs-badge-border-radius: var(--ui-r-pill); --bs-badge-color: inherit; display: inline-flex; align-items: center; gap: 5px; line-height: 1.5; }
.text-bg-success, .text-bg-primary, .badge.bg-primary, .badge.badge-primary, .badge.bg-success { background-color: var(--ui-ok-bg) !important; color: var(--ui-ok) !important; }
.text-bg-warning, .badge.bg-warning { background-color: var(--ui-warn-bg) !important; color: var(--ui-warn) !important; }
.text-bg-danger, .badge.bg-danger { background-color: var(--ui-bad-bg) !important; color: var(--ui-bad) !important; }
.text-bg-info, .badge.bg-info { background-color: var(--ui-info-bg) !important; color: var(--ui-info) !important; }
.text-bg-secondary, .text-bg-light, .badge.bg-secondary, .badge.bg-light { background-color: var(--ui-nu-bg) !important; color: var(--ui-nu) !important; }
.text-bg-dark, .badge.bg-dark { background-color: var(--ui-ink) !important; color: var(--ui-on-ink) !important; }

/* alerts */
/* .alert is the canvas's .al: icon then text in a row. Spacing between alerts comes from the page's gap. */
.alert { --bs-alert-border: 1px solid color-mix(in srgb, var(--bs-alert-color) 22%, transparent); --bs-alert-border-radius: var(--ui-r-inner); --bs-alert-padding-x: 16px; --bs-alert-padding-y: 14px; --bs-alert-margin-bottom: 0; display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.5; box-shadow: none; }
.alert > .fa-light { flex: none; margin-top: 2px; }
.alert-danger { --bs-alert-bg: var(--ui-danger-wash); --bs-alert-color: var(--ui-bad); }
.alert-warning { --bs-alert-bg: var(--ui-warn-wash); --bs-alert-color: var(--ui-warn); }
.alert-info { --bs-alert-bg: var(--ui-info-wash); --bs-alert-color: var(--ui-info); }
.alert-success, .alert-primary { --bs-alert-bg: var(--ui-green-wash); --bs-alert-color: var(--ui-ok); }
.alert-secondary, .alert-light, .alert-dark { --bs-alert-bg: var(--ui-panel); --bs-alert-color: var(--ui-ink-3); }
.alert-link { font-weight: 600; }

/* tabs */
.nav-tabs { --bs-nav-tabs-border-width: 1px; --bs-nav-tabs-border-color: var(--ui-line-2); --bs-nav-tabs-link-active-color: var(--ui-ink); --bs-nav-tabs-link-active-bg: transparent; --bs-nav-tabs-link-active-border-color: transparent transparent var(--ui-green); --bs-nav-tabs-link-hover-border-color: transparent transparent transparent; --bs-nav-link-color: var(--ui-muted); --bs-nav-link-hover-color: var(--ui-ink); --bs-nav-link-font-size: 13px; --bs-nav-link-font-weight: 500; --bs-nav-link-padding-x: 14px; --bs-nav-link-padding-y: 10px; gap: 4px; }
.nav-tabs .nav-link { border-width: 0 0 2.5px; border-radius: 10px 10px 0 0; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
/* count badge on a tab */
.nav-link .n { min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--ui-r-pill); background: var(--ui-ghost); color: var(--ui-ink-3); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-link .n.warn { background: var(--ui-bad-bg); color: var(--ui-bad); }
.nav-link.active .n { background: var(--ui-green-fill); color: var(--ui-on-fill); }
.nav-tabs .nav-link:hover { background: var(--ui-bg); }
.nav-tabs .nav-link.active { font-weight: 600; }
.nav-pills { --bs-nav-pills-border-radius: var(--ui-r-pill); --bs-nav-pills-link-active-bg: var(--ui-ink); --bs-nav-pills-link-active-color: var(--ui-on-ink); --bs-nav-link-color: var(--ui-ink); --bs-nav-link-font-size: 13px; gap: 6px; }
.nav-pills .nav-link { border: 1.5px solid var(--ui-line); background: var(--ui-surface); min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; }
.nav-pills .nav-link.active { border-color: var(--ui-ink); }
.nav-underline { --bs-nav-underline-link-active-color: var(--ui-ink); --bs-nav-underline-border-width: 2.5px; --bs-nav-link-color: var(--ui-muted); }
.nav-underline .nav-link.active { border-bottom-color: var(--ui-green); font-weight: 600; }
/* .nav-tabs.scroll keeps a long tab strip on one line: slightly tighter tabs, and a thin sideways scroll when it still
   doesn't fit (staff details has 12 tabs), instead of wrapping one orphan tab onto a second row. */
.nav-tabs.scroll { flex-wrap: nowrap; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--ui-line) transparent; overscroll-behavior-x: contain; }
.nav-tabs.scroll::-webkit-scrollbar { height: 4px; }
.nav-tabs.scroll::-webkit-scrollbar-thumb { background: var(--ui-line); border-radius: 4px; }
.nav-tabs.scroll > .nav-link { flex: none; padding: 10px 11px; }

/* tables */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ui-ink); --bs-table-border-color: var(--ui-line-4); --bs-table-striped-bg: var(--ui-surface-2); --bs-table-hover-bg: var(--ui-surface-2); --bs-table-active-bg: var(--ui-mint-tint); font-size: 13px; vertical-align: middle; }
.table > thead > tr > th, .table > :not(caption) > * > th { font-size: 12px; font-weight: 500; color: var(--ui-muted); background: var(--ui-surface-2); border-bottom: 1px solid var(--ui-line-4); padding: 10px 18px; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.table > tbody > tr > td, .table > :not(caption) > * > td { padding: 10px 18px; border-top: 1px solid var(--ui-line-4); border-bottom: 0; }
.table-sm > :not(caption) > * > * { padding: 6px 12px; }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table-bordered > :not(caption) > * { border-color: var(--ui-line-4); }
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px; }
.table-responsive { border-radius: var(--ui-r-inner); }
.table-primary, .table-success { --bs-table-bg: var(--ui-ok-bg); --bs-table-color: var(--ui-ok); }
.table-warning { --bs-table-bg: var(--ui-warn-bg); --bs-table-color: var(--ui-warn); }
.table-danger { --bs-table-bg: var(--ui-bad-bg); --bs-table-color: var(--ui-bad); }
.table-info { --bs-table-bg: var(--ui-info-bg); --bs-table-color: var(--ui-info); }
.table-light, .table-secondary { --bs-table-bg: var(--ui-panel); }

/* pagination */
.pagination { --bs-pagination-border-radius: var(--ui-r-sm); --bs-pagination-color: var(--ui-ink-3); --bs-pagination-bg: var(--ui-surface); --bs-pagination-border-color: var(--ui-line); --bs-pagination-border-width: 1.5px; --bs-pagination-hover-color: var(--ui-ink); --bs-pagination-hover-bg: var(--ui-surface); --bs-pagination-hover-border-color: var(--ui-line-hover); --bs-pagination-active-color: var(--ui-on-ink); --bs-pagination-active-bg: var(--ui-ink); --bs-pagination-active-border-color: var(--ui-ink); --bs-pagination-focus-box-shadow: none; --bs-pagination-font-size: 13px; --bs-pagination-padding-x: 8px; --bs-pagination-padding-y: 0; gap: 4px; }
.page-link { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ui-r-sm) !important; font-weight: 500; }

/* placeholders, spinners, progress, tooltips, popovers */
.placeholder { background: var(--ui-ghost); border-radius: var(--ui-r-sm); opacity: 1; min-height: 1em; }
.placeholder-glow .placeholder { animation: placeholder-glow 2s ease-in-out infinite; }
.spinner-border, .spinner-grow { color: var(--ui-green); }
.btn-primary .spinner-border {
    color: var(--ui-on-fill);
}
.progress { --bs-progress-height: 8px; --bs-progress-bg: var(--ui-ghost); --bs-progress-border-radius: var(--ui-r-pill); --bs-progress-bar-bg: var(--ui-green-fill); }
.progress-bar { border-radius: var(--ui-r-pill); }
.progress.lg { --bs-progress-height: 12px; }
.tooltip { --bs-tooltip-bg: var(--ui-ink); --bs-tooltip-color: var(--ui-on-ink); --bs-tooltip-border-radius: var(--ui-r-sm); --bs-tooltip-font-size: 12px; --bs-tooltip-padding-x: 10px; --bs-tooltip-padding-y: 6px; --bs-tooltip-opacity: 1; font-family: var(--ui-font); font-weight: 500; }
/* Shift-average summaries need more room than Bootstrap's default 200px tooltip. */
.auto-width-tooltip { --bs-tooltip-max-width: min(420px, calc(100vw - 24px)); }
.auto-width-tooltip .tooltip-inner { overflow-wrap: anywhere; }
.popover { --bs-popover-border-width: 0; --bs-popover-border-radius: var(--ui-r-inner); --bs-popover-box-shadow: var(--ui-shadow-dd); --bs-popover-header-bg: var(--ui-surface-2); --bs-popover-font-size: 13px; font-family: var(--ui-font); }
.list-group { --bs-list-group-border-color: var(--ui-line-4); --bs-list-group-border-radius: var(--ui-r-box); --bs-list-group-item-padding-x: 16px; --bs-list-group-item-padding-y: 12px; --bs-list-group-action-hover-bg: var(--ui-bg); --bs-list-group-active-bg: var(--ui-mint-tint); --bs-list-group-active-color: var(--ui-green-ink); --bs-list-group-active-border-color: var(--ui-line-4); font-size: 13.5px; }
.accordion { --bs-accordion-border-color: var(--ui-line-2); --bs-accordion-border-radius: var(--ui-r-box); --bs-accordion-inner-border-radius: 14px; --bs-accordion-btn-bg: var(--ui-surface); --bs-accordion-btn-color: var(--ui-ink); --bs-accordion-active-bg: var(--ui-bg); --bs-accordion-active-color: var(--ui-ink); --bs-accordion-btn-focus-box-shadow: none; --bs-accordion-btn-padding-x: 20px; --bs-accordion-btn-padding-y: 14px; }
.accordion-button { font: 600 14px var(--ui-font); }
.accordion-button::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235E6A63' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.offcanvas { --bs-offcanvas-border-width: 0; --bs-offcanvas-box-shadow: var(--ui-shadow-dd); }
.breadcrumb { --bs-breadcrumb-divider-color: var(--ui-line-hover); font-size: 13px; }
.toast { --bs-toast-border-radius: var(--ui-r-inner); --bs-toast-border-width: 0; --bs-toast-box-shadow: var(--ui-shadow-dd); }
hr { border-color: var(--ui-line-3); opacity: 1; }
.text-primary { color: var(--ui-green) !important; }
.text-secondary, .text-muted { color: var(--ui-muted) !important; }
.bg-primary { background-color: var(--ui-green-deep) !important; }
.bg-light { background-color: var(--ui-bg) !important; }
.border { border-color: var(--ui-line) !important; }
.rounded { border-radius: var(--ui-r-input) !important; }
.rounded-3 { border-radius: var(--ui-r-inner) !important; }
.shadow-sm { box-shadow: var(--ui-shadow-card) !important; }

/* Havit specifics */
.hx-input-date .dropdown-menu, .hx-calendar { font-family: var(--ui-font); }
.hx-calendar-day-selected { border-radius: 8px; }
.hx-input-tags-tag, .hx-input-tags .badge { background: var(--ui-mint-tint) !important; color: var(--ui-green-ink) !important; }
.hx-multi-select-dropdown-menu, .hx-select .dropdown-menu { max-height: 320px; }
.hx-spinner { color: var(--ui-green); }
.hx-progress-indicator .progress-bar { background: var(--ui-green-fill); }

/* Blazored.Modal */
.blazored-modal { border-radius: var(--ui-r-modal); box-shadow: var(--ui-shadow-modal); font-family: var(--ui-font); border: 0; padding: 0; }
.blazored-modal-header { padding: 18px 22px; border-bottom: 1px solid var(--ui-line-3); }
.blazored-modal-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.blazored-modal-content { padding: 20px 22px; }
.blazored-modal-overlay { background: var(--ui-scrim); }
.blazored-modal-close { width: 38px; height: 38px; border-radius: 50%; background: var(--ui-bg); }

/* Blazored.Typeahead: its package stylesheet loads after this one, so the field rules double the class to win */
.blazored-typeahead.blazored-typeahead { border: 1.5px solid var(--ui-line); border-radius: var(--ui-r-input); background: var(--ui-surface-2); box-shadow: none; overflow: visible; }
.blazored-typeahead.blazored-typeahead:focus-within { border-color: var(--ui-green); background: var(--ui-surface); }
.blazored-typeahead .blazored-typeahead__input.blazored-typeahead__input,
.blazored-typeahead .blazored-typeahead__input-mask.blazored-typeahead__input-mask { background: transparent; border: 0; border-radius: var(--ui-r-input); padding: 0 12px; min-height: 39px; font: 500 14px var(--ui-font); color: var(--ui-ink); box-shadow: none; outline: 0; }
.blazored-typeahead .blazored-typeahead__input::placeholder { color: var(--ui-muted-2); }
.blazored-typeahead__results { border: 0; border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow-dd); }
.blazored-typeahead__result { padding: 10px 18px; font-size: 13.5px; }
.blazored-typeahead__active-item, .blazored-typeahead__result:hover { background: var(--ui-bg); }

/* alertify notifier (DisplaySuccess / DisplayError / info): each toast is drawn as the matching .alert box (success,
   danger, warning, info) with the icon an alert carries, plus a shadow as it floats over the page. alertify still
   shows, stacks and dismisses them. Its theme stylesheets load after this one, hence !important on what they set.
   Error toasts often carry a raw API error (long JSON, no spaces): wrap anywhere. */
.alertify-notifier .ajs-message { --toast: var(--ui-ink-3); --toast-bg: var(--ui-panel); --toast-icon: "\f05a"; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px !important; border: 1px solid color-mix(in srgb, var(--toast) 22%, transparent) !important; border-radius: var(--ui-r-inner); background: var(--toast-bg) !important; color: var(--toast) !important; width: min(380px, calc(100vw - 32px)) !important; font: 500 13px/1.5 var(--ui-font); text-align: left !important; text-shadow: none; box-shadow: var(--ui-shadow-dd); overflow-wrap: anywhere; }
.alertify-notifier .ajs-message::before { content: var(--toast-icon); font: var(--fa-font-light); font-size: 16px; flex: none; margin-top: 2px; }
.alertify-notifier .ajs-message.ajs-success { --toast: var(--ui-ok); --toast-bg: var(--ui-green-wash); --toast-icon: "\f058"; }
.alertify-notifier .ajs-message.ajs-error { --toast: var(--ui-bad); --toast-bg: var(--ui-danger-wash); --toast-icon: "\f06a"; }
.alertify-notifier .ajs-message.ajs-warning { --toast: var(--ui-warn); --toast-bg: var(--ui-warn-wash); --toast-icon: "\f071"; }
.alertify-notifier .ajs-message.ajs-notifycustom { --toast: var(--ui-info); --toast-bg: var(--ui-info-wash); }
/* LongTaskModal: a background task's progress, floating bottom-right over the page like the notifier toasts above.
   White card, a tonal status disc (text-bg-*), title, message and a progress bar toned by status. */
.task-toast { position: fixed; right: 16px; bottom: 16px; z-index: 1030; width: min(360px, calc(100vw - 32px)); display: flex; gap: 12px; align-items: flex-start; padding: 14px 14px 16px 16px; border-radius: var(--ui-r-inner); background: var(--ui-surface); box-shadow: var(--ui-shadow-dd); color: var(--ui-ink); overflow-wrap: anywhere; }
.task-toast .tt-ico { width: 34px; height: 34px; border-radius: var(--ui-r-sm); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.task-toast .tt-ico .spinner-border { color: inherit; width: 16px; height: 16px; border-width: 2px; }
.task-toast .tt-title { font-size: 14px; font-weight: 600; line-height: 34px; }
.task-toast .progress { margin-top: 10px; }
.task-toast .btn-close { width: 30px; height: 30px; background-size: 14px; flex: none; }

.alertify .ajs-dialog { border-radius: var(--ui-r-modal); box-shadow: var(--ui-shadow-modal); font-family: var(--ui-font); }
.alertify .ajs-header { font-weight: 700; font-size: 19px; border-bottom: 1px solid var(--ui-line-3); }
.alertify .ajs-footer { background: var(--ui-surface-2); border-top: 1px solid var(--ui-line-3); }
.alertify .ajs-footer .ajs-buttons .ajs-button { border-radius: var(--ui-r-pill); font: 600 13px var(--ui-font); min-height: 34px; padding: 0 14px; }
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-ok { background: var(--ui-green-fill); color: var(--ui-on-fill); }
.alertify .ajs-footer .ajs-buttons .ajs-button.ajs-cancel { background: var(--ui-surface); border: 1.5px solid var(--ui-line); color: var(--ui-ink); }

/* Blazor error bar */
#blazor-error-ui { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 9999; padding: 12px 20px; background: var(--ui-danger-wash); color: var(--ui-bad); font: 600 13px var(--ui-font); box-shadow: 0 -1px 0 var(--ui-danger-line); display: flex; align-items: center; gap: 14px; }
#blazor-error-ui .reload { margin-left: auto; cursor: pointer; }
#blazor-error-ui .dismiss { cursor: pointer; }

/* ============================================================================
   7. RESPONSIVE
   ============================================================================ */
@media (max-width: 1200px) {
    .kpis, .sk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .top { grid-template-columns: 1fr; }
    .rl { grid-template-columns: 1fr; }
    .rail { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 991.98px) {
    #page-container.shell, #page-container.shell.sb-mini { padding-left: 0; }
    .sb, .sb-mini .sb { width: var(--ui-sb-w); padding: 14px 12px 16px; transform: translateX(-100%); box-shadow: none; }
    .sb-open .sb { transform: none; box-shadow: var(--ui-shadow-sb); }
    .sbpin { display: none !important; }
    .sbclose { display: flex; }
    .sb-open .sb-backdrop { display: block; position: fixed; inset: 0; background: var(--ui-scrim); z-index: 39; }
    .tbmenu { display: inline-flex; }
    .tb { padding: 10px 16px; }
    .tbt { max-width: 100%; }
    .tbclock, .tbs { display: none; }
    .pg { padding: 16px; }
    .h1 { font-size: 24px; }
    .g3 { grid-template-columns: 1fr; }
    .kpis, .sk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tdv .tdn { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 575.98px) {
    .kpis, .sk-kpis, .g2.fixed { grid-template-columns: 1fr; }
    .scrim { padding: 16px; }
    .mdl { width: 100% !important; }
    .srch, .sk-srch { width: 100%; }
    .tdl { display: none; }
}
/* phone: strips wider than the screen scroll inside their card instead of pushing the page sideways (segmented
   controls, the boxed .stab strips, the Invoice System tab groups); rows that say "nothing here" stay on screen */
@media (max-width: 767.98px) {
    .pg .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .pg .seg > button, .pg .seg > a { flex: none; }
    .pg .card > div:has(> .stab) { max-width: 100%; min-width: 0; }
    .pg .stab[role="tablist"] { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .pg .stab[role="tablist"] > button, .pg .stab[role="tablist"] > a { flex: none; }
    /* the Invoice System | Approval divider is a stray vertical rule once the groups wrap onto two lines */
    .nav-tabs.tgroups > .tsep { display: none; }
    /* the "no documents" row sits in a 1000px scrolling table: pin it to the visible part of the card */
    .card > .tbl > div > .tr.empty { position: sticky; left: 18px; width: calc(100vw - 68px); box-sizing: border-box; }
    .tbl td[colspan].text-center, .tbl td[colspan].sub, .tbl > div > .sub { text-align: left !important; }
    /* stock tables keep a readable width and scroll, rather than squeezing every column into 350px */
    .sdt .tbl > table, .stock-workspace .card .tbl > table.table { min-width: 640px; }
}
@media (max-width: 575.98px) {
    /* top bar: the menu and title take the first line, the round buttons a tidy second one */
    .tb .tbt { flex: 1 1 calc(100% - 56px); }
    .seg.gr button { padding: 0 11px; font-size: 12.5px; flex: none; }
}
@media print {
    .sb, .tb, .ic { display: none !important; }
    #page-container.shell { padding-left: 0 !important; }
}

/* ---- top-bar menus (widths, rows) and sidebar extras ---- */
.dropdown-menu .mi { padding: 10px 18px; border-radius: 0; font-size: 13.5px; }
.dropdown-menu .mi .fa-light { color: var(--ui-green); }
.dropdown-menu .cap { padding: 16px 18px 8px; display: block; }
.dropdown-menu > .cap:first-child, .dd > .cap:first-child { padding-top: 8px; }
.dropdown-menu .sep { margin: 6px 0; }
.dd-help { width: 280px; }
/* the profile menu is long: it stops short of the window bottom (top bar + its 12px drop) and scrolls inside */
.dd-user { width: 300px; max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.dd-imp { width: 340px; }
.dd-imp.show { display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.dd-imp .cap { padding: 10px 18px 4px; }
.dd-imp > .cap:first-child { padding-top: 6px; }
.dd-imp .dd-scroll { max-height: 260px; padding-bottom: 4px; flex: 0 1 auto; min-height: 0; }
.dd-imp .imp { padding: 5px 18px; gap: 10px; font-size: 13px; }
.dd-imp .imp .av { width: 26px; height: 26px; font-size: 10.5px; }
.dd-imp .imp > span:not(.av):not(.id) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-switch { width: 340px; max-width: calc(100vw - 32px); }
.dd-notif { width: 520px; max-width: calc(100vw - 32px); padding: 0; }
.dd-search { width: 520px; max-width: calc(100vw - 32px); padding: 0; }
.dd-scroll { max-height: 440px; overflow: auto; padding-bottom: 8px; }
.sbimg { width: 18px; height: 18px; object-fit: contain; flex: none; }
.stock-nav-alert-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 7px; border-radius: var(--ui-r-pill); background: var(--ui-danger-fill); color: var(--ui-on-fill); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.shell.nochrome { padding-left: 0 !important; }
.nt-more { display: block; width: 100%; text-align: center; padding: 14px; border: 0; border-top: 1px solid var(--ui-line-4); background: transparent; font: 600 13px var(--ui-font); color: var(--ui-green); cursor: pointer; }
.swhd { padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 6px; }
.swlist { border-top: 1px solid var(--ui-line-3); max-height: 360px; overflow: auto; padding: 4px 0 6px; }
.swlist .swg { padding: 6px 14px; font-size: 13px; }
.swlist .sws { padding: 4px 14px 4px 26px; font-size: 12.5px; }
.tdn.tdn-lg { min-width: 240px; }
.tdn.tdn-sm { display: none; min-width: 85px; }
@media (max-width: 991.98px) { .tdn.tdn-lg { display: none; } .tdn.tdn-sm { display: inline; } }

/* ============================================================================
   STOCK KIT additions (sk-*): grids, tiles, lanes, calendar, skeletons, data table
   ============================================================================ */
.stock-workspace { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sk-lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* HeaderLead pages (.ph pattern: Stock-MasterSuppliers, -SupplierGroups, -OrderingStatus) bottom-align the actions with
   the subtitle, as the artboard's `align-items:flex-end`. */
.stock-workspace > .sk-act:has(> .sk-lead) { align-items: flex-end; }
.sk-row48 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px; }
.sk-row75 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 14px; }
.sk-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sk-g4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.sk-c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sk-c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sk-c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sk-al { grid-template-columns: minmax(0, 1fr) 220px; padding: 8px 16px; }
.sk-ua { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) 170px; }
.sk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.sk-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--ui-line-2); border-radius: var(--ui-r-box); text-decoration: none; color: var(--ui-ink); font-size: 14px; background: var(--ui-surface-2); }
.sk-tile:hover { border-color: var(--ui-mint); color: var(--ui-ink); }
.sk-tile > .fa-light:last-child { color: var(--ui-muted-3); }
.sk-ti { width: 38px; height: 38px; border-radius: var(--ui-r-input); background: var(--ui-mint-tint); color: var(--ui-green-ink); display: flex; align-items: center; justify-content: center; flex: none; }
.sk-kpi { display: flex; flex-direction: row; align-items: center; gap: 12px; text-align: left; }
.sk-kpi > .sk-esi { flex: none; }
.sk-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sk-lane { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--ui-r-box); border: 1.5px solid var(--ui-line-2); background: var(--ui-surface-2); font: 500 13px var(--ui-font); color: var(--ui-ink); cursor: pointer; text-align: left; }
.sk-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.sk-cal span { font-size: 11px; font-weight: 600; color: var(--ui-muted); padding: 4px 0; }
.sk-d { height: 36px; border: 0; border-radius: var(--ui-r-sm); background: transparent; font: 500 13px var(--ui-font); color: var(--ui-ink); cursor: pointer; }
.sk-d.mu { color: var(--ui-muted-3); }
.sk-d.on { background: var(--ui-green-fill); color: var(--ui-on-fill); font-weight: 700; }
.ix { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-muted-3); display: inline-flex; align-items: center; justify-content: center; opacity: .5; cursor: not-allowed; }
.fg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fg2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kt .kl { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-muted); }
.gs { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: var(--ui-r-box); border: 1.5px solid var(--ui-line-2); background: var(--ui-surface); }
.gs.cur { border-color: var(--ui-mint); background: var(--ui-green-wash-2); }
.gn { width: 34px; height: 34px; border-radius: 50%; background: var(--ui-bad-bg); color: var(--ui-bad); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.gst { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ui-bad); font-weight: 500; }
.gst::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ui-danger-fill); }
.bar { height: 8px; border-radius: 4px; background: var(--ui-ghost); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ui-green-fill); border-radius: 4px; }
.wn { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--ui-r-box); border: 1.5px solid var(--ui-line-2); text-decoration: none; color: var(--ui-ink); background: var(--ui-surface-2); }
.wn:hover { border-color: var(--ui-line-hover); color: var(--ui-ink); }
.wf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ovg2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.ovc { display: flex; flex-direction: column; }
.ovc .emp { flex: 1; justify-content: center; }
.cash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex: 1; }
.cst { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--ui-r-inner); background: var(--ui-surface-2); border: 1.5px solid var(--ui-line-3); }
.mv button { display: inline-flex; align-items: center; }
/* column templates drawn on specific stock artboards */
.ccg { grid-template-columns: 1.6fr 1.1fr 1fr .8fr 1fr 1fr .9fr .8fr; }
.cn-t { grid-template-columns: 2fr 1fr 1fr 1.6fr 44px; }
.os-t { grid-template-columns: 1.6fr 1fr .7fr .8fr 1fr .9fr .9fr 1fr 2fr; }
/* skeletons (StockSkeleton) */
.sk-skel { display: flex; flex-direction: column; gap: 10px; }
.sk-skel .placeholder { height: 14px; animation: placeholder-glow 2s ease-in-out infinite; }
.sk-skel-row { display: grid; gap: 10px; }
.sk-skel-head .placeholder { height: 18px; background: var(--ui-line); }
.sk-skel-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sk-skel-card { height: 96px; border-radius: var(--ui-r-card); }
.sk-skel-line { display: block; }
/* data table (StockDataTable, SortTh) */
.sdt { display: flex; flex-direction: column; gap: 12px; }
.sdt-tools { justify-content: flex-start; }
.sdt-end { margin-left: auto; }
.sdt-count { margin-left: auto; white-space: nowrap; }
.sdt-empty { padding: 4px 0; }
.srt-th { cursor: pointer; user-select: none; }
.srt-th .srt .fa-light { color: var(--ui-muted-3); }
.srt-th.on { color: var(--ui-ink) !important; }
.srt-th.on .srt .fa-light { color: var(--ui-green); }
.rowdetail > td { background: var(--ui-surface-2); border-top: 0 !important; padding-top: 0 !important; }
@media (max-width: 991.98px) {
    .sk-row48, .sk-row75, .sk-g2, .sk-g4, .sk-lanes, .wf { grid-template-columns: 1fr; }
    .fg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ovg2 { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) { .fg, .fg2, .cash { grid-template-columns: 1fr; } }

/* ---- stock: tabs, quantity stepper, list and row states ---- */
.sk-tabs.pills, .sk-tabs:has(> .btn) { border-bottom: 0; gap: 6px; }
.c-ok { color: var(--ui-ok); } .c-warn { color: var(--ui-warn); } .c-bad { color: var(--ui-bad); } .c-info { color: var(--ui-info); } .c-muted { color: var(--ui-muted); } .c-pri { color: var(--ui-green-ink); }
.sk-coll-body { border-top: 1px solid var(--ui-line-3); }
.sk-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ui-line); border-radius: var(--ui-r-pill); overflow: hidden; background: var(--ui-surface); }
.sk-qty button { width: 32px; height: 32px; border: 0; background: var(--ui-surface); color: var(--ui-ink-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: 600 16px var(--ui-font); }
.sk-qty button:hover { background: var(--ui-bg); }
.sk-qty input { width: 56px; height: 32px; border: 0; text-align: center; font: 600 13px var(--ui-font); color: var(--ui-ink); background: transparent; }
.ct.lt { font-size: 12px; color: var(--ui-muted); }
.tr.editing, .tr.on { background: var(--ui-green-wash); }
/* an autosuggest (NominalSearch) in an edit row is the same 34px control as its neighbours */
.tr.editing .hx-autosuggest .form-control { min-height: 34px; height: 34px; line-height: 31px; font-size: 13px; padding-left: 10px; border-radius: var(--ui-r-sm); }
.gn.ok { background: var(--ui-ok-bg); color: var(--ui-ok); }
.gn.warn { background: var(--ui-warn-bg); color: var(--ui-warn); }
.gst.ok { color: var(--ui-ok); } .gst.ok::before { background: var(--ui-green-fill); }
.gst.warn { color: var(--ui-warn); } .gst.warn::before { background: var(--ui-amber); }

.lr.on, .lr.active { background: var(--ui-green-wash); box-shadow: inset 3px 0 0 var(--ui-green); }

.tr.cur { background: var(--ui-green-wash-2); }

/* ---- overflowing boxes, AI progress bar, step indicator ---- */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mdl.ovis, .sk-panel.ovis, .card.ovis, .box.ovis { overflow: visible; }
/* an .ovis card no longer clips its header band to its corners, so the band rounds its own */
.card.ovis > :is(.band, .roh):first-child { border-radius: var(--ui-r-card) var(--ui-r-card) 0 0; }
.ai-busy { position: relative; height: 6px; border-radius: 999px; background: var(--ui-ghost); overflow: hidden; }
.ai-busy::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 999px; background: var(--ui-ai-gradient); animation: ai-busy 1.4s var(--ui-ease) infinite; }
@keyframes ai-busy { 0% { left: -40%; } 100% { left: 100%; } }
.steps { display: flex; gap: 10px; flex-wrap: wrap; }
.steps > span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ui-muted); }
.steps > span > b { width: 24px; height: 24px; border-radius: 50%; background: var(--ui-ghost); color: var(--ui-ink-3); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.steps > span.on { color: var(--ui-ink); font-weight: 600; }
.steps > span.on > b { background: var(--ui-green-fill); color: var(--ui-on-fill); }
.steps > span.done > b { background: var(--ui-mint-tint); color: var(--ui-green-ink); }

/* ---- report legends and KPI deltas ---- */
.reports-pair-cols { --cols: minmax(0, 1fr) minmax(0, 1fr); }
.report-dot-star { background: var(--ui-ok); }
.report-dot-workhorse { background: var(--ui-green-mid); }
.report-dot-puzzle { background: var(--ui-warn); }
.report-dot-dog { background: var(--ui-bad); }
.reports-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.kd.up { color: var(--ui-ok); } .kd.down { color: var(--ui-bad); }
.legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ui-muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; background: var(--ui-chart-ink); }
.legend i.sq { width: 10px; height: 10px; border-radius: 3px; }
.ft.sub { color: var(--ui-muted-2); font-size: 12px; }
.rb { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 13px; }
.rb .bar { grid-column: 1 / -1; }

/* full-bleed pages (onboarding, jobs portal): the page draws its own header bar */
.shell.nochrome > .main > .pg { padding: 0; gap: 0; }
.swt { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---- misc states: green modal heads, tones, green table heads, empty rows, validation ---- */
.modal-header.gh h1, .modal-header.gh h2, .modal-header.gh h3, .modal-header.gh h4, .modal-header.gh .mt, .modal-header.gh .modal-title { color: var(--ui-on-fill); }
button.ri { border: 0; background: none; font: inherit; width: 100%; text-align: left; cursor: pointer; }
.tr.gth, .th.gth { background: var(--ui-green-deep); color: var(--ui-on-fill); font-weight: 600; font-size: 12px; }
.tr.gth a, .th.gth a { color: var(--ui-on-fill); }
/* fractional column widths leave hairline seams between green head cells: a 1px shadow covers them */
th.gth + th.gth { box-shadow: -1px 0 0 var(--ui-green-deep); }
/* an "empty" row is one full-width cell (it ignores the table's --cols); it may carry its next step as a button */
.tr.empty { grid-template-columns: none; justify-content: center; gap: 10px; color: var(--ui-muted); font-size: 13px; text-align: center; }
.tr.empty > * { grid-column: 1 / -1; }
.tr.empty > .btn { justify-self: center; }
/* a dashed empty row straight in a card's table is inset like the other dashed empty states (Invoice System lists) */
.card > .tbl > div > .tr.empty { margin: 18px; }
/* inside a table box it is a plain centred muted row, not the dashed .empty card (M-Cashup-Tills, -OpenAccounts) */
.box .tr.empty { padding: 10px 18px; border: 0; border-top: 1px solid var(--ui-line-4); border-radius: 0; }
.pager button:disabled, .pager a[aria-disabled="true"] { opacity: .45; cursor: default; pointer-events: none; }
/* the current page is disabled (it can't be picked again) but stays readable */
.pager button.on:disabled { opacity: 1; }
.validation-message, .validation-errors { color: var(--ui-danger); font-size: 12px; font-weight: 500; }
.validation-errors { margin: 0 0 8px; padding-left: 18px; }
.flt select { height: 58px; padding: 22px 14px 6px; }
a.dl, button.dl { color: var(--ui-danger); font-weight: 500; text-decoration: none; background: none; border: 0; padding: 0; font: inherit; font-weight: 500; cursor: pointer; }
a.dl:hover, button.dl:hover { text-decoration: underline; color: var(--ui-danger); }
.tw:disabled, .tw[disabled], .tw.disabled { opacity: .45; cursor: default; pointer-events: none; }
.srt { border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.tbtn { border: 0; background: none; font: inherit; color: inherit; padding: 0; cursor: pointer; }

/* ---- auth frame, drop zone, pills, text helpers, label rows, thumbnails, menu states ---- */
/* signed-out frame (AuthLayout, MFA pages) */
.authc { min-height: calc(100vh - 52px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px; background: var(--ui-bg); }
.authlogo { width: 160px; color: var(--ui-ink); fill: currentColor; }
.authlogo img { width: 100%; height: auto; display: block; }
.authc > .card { width: 460px; max-width: 100%; }
.authwrap { display: flex; flex-direction: column; gap: 10px; max-width: 100%; }
.authback { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; align-self: flex-start; }
.authrow { display: flex; gap: 18px; align-items: stretch; justify-content: center; }
.authmain { width: 460px; max-width: 100%; }
.authupd { width: 460px; display: flex; flex-direction: column; }
@media (max-width: 991.98px) { .authupd { display: none; } }
.mfaic { width: 40px; height: 40px; border-radius: 50%; background: var(--ui-mint-tint); color: var(--ui-green-ink); display: flex; align-items: center; justify-content: center; flex: none; }
/* drop zone (uploads). On its own it is the dashed box; around a Havit HxInputFileDropZone it is only layout (the zone,
   then any previews, stacked) and the Havit zone takes the look through its variables. */
.dz { --hx-input-file-drop-zone-border-width: 2px; --hx-input-file-drop-zone-border-color: var(--ui-line-hover);
      --hx-input-file-drop-zone-border-radius: var(--ui-r-inner); --hx-input-file-drop-zone-background-color: var(--ui-surface-2);
      --hx-input-file-drop-zone-hover-background-color: var(--ui-surface); --hx-input-file-drop-zone-hover-border-color: var(--ui-green);
      --hx-input-file-drop-zone-hover-box-shadow: none; --hx-input-file-drop-zone-padding: 16px;
      border: 1.5px dashed var(--ui-dash); border-radius: var(--ui-r-box); background: var(--ui-surface-2); padding: 22px; text-align: center; color: var(--ui-muted); font-size: 13px; cursor: pointer; }
.dz:hover, .dz.over { border-color: var(--ui-green); background: var(--ui-mint-tint); color: var(--ui-green-ink); }
.dz:has(> .hx-input-file-drop-zone), .dz:has(> .hx-input-file-drop-zone):hover { display: flex; flex-direction: column; gap: 12px; border: 0; padding: 0; background: none; cursor: auto; }
.dz .hx-input-file-drop-zone { min-height: 150px; color: var(--ui-muted); font-size: 13px; text-align: center; cursor: pointer; }
.dzi { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ui-muted); }
.dzi .fa-light { color: var(--ui-green); }
/* joined row-action pills (View / Delete in a list row): green first, then ink, or red (.rd) for a destructive one */
.pair { display: inline-flex; border-radius: var(--ui-r-pill); overflow: hidden; justify-self: start; }
.pair > * { height: 34px; padding: 0 14px; border: 0; font: 600 12.5px var(--ui-font); color: var(--ui-on-ink); background: var(--ui-ink); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none; }
.pair > :first-child { background: var(--ui-green-fill); color: var(--ui-on-fill); }
.pair > .rd { background: var(--ui-danger-fill); color: var(--ui-on-fill); }
.pair > *:hover { filter: brightness(1.12); }
/* joined buttons: two pills read as one, split by a light rule (Holiday Accrual: Export | Recalculate) */
.joined { display: inline-flex; }
.joined > .btn:not(:only-child):first-child { border-radius: var(--ui-r-pill) 0 0 var(--ui-r-pill); }
.joined > .btn + .btn { border-radius: 0 var(--ui-r-pill) var(--ui-r-pill) 0; border-left: 1px solid var(--ui-mint-line); }
.mf.split { justify-content: space-between; }
/* text helpers */
.neg { color: var(--ui-danger); }
.msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.edl { border: 0; background: none; padding: 0; font: 600 11px var(--ui-font); color: var(--ui-green); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; text-decoration: none; }
.edl:hover { text-decoration: underline; }
/* form label row: label left, control right; stacks on phones. .tall aligns a tall control's label to its first line.
   .narrow (Lost property) and .wide (Incidents) are the artboards' other label widths. */
.flr { display: grid; grid-template-columns: var(--flr-label, 180px) minmax(0, 1fr); gap: 12px; align-items: center; }
.flr.tall { align-items: start; }
.flr.tall > span:first-child { padding-top: 10px; }
.flr.narrow { --flr-label: 120px; gap: 14px; font-size: 13px; font-weight: 500; }
.flr.wide { --flr-label: 260px; gap: 16px; font-size: 13.5px; }
.flr.wide > span:first-child { font-weight: 600; color: var(--ui-ink); }
.flr-add { font-size: 12px; font-weight: 500; color: var(--ui-green); }
@media (max-width: 640px) { .flr { grid-template-columns: 1fr; gap: 6px; } .flr.tall > span:first-child { padding-top: 0; } }
/* image thumbnails with a corner delete */
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--ui-ghost); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb > button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(19,35,27,.7); color: var(--ui-on-fill); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
/* misc states */
.mi.on { background: var(--ui-mint-tint); color: var(--ui-green-ink); font-weight: 600; }
.mi.dis, .mi:disabled { opacity: .45; pointer-events: none; }
.mi.rd, .mi.danger { color: var(--ui-danger); } .mi.rd .fa-light, .mi.danger .fa-light { color: var(--ui-danger); }
.btn.dropdown-toggle:has(.fa-light)::after { display: none; }
.ibx:disabled { opacity: .45; cursor: default; pointer-events: none; }
.tr.unread { background: var(--ui-mint-tint); }
label.btn:focus-within { outline: 2px solid var(--ui-green); outline-offset: 2px; }
.ivb { height: 38px; }
/* Quill (rich text) re-skin */
.ql-toolbar.ql-snow { border: 1.5px solid var(--ui-line) !important; border-radius: var(--ui-r-input) var(--ui-r-input) 0 0; background: var(--ui-surface-2); font-family: var(--ui-font) !important; }
.ql-container.ql-snow { border: 1.5px solid var(--ui-line) !important; border-top: 0 !important; border-radius: 0 0 var(--ui-r-input) var(--ui-r-input); font-family: var(--ui-font) !important; font-size: 14px; background: var(--ui-surface); }

/* ---- links, rows and boxes ---- */
/* danger / ink links */
.lk.dg, .w7lnk.dg, a.dg { color: var(--ui-danger); }
.lk.ink, a.ink { color: var(--ui-body); }
.lk.ink:hover, a.ink:hover { color: var(--ui-green); }
/* rows and boxes */
.tr.warn { background: var(--ui-warn-wash); }
.tr.kv { grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); }
/* a disabled segment stays readable (it is the one that can't be picked now); a disabled link segment fades */
.seg button:disabled { opacity: 1; cursor: default; }
.seg a[disabled] { opacity: .45; cursor: not-allowed; }
.w7pg a.dis, .w7pg a[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.srch .mx { width: 26px; height: 26px; }

/* ============================================================================
   8. THIRD-PARTY EDITORS
   ============================================================================ */
/* Contract template editor (sceditor, injected by loadTextEditor into .ced; Company Contracts, Staff Contracts): a 16px
   bordered box with a surface-2 toolbar. sceditor writes a fixed pixel width on its container at init, so the width is
   forced. The artboard (S-ContractTemplates-Create) draws the toolbar as one wrapped row of small outlined text tools
   (B, I, U, Font, Cut...), not sceditor's colour sprite icons: hide the sprite and print the label; the title stays. */
.ced .sceditor-container { width: 100% !important; border: 1.5px solid var(--ui-line); border-radius: var(--ui-r-box); overflow: hidden; background: var(--ui-surface); font-family: var(--ui-font); }
.ced .sceditor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--ui-surface-2); border-bottom: 1px solid var(--ui-line-2); }
.ced .sceditor-toolbar .sceditor-group { display: contents; }
.ced .sceditor-button { box-sizing: border-box; width: auto; min-width: 32px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--ui-line); background: var(--ui-surface); display: inline-flex; align-items: center; justify-content: center; font: 500 12px var(--ui-font); color: var(--ui-ink); cursor: pointer; text-decoration: none; }
.ced .sceditor-button:hover, .ced .sceditor-button.active { background: var(--ui-ghost); }
.ced .sceditor-button > div { display: none; }
.ced .sceditor-button::before { line-height: 1; }
.ced .sceditor-button-bold::before { content: "B"; font-weight: 700; }
.ced .sceditor-button-italic::before { content: "I"; font-style: italic; }
.ced .sceditor-button-underline::before { content: "U"; text-decoration: underline; }
.ced .sceditor-button-strike::before { content: "S"; text-decoration: line-through; }
.ced .sceditor-button-subscript::before { content: "x\2082"; }
.ced .sceditor-button-superscript::before { content: "x\00B2"; }
.ced .sceditor-button-left::before, .ced .sceditor-button-center::before, .ced .sceditor-button-right::before, .ced .sceditor-button-justify::before { content: "\2261"; }
.ced .sceditor-button-font::before { content: "Font"; }
.ced .sceditor-button-size::before { content: "Size"; }
.ced .sceditor-button-color::before { content: "A"; }
.ced .sceditor-button-removeformat::before { content: "Tx"; }
.ced .sceditor-button-cut::before { content: "Cut"; }
.ced .sceditor-button-copy::before { content: "Copy"; }
.ced .sceditor-button-paste::before, .ced .sceditor-button-pastetext::before { content: "Paste"; }
.ced .sceditor-button-bulletlist::before { content: "\2022\2261"; }
.ced .sceditor-button-orderedlist::before { content: "1\2261"; }
.ced .sceditor-button-indent::before { content: "\2192"; }
.ced .sceditor-button-outdent::before { content: "\2190"; }
.ced .sceditor-button-table::before { content: "\25A6"; }
.ced .sceditor-button-code::before { content: "</>"; }
.ced .sceditor-button-quote::before { content: "\201C"; }
.ced .sceditor-button-horizontalrule::before { content: "\2014"; }
.ced .sceditor-button-image::before { content: "Img"; }
.ced .sceditor-button-email::before { content: "@"; }
.ced .sceditor-button-link::before { content: "Link"; }
.ced .sceditor-button-unlink::before { content: "Unlink"; }
.ced .sceditor-button-ltr::before { content: "LTR"; }
.ced .sceditor-button-rtl::before { content: "RTL"; }
.ced .sceditor-button-print::before { content: "Print"; }
.ced .sceditor-button-maximize::before { content: "\2922"; }
.ced .sceditor-button-source::before { content: "Src"; }
