/* ==========================================================================
   ZAMSTOCK design system  ·  public/css/zs.css
   Loaded after Tabler. Re-tones Tabler through its own CSS variables and adds
   the application shell (sidebar, top bar, page header) and shared patterns.

   Identity: forest-green chrome, emerald for actions, copper for the brand
   mark and anything that needs attention (warnings, low stock). Cool neutral
   surfaces. IBM Plex Sans with tabular figures so money columns line up.
   ========================================================================== */

/* ── Fonts (self-hosted, work offline) ─────────────────────────────────── */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/vendor/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(/vendor/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/vendor/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/vendor/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(/vendor/fonts/ibm-plex-sans/files/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/vendor/fonts/ibm-plex-mono/files/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(/vendor/fonts/ibm-plex-mono/files/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root, [data-bs-theme=light] {
  --zs-canvas: #f2f5f3;
  --zs-surface: #ffffff;
  --zs-surface-2: #f7f9f8;
  --zs-surface-3: #eef2f0;
  --zs-line: #dde4e0;
  --zs-line-strong: #c5cfca;
  --zs-ink: #16211b;
  --zs-text: #34413a;
  --zs-muted: #63716a;
  --zs-faint: #8b9891;

  --zs-emerald: #12774a;
  --zs-emerald-rgb: 18,119,74;
  --zs-emerald-hover: #0d5f3a;
  --zs-emerald-soft: #e3f1ea;
  --zs-copper: #ad5a14;
  --zs-copper-rgb: 173,90,20;
  --zs-copper-soft: #f8ebdd;
  --zs-red: #b42318;
  --zs-red-rgb: 180,35,24;
  --zs-red-soft: #fbe9e7;
  --zs-blue: #1d5fa6;
  --zs-blue-rgb: 29,95,166;
  --zs-blue-soft: #e5eef8;

  /* chrome */
  --zs-side-bg: #0f2a20;
  --zs-side-bg-2: #15362a;
  --zs-side-line: rgba(255,255,255,.08);
  --zs-side-text: #b9cdc3;
  --zs-side-muted: #7f9b8d;
  --zs-side-active: #ffffff;
  --zs-copper-bright: #e39a55;

  --zs-shadow-pop: 0 1px 2px rgba(16,33,26,.06), 0 8px 24px -4px rgba(16,33,26,.14);
  --zs-shadow-modal: 0 2px 6px rgba(16,33,26,.08), 0 24px 56px -12px rgba(16,33,26,.28);
  --zs-focus: 0 0 0 3px rgba(var(--zs-emerald-rgb), .22);

  --zs-r-sm: 5px;  /* badges, chips */
  --zs-r: 7px;     /* inputs, buttons */
  --zs-r-lg: 10px; /* cards, panels */
  --zs-r-xl: 14px; /* modals, auth card */

  --zs-side-w: 256px;
  --zs-rail-w: 68px;
  --zs-top-h: 58px;
}

[data-bs-theme=dark] {
  --zs-canvas: #0b1411;
  --zs-surface: #111d18;
  --zs-surface-2: #15231d;
  --zs-surface-3: #1a2b24;
  --zs-line: #233630;
  --zs-line-strong: #2f463d;
  --zs-ink: #ecf2ef;
  --zs-text: #ccd7d1;
  --zs-muted: #91a39a;
  --zs-faint: #6d8077;

  --zs-emerald: #2c9e68;
  --zs-emerald-rgb: 44,158,104;
  --zs-emerald-hover: #38b378;
  --zs-emerald-soft: rgba(44,158,104,.16);
  --zs-copper: #d98b45;
  --zs-copper-rgb: 217,139,69;
  --zs-copper-soft: rgba(217,139,69,.15);
  --zs-red: #ef6a5e;
  --zs-red-rgb: 239,106,94;
  --zs-red-soft: rgba(239,106,94,.14);
  --zs-blue: #6aa5e6;
  --zs-blue-rgb: 106,165,230;
  --zs-blue-soft: rgba(106,165,230,.14);

  --zs-side-bg: #08110e;
  --zs-side-bg-2: #10201a;
  --zs-side-line: rgba(255,255,255,.06);

  --zs-shadow-pop: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -6px rgba(0,0,0,.6);
  --zs-shadow-modal: 0 2px 8px rgba(0,0,0,.5), 0 28px 64px -12px rgba(0,0,0,.75);
}

/* ── Map onto Tabler ────────────────────────────────────────────────────── */
:root, [data-bs-theme=light], [data-bs-theme=dark] {
  --tblr-font-sans-serif: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tblr-font-monospace: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --tblr-body-font-size: .875rem;
  --tblr-body-line-height: 1.5;
  --tblr-font-weight-medium: 500;
  --tblr-font-weight-bold: 600;

  --tblr-primary: var(--zs-emerald);
  --tblr-primary-rgb: var(--zs-emerald-rgb);
  --tblr-primary-fg: #fff;
  --tblr-primary-darken: var(--zs-emerald-hover);
  --tblr-primary-lt: var(--zs-emerald-soft);
  --tblr-primary-text-emphasis: var(--zs-emerald-hover);
  --tblr-primary-bg-subtle: var(--zs-emerald-soft);
  --tblr-primary-border-subtle: rgba(var(--zs-emerald-rgb), .3);

  --tblr-green: var(--zs-emerald);       --tblr-green-rgb: var(--zs-emerald-rgb);  --tblr-green-lt: var(--zs-emerald-soft);
  --tblr-success: var(--zs-emerald);     --tblr-success-rgb: var(--zs-emerald-rgb);--tblr-success-lt: var(--zs-emerald-soft);
  --tblr-red: var(--zs-red);             --tblr-red-rgb: var(--zs-red-rgb);        --tblr-red-lt: var(--zs-red-soft);
  --tblr-danger: var(--zs-red);          --tblr-danger-rgb: var(--zs-red-rgb);     --tblr-danger-lt: var(--zs-red-soft);
  --tblr-orange: var(--zs-copper);       --tblr-orange-rgb: var(--zs-copper-rgb);  --tblr-orange-lt: var(--zs-copper-soft);
  --tblr-warning: var(--zs-copper);      --tblr-warning-rgb: var(--zs-copper-rgb); --tblr-warning-lt: var(--zs-copper-soft);
  --tblr-yellow: #a77a06;                --tblr-yellow-rgb: 167,122,6;             --tblr-yellow-lt: color-mix(in srgb, #c99a14 16%, transparent);
  --tblr-blue: var(--zs-blue);           --tblr-blue-rgb: var(--zs-blue-rgb);      --tblr-blue-lt: var(--zs-blue-soft);
  --tblr-info: var(--zs-blue);           --tblr-info-rgb: var(--zs-blue-rgb);      --tblr-info-lt: var(--zs-blue-soft);
  --tblr-azure: #2b7bb9;                 --tblr-azure-rgb: 43,123,185;             --tblr-azure-lt: color-mix(in srgb, #2b7bb9 13%, transparent);
  --tblr-teal: #0f7f7a;                  --tblr-teal-rgb: 15,127,122;              --tblr-teal-lt: color-mix(in srgb, #0f7f7a 13%, transparent);
  --tblr-cyan: #0e7490;                  --tblr-cyan-rgb: 14,116,144;              --tblr-cyan-lt: color-mix(in srgb, #0e7490 13%, transparent);
  --tblr-purple: #7a4bb0;                --tblr-purple-rgb: 122,75,176;            --tblr-purple-lt: color-mix(in srgb, #7a4bb0 13%, transparent);
  --tblr-indigo: #4a5bb8;                --tblr-indigo-rgb: 74,91,184;             --tblr-indigo-lt: color-mix(in srgb, #4a5bb8 13%, transparent);
  --tblr-pink: #b43c74;                  --tblr-pink-rgb: 180,60,116;              --tblr-pink-lt: color-mix(in srgb, #b43c74 13%, transparent);
  --tblr-lime: #5b8a12;                  --tblr-lime-rgb: 91,138,18;               --tblr-lime-lt: color-mix(in srgb, #5b8a12 14%, transparent);

  --tblr-body-bg: var(--zs-canvas);
  --tblr-body-color: var(--zs-text);
  --tblr-emphasis-color: var(--zs-ink);
  --tblr-heading-color: var(--zs-ink);
  --tblr-secondary: var(--zs-muted);
  --tblr-muted: var(--zs-muted);
  --tblr-secondary-color: var(--zs-muted);
  --tblr-tertiary: var(--zs-faint);
  --tblr-bg-surface: var(--zs-surface);
  --tblr-bg-surface-primary: var(--zs-surface);
  --tblr-bg-surface-secondary: var(--zs-surface-2);
  --tblr-bg-surface-tertiary: var(--zs-surface-2);
  --tblr-bg-forms: var(--zs-surface);
  --tblr-border-color: var(--zs-line);
  --tblr-border-color-translucent: var(--zs-line);
  --tblr-link-color: var(--zs-emerald);
  --tblr-link-color-rgb: var(--zs-emerald-rgb);
  --tblr-link-hover-color: var(--zs-emerald-hover);
  --tblr-border-radius: var(--zs-r);
  --tblr-border-radius-sm: var(--zs-r-sm);
  --tblr-border-radius-lg: var(--zs-r-lg);
  --tblr-shadow-card: none;
  --tblr-shadow-input: none;
  --tblr-box-shadow: none;
  --tblr-box-shadow-lg: var(--zs-shadow-modal);
  --tblr-focus-ring-color: rgba(var(--zs-emerald-rgb), .22);
  --tblr-active-bg: rgba(var(--zs-emerald-rgb), .06);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--tblr-font-sans-serif);
  background: var(--zs-canvas);
  color: var(--zs-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--zs-ink); font-weight: 600; letter-spacing: -.005em; }
h1, .h1 { font-size: 1.625rem; line-height: 1.25; }
h2, .h2 { font-size: 1.375rem; line-height: 1.3; }
h3, .h3 { font-size: 1.125rem; line-height: 1.35; }
h4, .h4 { font-size: 1rem; }
h5, .h5 { font-size: .9375rem; }
h6, .h6 { font-size: .875rem; }
.text-muted, .text-secondary { color: var(--zs-muted) !important; }
.small, small { font-size: .8125rem; }
code, kbd, pre, .font-monospace { font-family: var(--tblr-font-monospace); }
code { font-size: .8em; color: var(--zs-text); background: var(--zs-surface-3); padding: .1em .4em; border-radius: 4px; }
::selection { background: rgba(var(--zs-emerald-rgb), .2); }
a { text-underline-offset: .15em; }

/* Numbers line up everywhere it matters */
table, .table, .zs-num, .zs-stat-value, .money, input[type=number], .h1, .h2, .h3, .fs-1, .fs-2, .fs-3 { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

:focus-visible { outline: 2px solid var(--zs-emerald); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus, .form-select:focus { outline: none; }

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

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  --tblr-card-bg: var(--zs-surface);
  --tblr-card-border-color: var(--zs-line);
  --tblr-card-border-radius: var(--zs-r-lg);
  --tblr-card-inner-border-radius: calc(var(--zs-r-lg) - 1px);
  --tblr-card-cap-bg: transparent;
  --tblr-card-cap-padding-y: .875rem;
  --tblr-card-cap-padding-x: 1.25rem;
  --tblr-card-spacer-x: 1.25rem;
  box-shadow: none;
}
.card-header { border-bottom: 1px solid var(--zs-line); min-height: 3.25rem; }
.card-title, .card-header .card-title { font-size: .9375rem; font-weight: 600; color: var(--zs-ink); }
.card-title i.ti, .card-header h5 i.ti, .card-header h6 i.ti { color: var(--zs-muted); }
.card-subtitle { color: var(--zs-muted); }
.card-footer { background: var(--zs-surface-2); border-top: 1px solid var(--zs-line); }
.card-sm .card-body { padding: 1rem; }
.card-link-pop:hover { border-color: var(--zs-line-strong); box-shadow: var(--zs-shadow-pop); }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table {
  --tblr-table-bg: transparent;
  --tblr-table-border-color: var(--zs-line);
  --tblr-table-hover-bg: color-mix(in srgb, var(--zs-emerald) 4%, transparent);
  --tblr-table-striped-bg: var(--zs-surface-2);
  color: var(--zs-text);
}
.table thead th, .table > thead > tr > th, .markdown > table thead th {
  text-transform: none;
  letter-spacing: 0;
  font-size: .75rem;
  font-weight: 600;
  color: var(--zs-muted);
  background: var(--zs-surface-2);
  padding-top: .625rem;
  padding-bottom: .625rem;
  border-bottom: 1px solid var(--zs-line);
}
.card-table thead th:first-child, .card-table td:first-child { padding-left: 1.25rem; }
.card-table thead th:last-child, .card-table td:last-child { padding-right: 1.25rem; }
.table > :not(caption) > * > * { border-bottom-color: var(--zs-line); }
.table td { vertical-align: middle; }
.table-vcenter > :not(caption) > * > * { padding-top: .7rem; padding-bottom: .7rem; }
.table-sm > :not(caption) > * > * { padding-top: .45rem; padding-bottom: .45rem; }
.table tfoot th, .table tfoot td { background: var(--zs-surface-2); font-weight: 600; color: var(--zs-ink); }
.table td a.text-dark, .table td a.text-reset { color: var(--zs-ink) !important; }
.table td code { white-space: nowrap; }
.table-responsive { scrollbar-width: thin; }
.table tbody tr:last-child > * { border-bottom-width: 0; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  --tblr-btn-font-weight: 500;
  --tblr-btn-border-radius: var(--zs-r);
  --tblr-btn-padding-y: .4375rem;
  --tblr-btn-padding-x: .875rem;
  --tblr-btn-font-size: .875rem;
  --tblr-btn-line-height: 1.4286;
  --tblr-btn-box-shadow: none;
  gap: .375rem;
  transition: background-color .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn:focus-visible { box-shadow: var(--zs-focus); }
.btn i.ti { font-size: 1.05rem; line-height: 1; }
.btn .me-1, .btn .me-2 { margin-right: 0 !important; }
.btn-sm { --tblr-btn-padding-y: .3125rem; --tblr-btn-padding-x: .625rem; --tblr-btn-font-size: .8125rem; --tblr-btn-border-radius: 6px; }
.btn-lg { --tblr-btn-padding-y: .625rem; --tblr-btn-padding-x: 1.25rem; --tblr-btn-font-size: .9375rem; }
.btn-xs { --tblr-btn-padding-y: .1875rem; --tblr-btn-padding-x: .45rem; --tblr-btn-font-size: .75rem; --tblr-btn-border-radius: 5px; }
.btn-primary, .btn-success, .btn-green {
  --tblr-btn-bg: var(--zs-emerald); --tblr-btn-color: #fff; --tblr-btn-border-color: var(--zs-emerald);
  --tblr-btn-hover-bg: var(--zs-emerald-hover); --tblr-btn-hover-border-color: var(--zs-emerald-hover); --tblr-btn-hover-color: #fff;
  --tblr-btn-active-bg: var(--zs-emerald-hover); --tblr-btn-active-border-color: var(--zs-emerald-hover);
  --tblr-btn-disabled-bg: var(--zs-emerald); --tblr-btn-disabled-border-color: var(--zs-emerald);
}
[data-bs-theme=dark] .btn-primary, [data-bs-theme=dark] .btn-success { --tblr-btn-color: #04150d; --tblr-btn-hover-color: #04150d; --tblr-btn-active-color: #04150d; }
.btn-danger, .btn-red { --tblr-btn-bg: var(--zs-red); --tblr-btn-border-color: var(--zs-red); --tblr-btn-hover-bg: color-mix(in srgb, var(--zs-red), #000 14%); --tblr-btn-hover-border-color: transparent; --tblr-btn-color: #fff; --tblr-btn-hover-color: #fff; }
.btn-warning, .btn-orange { --tblr-btn-bg: var(--zs-copper); --tblr-btn-border-color: var(--zs-copper); --tblr-btn-hover-bg: color-mix(in srgb, var(--zs-copper), #000 14%); --tblr-btn-color: #fff; --tblr-btn-hover-color: #fff; }
.btn-info, .btn-blue, .btn-azure { --tblr-btn-bg: var(--zs-blue); --tblr-btn-border-color: var(--zs-blue); --tblr-btn-hover-bg: color-mix(in srgb, var(--zs-blue), #000 14%); --tblr-btn-color: #fff; --tblr-btn-hover-color: #fff; }
.btn-secondary, .btn-dark { --tblr-btn-bg: var(--zs-ink); --tblr-btn-border-color: var(--zs-ink); --tblr-btn-color: var(--zs-surface); --tblr-btn-hover-bg: color-mix(in srgb, var(--zs-ink), var(--zs-surface) 18%); --tblr-btn-hover-color: var(--zs-surface); }
.btn-light { --tblr-btn-bg: var(--zs-surface-3); --tblr-btn-border-color: var(--zs-surface-3); --tblr-btn-color: var(--zs-ink); --tblr-btn-hover-bg: var(--zs-line); }
.btn-outline-primary, .btn-outline-success { --tblr-btn-color: var(--zs-emerald); --tblr-btn-border-color: rgba(var(--zs-emerald-rgb), .45); --tblr-btn-hover-bg: var(--zs-emerald-soft); --tblr-btn-hover-color: var(--zs-emerald-hover); --tblr-btn-hover-border-color: var(--zs-emerald); --tblr-btn-bg: transparent; }
.btn-outline-secondary, .btn-outline-dark, .btn-outline-light { --tblr-btn-color: var(--zs-ink); --tblr-btn-border-color: var(--zs-line-strong); --tblr-btn-hover-bg: var(--zs-surface-2); --tblr-btn-hover-color: var(--zs-ink); --tblr-btn-hover-border-color: var(--zs-faint); --tblr-btn-bg: var(--zs-surface); }
.btn-outline-danger { --tblr-btn-color: var(--zs-red); --tblr-btn-border-color: rgba(var(--zs-red-rgb), .4); --tblr-btn-hover-bg: var(--zs-red-soft); --tblr-btn-hover-color: var(--zs-red); --tblr-btn-hover-border-color: var(--zs-red); --tblr-btn-bg: transparent; }
.btn-outline-warning { --tblr-btn-color: var(--zs-copper); --tblr-btn-border-color: rgba(var(--zs-copper-rgb), .45); --tblr-btn-hover-bg: var(--zs-copper-soft); --tblr-btn-hover-color: var(--zs-copper); --tblr-btn-hover-border-color: var(--zs-copper); --tblr-btn-bg: transparent; }
.btn-outline-info { --tblr-btn-color: var(--zs-blue); --tblr-btn-border-color: rgba(var(--zs-blue-rgb), .4); --tblr-btn-hover-bg: var(--zs-blue-soft); --tblr-btn-hover-color: var(--zs-blue); --tblr-btn-hover-border-color: var(--zs-blue); --tblr-btn-bg: transparent; }
.btn-ghost-secondary, .btn-ghost-dark { --tblr-btn-color: var(--zs-muted); --tblr-btn-hover-bg: var(--zs-surface-3); --tblr-btn-hover-color: var(--zs-ink); --tblr-btn-active-bg: var(--zs-surface-3); }
.btn-ghost-primary { --tblr-btn-color: var(--zs-emerald); --tblr-btn-hover-bg: var(--zs-emerald-soft); --tblr-btn-hover-color: var(--zs-emerald-hover); }
.btn-ghost-danger { --tblr-btn-color: var(--zs-red); --tblr-btn-hover-bg: var(--zs-red-soft); --tblr-btn-hover-color: var(--zs-red); }
.btn-ghost-warning { --tblr-btn-color: var(--zs-copper); --tblr-btn-hover-bg: var(--zs-copper-soft); --tblr-btn-hover-color: var(--zs-copper); }
.btn-ghost-info, .btn-ghost-blue { --tblr-btn-color: var(--zs-blue); --tblr-btn-hover-bg: var(--zs-blue-soft); --tblr-btn-hover-color: var(--zs-blue); }
.btn-icon { --tblr-btn-padding-x: .4375rem; min-width: 2.25rem; justify-content: center; }
.btn-sm.btn-icon { min-width: 1.875rem; --tblr-btn-padding-x: .3125rem; }
.btn-list { gap: .5rem; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--zs-line-strong);
  border-radius: var(--zs-r);
  background-color: var(--zs-surface);
  color: var(--zs-ink);
  padding: .4375rem .75rem;
  font-size: .875rem;
  line-height: 1.4286;
  transition: border-color .12s, box-shadow .12s;
}
.form-select { padding-right: 2.25rem; }
.form-control-sm, .form-select-sm { padding: .3125rem .625rem; font-size: .8125rem; border-radius: 6px; }
.form-select-sm { padding-right: 2rem; }
.form-control-lg { padding: .625rem .875rem; font-size: 1rem; }
.form-control:hover:not(:focus):not(:disabled), .form-select:hover:not(:focus):not(:disabled) { border-color: var(--zs-faint); }
.form-control:focus, .form-select:focus { border-color: var(--zs-emerald); box-shadow: var(--zs-focus); }
.form-control::placeholder { color: var(--zs-faint); opacity: 1; }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--zs-surface-2); color: var(--zs-muted); }
.form-label { font-size: .8125rem; font-weight: 500; color: var(--zs-ink); margin-bottom: .375rem; }
.form-label.required::after { color: var(--zs-red); }
.form-hint, .form-text { color: var(--zs-muted); font-size: .78rem; }
.form-check-input { border-color: var(--zs-line-strong); }
.form-check-input:checked { background-color: var(--zs-emerald); border-color: var(--zs-emerald); }
.form-check-input:focus { box-shadow: var(--zs-focus); border-color: var(--zs-emerald); }
.form-switch .form-check-input:checked { background-color: var(--zs-emerald); }
.input-group-text { background: var(--zs-surface-2); border-color: var(--zs-line-strong); color: var(--zs-muted); font-size: .8125rem; }
.input-group > .form-control:focus, .input-group > .form-select:focus { z-index: 5; }
.input-icon-addon { color: var(--zs-faint); }
.is-invalid { border-color: var(--zs-red) !important; }
.invalid-feedback { color: var(--zs-red); }
fieldset legend { font-size: .9375rem; font-weight: 600; color: var(--zs-ink); }

/* ── Badges & status ────────────────────────────────────────────────────── */
.badge {
  --tblr-badge-font-weight: 500;
  --tblr-badge-font-size: .75rem;
  --tblr-badge-padding-y: .2rem;
  --tblr-badge-padding-x: .5rem;
  --tblr-badge-border-radius: var(--zs-r-sm);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.25;
  vertical-align: middle;
}
.badge:empty { display: inline-block; }
.badge.bg-secondary-lt, .badge.bg-light, .badge.bg-gray-lt { background: var(--zs-surface-3) !important; color: var(--zs-muted) !important; }
.badge.bg-secondary { background: var(--zs-muted) !important; color: #fff !important; }
.bg-warning.text-dark, .badge.bg-warning { color: #fff !important; }
.bg-primary, .bg-success, .bg-green { background-color: var(--zs-emerald) !important; }
.bg-danger, .bg-red { background-color: var(--zs-red) !important; }
.bg-warning, .bg-orange { background-color: var(--zs-copper) !important; }
.bg-info, .bg-blue, .bg-azure { background-color: var(--zs-blue) !important; }
.text-primary, .text-success, .text-green { color: var(--zs-emerald) !important; }
.text-danger, .text-red { color: var(--zs-red) !important; }
.text-warning, .text-orange { color: var(--zs-copper) !important; }
.text-info, .text-blue, .text-azure { color: var(--zs-blue) !important; }
.text-dark, .text-body-emphasis { color: var(--zs-ink) !important; }
.status-dot { width: .5rem; height: .5rem; border-radius: 50%; display: inline-block; background: currentColor; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  --tblr-alert-bg: var(--zs-surface);
  --tblr-alert-border-color: var(--zs-line);
  --tblr-alert-color: var(--zs-text);
  border-radius: var(--zs-r-lg);
  border: 1px solid var(--zs-line);
  border-left-width: 3px;
  padding: .75rem 1rem;
  font-size: .875rem;
  box-shadow: none;
}
.alert .alert-title { font-weight: 600; }
.alert-success { border-left-color: var(--zs-emerald); background: color-mix(in srgb, var(--zs-emerald) 6%, var(--zs-surface)); }
.alert-success > i.ti:first-child { color: var(--zs-emerald); }
.alert-danger { border-left-color: var(--zs-red); background: color-mix(in srgb, var(--zs-red) 6%, var(--zs-surface)); }
.alert-danger > i.ti:first-child { color: var(--zs-red); }
.alert-warning { border-left-color: var(--zs-copper); background: color-mix(in srgb, var(--zs-copper) 7%, var(--zs-surface)); }
.alert-warning > i.ti:first-child { color: var(--zs-copper); }
.alert-info { border-left-color: var(--zs-blue); background: color-mix(in srgb, var(--zs-blue) 6%, var(--zs-surface)); }
.alert-info > i.ti:first-child { color: var(--zs-blue); }
.alert-dismissible .btn-close { padding: .95rem 1rem; }
.alert-important.alert-success, .alert-important.alert-danger, .alert-important.alert-warning, .alert-important.alert-info { color: #fff; }

/* ── Dropdowns, modals, tooltips ────────────────────────────────────────── */
.dropdown-menu {
  --tblr-dropdown-bg: var(--zs-surface);
  --tblr-dropdown-border-color: var(--zs-line);
  --tblr-dropdown-link-color: var(--zs-text);
  --tblr-dropdown-link-hover-bg: var(--zs-surface-3);
  --tblr-dropdown-link-hover-color: var(--zs-ink);
  --tblr-dropdown-link-active-bg: var(--zs-emerald-soft);
  --tblr-dropdown-link-active-color: var(--zs-emerald-hover);
  border-radius: var(--zs-r-lg);
  box-shadow: var(--zs-shadow-pop);
  padding: .375rem;
  font-size: .875rem;
}
.dropdown-item { border-radius: 6px; padding: .45rem .625rem; display: flex; align-items: center; gap: .5rem; }
.dropdown-item i.ti { color: var(--zs-muted); font-size: 1.05rem; }
.dropdown-divider { margin: .375rem -.375rem; border-color: var(--zs-line); }
.dropdown-header { font-size: .75rem; font-weight: 600; color: var(--zs-muted); text-transform: none; letter-spacing: 0; }
.modal { --tblr-modal-bg: var(--zs-surface); --tblr-modal-border-color: var(--zs-line); --tblr-modal-border-radius: var(--zs-r-xl); --tblr-modal-box-shadow: var(--zs-shadow-modal); --tblr-modal-header-border-color: var(--zs-line); --tblr-modal-footer-border-color: var(--zs-line); }
.modal-content { border: 1px solid var(--zs-line); box-shadow: var(--zs-shadow-modal); }
.modal-header { padding: 1rem 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; color: var(--zs-ink); }
.modal-footer { background: var(--zs-surface-2); padding: .75rem 1.25rem; }
.modal-backdrop { --tblr-backdrop-bg: #07120d; --tblr-backdrop-opacity: .48; }
.modal-blur { backdrop-filter: blur(3px); }
.modal-dialog { max-height: calc(100% - 1rem); }
.modal-content { max-height: 100%; overflow: hidden; }
.modal-body { overflow-y: auto; }
.tooltip { --tblr-tooltip-bg: var(--zs-ink); --tblr-tooltip-color: var(--zs-surface); --tblr-tooltip-font-size: .75rem; }
.popover { --tblr-popover-border-color: var(--zs-line); box-shadow: var(--zs-shadow-pop); }

/* ── Tabs, pills, list groups, pagination, progress ─────────────────────── */
.nav-tabs { border-bottom: 1px solid var(--zs-line); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--zs-muted); font-weight: 500; padding: .625rem .75rem; margin-bottom: -1px; border-radius: 0; background: none; }
.nav-tabs .nav-link:hover { color: var(--zs-ink); border-bottom-color: var(--zs-line-strong); }
.nav-tabs .nav-link.active { color: var(--zs-ink); border-bottom-color: var(--zs-emerald); background: none; }
.card-header-tabs { margin-bottom: calc(-1 * var(--tblr-card-cap-padding-y)); }
.nav-pills .nav-link { border-radius: 999px; color: var(--zs-muted); font-weight: 500; padding: .35rem .85rem; }
.nav-pills .nav-link:hover { color: var(--zs-ink); background: var(--zs-surface-3); }
.nav-pills .nav-link.active { background: var(--zs-ink); color: var(--zs-surface); }
.list-group { --tblr-list-group-bg: transparent; --tblr-list-group-border-color: var(--zs-line); --tblr-list-group-action-hover-bg: var(--zs-surface-2); --tblr-list-group-active-bg: var(--zs-emerald-soft); --tblr-list-group-active-color: var(--zs-emerald-hover); --tblr-list-group-active-border-color: var(--zs-line); }
.list-group-item { color: var(--zs-text); }
.pagination { gap: .25rem; }
.page-link { border-radius: 6px !important; border: 1px solid transparent; color: var(--zs-muted); min-width: 2rem; text-align: center; }
.page-link:hover { background: var(--zs-surface-3); color: var(--zs-ink); }
.page-item.active .page-link { background: var(--zs-ink); border-color: var(--zs-ink); color: var(--zs-surface); }
.progress { background: var(--zs-surface-3); border-radius: 999px; }
.progress-bar { background-color: var(--zs-emerald); }
.avatar { --tblr-avatar-bg: var(--zs-surface-3); color: var(--zs-ink); font-weight: 600; border-radius: 8px; }
.avatar.rounded-circle, .avatar-rounded { border-radius: 50%; }
.steps { --tblr-steps-color: var(--zs-emerald); }
.hr-text { color: var(--zs-muted); font-size: .75rem; text-transform: none; letter-spacing: 0; }
.accordion { --tblr-accordion-border-color: var(--zs-line); --tblr-accordion-active-bg: var(--zs-surface-2); --tblr-accordion-active-color: var(--zs-ink); --tblr-accordion-btn-focus-box-shadow: var(--zs-focus); }
.empty { padding: 3rem 1rem; }
.empty-title { color: var(--zs-ink); font-weight: 600; }
.empty-subtitle { color: var(--zs-muted); }
hr { border-color: var(--zs-line); opacity: 1; }
.border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--zs-line) !important; }
.bg-white { background-color: var(--zs-surface) !important; }
.bg-light { background-color: var(--zs-surface-2) !important; }

/* ==========================================================================
   Application shell
   ========================================================================== */
.zs-app { min-height: 100vh; display: flex; }

/* Sidebar ----------------------------------------------------------------- */
.zs-side {
  position: fixed; inset: 0 auto 0 0; z-index: 1035;
  width: var(--zs-side-w);
  background: var(--zs-side-bg);
  color: var(--zs-side-text);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--zs-side-line);
  transition: width .18s ease, transform .2s ease;
}
.zs-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.125rem .875rem; text-decoration: none; color: #fff; min-height: var(--zs-top-h); }
.zs-brand:hover { color: #fff; text-decoration: none; }
.zs-mark { width: 32px; height: 32px; flex: none; display: block; }
.zs-wordmark { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.zs-wordmark span { color: var(--zs-copper-bright); font-weight: 500; }

.zs-org {
  margin: 0 .75rem .5rem; padding: .55rem .7rem;
  border: 1px solid var(--zs-side-line); border-radius: 9px;
  background: rgba(255,255,255,.03);
  display: flex; align-items: center; gap: .6rem; min-width: 0;
}
.zs-org-initial { width: 28px; height: 28px; border-radius: 7px; flex: none; background: rgba(227,154,85,.16); color: var(--zs-copper-bright); display: grid; place-items: center; font-weight: 600; font-size: .8125rem; }
.zs-org-name { color: #fff; font-weight: 500; font-size: .8125rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zs-org-branch { color: var(--zs-side-muted); font-size: .72rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.zs-nav { flex: 1; overflow-y: auto; padding: .25rem .625rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.zs-nav::-webkit-scrollbar { width: 6px; }
.zs-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 6px; }
.zs-nav ul { list-style: none; margin: 0; padding: 0; }
.zs-group { margin-top: .375rem; }
.zs-group-btn {
  width: 100%; display: flex; align-items: center; gap: .5rem;
  background: none; border: 0; color: var(--zs-side-muted);
  font: inherit; font-size: .75rem; font-weight: 600; letter-spacing: .01em;
  padding: .55rem .625rem .4rem; border-radius: 6px; cursor: pointer; text-align: left;
}
.zs-group-btn:hover { color: var(--zs-side-text); }
.zs-group-btn .zs-chev { margin-left: auto; font-size: .9rem; transition: transform .15s ease; }
.zs-group.is-collapsed .zs-chev { transform: rotate(-90deg); }
.zs-group.is-collapsed > ul { display: none; }
.zs-group-count { font-weight: 500; font-size: .7rem; color: var(--zs-side-muted); opacity: 0; transition: opacity .12s; }
.zs-group.is-collapsed .zs-group-count { opacity: .8; }

.zs-link {
  position: relative; display: flex; align-items: center; gap: .7rem;
  padding: .45rem .625rem; margin: 1px 0; border-radius: 7px;
  color: var(--zs-side-text); text-decoration: none; font-size: .84rem; line-height: 1.3;
  white-space: nowrap;
}
.zs-link i.ti { font-size: 1.125rem; color: var(--zs-side-muted); flex: none; width: 1.25rem; text-align: center; }
.zs-link:hover { background: var(--zs-side-bg-2); color: #fff; text-decoration: none; }
.zs-link:hover i.ti { color: var(--zs-side-text); }
.zs-link.is-active { background: rgba(255,255,255,.08); color: var(--zs-side-active); font-weight: 500; }
.zs-link.is-active i.ti { color: var(--zs-copper-bright); }
.zs-link.is-active::before { content: ""; position: absolute; left: -.625rem; top: .4rem; bottom: .4rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--zs-copper-bright); }
.zs-link:focus-visible { outline: 2px solid var(--zs-copper-bright); outline-offset: -2px; }
.zs-link-label { overflow: hidden; text-overflow: ellipsis; }

.zs-side-foot { border-top: 1px solid var(--zs-side-line); padding: .625rem; }
.zs-side-foot .zs-link { color: var(--zs-side-muted); }

/* Main column ------------------------------------------------------------- */
.zs-main { flex: 1; min-width: 0; margin-left: var(--zs-side-w); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left .18s ease; }

.zs-top {
  position: sticky; top: 0; z-index: 1030;
  height: var(--zs-top-h);
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.5rem;
  background: color-mix(in srgb, var(--zs-surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--zs-line);
}
.zs-top-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--zs-muted); position: relative; }
.zs-top-btn:hover { background: var(--zs-surface-3); color: var(--zs-ink); }
.zs-top-btn i.ti { font-size: 1.25rem; }
.zs-crumbs { display: flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--zs-muted); min-width: 0; white-space: nowrap; }
.zs-crumbs b { color: var(--zs-ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.zs-crumbs i.ti { font-size: .85rem; color: var(--zs-faint); }
.zs-search {
  display: flex; align-items: center; gap: .55rem;
  width: min(340px, 32vw); height: 36px; padding: 0 .5rem 0 .75rem;
  border: 1px solid var(--zs-line); border-radius: 8px;
  background: var(--zs-surface-2); color: var(--zs-faint); font-size: .84rem; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.zs-search:hover { border-color: var(--zs-line-strong); background: var(--zs-surface); color: var(--zs-muted); }
.zs-search kbd { margin-left: auto; }
kbd, .zs-kbd { font-family: var(--tblr-font-sans-serif); font-size: .7rem; font-weight: 500; color: var(--zs-muted); background: var(--zs-surface); border: 1px solid var(--zs-line); border-bottom-width: 2px; border-radius: 5px; padding: .05rem .35rem; box-shadow: none; }
.zs-top-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.zs-dot { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--zs-red); color: #fff; font-size: .625rem; font-weight: 600; line-height: 16px; text-align: center; border: 2px solid var(--zs-surface); box-sizing: content-box; }
.zs-user { display: flex; align-items: center; gap: .55rem; padding: .25rem .4rem .25rem .25rem; border-radius: 9px; border: 0; background: none; color: var(--zs-ink); }
.zs-user:hover { background: var(--zs-surface-3); }
.zs-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .8125rem; background: var(--zs-emerald-soft); color: var(--zs-emerald-hover); flex: none; }
[data-bs-theme=dark] .zs-avatar { color: var(--zs-emerald-hover); }
.zs-user-name { font-size: .8125rem; font-weight: 500; line-height: 1.2; text-align: left; }
.zs-user-role { font-size: .72rem; color: var(--zs-muted); line-height: 1.2; text-transform: capitalize; text-align: left; }
.zs-theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; background: var(--zs-surface-3); border-radius: 8px; margin: .25rem .25rem .375rem; }
.zs-theme-switch button { border: 0; background: none; border-radius: 6px; padding: .3rem 0; font-size: .75rem; color: var(--zs-muted); display: flex; align-items: center; justify-content: center; gap: .25rem; }
.zs-theme-switch button.is-on { background: var(--zs-surface); color: var(--zs-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Page header + body ------------------------------------------------------ */
.zs-page-head { padding: 1.5rem 1.5rem 0; }
.zs-page-head h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.012em; }
.zs-page-head .zs-page-sub { color: var(--zs-muted); margin-top: .25rem; font-size: .875rem; }
.zs-page-body { flex: 1; padding: 1.25rem 1.5rem 2rem; }
.zs-page-body > .container-fluid { padding: 0; max-width: 1680px; margin: 0; }
.zs-foot { padding: 1rem 1.5rem 1.25rem; font-size: .75rem; color: var(--zs-faint); display: flex; gap: 1rem; flex-wrap: wrap; }
.zs-flash { margin-bottom: 1rem; }

/* Legacy inner headers some pages render themselves */
.page-header { margin: 0 0 1rem; padding: 0; min-height: 0; }
.page-title { font-size: 1.25rem; font-weight: 600; color: var(--zs-ink); }
.page-pretitle { font-size: .75rem; text-transform: none; letter-spacing: 0; color: var(--zs-muted); }
.page-body { margin-top: 0; margin-bottom: 0; }

/* Rail (collapsed sidebar) ----------------------------------------------- */
@media (min-width: 992px) {
  .zs-rail .zs-side { width: var(--zs-rail-w); }
  .zs-rail .zs-main { margin-left: var(--zs-rail-w); }
  .zs-rail .zs-wordmark, .zs-rail .zs-org-text, .zs-rail .zs-link-label, .zs-rail .zs-group-btn span, .zs-rail .zs-group-btn .zs-chev, .zs-rail .zs-group-count { display: none; }
  .zs-rail .zs-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .zs-rail .zs-org { justify-content: center; margin-left: .625rem; margin-right: .625rem; padding: .4rem 0; }
  .zs-rail .zs-link { justify-content: center; padding: .55rem 0; }
  .zs-rail .zs-group-btn { height: 1px; padding: 0; margin: .5rem .5rem; background: var(--zs-side-line); pointer-events: none; }
  .zs-rail .zs-group:first-child .zs-group-btn { display: none; }
  .zs-rail .zs-group.is-collapsed > ul { display: block; }
}

/* Mobile ------------------------------------------------------------------ */
.zs-scrim { display: none; }
@media (max-width: 991.98px) {
  .zs-side { transform: translateX(-100%); width: min(86vw, 290px); box-shadow: var(--zs-shadow-modal); }
  .zs-main { margin-left: 0; }
  .zs-nav-open .zs-side { transform: none; }
  .zs-nav-open .zs-scrim { display: block; position: fixed; inset: 0; z-index: 1034; background: rgba(7,18,13,.45); }
  .zs-top { padding: 0 .75rem; gap: .5rem; }
  .zs-search { width: 36px; padding: 0; justify-content: center; background: none; border: 0; }
  .zs-search span, .zs-search kbd { display: none; }
  .zs-search i.ti { font-size: 1.25rem; color: var(--zs-muted); }
  .zs-page-head { padding: 1.125rem 1rem 0; }
  .zs-page-head h1 { font-size: 1.25rem; }
  .zs-page-body { padding: 1rem 1rem 1.5rem; }
  .zs-foot { padding: .75rem 1rem 1rem; }
  .zs-hide-sm { display: none !important; }
}
@media (min-width: 992px) { .zs-only-sm { display: none !important; } }

/* Jump-to palette ---------------------------------------------------------- */
.zs-palette { position: fixed; inset: 0; z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding: 12vh 1rem 1rem; background: rgba(7,18,13,.45); }
.zs-palette.is-open { display: flex; }
.zs-palette-box { width: min(560px, 100%); background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-r-xl); box-shadow: var(--zs-shadow-modal); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.zs-palette-input { display: flex; align-items: center; gap: .625rem; padding: .875rem 1rem; border-bottom: 1px solid var(--zs-line); }
.zs-palette-input i.ti { font-size: 1.25rem; color: var(--zs-faint); }
.zs-palette-input input { flex: 1; border: 0; outline: 0; background: none; font-size: 1rem; color: var(--zs-ink); }
.zs-palette-list { overflow-y: auto; padding: .375rem; }
.zs-palette-group { font-size: .72rem; font-weight: 600; color: var(--zs-faint); padding: .5rem .625rem .25rem; }
.zs-palette-item { display: flex; align-items: center; gap: .625rem; padding: .5rem .625rem; border-radius: 8px; color: var(--zs-text); text-decoration: none; font-size: .875rem; }
.zs-palette-item i.ti { color: var(--zs-muted); font-size: 1.125rem; }
.zs-palette-item small { margin-left: auto; color: var(--zs-faint); font-size: .75rem; }
.zs-palette-item.is-sel, .zs-palette-item:hover { background: var(--zs-emerald-soft); color: var(--zs-ink); text-decoration: none; }
.zs-palette-item.is-sel i.ti { color: var(--zs-emerald); }
.zs-palette-empty { padding: 1.5rem; text-align: center; color: var(--zs-muted); font-size: .875rem; }
.zs-palette-foot { display: flex; gap: 1rem; padding: .5rem 1rem; border-top: 1px solid var(--zs-line); background: var(--zs-surface-2); font-size: .72rem; color: var(--zs-muted); }

/* Toasts ------------------------------------------------------------------- */
#uiToastContainer { top: calc(var(--zs-top-h) + 12px) !important; }
.zs-toast { background: var(--zs-surface); color: var(--zs-ink); border: 1px solid var(--zs-line); border-left: 3px solid var(--zs-tone, var(--zs-blue)); border-radius: 10px; box-shadow: var(--zs-shadow-pop); padding: .7rem .875rem; display: flex; gap: .625rem; align-items: flex-start; font-size: .875rem; animation: zsToastIn .2s ease; }
.zs-toast i.ti { color: var(--zs-tone, var(--zs-blue)); font-size: 1.15rem; flex: none; margin-top: 1px; }
.zs-toast button { border: 0; background: none; color: var(--zs-faint); margin-left: auto; padding: 0 0 0 .5rem; font-size: 1.1rem; line-height: 1; }
@keyframes zsToastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Shared page patterns
   ========================================================================== */

/* Stat tile: label on top, value, optional delta/footnote */
.zs-stats { display: grid; grid-template-columns: repeat(var(--zs-stat-cols, 6), minmax(0, 1fr)); background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-r-lg); overflow: hidden; }
@media (max-width: 1399.98px) { .zs-stats { --zs-stat-cols: 3; } }
@media (max-width: 767.98px) { .zs-stats { --zs-stat-cols: 2; } }
.zs-stat { background: var(--zs-surface); box-shadow: 1px 0 0 var(--zs-line), 0 1px 0 var(--zs-line); padding: 1rem 1.125rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0; text-decoration: none; color: inherit; }
a.zs-stat:hover { background: var(--zs-surface-2); text-decoration: none; color: inherit; }
.zs-stat-label { font-size: .8125rem; color: var(--zs-muted); display: flex; align-items: center; gap: .4rem; }
.zs-stat-label i.ti { font-size: 1rem; color: var(--zs-faint); }
.zs-stat-value { font-size: 1.375rem; font-weight: 600; color: var(--zs-ink); letter-spacing: -.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zs-stat-value .zs-cur { font-size: .8125rem; font-weight: 500; color: var(--zs-muted); margin-right: .2rem; letter-spacing: 0; }
.zs-stat-note { font-size: .75rem; color: var(--zs-muted); }
.zs-stat.is-alert .zs-stat-value { color: var(--zs-copper); }
.zs-stat.is-bad .zs-stat-value { color: var(--zs-red); }

/* Section heading inside a page */
.zs-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 .75rem; }
.zs-section-title h2, .zs-section-title h3 { font-size: 1rem; margin: 0; }
.zs-section-title a { font-size: .8125rem; }

/* Empty state */
.zs-empty { text-align: center; padding: 2.5rem 1rem; color: var(--zs-muted); }
.zs-empty i.ti { font-size: 2rem; color: var(--zs-faint); display: block; margin-bottom: .5rem; }
.zs-empty strong { display: block; color: var(--zs-ink); font-weight: 600; margin-bottom: .25rem; }

/* Chips used as quick links */
.zs-quick { display: flex; flex-wrap: wrap; gap: .5rem; }
.zs-quick a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .75rem; border: 1px solid var(--zs-line); border-radius: 8px; background: var(--zs-surface); color: var(--zs-ink); font-size: .8125rem; font-weight: 500; text-decoration: none; }
.zs-quick a:hover { border-color: var(--zs-emerald); color: var(--zs-emerald-hover); background: var(--zs-emerald-soft); }
.zs-quick a i.ti { font-size: 1.05rem; color: var(--zs-muted); }
.zs-quick a:hover i.ti { color: var(--zs-emerald); }

/* Older pages draw tinted icon squares with bg-*-lt + avatar; keep them calm */
.card .avatar[class*="bg-"] { border-radius: 9px; }

/* Print: only the document */
@media print {
  .zs-side, .zs-top, .zs-foot, .zs-palette, #uiToastContainer, .zs-scrim { display: none !important; }
  .zs-main { margin: 0 !important; }
  .zs-page-head, .zs-page-body { padding: 0 !important; }
  body { background: #fff !important; }
  .card { border-color: #ccc !important; }
}
.zs-flash:not(:has(.alert)) { display: none; }

/* Older views label things in tracked capitals — read them in sentence case */
.zs-page-body .text-uppercase.text-muted, .zs-page-body .text-uppercase.small, .zs-page-body .subheader, .subheader { text-transform: none !important; letter-spacing: 0 !important; font-size: .8125rem; font-weight: 500; color: var(--zs-muted); }

/* ==========================================================================
   Sign-in, registration and status pages
   ========================================================================== */
.zs-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); background: var(--zs-surface); }
.zs-auth-side {
  position: relative; overflow: hidden;
  background-color: var(--zs-side-bg);
  /* ledger ruling */
  background-image: repeating-linear-gradient(to bottom, transparent 0 39px, rgba(255,255,255,.045) 39px 40px);
  color: var(--zs-side-text);
  padding: 2.5rem 3rem 2.5rem 6rem; display: flex; flex-direction: column;
}
.zs-auth-side::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4.25rem; width: 1px; background: rgba(227,154,85,.28); }
.zs-auth-side > * { position: relative; z-index: 1; }
.zs-auth-brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; }
.zs-auth-brand:hover { color: #fff; text-decoration: none; }
.zs-auth-brand .zs-mark { width: 36px; height: 36px; }
.zs-auth-brand b { font-size: 1.125rem; font-weight: 600; }
.zs-auth-brand b span { color: var(--zs-copper-bright); font-weight: 500; }
.zs-auth-pitch { margin-top: auto; margin-bottom: auto; padding: 3rem 0; max-width: 30rem; }
.zs-auth-pitch h2 { color: #fff; font-size: 2rem; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; margin-bottom: 1.5rem; }
.zs-auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.zs-auth-pitch li { display: grid; grid-template-columns: 1.5rem 1fr; gap: .75rem; line-height: 1.45; }
.zs-auth-pitch li i.ti { color: var(--zs-copper-bright); font-size: 1.25rem; }
.zs-auth-pitch li b { color: #fff; font-weight: 500; display: block; }
.zs-auth-side-foot { font-size: .75rem; color: var(--zs-side-muted); }
.zs-auth-main { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem clamp(1.25rem, 6vw, 5rem); }
.zs-auth-form { width: 100%; max-width: 400px; margin: 0 auto; }
.zs-auth-form h1 { font-size: 1.625rem; margin-bottom: .35rem; letter-spacing: -.015em; }
.zs-auth-form .lead { color: var(--zs-muted); font-size: .9375rem; margin-bottom: 1.75rem; }
.zs-auth-form .form-control { padding: .625rem .8rem; font-size: .9375rem; }
.zs-auth-form .btn-lg { width: 100%; padding-top: .7rem; padding-bottom: .7rem; }
.zs-auth-alt { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--zs-line); font-size: .875rem; color: var(--zs-muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.zs-pw { position: relative; }
.zs-pw .form-control { padding-right: 2.75rem; }
.zs-pw button { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--zs-faint); width: 2.1rem; height: 2.1rem; border-radius: 6px; display: grid; place-items: center; }
.zs-pw button:hover { color: var(--zs-ink); background: var(--zs-surface-3); }
.zs-auth-mobile-brand { display: none; }
@media (max-width: 991.98px) {
  .zs-auth { grid-template-columns: 1fr; }
  .zs-auth-side { display: none; }
  .zs-auth-main { justify-content: flex-start; padding-top: 2rem; }
  .zs-auth-mobile-brand { display: flex; margin-bottom: 2.25rem; }
  .zs-auth-mobile-brand.zs-auth-brand, .zs-auth-mobile-brand.zs-auth-brand:hover { color: var(--zs-ink); }
}

/* Single-message pages: errors, blocked, expired */
.zs-status { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--zs-canvas); }
.zs-status-card { width: min(480px, 100%); background: var(--zs-surface); border: 1px solid var(--zs-line); border-radius: var(--zs-r-xl); padding: 2.25rem 2rem 2rem; }
.zs-status-card .zs-mark { width: 30px; height: 30px; margin-bottom: 1.75rem; }
.zs-status-code { font-size: .8125rem; font-weight: 600; color: var(--zs-copper); margin-bottom: .35rem; }
.zs-status-card h1 { font-size: 1.375rem; margin-bottom: .5rem; }
.zs-status-card p { color: var(--zs-muted); }
.zs-status-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }

/* Card headers with several actions wrap instead of pushing the page sideways */
.card-header { flex-wrap: wrap; row-gap: .5rem; }
.card-header > .d-flex, .card-header .card-actions, .card-header .card-options, .card-header .btn-list { flex-wrap: wrap; gap: .5rem; }
@media (max-width: 767.98px) {
  .card-header .card-actions, .card-header .card-options { margin-left: 0; width: 100%; }
  .zs-page-body .row > [class*="col-auto"] { max-width: 100%; }
}
.zs-bar:nth-child(-n+2) .zs-tip { left: 0; transform: none; }
.zs-bar:nth-last-child(-n+3) .zs-tip { left: auto; right: 0; transform: none; }
.zs-page-body p code, .zs-page-body .alert code, .zs-page-body .form-hint code { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
  .zs-page-body form.d-flex, .zs-page-body .d-flex.gap-2, .zs-page-body .d-flex.gap-3 { flex-wrap: wrap; }
  .zs-page-body .form-select, .zs-page-body .form-control { max-width: 100% !important; }
  .zs-page-body :not(.table-responsive) > table.table { display: block; overflow-x: auto; }
}
.alert:not(.d-flex) { display: block; }
@media (max-width: 767.98px) { .zs-page-body .btn-group { flex-wrap: wrap; } }

/* Older summary tiles were solid colour blocks with white text. Read them as
   calm tiles with a coloured top rule instead, so a page has one accent. */
.card.text-white:is(.bg-primary, .bg-success, .bg-green, .bg-warning, .bg-orange, .bg-info, .bg-blue, .bg-azure, .bg-danger, .bg-red, .bg-secondary, .bg-dark, .bg-purple, .bg-teal) {
  background: var(--zs-surface) !important;
  color: var(--zs-text) !important;
  border-top: 3px solid var(--zs-tile-tone, var(--zs-line-strong));
}
.card.text-white:is(.bg-primary, .bg-success, .bg-green) { --zs-tile-tone: var(--zs-emerald); }
.card.text-white:is(.bg-warning, .bg-orange) { --zs-tile-tone: var(--zs-copper); }
.card.text-white:is(.bg-info, .bg-blue, .bg-azure) { --zs-tile-tone: var(--zs-blue); }
.card.text-white:is(.bg-danger, .bg-red) { --zs-tile-tone: var(--zs-red); }
.card.text-white:is(.bg-purple, .bg-teal) { --zs-tile-tone: var(--tblr-purple); }
.card.text-white :is(.text-white, .text-white-50, .text-light) { color: var(--zs-muted) !important; }
.card.text-white :is(h1, h2, h3, h4, .h1, .h2, .h3, .h4, .fs-1, .fs-2, .fs-3, .fw-bold, .fw-semibold, strong) { color: var(--zs-ink) !important; }
.card.text-white .opacity-75, .card.text-white .opacity-50 { opacity: 1 !important; }
.card.text-white i.ti { color: var(--zs-tile-tone) !important; opacity: 1 !important; }
/* tinted "-lt" summary tiles */
.card.card-sm:is(.bg-red-lt, .bg-green-lt, .bg-blue-lt) { border-color: var(--zs-line) !important; }

/* Row and cell tints follow the palette in both themes */
.table-success, .table > tbody > tr.table-success > * { --tblr-table-bg: color-mix(in srgb, var(--zs-emerald) 9%, var(--zs-surface)); --tblr-table-color: var(--zs-ink); }
.table-danger, .table > tbody > tr.table-danger > * { --tblr-table-bg: color-mix(in srgb, var(--zs-red) 9%, var(--zs-surface)); --tblr-table-color: var(--zs-ink); }
.table-warning, .table > tbody > tr.table-warning > * { --tblr-table-bg: color-mix(in srgb, var(--zs-copper) 10%, var(--zs-surface)); --tblr-table-color: var(--zs-ink); }
.table-info, .table-primary { --tblr-table-bg: color-mix(in srgb, var(--zs-blue) 8%, var(--zs-surface)); --tblr-table-color: var(--zs-ink); }
.table-light, .table-active, .table-secondary { --tblr-table-bg: var(--zs-surface-2); --tblr-table-color: var(--zs-ink); }
.table-success > *, .table-danger > *, .table-warning > *, .table-info > *, .table-primary > *, .table-light > *, .table-active > *, .table-secondary > * { color: var(--zs-ink); }
.table-success, .table-danger, .table-warning, .table-info, .table-primary, .table-light, .table-active, .table-secondary {
  --tblr-table-hover-bg: color-mix(in srgb, var(--tblr-table-bg) 88%, var(--zs-ink));
  --tblr-table-striped-bg: var(--tblr-table-bg);
  --tblr-table-active-bg: var(--tblr-table-bg);
  --tblr-table-border-color: var(--zs-line);
  --tblr-table-hover-color: var(--zs-ink);
}

/* ── Selecting several rows ─────────────────────────────────────────────── */
.zs-bulk-cell { width: 2.75rem; padding-right: 0 !important; }
.card-table .zs-bulk-cell:first-child { padding-left: 1.25rem; }
.zs-bulk-cell .form-check-input { margin: 0; width: 1.05rem; height: 1.05rem; cursor: pointer; vertical-align: middle; }
.table tr.zs-bulk-selected > * { --tblr-table-bg: color-mix(in srgb, var(--zs-emerald) 7%, var(--zs-surface)); }
.zs-bulk-bar {
  position: fixed; left: 50%; bottom: 1.25rem; z-index: 1040;
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .5rem .5rem 1.1rem; border-radius: 12px;
  background: var(--zs-ink); color: var(--zs-surface); box-shadow: var(--zs-shadow-modal);
  transition: transform .18s ease, opacity .18s ease; max-width: calc(100vw - 2rem);
}
.zs-bulk-bar.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.zs-bulk-count { font-size: .875rem; font-weight: 500; margin-right: .5rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.zs-bulk-bar .zs-bulk-clear { --tblr-btn-bg: transparent; --tblr-btn-border-color: rgba(255,255,255,.25); --tblr-btn-color: var(--zs-surface); --tblr-btn-hover-bg: rgba(255,255,255,.1); --tblr-btn-hover-color: var(--zs-surface); --tblr-btn-hover-border-color: rgba(255,255,255,.4); }
[data-bs-theme=dark] .zs-bulk-bar .zs-bulk-clear { --tblr-btn-border-color: rgba(0,0,0,.25); --tblr-btn-hover-bg: rgba(0,0,0,.08); }
.zs-bulk-bar.is-busy .zs-bulk-count::before { content: ""; display: inline-block; width: .8rem; height: .8rem; margin-right: .5rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: zsSpin .7s linear infinite; }
@keyframes zsSpin { to { transform: rotate(360deg); } }
@media (max-width: 575.98px) { .zs-bulk-bar { left: 1rem; right: 1rem; transform: translateY(140%); justify-content: flex-end; } .zs-bulk-bar.is-on { transform: none; } .zs-bulk-count { margin-right: auto; } }

.zs-stats.zs-stats-4 { --zs-stat-cols: 4; }
.zs-stats.zs-stats-6 { --zs-stat-cols: 6; }
@media (max-width: 1199.98px) { .zs-stats.zs-stats-6 { --zs-stat-cols: 3; } }
@media (max-width: 767.98px) { .zs-stats.zs-stats-4, .zs-stats.zs-stats-6 { --zs-stat-cols: 2; } }
