/* ZenithTracker Canopy v1: the application's one stylesheet, on the tokens in tokens.css.
   Derived from the design-v5 package's components.css (docs/reference/design-v5/assets/css/);
   the application's existing class names are merged into the same rules rather than kept as
   a second system. No behavior, permission or quantity logic lives here; every state also
   has a text label (color is never the only cue). Self-only CSP: no remote fonts or images.
   Phone up to 700px (bottom navigation), tablet 701-1199px (menu drawer), desktop from
   1200px (workspace sidebar). No page-level horizontal scroll. */

/* ---- base --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body[data-zt-ui="canopy-v1"] {
  margin: 0; background: var(--zt-canvas); color: var(--zt-ink);
  font: var(--zt-type-base)/var(--zt-line) var(--zt-font); overflow-wrap: anywhere;
}
img { max-width: 100%; height: auto; }
a { color: var(--zt-brand); }
a:hover { color: var(--zt-brand-hover); }
:focus-visible { outline: var(--zt-focus-width) solid var(--zt-focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--zt-space-3); letter-spacing: -.02em; }
h1 { font-size: var(--zt-type-title); letter-spacing: -.035em; line-height: 1.18; }
h2 { font-size: 1.2rem; }
h3, .h3 { font-size: 1.05rem; }
p { margin: 0 0 var(--zt-space-3); }
code, .mono { font-family: var(--zt-mono); font-size: .9em; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
/* A disclosure's summary is a control too: a full 44px target. */
summary { min-height: var(--zt-touch); padding-block: 10px; cursor: pointer; }
.visually-hidden, .zt-sr {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; margin: -1px;
  padding: 0; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--zt-space-3); top: -6rem; z-index: 60; background: var(--zt-surface);
  color: var(--zt-brand); font-weight: 700; padding: var(--zt-space-3) var(--zt-space-4);
  border: 2px solid var(--zt-focus); border-radius: var(--zt-radius-sm);
}
.skip-link:focus { top: var(--zt-space-3); }

/* ---- icons and supply media ----------------------------------------------------------- */
.zt-icon { width: 22px; height: 22px; flex: none; fill: none; vertical-align: middle; }
.zt-icon--sm { width: 16px; height: 16px; }
.zt-icon--lg { width: 32px; height: 32px; }
.zt-icon-tile {
  position: relative; overflow: hidden; display: inline-grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: 12px; background: var(--zt-mint); color: var(--zt-brand);
}
.zt-icon-tile .zt-icon { width: 30px; height: 30px; }
.zt-icon-tile--sm { width: 40px; height: 40px; border-radius: 10px; }
.zt-icon-tile--sm .zt-icon { width: 24px; height: 24px; }
.zt-icon-tile--lg { width: 64px; height: 64px; border-radius: 16px; }
.zt-icon-tile--lg .zt-icon { width: 40px; height: 40px; }
.zt-tone-ppe { background: var(--zt-info-bg); color: var(--zt-info); }
.zt-tone-cleaning { background: var(--zt-teal-bg); color: var(--zt-teal); }
.zt-tone-growing { background: var(--zt-mint); color: var(--zt-brand); }
.zt-tone-packaging { background: var(--zt-purple-bg); color: var(--zt-purple); }
.zt-tone-maintenance { background: var(--zt-neutral-bg); color: var(--zt-neutral); }
.zt-tone-measurement { background: #eaf1fc; color: #365b92; }
/* An authorized photo covers the icon; when it fails, photo-fallback.js hides it and the
   icon underneath shows. */
.zt-supply-media__photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff;
}

/* ---- shell ---------------------------------------------------------------------------- */
.demo-banner {
  background: var(--zt-purple); color: #fff; text-align: center; font-size: var(--zt-type-sm);
  font-weight: 650; padding: var(--zt-space-1) var(--zt-space-4);
}
.site-header {
  min-height: 4.75rem; padding: var(--zt-space-3) var(--zt-space-6); display: flex;
  align-items: center; gap: var(--zt-space-4); background: var(--zt-surface);
  border-bottom: 1px solid var(--zt-border); position: sticky; top: 0; z-index: 20;
}
.zt-brand { display: flex; align-items: center; gap: 10px; min-height: var(--zt-touch); color: var(--zt-ink); text-decoration: none; flex: none; }
.zt-brand:hover { color: var(--zt-ink); }
.zt-brand img { width: 40px; height: 40px; display: block; }
.zt-brand__text { display: block; font-size: 1.375rem; font-weight: 800; line-height: 1.1; letter-spacing: -.04em; }
.zt-brand__text em { color: var(--zt-brand); font-style: normal; }
.zt-brand small {
  display: block; font-size: .625rem; letter-spacing: .15em; font-weight: 700; margin-top: 4px;
  color: var(--zt-muted); text-transform: uppercase;
}
.site-header__context { flex: 1 1 auto; color: var(--zt-muted); font-size: var(--zt-type-sm); text-align: center; min-width: 0; }
.site-header__identity { display: flex; align-items: center; gap: var(--zt-space-3); font-size: var(--zt-type-sm); min-width: 0; }
.site-header__signout { flex: none; }
.zt-avatar {
  width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none;
  background: var(--zt-mint); border: 1px solid var(--zt-border); color: var(--zt-brand);
  border-radius: 50%; font-size: .8125rem; font-weight: 800;
}
.zt-identity { display: flex; align-items: center; gap: 10px; }
.zt-identity__text { line-height: 1.3; }
.zt-identity__text strong { display: block; font-size: var(--zt-type-sm); }
.site-header__identity .link-button { font-weight: 650; }
.nav-toggle {
  display: none; align-items: center; justify-content: center; gap: var(--zt-space-2);
  min-width: var(--zt-touch); min-height: var(--zt-touch);
  border: 1px solid var(--zt-control-border); background: var(--zt-surface); border-radius: var(--zt-radius-sm);
  padding: 0 var(--zt-space-3); color: var(--zt-ink); font-weight: 650; cursor: pointer;
}
.nav-toggle .zt-icon { width: 20px; height: 20px; color: var(--zt-brand); }

.shell { display: block; }
.side-nav {
  display: none; background: linear-gradient(180deg, #fbfdfb, var(--zt-mint));
  border-right: 1px solid var(--zt-border); padding: var(--zt-space-6) var(--zt-space-3) var(--zt-space-5);
}
.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-nav__group {
  font-size: .6875rem; letter-spacing: .1em; font-weight: 750; color: var(--zt-muted);
  margin: var(--zt-space-4) var(--zt-space-3) var(--zt-space-1); text-transform: uppercase;
}
.side-nav__group:first-child { margin-top: 0; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; min-height: var(--zt-touch); padding: 10px 12px;
  border-radius: 9px; font-size: .9375rem; font-weight: 650; color: var(--zt-ink); text-decoration: none;
}
.side-nav a .zt-icon { width: 20px; height: 20px; color: var(--zt-brand); }
.side-nav a:hover { background: var(--zt-mint-strong); color: var(--zt-ink); }
.side-nav a[aria-current="page"] { background: var(--zt-brand); color: #fff; box-shadow: 0 4px 9px rgb(20 106 78 / 14%); }
.side-nav a[aria-current="page"] .zt-icon { color: #fff; }
.side-nav__note { margin: var(--zt-space-8) 0 0; padding: 0 var(--zt-space-3); color: var(--zt-muted); font-size: .8125rem; }
.side-nav__note strong { display: block; color: var(--zt-brand); font-size: var(--zt-type-sm); margin-bottom: 4px; }

.site-main {
  display: block; width: 100%; max-width: 100rem; margin: 0 auto; min-width: 0;
  padding: var(--zt-space-5) var(--zt-space-4) calc(6rem + env(safe-area-inset-bottom));
}
.site-main:focus { outline: none; }
/* Consecutive page sections breathe; vertical margins collapse with a section's own. */
.site-main > * + * { margin-top: var(--zt-space-4); }
.zt-qty { white-space: nowrap; font-variant-numeric: tabular-nums; }
.site-footer {
  color: var(--zt-muted); font-size: .8125rem; text-align: center;
  padding: var(--zt-space-4) var(--zt-space-4) calc(6rem + env(safe-area-inset-bottom));
}
.site-footer p { margin: 0; }

/* The bottom navigation keeps the approved height (--zt-bottom-nav, tokens.css) whether a
   label takes one line or two (a long label wraps on a 320px phone): icon, gap and two lines
   fit inside the link. The bars above it sit 4px higher, clear of its top border. */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column;
  grid-auto-columns: 1fr; gap: 4px; background: var(--zt-surface); border-top: 1px solid var(--zt-border);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 10px rgb(23 47 72 / 4%);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 3.5rem; padding: 3px 4px; text-decoration: none; color: var(--zt-muted); border-radius: 9px;
  font-size: .75rem; font-weight: 650; text-align: center; line-height: 1.1;
}
.bottom-nav a .zt-icon { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--zt-brand); background: var(--zt-mint); font-weight: 750; }

/* Phone header: icon mark and initials; names and context move into the menu and pages. */
@media (max-width: 700px) {
  /* Brand row (menu, mark and wordmark, sign out) and a slim context row (department
     and person) below it: no wrapping leftovers, nothing off-screen at 320px. */
  .site-header { min-height: 0; padding: var(--zt-space-2) var(--zt-space-4); gap: var(--zt-space-2) var(--zt-space-3); flex-wrap: wrap; }
  .zt-brand { margin-right: auto; }
  .zt-brand__text { font-size: 1.1875rem; }
  .zt-brand img { width: 34px; height: 34px; }
  .zt-brand small, .site-header__context, .zt-avatar { display: none; }
  .site-header__identity {
    order: 5; flex: 1 1 100%; flex-wrap: wrap; gap: var(--zt-space-2); margin: 0 calc(-1 * var(--zt-space-4)) calc(-1 * var(--zt-space-2));
    padding: 6px var(--zt-space-4); background: var(--zt-soft); border-top: 1px solid var(--zt-border);
  }
  .site-header__identity:empty { display: none; }
  .zt-identity__text strong { font-weight: 650; color: var(--zt-muted); }
  .nav-toggle { display: inline-flex; padding: 0 var(--zt-space-2); }
  .page-head > .dept-badge { display: none; }
  .side-nav[data-open="true"] { display: block; border-right: 0; border-bottom: 1px solid var(--zt-border); }
}
/* Large text on a phone (150% or more; shell.js marks it): the content gets the screen.
   The header scrolls with the page and the bottom bar folds away; every destination stays
   in the menu (zoomed viewports may collapse secondary navigation). The review bar stays. */
@media (max-width: 700px) {
  :root[data-zt-text="large"] .site-header { position: static; }
  :root[data-zt-text="large"] .bottom-nav { display: none; }
  :root[data-zt-text="large"] .cart-bar { bottom: calc(var(--zt-space-3) + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .zt-brand__text { font-size: 1.0625rem; }
  /* Icon only on the narrowest phones; the label still names the button. */
  .nav-toggle__label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; margin: -1px;
    padding: 0; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
@media (max-width: 999px) { .site-header__context { display: none; } .zt-brand { margin-right: auto; } }
@media (min-width: 701px) {
  .bottom-nav { display: none; }
  .site-main { padding: var(--zt-space-6) var(--zt-space-6) var(--zt-space-8); }
  .site-footer { padding-bottom: var(--zt-space-8); }
  .nav-toggle { display: inline-flex; }
  .shell { display: flex; align-items: flex-start; }
  .side-nav[data-open="true"] {
    display: flex; flex-direction: column; position: sticky; top: 4.75rem; flex: 0 0 15rem;
    width: 15rem; height: calc(100vh - 4.75rem); overflow-y: auto;
  }
  .site-main { flex: 1 1 auto; }
}
@media (min-width: 1200px) {
  .nav-toggle { display: none; }
  .shell { align-items: stretch; }
  .side-nav, .side-nav[data-open="false"], .side-nav[data-open="true"] {
    display: block; position: static; flex: 0 0 var(--zt-sidebar); width: var(--zt-sidebar); height: auto; overflow: visible;
  }
  .side-nav__inner { position: sticky; top: 6.25rem; }
  .site-main { padding: 28px 30px 36px; }
  /* Large text widens the rail with its words (14rem is the 224px rail at normal size), so
     every destination keeps its name whole instead of breaking it mid-word. */
  :root[data-zt-text="large"] .side-nav,
  :root[data-zt-text="large"] .side-nav[data-open="false"],
  :root[data-zt-text="large"] .side-nav[data-open="true"] { flex-basis: 14rem; width: 14rem; }
}
@media (min-width: 1700px) { .site-main { padding: 36px 40px; } }

/* ---- page structure ------------------------------------------------------------------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--zt-space-2) var(--zt-space-4); margin-bottom: var(--zt-space-5); }
.page-head h1 { margin: 0; }
.page-head__actions { margin-left: auto; display: flex; gap: var(--zt-space-2); flex-wrap: wrap; }
.page-head__intro { flex: 1 1 22rem; min-width: 0; }
.page-head__intro h1 { margin: 4px 0 6px; }
.zt-label, .page-head__eyebrow {
  display: block; font-size: var(--zt-type-xs); font-weight: 750; letter-spacing: .07em;
  text-transform: uppercase; color: var(--zt-muted); margin: 0;
}
.lede, .zt-subtitle { color: var(--zt-muted); max-width: 62ch; }
.page-head__intro .lede { margin: 0; }
.zt-hero {
  position: relative; overflow: hidden; background: linear-gradient(110deg, #eef8f1 0%, #f8fcf9 74%);
  border: 1px solid var(--zt-border); border-radius: var(--zt-radius); padding: var(--zt-space-6);
  margin-bottom: var(--zt-space-5); min-height: 8.25rem;
}
.zt-hero > * { position: relative; z-index: 1; }
.zt-hero h1 { margin: 6px 0 8px; }
.zt-hero p { max-width: 60%; margin: 0; color: var(--zt-muted); }
.zt-hero .zt-hero__art {
  position: absolute; z-index: 0; right: 0; bottom: 0; width: 330px; max-width: 40%; height: 125px;
  object-fit: contain; opacity: .9; pointer-events: none;
}
.zt-hero__actions { display: flex; flex-wrap: wrap; gap: var(--zt-space-2); margin-top: var(--zt-space-4); }

.grid { display: grid; gap: var(--zt-space-4); }
.stack > * + * { margin-top: var(--zt-space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--zt-space-2); align-items: center; }
ul.cluster { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--zt-muted); }
.small { font-size: var(--zt-type-sm); }
.as-of { color: var(--zt-muted); font-size: var(--zt-type-sm); }
.indent { margin-left: var(--zt-space-5); }

.panel {
  background: var(--zt-surface); border: 1px solid var(--zt-border); border-radius: var(--zt-radius);
  padding: var(--zt-space-5); box-shadow: var(--zt-shadow); min-width: 0;
}
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel > h2:first-child { font-size: 1.0625rem; }
.panel--flush { padding: 0; overflow: hidden; }
.panel--flush > h2:first-child { padding: var(--zt-space-5) var(--zt-space-5) 0; }
.panel--flush > .panel__head { padding: var(--zt-space-4) var(--zt-space-5) 0; }
.panel--flush > p { padding: 0 var(--zt-space-5); }
.panel--flush > p:last-child { padding-bottom: var(--zt-space-4); }
.panel__head { display: flex; flex-wrap: wrap; gap: var(--zt-space-2); align-items: center; justify-content: space-between; margin-bottom: var(--zt-space-4); }
.panel__head h2 { margin: 0; font-size: 1.0625rem; display: flex; align-items: center; gap: 8px; }
.panel__head h2 .zt-icon { width: 20px; height: 20px; color: var(--zt-brand); }
.panel__head a { font-size: var(--zt-type-sm); font-weight: 650; }
.panel--mint { background: linear-gradient(150deg, var(--zt-mint), #f7fcf8); }

@media (min-width: 701px) {
  .grid--2, .zt-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--sidebar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
}
@media (min-width: 1200px) { .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.zt-two { display: grid; gap: var(--zt-space-4); }

/* Admin and manager workspaces: main column plus a supporting rail. */
.zt-workspace { display: grid; gap: var(--zt-space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.zt-workspace__main, .zt-workspace__rail { display: grid; gap: var(--zt-space-5); min-width: 0; }
@media (min-width: 1200px) { .zt-workspace { grid-template-columns: minmax(0, 1fr) 278px; } }
@media (min-width: 701px) and (max-width: 1199px) { .zt-workspace__rail { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- metric tiles --------------------------------------------------------------------- */
/* As many columns as hold their words at the current text size: 2 on a phone, 1 with
   large text, at most 3 on a tablet; the wide layouts below set their own. */
.zt-metrics {
  display: grid; gap: 14px; margin-bottom: var(--zt-space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8em), 1fr));
}
@media (min-width: 701px) { .zt-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(12em, 30%)), 1fr)); } }
@media (min-width: 1200px) {
  .zt-metrics--4 { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
  .zt-metrics--6 { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
}
.zt-metric, .metric {
  display: block; position: relative; background: var(--zt-surface); border: 1px solid var(--zt-border);
  border-top: 3px solid var(--zt-border); border-radius: var(--zt-radius); padding: 16px; min-width: 0;
  box-shadow: var(--zt-shadow); color: var(--zt-ink); text-decoration: none;
}
a.zt-metric:hover, a.metric:hover { color: var(--zt-ink); border-color: var(--zt-brand); }
.zt-metric__top { display: flex; gap: 10px; align-items: center; font-size: .8125rem; font-weight: 700; color: var(--zt-muted); }
.zt-metric__icon {
  width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--zt-mint); color: var(--zt-brand);
}
.zt-metric__icon .zt-icon { width: 20px; height: 20px; }
.zt-metric__value, .metric__value {
  display: block; font-size: 1.75rem; font-weight: 780; line-height: 1.2; margin: 10px 0 4px;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.zt-metric__note, .metric__label { display: block; font-size: .8125rem; color: var(--zt-muted); }
.metric .metric__label:first-child { font-weight: 700; }
.zt-metric--green, .metric--ok { border-top-color: #419170; }
.zt-metric--red, .metric--danger { border-top-color: #c9584c; background: linear-gradient(#fff8f6, #fff); }
.zt-metric--red .zt-metric__icon, .metric--danger .zt-metric__icon { color: var(--zt-danger); background: var(--zt-danger-bg); }
.zt-metric--blue, .metric--info { border-top-color: #438bbf; background: linear-gradient(#f5faff, #fff); }
.zt-metric--blue .zt-metric__icon, .metric--info .zt-metric__icon { color: var(--zt-info); background: var(--zt-info-bg); }
.zt-metric--amber, .metric--warn { border-top-color: #c29739; background: linear-gradient(#fffbf2, #fff); }
.zt-metric--amber .zt-metric__icon, .metric--warn .zt-metric__icon { color: var(--zt-warning); background: var(--zt-warning-bg); }
.zt-metric--gray, .metric--neutral { border-top-color: #8094a2; }
.zt-metric--gray .zt-metric__icon, .metric--neutral .zt-metric__icon { color: var(--zt-neutral); background: var(--zt-neutral-bg); }

.action-cards { display: grid; gap: var(--zt-space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.action-card {
  display: flex; align-items: center; gap: var(--zt-space-3); min-height: 4.5rem;
  padding: var(--zt-space-3) var(--zt-space-4); border-radius: var(--zt-radius); text-decoration: none;
  background: var(--zt-surface); color: var(--zt-ink); font-weight: 700; border: 1px solid var(--zt-border);
  box-shadow: var(--zt-shadow);
}
.action-card .zt-icon-tile { width: 40px; height: 40px; border-radius: 10px; }
.action-card .zt-icon-tile .zt-icon { width: 22px; height: 22px; }
.action-card span { display: block; min-width: 0; }
.action-card small { display: block; font-weight: 400; color: var(--zt-muted); font-size: .8125rem; }
.action-card:hover { border-color: var(--zt-brand); color: var(--zt-ink); }
.action-card--primary { background: var(--zt-brand); border-color: var(--zt-brand); color: #fff; }
.action-card--primary small { color: #d6eddf; }
.action-card--primary .zt-icon-tile { background: rgb(255 255 255 / 16%); color: #fff; }
.action-card--primary:hover { background: var(--zt-brand-hover); color: #fff; }

/* ---- lists and tables ----------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: var(--zt-space-3) 0; border-top: 1px solid var(--zt-border); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.row { display: flex; flex-wrap: wrap; gap: var(--zt-space-2) var(--zt-space-3); align-items: baseline; justify-content: space-between; }
.zt-list-row { display: flex; gap: 12px; align-items: flex-start; }
.zt-list-row > .zt-icon { width: 20px; height: 20px; color: var(--zt-brand); margin-top: 2px; }
.zt-list-row__body { flex: 1; min-width: 0; }
.zt-list-row__body strong { display: block; }
.zt-list-row__body p { margin: 2px 0 0; font-size: var(--zt-type-sm); color: var(--zt-muted); }
/* A review line's quantity reads as one phrase ("2 boxes") at the end of its row; a long
   name wraps beside it rather than pushing it to a line of its own. */
[data-review-line] .zt-list-row__body > .row { flex-wrap: nowrap; align-items: flex-start; }
[data-review-line] .zt-list-row__body > .row > :first-child { flex: 1 1 auto; min-width: 0; }
[data-review-line] .zt-qty { flex: none; }
[data-review-line] .zt-qty strong { display: inline; }

.table-region { overflow-x: auto; max-width: 100%; border-radius: 10px; }
.table-region:focus-visible { outline: var(--zt-focus-width) solid var(--zt-focus); }
table.data { width: 100%; border-collapse: collapse; background: var(--zt-surface); font-size: .9375rem; }
table.data th, table.data td { text-align: left; padding: 12px; border-bottom: 1px solid #e6eee9; vertical-align: middle; }
/* Header labels keep their own case: forced capitals change what is read aloud and copied. */
table.data thead th {
  position: sticky; top: 0; background: var(--zt-soft); font-size: .8125rem; letter-spacing: .01em;
  color: var(--zt-muted); font-weight: 750; border-bottom-color: var(--zt-border); overflow-wrap: normal;
}
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }
/* At table widths a cell keeps its words whole: a wide table (a report, for instance)
   scrolls inside its keyboard-reachable region instead of breaking SKUs, units and names
   mid-word. Phone cards (below) keep breaking long words so nothing overflows them. */
@media (min-width: 768px) {
  table.data td, table.data th { overflow-wrap: normal; }
  /* A status chip reads as one label ("Low stock", "Not yet counted"): its column makes
     room for it instead of folding it into a two-line pill. */
  table.data .badge, table.data .zt-chip { white-space: nowrap; }
  /* A cost's rate form (rate, status, reason, button) takes two rows, not four (S25). */
  [data-unpriced] td > form.inline-fields {
    display: grid; grid-template-columns: minmax(6rem, 1fr) minmax(8rem, 1fr); gap: 6px;
    min-width: 20rem;
  }
}
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data caption { text-align: left; padding: var(--zt-space-2) var(--zt-space-3); color: var(--zt-muted); font-size: var(--zt-type-sm); }
table.data td small { display: block; color: var(--zt-muted); font-size: .8125rem; margin-top: 2px; }
table.data tr[data-health="LOW"] td { background: #fffbf3; }
table.data tr[data-health="OUT"] td { background: #fff5f2; }
.zt-supply-cell { display: flex; align-items: center; gap: 12px; min-width: 12rem; }
.zt-supply-cell .zt-icon-tile { width: 40px; height: 40px; border-radius: 10px; }
.zt-supply-cell .zt-icon-tile .zt-icon { width: 24px; height: 24px; }
.zt-supply-cell > span:last-child { min-width: 0; }
.zt-supply-cell strong { display: block; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--zt-space-2) var(--zt-space-4); margin: 0; }
dl.facts dt { color: var(--zt-muted); }
dl.facts dd { margin: 0; font-weight: 650; }
@media (max-width: 700px) {
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.facts dd { margin-bottom: var(--zt-space-2); }
}
/* Important line details stack into readable cards on phones instead of tiny columns. */
@media (max-width: 767px) {
  table.data--cards thead { position: absolute; left: -9999px; }
  table.data--cards, table.data--cards tbody, table.data--cards tr, table.data--cards td { display: block; width: 100%; }
  table.data--cards tr {
    border: 1px solid var(--zt-border); border-radius: 12px; margin-bottom: var(--zt-space-3);
    background: var(--zt-surface); padding: var(--zt-space-2) 0; box-shadow: 0 1px 3px rgb(23 47 72 / 3%);
  }
  table.data--cards td { border: 0; padding: 4px var(--zt-space-4); }
  table.data--cards td[data-label]::before { content: attr(data-label) ": "; color: var(--zt-muted); font-weight: 400; }
  table.data--cards td:empty { display: none; }
  table.data--cards td.num { text-align: left; white-space: normal; }
  /* In a card the supply cell has the card's width; its desktop minimum (12rem, 24rem
     with large text) would push it past the card. */
  table.data--cards .zt-supply-cell { min-width: 0; }
  .panel--flush table.data--cards { background: transparent; }
  /* A card inset in a flush panel is as wide as the room its margins leave, not the
     full width plus them (which would scroll it sideways and cut off its right edge). */
  .panel--flush table.data--cards tr { margin: var(--zt-space-3); width: auto; }
}

/* ---- status chips --------------------------------------------------------------------- */
.badge, .zt-chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: var(--zt-radius-pill);
  padding: 3px 10px; font-size: .8125rem; font-weight: 700; line-height: 1.35; border: 1px solid transparent;
  background: var(--zt-neutral-bg); color: var(--zt-neutral); max-width: 100%; white-space: normal; overflow-wrap: break-word;
}
.badge .zt-icon, .zt-chip .zt-icon { width: 14px; height: 14px; }
.badge--ok, .zt-chip--green, .dept-badge { background: var(--zt-success-bg); color: var(--zt-success); }
.badge--low, .badge--warn, .zt-chip--amber { background: var(--zt-warning-bg); color: var(--zt-warning); }
.badge--out, .badge--danger, .zt-chip--red { background: var(--zt-danger-bg); color: var(--zt-danger); }
.badge--incoming, .badge--info, .zt-chip--blue { background: var(--zt-info-bg); color: var(--zt-info); }
.badge--neutral, .badge--unknown { background: var(--zt-neutral-bg); color: var(--zt-neutral); border-color: #c5d0d6; }
.zt-chip--purple { background: var(--zt-purple-bg); color: var(--zt-purple); }
.dept-badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: var(--zt-radius-pill);
  padding: 3px 12px; font-weight: 700; font-size: var(--zt-type-sm); border: 1px solid #b7dcc5;
  overflow-wrap: break-word;
}

/* ---- notices -------------------------------------------------------------------------- */
.alert {
  border-radius: 12px; padding: var(--zt-space-3) var(--zt-space-4); border: 1px solid; border-left-width: 4px;
  margin-bottom: var(--zt-space-4); background: var(--zt-surface);
}
.alert--info { background: var(--zt-info-bg); border-color: #9cc2e6; border-left-color: var(--zt-info); }
.alert--ok { background: var(--zt-success-bg); border-color: #a8d3ba; border-left-color: var(--zt-success); }
.alert--warn { background: var(--zt-warning-bg); border-color: #e6c77f; border-left-color: var(--zt-warning); }
.alert--danger { background: var(--zt-danger-bg); border-color: #e2aaa4; border-left-color: var(--zt-danger); }
.alert > :last-child { margin-bottom: 0; }
.zt-note { border-radius: 10px; background: var(--zt-info-bg); color: var(--zt-info); padding: 12px 15px; font-size: var(--zt-type-sm); }
.zt-note > :last-child { margin-bottom: 0; }
.zt-note--green { background: var(--zt-mint); color: var(--zt-brand-deep); }
.zt-note--amber { background: var(--zt-warning-bg); color: var(--zt-warning); }
.zt-note--red { background: var(--zt-danger-bg); color: var(--zt-danger); }
.error-summary {
  border: 2px solid var(--zt-danger); background: var(--zt-danger-bg); border-radius: 12px;
  padding: var(--zt-space-3) var(--zt-space-4); margin-bottom: var(--zt-space-4);
}
.error-summary:focus { outline: var(--zt-focus-width) solid var(--zt-focus); }
.error-summary ul { margin: var(--zt-space-2) 0 0; padding-left: var(--zt-space-5); }
.secret-box {
  font-family: var(--zt-mono); font-size: 1rem; background: var(--zt-neutral-bg); border: 1px dashed var(--zt-control-border);
  border-radius: var(--zt-radius-sm); padding: var(--zt-space-3); word-break: break-all;
}

/* ---- forms and buttons ---------------------------------------------------------------- */
form { margin: 0; }
.field { margin-bottom: var(--zt-space-4); }
.field label, .field legend, .label { display: block; font-weight: 650; margin-bottom: var(--zt-space-1); }
.field .hint { color: var(--zt-muted); font-size: var(--zt-type-sm); margin: 0 0 var(--zt-space-1); }
.field .error, .error { color: var(--zt-danger); font-weight: 650; font-size: var(--zt-type-sm); margin: var(--zt-space-1) 0 0; }
fieldset { border: 1px solid var(--zt-border); border-radius: 12px; padding: var(--zt-space-3) var(--zt-space-4); margin: 0 0 var(--zt-space-4); min-width: 0; }
legend { font-weight: 700; padding: 0 var(--zt-space-1); }
input[type="text"], input[type="password"], input[type="search"], input[type="email"], input[type="url"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="file"],
input:not([type]), select, textarea {
  width: 100%; max-width: 40rem; font-size: 1rem; color: var(--zt-ink); min-height: var(--zt-touch);
  padding: var(--zt-space-2) var(--zt-space-3); border: 1px solid var(--zt-control-border);
  border-radius: 8px; background: var(--zt-surface);
}
textarea { min-height: 6rem; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border: 2px solid var(--zt-danger); }
.check { display: flex; gap: var(--zt-space-2); align-items: flex-start; min-height: var(--zt-touch); padding: var(--zt-space-2) 0; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: 0 0 auto; accent-color: var(--zt-brand); }
.inline-fields { display: flex; flex-wrap: wrap; gap: var(--zt-space-3); align-items: flex-end; }
.inline-fields .field { flex: 1 1 10rem; min-width: 0; }
.zt-search-field { position: relative; }
.zt-search-field .zt-icon { position: absolute; left: 12px; bottom: 11px; width: 20px; height: 20px; color: var(--zt-muted); pointer-events: none; }
.zt-search-field input { padding-left: 2.6rem; background: var(--zt-surface); }

.button, button.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--zt-space-2);
  min-height: var(--zt-touch); padding: 0 var(--zt-space-4); border-radius: 8px; font-weight: 700;
  font-size: .9375rem; text-decoration: none; cursor: pointer; background: var(--zt-surface);
  color: var(--zt-ink); border: 1px solid var(--zt-control-border); line-height: 1.3;
}
.button:hover { background: var(--zt-soft); color: var(--zt-ink); }
.button .zt-icon { width: 20px; height: 20px; }
.button--primary, button.button--primary {
  background: var(--zt-brand); color: #fff; border-color: var(--zt-brand); box-shadow: 0 2px 4px rgb(20 106 78 / 12%);
}
.button--primary:hover { background: var(--zt-brand-hover); color: #fff; }
.button--danger { color: var(--zt-danger); border-color: var(--zt-danger); }
.button--danger:hover { background: var(--zt-danger-bg); color: var(--zt-danger); }
.button--quiet { border-color: var(--zt-border); color: var(--zt-brand); }
.button[disabled], .button[aria-disabled="true"] { background: var(--zt-soft); color: var(--zt-muted); border-color: var(--zt-border); cursor: not-allowed; box-shadow: none; }
.button--block { width: 100%; }
.link-button { background: none; border: 0; color: var(--zt-brand); text-decoration: underline; cursor: pointer; padding: 0; min-height: var(--zt-touch); font-weight: 600; }

/* ---- quantity stepper ----------------------------------------------------------------- */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--zt-control-border); border-radius: 9px; overflow: hidden; background: var(--zt-surface); }
.stepper button {
  width: var(--zt-touch); min-width: var(--zt-touch); min-height: var(--zt-touch); border: 0; display: grid; place-items: center;
  background: var(--zt-soft); color: var(--zt-ink); cursor: pointer;
}
.stepper button:last-child { background: var(--zt-brand); color: #fff; }
.stepper button .zt-icon { width: 18px; height: 18px; }
.stepper button:focus-visible, .stepper input:focus-visible { outline-offset: -3px; }
.stepper input {
  width: 4.5rem; max-width: none; min-height: var(--zt-touch); border: 0; border-radius: 0; text-align: center;
  font-weight: 750; font-size: 1.0625rem; font-variant-numeric: tabular-nums;
}

/* ---- supply cards (withdrawal) -------------------------------------------------------- */
.supply-grid { display: grid; gap: 11px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1200px) { .supply-grid--compact { grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); } }
.supply-card {
  background: var(--zt-surface); border: 1px solid var(--zt-border); border-radius: var(--zt-radius); padding: 15px;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 13px; align-items: center; min-width: 0;
  box-shadow: 0 1px 3px rgb(23 47 72 / 3%);
}
.supply-card[data-selected="true"] { border-color: var(--zt-brand); box-shadow: 0 0 0 1px var(--zt-brand), var(--zt-shadow); }
.supply-card__body { min-width: 0; }
.supply-card__title { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--zt-space-2); }
.supply-card__name { font-weight: 700; font-size: 1.0625rem; margin: 0; line-height: 1.3; }
.supply-card__meta { color: var(--zt-muted); font-size: var(--zt-type-sm); margin: 2px 0 7px; }
.supply-card__status { display: flex; flex-wrap: wrap; gap: 5px; }
.supply-card__controls { display: flex; flex-direction: column; align-items: center; gap: 4px; justify-self: end; }
.supply-card__unit { font-size: .8125rem; color: var(--zt-muted); text-align: center; }
.supply-card__reason { font-size: var(--zt-type-sm); color: var(--zt-muted); max-width: 16rem; text-align: right; }
.supply-card__error { max-width: 16rem; text-align: center; }
.supply-card__error:empty { display: none; }
.fav-button {
  min-height: var(--zt-touch); min-width: var(--zt-touch); display: inline-grid; place-items: center; flex: none;
  border: 1px solid transparent; background: transparent; border-radius: 9px; cursor: pointer; color: var(--zt-muted); margin: -10px -10px 0 0;
}
.fav-button:hover { background: var(--zt-soft); }
.fav-button .zt-icon { width: 20px; height: 20px; }
.fav-button[aria-pressed="true"] { color: var(--zt-warning); }
.fav-button[aria-pressed="true"] .zt-icon { fill: currentColor; }
@media (max-width: 700px) {
  .supply-card { grid-template-columns: 42px minmax(0, 1fr); padding: 13px; gap: 10px; align-items: start; }
  .supply-card > .zt-icon-tile { width: 42px; height: 42px; }
  .supply-card > .zt-icon-tile .zt-icon { width: 28px; height: 28px; }
  .supply-card__controls { grid-column: 2; flex-direction: row; justify-self: start; align-items: center; gap: 10px; flex-wrap: wrap; }
  .supply-card__reason { text-align: left; }
}

/* The cart: a sticky bar along the bottom on phones and tablets (above the bottom
   navigation), a sticky side panel beside the cards on desktops. withdraw.js reads
   --zt-cart-side to know which, and measures a bottom bar into --zt-sticky-bottom. */
.zt-withdraw-grid { display: grid; gap: var(--zt-space-5); grid-template-columns: minmax(0, 1fr); align-items: start; }
.cart-bar {
  position: sticky; bottom: calc(var(--zt-bottom-nav) + 4px + env(safe-area-inset-bottom)); z-index: 25;
  background: var(--zt-brand-deep); color: #fff; border-radius: var(--zt-radius); border: 1px solid var(--zt-brand-deep);
  box-shadow: 0 -3px 14px rgb(23 47 72 / 12%); padding: var(--zt-space-3) var(--zt-space-4);
  display: flex; flex-wrap: wrap; gap: var(--zt-space-2) var(--zt-space-4); align-items: center; justify-content: space-between;
}
.cart-bar h2 { margin: 0; font-size: 1rem; color: #fff; }
.cart-bar .status-live { margin: 0; font-weight: 700; }
.cart-bar .muted { color: #d1e7db; }
.cart-bar .list { flex-basis: 100%; }
.cart-bar .list > li { border-top-color: rgb(255 255 255 / 18%); }
/* A cart line draws its supply's tile beside the text (design-v5 ZT5-004). The low
   specificity keeps the phone rule that hides ordinary lines in the short bar. */
[data-cart-line] { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
[data-cart-line] > .zt-icon-tile { width: 32px; height: 32px; border-radius: 8px; }
[data-cart-line] > .zt-icon-tile .zt-icon { width: 20px; height: 20px; }
[data-cart-text] { flex: 1 1 8rem; min-width: 0; }
.cart-bar .button--primary { background: #fff; color: var(--zt-brand-deep); border-color: #fff; }
.cart-bar .button--primary:hover { background: var(--zt-mint); color: var(--zt-brand-deep); }
.cart-bar .button--primary[aria-disabled="true"] { background: #e4ece7; color: var(--zt-muted); }
.cart-bar .link-button { color: #fff; }
.cart-bar .badge--danger { background: #fff0ee; }
.cart-bar__count {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  background: #fff; color: var(--zt-brand-deep); font-size: .8125rem; font-weight: 800; margin-left: 6px;
}
@media (min-width: 701px) { .cart-bar { bottom: var(--zt-space-4); } }
@media (max-height: 560px) { .cart-bar { position: static; } }
.cart-bar--in-flow { position: static; }
@media (max-width: 1199px) {
  /* The page, not the grid below the search form, bounds the sticky bar: clamped to
     the grid's top it would sit on the bottom navigation of a short first screen. */
  .zt-withdraw-grid { display: contents; }
  .zt-withdraw-grid > .cart-bar { margin-top: var(--zt-space-5); }
  /* The bar stays short: the count and the review action on one row. Ordinary lines
     show on their cards and on the review page; problem lines stay listed here. */
  .cart-bar { flex-wrap: wrap; padding: 10px var(--zt-space-4); gap: 4px var(--zt-space-3); }
  .cart-bar > div:first-child { flex: 1 1 10rem; min-width: 0; }
  .cart-bar h2 {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .cart-bar [data-save-state]:empty { display: none; }
  .cart-bar [data-save-state] { margin: 0; }
  .cart-bar .list:not(:has(li[data-unavailable])) { display: none; }
  .cart-bar [data-cart-line]:not([data-unavailable]) { display: none; }
}
@media (max-width: 700px) {
  .cart-bar__more { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 1200px) {
  .zt-withdraw-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .cart-bar {
    --zt-cart-side: 1; position: sticky; top: 6rem; bottom: auto; flex-direction: column; align-items: stretch;
    background: var(--zt-surface); color: var(--zt-ink); border-color: var(--zt-border); box-shadow: var(--zt-shadow);
    padding: var(--zt-space-5);
  }
  .cart-bar h2 { color: var(--zt-ink); font-size: 1.0625rem; }
  .cart-bar .muted { color: var(--zt-muted); }
  .cart-bar .list > li { border-top-color: var(--zt-border); font-size: var(--zt-type-sm); }
  .cart-bar .button--primary { background: var(--zt-brand); color: #fff; border-color: var(--zt-brand); width: 100%; }
  .cart-bar .button--primary:hover { background: var(--zt-brand-hover); color: #fff; }
  .cart-bar .link-button { color: var(--zt-brand); }
  .cart-bar__count { background: var(--zt-brand); color: #fff; }
  .cart-bar__note { display: block; }
}
.cart-bar__note { display: none; margin: 0; padding: var(--zt-space-3); border-radius: 10px; background: var(--zt-mint); color: var(--zt-brand-deep); font-size: .8125rem; }

/* Keyboard focus and scroll-into-view stop clear of the sticky header, the fixed bottom
   navigation and the sticky cart, never under them (13.2). */
html { scroll-padding-top: 5.5rem; scroll-padding-bottom: calc(var(--zt-sticky-bottom, 0px) + 1rem); }
@media (max-width: 700px), (max-height: 560px) {
  .site-header { position: static; }
  html { scroll-padding-top: .5rem; }
}
@media (max-width: 700px) {
  html { scroll-padding-bottom: calc(var(--zt-bottom-nav) + 4px + env(safe-area-inset-bottom) + var(--zt-sticky-bottom, 0px) + .5rem); }
}

/* ---- submission, history and misc components ------------------------------------------ */
.status-live { min-height: 1.5rem; }
.submission { border-radius: var(--zt-radius); padding: var(--zt-space-4); border: 2px solid var(--zt-border); background: var(--zt-surface); box-shadow: var(--zt-shadow); }
.submission[data-state="checking"] { border-color: var(--zt-warning); background: var(--zt-warning-bg); }
.submission[data-state="confirmed"] { border-color: var(--zt-success); background: var(--zt-success-bg); }
.submission[data-state="needs_review"] { border-color: var(--zt-danger); background: var(--zt-danger-bg); }
.submission[data-state="blocked"] { border-color: var(--zt-warning); background: var(--zt-warning-bg); }
.submission[data-state="storage"] { border-color: var(--zt-danger); background: var(--zt-danger-bg); }
.submission [data-submission-message] { font-weight: 650; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 var(--zt-space-1); border-left: 3px solid var(--zt-mint-strong); }
.timeline li { margin: 0 0 var(--zt-space-3) var(--zt-space-3); }
.equation { font-family: var(--zt-mono); background: var(--zt-soft); border-radius: var(--zt-radius-sm); padding: var(--zt-space-3); overflow-x: auto; }
.partition { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: var(--zt-space-2); }
.partition > div { background: var(--zt-soft); border: 1px solid var(--zt-border); border-radius: 10px; padding: var(--zt-space-2) var(--zt-space-3); }
.partition strong { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.pagination { display: flex; gap: var(--zt-space-2); justify-content: space-between; margin-top: var(--zt-space-4); }
.tabs { display: flex; flex-wrap: wrap; gap: var(--zt-space-2); margin-bottom: var(--zt-space-5); }
.tabs a {
  padding: 8px 15px; text-decoration: none; font-weight: 650; color: var(--zt-muted); min-height: var(--zt-touch);
  display: inline-flex; align-items: center; border: 1px solid var(--zt-border); border-radius: var(--zt-radius-pill);
  background: var(--zt-surface); font-size: .9375rem;
}
.tabs a:hover { color: var(--zt-brand); border-color: var(--zt-brand); }
.tabs a[aria-current="page"] { color: var(--zt-brand); background: var(--zt-mint); border-color: var(--zt-brand); }
.qr-label { display: inline-grid; justify-items: center; gap: var(--zt-space-1); border: 1px solid var(--zt-border); border-radius: var(--zt-radius-sm); padding: var(--zt-space-3); background: var(--zt-surface); }
.qr-label svg { width: 10rem; height: 10rem; }
.status-card { background: var(--zt-surface); border: 1px solid var(--zt-border); border-radius: var(--zt-radius); padding: var(--zt-space-4); }
.status-card--ready { background: var(--zt-success-bg); }
.status-card--not-ready { background: var(--zt-danger-bg); }

/* Success: the emerald medallion on a mint panel, for a durable receipt only. */
.zt-success {
  background: linear-gradient(150deg, var(--zt-mint), #f7fcf8); padding: var(--zt-space-6); border-radius: var(--zt-radius);
  border: 1px solid var(--zt-border); text-align: center; margin-bottom: var(--zt-space-5);
}
.zt-success__icon { width: 64px; height: 64px; display: grid; place-items: center; background: var(--zt-brand); color: #fff; border-radius: 50%; margin: 0 auto var(--zt-space-4); }
.zt-success__icon .zt-icon { width: 34px; height: 34px; }
.zt-success h1 { font-size: 1.6rem; margin: 0 0 var(--zt-space-2); }
.zt-success p { color: var(--zt-muted); margin: 0 auto; max-width: 48ch; }
.zt-success .zt-success__title { color: var(--zt-ink); font-size: 1.25rem; margin-bottom: var(--zt-space-2); }

/* Exceptional states (refused, missing, expired, unavailable): the same panel with a
   tone tile, the facts and the next action; never a bare error page. */
.zt-state { max-width: 44rem; }
.zt-state__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  margin-bottom: var(--zt-space-4); background: var(--zt-neutral-bg); color: var(--zt-neutral);
}
.zt-state__icon .zt-icon { width: 28px; height: 28px; }
.zt-state--danger .zt-state__icon { background: var(--zt-danger-bg); color: var(--zt-danger); }
.zt-state--warn .zt-state__icon { background: var(--zt-warning-bg); color: var(--zt-warning); }
.zt-state--info .zt-state__icon { background: var(--zt-info-bg); color: var(--zt-info); }
body > .site-main .zt-state { margin: var(--zt-space-6) auto; }

/* Receiving: the this-delivery quantity is the large input on every width. */
[data-receive-line] input[data-accepted] {
  font-size: 1.25rem; min-height: 48px; max-width: 11rem; text-align: center; font-variant-numeric: tabular-nums;
}
[data-receive-line] .zt-list-row { align-items: center; margin-bottom: var(--zt-space-2); }
[data-receive-line] h2 { margin: 0; }

.action-card--report { align-items: flex-start; }
[data-report-list] { grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.action-card--report strong, .action-card--report .small { display: block; }
.action-card--report .small { font-weight: 400; margin-top: 2px; }

/* ---- charts: SKU counts with their numbers always printed --------------------------- */
.zt-chart-row { display: grid; grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr) 2.5rem; gap: 10px; align-items: center; font-size: var(--zt-type-sm); margin: 10px 0; }
.zt-chart-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.zt-bar { display: block; width: 100%; height: 10px; }
.zt-bar__track { fill: var(--zt-soft); }
.zt-bar__fill { fill: #63a481; }
.zt-chart-note { font-size: .8125rem; color: var(--zt-muted); margin: var(--zt-space-3) 0 0; }
.zt-donut-wrap { display: flex; align-items: center; gap: 24px; justify-content: center; flex-wrap: wrap; }
.zt-donut { width: 128px; flex: none; }
.zt-donut svg { width: 100%; height: auto; display: block; }
.zt-donut__track { stroke: var(--zt-soft); }
.zt-donut__total { font-size: 10px; font-weight: 800; fill: var(--zt-ink); }
.zt-donut__caption { font-size: 3.4px; font-weight: 600; fill: var(--zt-muted); }
.zt-seg--OK { stroke: #4b956f; }
.zt-seg--LOW { stroke: #d5a143; }
.zt-seg--OUT { stroke: #c95b51; }
.zt-seg--UNCOUNTED { stroke: #8094a2; }
.zt-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: var(--zt-type-sm); }
.zt-legend li { display: flex; align-items: center; gap: 8px; }
.zt-legend strong { margin-left: auto; padding-left: var(--zt-space-3); font-variant-numeric: tabular-nums; }
.zt-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.zt-dot--OK { background: #4b956f; }
.zt-dot--LOW { background: #d5a143; }
.zt-dot--OUT { background: #c95b51; }
.zt-dot--UNCOUNTED { background: #8094a2; }

/* ---- quick actions rail and setup summary --------------------------------------------- */
.zt-quick { display: grid; gap: 9px; }
.zt-quick .button { justify-content: flex-start; width: 100%; }
.zt-quick .button .zt-icon { color: var(--zt-brand); }
.zt-quick .button--primary .zt-icon { color: #fff; }

/* ---- icon picker (catalog administrators only) ---------------------------------------- */
.zt-icon-picker { border: 1px solid var(--zt-border); border-radius: 12px; padding: var(--zt-space-3) var(--zt-space-4) var(--zt-space-4); }
.zt-icon-picker__grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); margin-top: var(--zt-space-2); }
.zt-icon-option { position: relative; }
.zt-icon-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.zt-icon-option label {
  display: flex; align-items: center; gap: 10px; min-height: 3.5rem; padding: 6px 10px; margin: 0;
  border: 1px solid var(--zt-border); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: .875rem; background: var(--zt-surface);
}
.zt-icon-option label .zt-icon-tile { width: 36px; height: 36px; border-radius: 9px; }
.zt-icon-option label .zt-icon-tile .zt-icon { width: 22px; height: 22px; }
.zt-icon-option input:checked + label { border: 2px solid var(--zt-brand); background: var(--zt-mint); }
.zt-icon-option input:focus-visible + label { outline: var(--zt-focus-width) solid var(--zt-focus); outline-offset: 2px; }
.zt-icon-preview { display: flex; align-items: center; gap: var(--zt-space-3); padding: var(--zt-space-3); border-radius: 12px; background: var(--zt-soft); margin-bottom: var(--zt-space-3); }

/* ---- sign-in and setup: a compact branded card ---------------------------------------- */
.zt-auth { max-width: 32rem; margin: var(--zt-space-4) auto 0; }
.zt-auth .zt-hero { min-height: 0; padding: var(--zt-space-4) var(--zt-space-5); margin-bottom: var(--zt-space-4); }
.zt-auth__lead { font-weight: 700; color: var(--zt-brand-deep); margin: 4px 0 0; max-width: 65%; }
.zt-auth .zt-hero .zt-hero__art { width: 170px; height: 90px; max-width: 38%; opacity: .75; }
.zt-auth > .panel { padding: var(--zt-space-6); }

/* ---- responsive refinements ----------------------------------------------------------- */
@media (max-width: 700px) {
  h1 { font-size: 1.625rem; }
  .zt-hero { padding: var(--zt-space-5); min-height: 0; }
  .zt-hero p { max-width: 100%; font-size: var(--zt-type-sm); }
  .zt-hero .zt-hero__art { width: 150px; max-width: 42%; height: 80px; opacity: .35; }
  .zt-metrics { gap: 10px; }
  .zt-metric { padding: 13px; }
  .zt-metric__top { font-size: .75rem; gap: 7px; }
  .zt-metric__icon { width: 30px; height: 30px; border-radius: 8px; }
  .zt-metric__icon .zt-icon { width: 18px; height: 18px; }
  .zt-metric__value, .metric__value { font-size: 1.5rem; }
  .panel { padding: var(--zt-space-4); }
  .page-head { gap: var(--zt-space-2) var(--zt-space-3); margin-bottom: var(--zt-space-4); }
  .page-head__actions { margin-left: 0; }
  .zt-chart-row { grid-template-columns: minmax(5rem, 7rem) minmax(0, 1fr) 2rem; }
}
@media (max-width: 360px) {
  .site-main { padding-left: var(--zt-space-3); padding-right: var(--zt-space-3); }
  .supply-card { padding: 11px; gap: 8px; }
  .zt-metric__value, .metric__value { font-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .zt-metric, .metric, .panel, .supply-card, .badge, .zt-chip, .zt-hero, .button, .zt-icon-tile, .cart-bar, .submission, .alert {
    border: 1px solid CanvasText; box-shadow: none;
  }
  .zt-hero .zt-hero__art { display: none; }
  .side-nav a[aria-current="page"], .bottom-nav a[aria-current="page"], .tabs a[aria-current="page"] { outline: 2px solid Highlight; }
  .zt-bar__track, .zt-bar__fill, .zt-donut svg, .zt-dot { forced-color-adjust: none; }
  .zt-icon { color: CanvasText; }
}
@media print {
  .site-header, .side-nav, .bottom-nav, .site-footer, .no-print, .demo-banner, .cart-bar { display: none !important; }
  body[data-zt-ui="canopy-v1"] { background: #fff; }
  .site-main { padding: 0; max-width: none; }
  .panel, .supply-card, .zt-metric { box-shadow: none; break-inside: avoid; }
  .table-region { overflow: visible; }
  .zt-hero .zt-hero__art { display: none; }
  .badge, .zt-chip { border: 1px solid #999; }
  a { color: inherit; }
}

/* ---- page identity, report basis and filter toolbar (design-v5 S10, S23, S35) ------ */
.zt-identity--page { flex: 1 1 22rem; min-width: 0; gap: var(--zt-space-4); }
.zt-identity--page .page-head__intro { flex: 1 1 auto; }
.zt-basis {
  display: flex; align-items: flex-start; gap: 8px; margin: 0 0 var(--zt-space-4);
  border-radius: 10px; background: var(--zt-mint); color: var(--zt-brand-deep);
  padding: 10px 14px; font-size: var(--zt-type-sm);
}
.zt-basis > .zt-icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.zt-basis strong { margin-right: 4px; }
/* Labels on one line and controls on the next, whatever hint a field carries below it;
   the button lines up with the controls (one label line plus its gap above it). */
.zt-toolbar { align-items: flex-start; margin-bottom: var(--zt-space-4); }
.zt-toolbar .field { margin-bottom: 0; }
.zt-toolbar > .button { margin-top: calc(var(--zt-line) * 1em + var(--zt-space-1)); }
/* A group of filter checkboxes is one more field: its legend sits where a label does and its
   choices share the controls' line, not a bordered box taller than the fields beside it. */
.zt-checks { border: 0; padding: 0; margin: 0; }
.zt-checks > legend { padding: 0; }
.zt-checks > .check { display: inline-flex; margin-right: var(--zt-space-3); }
/* The action under a table (S12's drafts button) stands clear of it, its note beside it. */
.zt-table-actions { margin-top: var(--zt-space-4); }
