/* Big Kit Inventory - one stylesheet, built from the client mockups.
   Tokens first; every colour, size and radius below comes from here. */

:root {
  /* Colour scheme: Admin → Branding sets these per site (src/Core/Brand.php). Defaults: Sabon Station */
  --main: #0095da;
  --accent: #fff200;
  --brand: #0095da;            /* the branch's own colour (locations.brand_color): only the dot by the branch name */
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-2: #e7f3fb;        /* read-only fields, totals band */
  --line: #d9e3ea;
  --line-strong: #b9c8d3;
  --ink: #111417;
  --ink-2: #4e606c;
  --ink-3: #7a8a95;
  --primary: #0077b6;          /* deeper Sabon blue: white button text stays readable */
  --primary-ink: #ffffff;
  --primary-hover: #005f92;
  --primary-text: #0077b6;     /* links and highlighted text on white */
  --ok: #1f7a4d;   --ok-bg: #e5f4eb;
  --warn: #9a5b00; --warn-bg: #fdf1dc;
  --bad: #b42318;  --bad-bg: #fdeceb;
  --info: #3b5566; --info-bg: #e8eff4;
  --focus: #0087c7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(19, 35, 46, .04);
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font); font-feature-settings: "tnum" 1;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.1; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Top bar ---------- */
.brandband { height: 6px; background: linear-gradient(var(--main) 0 4px, var(--accent) 4px 6px); }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 24px; padding: 0 28px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 19px; text-decoration: none; white-space: nowrap; }
.logo img { height: 44px; width: auto; max-width: 200px; object-fit: contain; flex: none; }
.logo span { color: var(--ink-2); font-weight: 400; }
.logo-text { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.logo-text b { color: var(--ink); font-weight: 600; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 9px 14px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2);
  font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.on { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 -3px 0 var(--main); }
.nav .count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px;
  background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-family: var(--mono);
}
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 14px; }
.who .branch { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.who .branch i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.who .role { font-weight: 600; }
.who .branch-code { display: none; }
.menu { position: relative; }
.menu > button {
  border: 1px solid var(--line); background: var(--surface); border-radius: 50%; width: 34px; height: 34px;
  font: 600 13px var(--font); color: var(--ink); cursor: pointer;
}
.menu-pop {
  position: absolute; right: 0; top: 42px; min-width: 240px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(19,35,46,.12); padding: 8px; display: none;
}
.menu.open .menu-pop { display: block; }
.menu-pop a, .menu-pop button {
  display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 6px; border: 0;
  background: none; font: 400 14px var(--font); color: var(--ink); text-decoration: none; cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--bg); }
.menu-pop .label { padding: 8px 10px 4px; font: 500 11px var(--mono); letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* ---------- Page ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 40px 28px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { font: 500 12px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.page-head p { margin-top: 10px; color: var(--ink-2); font-size: 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.grid { display: grid; gap: 20px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.g-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: start; }
@media (max-width: 1080px) { .g-main, .g-split { grid-template-columns: minmax(0, 1fr); } .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) {
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 24px 16px 64px; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px 18px; }
  .kpi .k-val { font-size: 34px; margin-top: 6px; }
  .page-head { margin-bottom: 20px; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px 28px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.card-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card + .card { margin-top: 20px; }
.grid > .card + .card, .grid > *, .drums > .card { margin-top: 0; }
.stack > * + * { margin-top: 20px; }

/* KPI tiles */
.kpi { display: block; padding: 22px 26px; text-decoration: none; transition: border-color .15s; }
a.kpi:hover { border-color: var(--line-strong); }
.kpi .k-label { color: var(--ink-2); }
.kpi .k-val { font-size: 48px; line-height: 1.1; margin-top: 12px; font-weight: 500; letter-spacing: -.02em; }
.kpi.alert .k-val { color: var(--bad); }
.kpi .k-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t th { font-weight: 500; color: var(--ink-2); font-size: 14px; background: var(--surface); white-space: nowrap; }
.t th:first-child, .t td:first-child { padding-left: 28px; }
.t th:last-child, .t td:last-child { padding-right: 28px; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #fafcfd; }
.t td.total, .t th.total { font-weight: 600; }
.t .num, .t th.num { text-align: right; }
.t .code { font: 400 13px var(--mono); color: var(--ink-2); white-space: nowrap; }
.t .sub { display: block; font-size: 12.5px; color: var(--ink-3); }
.t tr.row-link { cursor: pointer; }
.t input.input, .t select.input { height: 42px; }
.t td[data-check] { min-width: 150px; }
.line-check:not(:empty) { margin-top: 6px; }
.t th.wrap { white-space: normal; }
.line-check .chip { white-space: normal; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 999px;
  font: 500 12.5px var(--mono); white-space: nowrap; background: var(--info-bg); color: var(--info);
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-muted { background: #eef2f5; color: var(--ink-2); }

/* ---------- Forms ---------- */
label.lbl, .lbl { display: block; font-weight: 500; margin-bottom: 8px; }
.field + .field { margin-top: 18px; }
.help { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.input {
  width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); font: 400 15px var(--font); color: var(--ink);
}
textarea.input { height: auto; min-height: 92px; padding: 12px 16px; resize: vertical; }
select.input { appearance: none; padding-right: 40px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2313232e' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 16px center; }
.input:focus { outline: 3px solid rgba(0,149,218,.25); border-color: var(--focus); }
.input[readonly], .input.ro { background: var(--surface-2); border-color: var(--surface-2); }
.input.bad { border-color: var(--bad); outline: 2px solid rgba(180,35,24,.12); }
.input.qty { text-align: right; max-width: 150px; font-variant-numeric: tabular-nums; }
.row-fields { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
.row-fields.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 760px) { .row-fields, .row-fields.two { grid-template-columns: 1fr; } }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg label {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 16px; background: var(--surface);
}
.seg input { width: 18px; height: 18px; accent-color: var(--focus); margin: 0; }
.seg label:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 500 15px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn:focus-visible { outline: 3px solid rgba(0,149,218,.35); outline-offset: 2px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: var(--bg); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; justify-content: flex-start; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { color: var(--primary-text); font-weight: 500; text-underline-offset: 3px; }

/* ---------- Status steps (Request status sidebar) ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 4px 6px; padding: 10px 0; }
.steps .n { font: 500 13px var(--mono); color: var(--ink-3); padding-top: 2px; }
.steps .t1 { font-weight: 600; font-size: 16px; }
.steps .t2 { grid-column: 2; color: var(--ink-2); font-size: 14px; }
.steps li.done .n { color: var(--ok); }
.steps li.now .t1 { color: var(--primary-text); }
.steps li.todo .t1 { color: var(--ink-3); }

/* Sign-off cards */
.sig { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.sig + .sig { margin-top: 14px; }
.sig-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sig-who { font-weight: 600; }
.sig-when { color: var(--ink-2); font-size: 14px; margin-top: 6px; }

/* Notes / callouts */
.callout { background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px 20px; display: flex; justify-content: space-between; gap: 12px; }
.note { color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Flash */
.flash { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-bad { background: var(--bad-bg); color: var(--bad); }
.flash-info { background: var(--info-bg); color: var(--info); }

/* Live badge */
.live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font: 500 12.5px var(--mono); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
.live.stale { background: var(--warn-bg); color: var(--warn); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live i { animation: none; } }

/* ---------- Drums ---------- */
.drums { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.drum { padding: 18px 20px; text-decoration: none; display: block; }
.drum.low { border: 2px solid var(--ink); }
.drum.mixing { border-style: dashed; }
.drum-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drum-code { font: 500 14px var(--mono); }
.drum-name { font-weight: 600; margin: 14px 0 12px; line-height: 1.3; min-height: 2.6em; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.drum.low .bar b { background: var(--bad); }
.drum-left { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.filters .input { height: 42px; width: auto; min-width: 200px; }

/* Empty state */
.empty { padding: 48px 28px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 420px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand i { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); }
.auth .card { border-top: 4px solid var(--main); }
.auth-logo { display: block; height: 104px; width: auto; max-width: 100%; object-fit: contain; margin: 2px auto 22px; }
.print-brand { display: flex; align-items: center; gap: 16px; }
.print-brand img { height: 64px; width: auto; max-width: 220px; object-fit: contain; flex: none; }

/* ---------- Print ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .brandband, .no-print, .actions, .flash { display: none !important; }
  .page { padding: 0; max-width: none; }
  .card { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  .t th, .t td { padding: 6px 8px; }
  .chip { background: none !important; padding: 0; }
}
.printdoc .sigs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.printdoc .sigs div { border-top: 1px solid #333; padding-top: 6px; font-size: 12px; }

/* ---------- Installer ---------- */
.install { max-width: 820px; margin: 0 auto; padding: 48px 24px 96px; }
.install h1 { margin-bottom: 12px; }
.install .lead { color: var(--ink-2); font-size: 16px; margin-bottom: 28px; max-width: 640px; }
.install .card { margin-bottom: 20px; }
.install .card + .card { margin-top: 0; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 14px; margin-bottom: 20px; }
.step > span {
  width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font: 500 14px var(--mono);
}
.step p { margin-top: 4px; font-size: 14px; }
.choice { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.choice label, .check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; cursor: pointer; }
.choice label { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 14px 16px; }
.choice label:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.choice label.is-disabled { opacity: .55; cursor: not-allowed; }
.choice legend { margin-bottom: 4px; }
.choice input, .check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--focus); }
.choice strong, .check strong { display: block; font-weight: 500; }
.choice .muted, .check .muted { display: block; font-size: 14px; margin-top: 2px; }
ol.next { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.install .note .mono { white-space: nowrap; }

/* ---------- Danger, updates, activity ---------- */
.btn-danger { border-color: var(--bad); color: var(--bad); background: var(--surface); }
.btn-danger:hover { background: var(--bad); color: #fff; border-color: var(--bad); }
.danger-zone { border-color: #f1c9c4; }
.blocker { border: 1px solid #f1c9c4; background: var(--bad-bg); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 14px; }
.blocker strong { color: var(--bad); }
.blocker p { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
details.files { font-size: 13px; margin-top: 6px; }
details.files summary { cursor: pointer; color: var(--ink-2); }
details.files ul { margin: 6px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; }
details.files li { word-break: break-all; }
ul.notes { margin: 8px 0 0; padding-left: 20px; }
.t.compact td { padding: 10px 12px; vertical-align: top; }
.t.compact td:first-child { padding-left: 0; }
.upload { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.upload .input[type=file] { flex: 1; min-width: 220px; padding: 10px 12px; height: auto; }
ul.backups { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
ul.backups li { display: grid; gap: 2px; word-break: break-all; }

/* =====================================================================
   Phones and tablets. Staff do transactions on these, so:
   - the main menu becomes a slide-out drawer (nothing hidden off-screen),
   - tables turn into stacked cards on phones (every input reachable, no sideways scroll),
   - tap targets are at least 44px and inputs 16px (no iOS zoom on focus).
   ===================================================================== */
.nav-toggle, .nav-head, .nav-backdrop { display: none; }
.row-fields.fit-auto { grid-template-columns: minmax(0, 1fr) auto; }
.row-fields.cols-a { grid-template-columns: 2fr 1fr 1.4fr; }
.row-fields.cols-b { grid-template-columns: 1fr 1.4fr 1.4fr 110px; }
.row-fields.cols-2-1 { grid-template-columns: 2fr 1fr; }
.g-drum { grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); align-items: start; }
.menu-pop { max-height: calc(100vh - 90px); overflow-y: auto; }

@media (max-width: 1099px) {
  .topbar-in { gap: 8px; padding: 0 12px 0 8px; min-height: 58px; }
  .nav-toggle {
    display: inline-flex; position: relative; align-items: center; justify-content: center; flex: none;
    width: 46px; height: 46px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); cursor: pointer;
  }
  .nav-toggle:focus-visible { outline: 3px solid rgba(0,149,218,.35); }
  .burger { display: grid; gap: 4px; }
  .burger i { display: block; width: 20px; height: 2px; border-radius: 1px; background: currentColor; }
  .nav-toggle .count {
    position: absolute; top: 5px; right: 3px; min-width: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--bad); color: #fff; font: 500 11px/18px var(--mono); text-align: center;
  }
  .logo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 17px; }

  .nav {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: min(330px, 86vw);
    flex-direction: column; gap: 2px; padding: 0 12px calc(24px + env(safe-area-inset-bottom));
    background: var(--surface); overflow-y: auto; overscroll-behavior: contain;
    transform: translateX(-104%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s;
    box-shadow: 0 0 40px rgba(19,35,46,.22);
  }
  body.nav-open .nav { transform: none; visibility: visible; transition: transform .22s ease; }
  .nav a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 14px; font-size: 17px; }
  .nav a.on { box-shadow: inset 4px 0 0 var(--main); }
  .nav-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
    position: sticky; top: 0; z-index: 1; background: var(--surface);
    padding: calc(18px + env(safe-area-inset-top)) 6px 14px 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
  }
  .nav-branch { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; }
  .nav-branch i { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; }
  .nav-role { display: block; color: var(--ink-2); font-size: 14px; margin-top: 4px; }
  .nav-close { flex: none; width: 44px; height: 44px; margin: -8px -4px 0 0; border: 0; border-radius: var(--radius-sm); background: none; font-size: 28px; line-height: 1; color: var(--ink-2); cursor: pointer; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(19,35,46,.42); }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open { overflow: hidden; }

  .who { gap: 8px; }
  .who .sep, .who .role { display: none; }
  .who .branch-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
  .menu > button { width: 42px; height: 42px; }
  .menu-pop { position: fixed; top: 62px; right: 10px; left: auto; min-width: 260px; max-width: calc(100vw - 20px); }
  .menu-pop a, .menu-pop button { padding: 12px 12px; font-size: 16px; }

  .input, .btn, select.input, textarea.input { font-size: 16px; }
  .page { padding-top: 28px; }
}
@media (prefers-reduced-motion: reduce) { .nav { transition: none !important; } }

@media (pointer: coarse) {
  .btn-sm { height: 44px; padding: 0 16px; }
  .t input.input, .t select.input { height: 46px; }
  .filters .input { height: 46px; }
  .seg label { min-height: 48px; }
  .check input, .choice input { width: 22px; height: 22px; margin-top: 0; }
}

@media (max-width: 760px) {
  .row-fields.fit-auto, .row-fields.cols-a, .row-fields.cols-b, .row-fields.cols-2-1 { grid-template-columns: minmax(0, 1fr); }
  .g-drum { grid-template-columns: minmax(0, 1fr); }
  .seg label { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 640px) {
  .who .branch-name { display: none; }
  .who .branch-code { display: inline; font-size: 13px; }
  .logo span { display: none; }
  .card-pad { padding: 20px 16px; }
  .card-head { padding: 16px; flex-wrap: wrap; row-gap: 4px; }
  .card-foot { padding: 14px 16px; }
  .card-head h2 { font-size: 18px; }
  .page-head { gap: 14px; }
  .page-head > .actions { width: 100%; }
  /* Buttons that finish a task fill the width, side by side when there are two */
  .actions > .btn, .actions > form, .card-foot > .btn, .card-foot > form { flex: 1 1 auto; }
  .actions > form .btn, .card-foot > form .btn { width: 100%; }
  .actions > .chip { flex: none; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .filters .input, .filters .btn { width: 100%; min-width: 0 !important; }
  .flash { margin-bottom: 16px; }
  .drums { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .drum-name { min-height: 0; }
  .kpi .k-label { font-size: 14px; }
  .sig { padding: 14px 16px; }
  .callout { flex-direction: column; }
}

/* Tables as stacked cards on phones. Labels come from the header (app.js adds data-label). */
@media screen and (max-width: 700px) {
  .table-wrap:has(> table.t:not(.no-stack)) { overflow: visible; }
  table.t:not(.no-stack), table.t:not(.no-stack) > tbody, table.t:not(.no-stack) > tfoot { display: block; width: 100%; }
  table.t:not(.no-stack) > thead { display: none; }
  table.t:not(.no-stack) tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.t:not(.no-stack) > tbody > tr:last-child { border-bottom: 0; }
  table.t:not(.no-stack) > tfoot > tr { background: var(--surface-2); }
  table.t:not(.no-stack) tr.row-link:active { background: var(--bg); }
  table.t:not(.no-stack) td {
    display: flow-root; padding: 5px 0; border: 0; text-align: right; white-space: normal; min-width: 0 !important; width: auto !important;
  }
  table.t:not(.no-stack) td::before {
    content: attr(data-label); float: left; max-width: 48%; margin-right: 14px; text-align: left;
    color: var(--ink-2); font-size: 14px; font-weight: 400; font-family: var(--font); line-height: 1.6;
  }
  table.t:not(.no-stack) td:empty { display: none; }
  table.t:not(.no-stack) td[data-label=""]::before, table.t:not(.no-stack) td:first-child::before { content: none; }
  table.t:not(.no-stack) td[data-label=""], table.t:not(.no-stack) td:first-child { text-align: left; }
  table.t:not(.no-stack) td:first-child { padding-top: 0; padding-bottom: 8px; font-weight: 500; font-size: 16px; }
  table.t:not(.no-stack) td:first-child .sub { font-weight: 400; }
  table.t:not(.no-stack) td.code { font-size: 13px; }
  table.t:not(.no-stack) td .sub { display: block; }
  /* Fields that need the width (item search, room, remarks, notes) sit under their label */
  table.t:not(.no-stack) td:has(.input:not(.qty)), table.t:not(.no-stack) td:has(textarea) { text-align: left; }
  table.t:not(.no-stack) td:has(.input:not(.qty))::before, table.t:not(.no-stack) td:has(textarea)::before { float: none; display: block; max-width: none; margin: 4px 0 6px; }
  table.t:not(.no-stack) td .input { width: 100%; min-width: 0 !important; max-width: none !important; }
  table.t:not(.no-stack) td .input.qty { width: 140px; max-width: 46% !important; }
  table.t:not(.no-stack) td:has(> .input.qty)::before { line-height: 46px; }
  table.t:not(.no-stack) td form { text-align: left; }
  table.t:not(.no-stack) td[data-label=""] .btn { margin-top: 6px; }
  table.t:not(.no-stack) td[data-check]:not(:has(*)) { display: none; }
  .t.compact td:first-child { padding-left: 0; }
  /* "Needs your action": number and status on top, what to do underneath */
  table.t.inbox tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "code chip" "text open"; gap: 6px 12px; align-items: center; }
  table.t.inbox td { padding: 0; font-size: 15px; font-weight: 400; }
  table.t.inbox td:nth-child(1) { grid-area: code; font-size: 13px; }
  table.t.inbox td:nth-child(2) { grid-area: text; font-weight: 500; }
  table.t.inbox td:nth-child(3) { grid-area: chip; text-align: right; }
  table.t.inbox td:nth-child(4) { grid-area: open; text-align: right; }
  /* Products: two lines per product — name and price, then code · kind · size */
  table.t.plist thead { display: none; }
  table.t.plist, table.t.plist tbody { display: block; }
  table.t.plist tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "name name name price" "code kind size size"; gap: 4px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  table.t.plist td { padding: 0; border: 0; font-size: 13px; color: var(--ink-2); }
  table.t.plist td:nth-child(1) { grid-area: name; font-size: 15px; font-weight: 500; color: var(--ink); }
  table.t.plist td:nth-child(2) { grid-area: code; }
  table.t.plist td:nth-child(3) { grid-area: kind; }
  table.t.plist td:nth-child(4) { grid-area: size; }
  table.t.plist td:nth-child(5) { grid-area: price; font-size: 15px; color: var(--ink); text-align: right; }
  table.t.plist td .sub { display: block; }
  table.t.plist td:nth-child(3) .sub { display: none; }
  table.t.plist td.edit { display: none; }
}
@media (hover: none) { .t tbody tr:hover td { background: none; } }
@media (min-width: 701px) and (max-width: 1099px) {
  .t th, .t td { padding: 13px 12px; }
  .t th:first-child, .t td:first-child { padding-left: 20px; }
  .t th:last-child, .t td:last-child { padding-right: 20px; }
  .card-pad { padding: 22px 22px; }
  .card-head { padding: 18px 20px; }
}
@media (min-width: 701px) and (max-width: 1099px) {
  .t th.opt, .t td.opt { display: none; }
  /* Item entry tables (receiving): one card per line, item on top, fields side by side */
  .table-wrap:has(> table.t.entry) { overflow: visible; }
  table.t.entry, table.t.entry > tbody { display: block; width: 100%; }
  table.t.entry > thead { display: none; }
  table.t.entry tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
  table.t.entry td { display: block; padding: 0 !important; border: 0; text-align: left; }
  table.t.entry td::before { content: attr(data-label); display: block; margin-bottom: 6px; font-size: 13.5px; color: var(--ink-2); }
  table.t.entry td:first-child { grid-column: 1 / -1; font-weight: 500; }
  table.t.entry td:first-child::before, table.t.entry td[data-label=""]::before { content: none; }
  table.t.entry td:empty { display: none; }
  table.t.entry td[data-check] { grid-column: 1 / -1; }
  table.t.entry td .input { width: 100%; min-width: 0 !important; max-width: none !important; }
  table.t.entry td.num { text-align: left; line-height: 46px; }
}
.menu-pop .menu-role { padding: 0 10px 8px; font-size: 13px; color: var(--ink-2); }
/* Laptops: keep every menu item visible (role is in the avatar menu) */
@media (min-width: 1100px) and (max-width: 1499px) {
  .topbar-in { gap: 16px; padding: 0 20px; }
  .nav a { padding: 9px 11px; }
  .who .sep, .who .role { display: none; }
}
@media (min-width: 1100px) {
  /* Never hide a menu item: wrap to a second row when there are many (Admin inside a branch) */
  .nav { flex-wrap: wrap; overflow: visible; row-gap: 2px; padding: 8px 0; }
}

/* ---------- Opening count ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 12px 16px; text-decoration: none; color: var(--ink-2); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--main); }
.savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -6px 18px rgba(19,35,46,.08);
}
@media (max-width: 640px) { .savebar { margin: 16px -16px 0; border-radius: 0; border-width: 1px 0 0; } .savebar .btn { flex: 1 1 auto; } }
.callout-start { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; border-color: var(--main); }

/* ---------- Selling ---------- */
.sale-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sale-total strong { font-size: 32px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.seg-wrap { border: 0; margin: 0; padding: 0; }
.sale-pay .seg label { height: 44px; padding: 0 14px; font-size: 15px; }
.sale-pay { position: sticky; top: 84px; }
@media (max-width: 1080px) { .sale-pay { position: static; } }
ul.progress-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
ul.progress-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
ul.progress-list .sub { display: block; font-size: 12.5px; color: var(--ink-3); }
.hint-ok { color: var(--ok); } .hint-warn { color: var(--warn); } .hint-bad { color: var(--bad); }
.sigpad { position: relative; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fff; height: 200px; touch-action: none; }
.sigpad canvas { width: 100%; height: 100%; display: block; border-radius: var(--radius-sm); }
.sigpad .sigpad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); pointer-events: none; }
.sigpad.signed .sigpad-hint { display: none; }
.source-opt { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
.source-opt + .source-opt { margin-top: 8px; }
.source-opt:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.source-opt.no { opacity: .55; }
.source-opt input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--focus); }
.queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.queue-card { display: block; padding: 18px 20px; text-decoration: none; }
.queue-card.alert { border: 2px solid var(--bad); }
.queue-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.queue-name { font-weight: 600; font-size: 18px; margin: 8px 0 10px; }
ul.queue-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
ul.queue-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.queue-foot { margin-top: 10px; }
.nowrap { white-space: nowrap; }
.prep-line { padding: 16px 28px; border-bottom: 1px solid var(--line); }
.prep-what { margin-bottom: 10px; }
.prep-what .sub { display: block; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 640px) { .queue { grid-template-columns: minmax(0, 1fr); } .prep-line { padding: 14px 16px; } }
.sale-sums { display: grid; gap: 4px; font-size: 14px; }
.sale-sums:empty { display: none; }
.sale-sums div { display: flex; justify-content: space-between; gap: 10px; }
.sale-sums .disc { color: var(--ok); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pager .btn + .btn { margin-left: 6px; }

/* Search-as-you-type dropdown (sale screen: customer and product boxes) */
.combo-list {
  position: absolute; z-index: 60; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(19, 35, 46, .16); padding: 4px 0;
}
.combo-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; min-height: 48px; cursor: pointer; }
.combo-opt + .combo-opt { border-top: 1px solid var(--line); }
.combo-opt.on, .combo-opt:hover { background: var(--surface-2); }
.combo-main { min-width: 0; display: flex; flex-direction: column; }
.combo-main strong { font-weight: 500; overflow-wrap: anywhere; }
.combo-main .sub { color: var(--ink-3); font-size: 13px; }
.combo-main .code { font-family: var(--mono); font-size: 12px; }
.combo-price { text-align: right; white-space: nowrap; font-weight: 500; }
.combo-price .sub { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.combo-title { padding: 8px 14px 6px; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.combo-new strong { color: var(--primary-text); }
.combo-list mark { background: #fff7a3; color: inherit; border-radius: 2px; padding: 0 1px; }
.combo-list .chip { flex: none; }

/* Admin → Branding */
.brand-logo-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.brand-logo-box { width: 160px; height: 120px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: repeating-conic-gradient(#f1f4f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.brand-logo-box img { max-width: 140px; max-height: 100px; object-fit: contain; }
.brand-schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.brand-schemes label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.brand-schemes label input { margin: 0; flex: none; }
.brand-schemes .swatches { display: flex; flex: none; }
.brand-schemes .swatch + .swatch { margin-left: -6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); flex: none; }
.swatch-any { background: conic-gradient(#e53e3e, #f6e05e, #38a169, #3182ce, #805ad5, #e53e3e); }
.input-color { height: 46px; padding: 4px; cursor: pointer; }
.brand-preview { position: sticky; top: 88px; align-self: start; overflow: hidden; }
.brand-preview-band { height: 6px; background: linear-gradient(var(--main) 0 4px, var(--accent) 4px 6px); }
.brand-preview-bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); min-height: 68px; }
.brand-preview-bar img { height: 44px; width: auto; max-width: 180px; object-fit: contain; }
.brand-preview-text { font-weight: 600; font-size: 17px; }
.brand-preview-tabs { margin: 0; }
.brand-preview-tabs a { padding: 8px 12px; cursor: default; }
.brand-preview-tint { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
@media (max-width: 1099px) { .brand-preview { position: static; } }

/* Notification bell (top bar, beside the branch) */
.bell { position: relative; }
.bell-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer; }
.bell-btn:hover { background: var(--bg); }
.bell-btn:focus-visible { outline: 3px solid rgba(0,149,218,.35); outline-offset: 2px; }
.bell-count { position: absolute; top: -5px; right: -6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 500 11px/18px var(--mono); text-align: center; border: 2px solid var(--surface); }
.bell.ring .bell-btn svg { animation: bell-ring .9s ease-in-out 1; transform-origin: 50% 10%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .bell.ring .bell-btn svg { animation: none; } }
.bell-pop { white-space: normal; text-align: left; position: absolute; right: -60px; top: 46px; width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(19,35,46,.16); display: none; z-index: 50; overflow: hidden; }
.bell.open .bell-pop { display: block; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bell-alerts { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.side-nav .count[hidden], .count[hidden] { display: none; }
.bell-readall { border: 0; background: none; color: var(--primary-text); font: 500 13px var(--font); cursor: pointer; padding: 4px 0; }
.bell-list { max-height: min(420px, 60vh); overflow-y: auto; overscroll-behavior: contain; }
.bell-empty { padding: 28px 16px; text-align: center; color: var(--ink-2); font-size: 14px; }
.bell-item { display: block; padding: 12px 16px 12px 28px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink-2); position: relative; font-size: 13.5px; line-height: 1.4; }
.bell-item:hover { background: var(--bg); }
.bell-item strong { display: block; color: var(--ink); font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.bell-item span { display: block; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-item small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.bell-item.unread { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.bell-item.unread strong { font-weight: 600; }
.bell-item.unread::before { content: ""; position: absolute; left: 12px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--main); }
.bell-foot { display: block; text-align: center; padding: 11px; font-size: 13.5px; font-weight: 500; color: var(--primary-text); text-decoration: none; }
.bell-foot:hover { background: var(--bg); }
.notif-list .bell-item:last-child { border-bottom: 0; }
.notif-list .bell-item span { -webkit-line-clamp: unset; }
@media (max-width: 640px) {
  .bell-btn { width: 36px; height: 36px; }
  .bell-pop { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
}
/* New-notice toast */
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 80; max-width: min(380px, calc(100vw - 32px)); background: var(--ink); color: #fff; border-radius: var(--radius); padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); text-decoration: none; display: block; font-size: 14px; animation: toast-in .2s ease-out; }
.toast strong { display: block; font-weight: 600; margin-bottom: 2px; }
.toast span { opacity: .85; font-size: 13px; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Show / hide password */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 52px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-2); cursor: pointer; border-radius: var(--radius-sm); }
.pw-eye:hover { color: var(--ink); background: var(--bg); }
.pw-eye:focus-visible { outline: 3px solid rgba(0,149,218,.35); }

/* Admin → Email → Messages */
.msg-group { margin: 26px 0 12px; font-size: 16px; color: var(--ink-2); }
.msg summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; }
.msg summary::-webkit-details-marker { display: none; }
.msg summary > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.msg summary::after { content: "▸"; color: var(--ink-3); margin-left: auto; }
.msg[open] summary::after { content: "▾"; }
.msg[open] summary { border-bottom: 1px solid var(--line); }
.msg-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 24px; padding: 20px; }
.fillins { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); align-items: baseline; }
.fillin code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.msg-mail { margin-top: 6px; background: #f4f2ee; border-radius: var(--radius-sm); padding: 12px; }
.msg-subject { font-size: 13px; margin-bottom: 8px; overflow-wrap: anywhere; }
.msg-card { background: #fff; border-radius: 8px; border-top: 4px solid var(--main); padding: 16px; font-family: Arial, Helvetica, sans-serif; color: #1d1d1b; font-size: 14px; line-height: 1.5; }
.msg-card p { margin: 8px 0 0; }
.msg-h { display: block; font-size: 17px; line-height: 1.3; }
.msg-btn { display: inline-block; margin-top: 14px; background: var(--primary); color: var(--primary-ink); font-weight: bold; padding: 9px 16px; border-radius: 8px; font-size: 14px; }
@media (max-width: 900px) { .msg-body { grid-template-columns: 1fr; padding: 16px; } }

/* ---------- Left sidebar (client mockup, Oct 2026) ----------
   Computers (1100px and up): fixed on the left. Phones and tablets: the same sidebar slides in from the menu button. */
:root { --side-w: 252px; }
.side { position: fixed; top: 0; bottom: 0; left: 0; width: var(--side-w); z-index: 45; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.side::before { content: ""; height: 6px; flex: none; background: linear-gradient(var(--main) 0 4px, var(--accent) 4px 6px); }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 12px; }
.side-logo { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--ink); }
.side-logo img { height: 42px; width: auto; max-width: 170px; object-fit: contain; flex: none; }
.side-logo .logo-text { max-width: 150px; }
.side-logo .logo-text b { font-size: 15px; line-height: 1.2; white-space: normal; }
.side-branch { margin: 0 12px 12px; position: relative; }
.menu > .side-branch-btn {
  width: 100%; height: auto; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); text-align: left; font: inherit; color: var(--ink); cursor: pointer;
}
.menu > .side-branch-btn:hover:not(:disabled) { border-color: var(--line-strong); }
.menu > .side-branch-btn:disabled { cursor: default; color: var(--ink); }
.side-branch-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; }
.side-branch-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.side-branch-txt small { font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.side-branch-txt strong { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-branch-btn .ico { color: var(--ink-3); flex: none; }
.side-branch .menu-pop { left: 0; right: 0; top: calc(100% + 4px); max-height: 60vh; overflow-y: auto; }
.side-cta { margin: 0 12px 6px; justify-content: center; gap: 8px; display: flex; }
.side-cta .ico { stroke-width: 2.4; }
.side-nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 14px; scrollbar-width: thin; }
.side-group { font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 16px 10px 6px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a.on { background: var(--surface-2); color: var(--ink); box-shadow: inset 3px 0 0 var(--main); }
.side-nav a .ico { flex: none; color: var(--ink-3); }
.side-nav a.on .ico { color: var(--primary-text); }
.side-nav a > span:first-of-type { flex: 1; }
.side-nav .count { min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font: 500 11px/20px var(--mono); text-align: center; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.side-foot .menu { flex: 1; min-width: 0; }
.menu > .avatar-btn { width: 100%; height: auto; display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; color: var(--ink); }
.menu > .avatar-btn:hover { background: var(--bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font: 600 13px var(--font); flex: none; background: var(--surface); }
.side-user-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-user-txt strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-txt small { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu.up .menu-pop { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.bell.up .bell-pop { top: auto; bottom: calc(100% + 8px); left: -8px; right: auto; }
.skip:focus { position: fixed; left: 12px; top: 12px; width: auto; height: auto; clip: auto; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.topbar .side-user-txt { display: none; }
.topbar .menu > .avatar-btn { padding: 0; width: auto; }
.topbar .who { gap: 10px; }

@media (min-width: 1100px) {
  body.has-side { padding-left: var(--side-w); }
  .topbar, .nav-backdrop { display: none !important; }
  .side .nav-close { display: none; }
}
@media (max-width: 1099px) {
  .side { width: min(300px, 86vw); transform: translateX(-102%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; box-shadow: 0 0 40px rgba(0,0,0,.18); z-index: 60; }
  body.nav-open .side { transform: none; visibility: visible; transition: transform .22s ease; }
  .side .nav-close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; font-size: 28px; color: var(--ink-2); cursor: pointer; border-radius: var(--radius-sm); }
  .side-foot .bell { display: none; }
  .nav-backdrop { z-index: 55; }
  .topbar::before { content: ""; display: block; height: 6px; background: linear-gradient(var(--main) 0 4px, var(--accent) 4px 6px); }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none !important; } }
@media print { .side, .nav-backdrop { display: none !important; } body.has-side { padding-left: 0; } }

/* Brand badges (logo, or initials on the brand colour) */
.bbadge { display: inline-grid; place-items: center; flex: none; border-radius: 9px; font: 700 12px/1 var(--font); letter-spacing: .02em; overflow: hidden; vertical-align: middle; }
.bbadge-sm { width: 26px; height: 26px; border-radius: 7px; font-size: 10px; }
.bbadge-md { width: 36px; height: 36px; font-size: 12px; }
.bbadge-lg { width: 64px; height: 64px; border-radius: 14px; font-size: 20px; }
.bbadge.has-logo { background: #fff; border: 1px solid var(--line); }
.bbadge img { width: 100%; height: 100%; object-fit: contain; }
.brand-cell { display: inline-flex; align-items: center; gap: 12px; }
.bf-preview { display: flex; align-items: center; gap: 14px; }
.brand-products { max-height: 520px; overflow-y: auto; }
.brand-products a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; }
.brand-products a:hover { background: var(--bg); }
.brand-products .code { color: var(--ink-3); font-size: 12px; flex: none; }
.pname-wrap { display: flex; align-items: flex-start; gap: 10px; }
.pname-wrap .bbadge { margin-top: 1px; }
.combo-main { flex: 1; }

/* Drum board (client mockup) */
.drum-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 16px; padding: 16px 18px; margin-bottom: 18px; }
.drum-filters > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.drum-filters .lbl { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.drum-filters select.input { min-width: 190px; }
.segmented { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.segmented a { padding: 8px 14px; border-radius: 6px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.segmented a.on { background: var(--surface); color: var(--primary-text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.toggle-pill { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500; background: var(--surface); }
.toggle-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
.toggle-pill.on { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.low-link { color: var(--bad); font-weight: 600; }
.drum { padding: 16px 18px; }
.drum.low { border: 2px solid var(--bad); }
.drum-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.drum-id > span:last-child { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.drum-code { font: 500 13px var(--mono); color: var(--ink-2); }
.drum-brand { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drum-name { margin: 12px 0 12px; }
.drum-left { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.drum-pct { font-weight: 600; color: var(--ink-2); }
.drum.low .drum-pct { color: var(--bad); }
@media (max-width: 640px) {
  .drum-filters > div, .drum-filters select.input { width: 100%; min-width: 0; }
  .segmented { width: 100%; } .segmented a { flex: 1; text-align: center; padding: 8px 6px; }
  .toggle-pill { width: 100%; justify-content: center; }
}
@media (min-width: 641px) { .drum-filters > div { flex: 0 1 auto; } .drum-filters select.input { width: 230px; } }

/* ---------- Planning → Schedule ---------- */
.btn-lg { padding: 12px 22px; font-size: 16px; gap: 8px; display: inline-flex; align-items: center; }
.btn-icon { width: 46px; padding: 0; display: inline-grid; place-items: center; }
.sched-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.sched-kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.sched-kpi-name { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink); }
.sched-kpi-name i { width: 9px; height: 9px; border-radius: 50%; background: var(--tc); flex: none; }
.sched-kpi strong { font-size: 30px; font-weight: 600; line-height: 1.2; }
.sched-kpi small { color: var(--ink-3); font-size: 12.5px; }
.sched-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.sched-range { font-size: 18px; font-weight: 600; padding: 0 6px; }
.sched-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.sched-week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); overflow-x: auto; min-height: 460px; }
.sched-day { border-right: 1px solid var(--line); padding: 12px 10px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sched-day:last-child { border-right: 0; }
.sched-dayhead { display: flex; flex-direction: column; padding: 0 2px 10px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.sched-dayhead small { font: 500 11px var(--mono); letter-spacing: .1em; color: var(--ink-3); }
.sched-dayhead strong { font-size: 20px; font-weight: 600; }
.sched-dayfull { display: none; }
.sched-day.today .sched-dayhead strong, .sched-day.today .sched-dayhead small { color: var(--primary-text); }
.sched-none { color: var(--ink-3); font-size: 12.5px; padding: 2px; }
.sched-card { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--tc) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--tc) 32%, var(--surface)); }
.sched-card:hover { border-color: var(--tc); }
.sched-card.on { outline: 2px solid var(--tc); outline-offset: 1px; }
.sched-card.done, .sched-card.cancelled { opacity: .62; }
.sched-card.cancelled .sched-title { text-decoration: line-through; }
.sched-chip { align-self: flex-start; display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5;
  color: color-mix(in srgb, var(--tc) 78%, #000); background: color-mix(in srgb, var(--tc) 16%, var(--surface)); }
.sched-time { font: 500 12px var(--mono); color: var(--ink-2); }
.sched-title { font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.sched-state { font-size: 11.5px; color: var(--ink-2); }
.sched-detail { padding: 20px 22px; position: sticky; top: 20px; }
.sched-detail .empty { padding: 28px 8px; }
.sched-dtitle { font-size: 21px; margin: 10px 0 14px; line-height: 1.25; }
.sched-dl { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 9px 12px; margin: 0 0 18px; font-size: 14.5px; }
.sched-dl dt { color: var(--ink-2); }
.sched-dl dd { margin: 0; overflow-wrap: anywhere; }
.sched-dl dd.pre { white-space: pre-line; }
.sched-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sched-actions form { margin: 0; }
.sched-cancel { margin-top: 10px; }

/* The two-step window */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(19,35,46,.45); }
.modal-card { position: relative; width: min(660px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal-step[hidden] { display: none; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head .eyebrow { margin-bottom: 4px; font-size: 11.5px; }
.modal-head h2 { font-size: 20px; }
.modal-x { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--ink); flex: none; }
.modal-x:hover { background: var(--bg); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 24px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.modal-foot .spacer { flex: 1; }
body.modal-open { overflow: hidden; }
.sched-types { gap: 10px; }
.sched-type { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.sched-type:hover, .sched-type:focus-visible { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 5%, var(--surface)); }
.sched-type-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; color: color-mix(in srgb, var(--tc) 85%, #000); background: color-mix(in srgb, var(--tc) 14%, var(--surface)); }
.sched-type-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sched-type-txt strong { font-weight: 600; }
.sched-type-txt span { color: var(--ink-2); font-size: 13.5px; }
.sched-type > .ico { color: var(--ink-3); }
.sched-typeline { display: flex; align-items: center; gap: 14px; }
.sched-fields { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sched-fields[hidden] { display: none; }
.sched-fields .field { margin: 0; }
.time-pair { display: flex; align-items: center; gap: 8px; }
.time-pair .input { flex: 1; min-width: 0; }
.sched-notes { min-height: 130px; }

@media (max-width: 1250px) { .sched-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .sched-wrap { grid-template-columns: 1fr; }
  .sched-wrap.has-sel .sched-detail { order: -1; }
  .sched-detail { position: static; }
  .sched-wrap:not(.has-sel) .sched-detail { display: none; }
}
@media (max-width: 760px) {
  .sched-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sched-kpi { padding: 12px 14px; }
  .sched-kpi strong { font-size: 24px; }
  /* Phones: the week becomes a list of days */
  .sched-week { grid-template-columns: 1fr; min-height: 0; overflow: visible; }
  .sched-day { border-right: 0; border-bottom: 1px solid var(--line); }
  .sched-day:last-child { border-bottom: 0; }
  .sched-dayhead { flex-direction: row; align-items: baseline; gap: 8px; border-bottom: 0; padding-bottom: 0; }
  .sched-dayhead small, .sched-dayhead strong { display: none; }
  .sched-dayfull { display: block; font-weight: 600; }
  .sched-day.today .sched-dayfull { color: var(--primary-text); }
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { width: 100%; max-height: 94vh; max-height: 94dvh; border-radius: 18px 18px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot .btn { padding-left: 14px; padding-right: 14px; }
  .sched-dl { grid-template-columns: 84px minmax(0, 1fr); }
}
.sched-kpis > .card, .sched-wrap > .card { margin-top: 0; }
@media (min-width: 1101px) { .sched-wrap { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (min-width: 761px) { .sched-week { grid-template-columns: repeat(7, minmax(108px, 1fr)); } }

/* v2.9.0: sale "Other amount", file inputs, attachments, sales filters */
.custom-amt { display: flex; gap: 6px; margin-top: 6px; }
.custom-amt .input { min-width: 0; }
.custom-amt .input.qty { width: 92px; flex: 1 1 auto; }
.custom-amt select.input { width: 76px; flex: 0 0 76px; }
.file-input { padding: 8px; height: auto; min-height: 44px; }
.seg-sm label { height: 36px !important; padding: 0 12px !important; font-size: 14px !important; min-height: 0 !important; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 16px 20px; }
.file-tile { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.file-tile a.thumb { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.file-tile a.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-tile a.thumb.pdf { display: grid; place-items: center; font-weight: 700; color: var(--ink-3); font-size: 14px; letter-spacing: .06em; }
.file-tile .meta { padding: 8px 10px; font-size: 12.5px; line-height: 1.35; }
.file-tile .meta strong { display: block; font-size: 13px; }
.file-tile form { margin: 0 10px 10px; }
.file-add { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 0 20px 18px; align-items: end; }
.file-add .row2 { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.file-add .row2 .input { flex: 1 1 160px; width: auto; }
.period { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.period .seg label { height: 44px; }
.officer-split { display: grid; gap: 0; }
@media (max-width: 760px) {
  .file-add { grid-template-columns: 1fr; }
  .files { grid-template-columns: repeat(2, 1fr); padding: 12px; }
}

/* v2.10.0: restock ordering, shipment orders, stock moves */
.step-h { display: flex; align-items: baseline; gap: 10px; font-size: 18px; margin: 0 0 14px; }
.step-h .n { font: 500 12px var(--mono); color: var(--ink-3); }
.pick-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pick-cards.two { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pick-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 14px 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); line-height: 1.35; }
.pick-card input { position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; margin: 0; accent-color: var(--focus); }
.pick-card:has(input:checked) { border-color: var(--primary); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--primary); }
.pick-card.is-off { cursor: default; border-style: dashed; background: var(--bg); padding-left: 14px; }
.pick-card.is-off strong { color: var(--ink-2); }
.pick-card:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.pick-card .tag { font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-left: 6px; }
[data-order]:not(.is-buy) .buy-only { display: none; }
.kv { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.order-summary .sale-total { border-top: 1px solid var(--line); padding-top: 12px; }
.line-cost { min-width: 110px; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
[data-adjust] .t.entry td { vertical-align: top; }
[data-adjust] [data-adj-room] { min-width: 120px; }
[data-adjust] [data-adj-dir] { min-width: 120px; }
[data-adjust] [data-adj-reason] { min-width: 190px; }
[data-adjust] .t.entry .qty { min-width: 90px; }
[data-adjust] [data-item-search] { min-width: 240px; }
@media (min-width: 900px) { .adj-foot { display: grid; grid-template-columns: 1fr 280px; align-items: end; gap: 12px 20px; } .adj-foot .help { grid-column: 1 / -1; margin: 0; } }
[data-adjust] td[data-now] { padding-top: 27px; }

/* v2.11.0: targets, reports */
.tbar { position: relative; height: 22px; border-radius: 6px; background: #eef2f5; overflow: hidden; }
.tbar i { position: absolute; inset: 0 auto 0 0; display: block; border-radius: 6px; }
.tbar span { position: relative; display: block; text-align: right; padding: 0 8px; font: 500 12.5px/22px var(--mono); }
.tbar-ok i { background: #bfe5cf; } .tbar-info i { background: #cfe7f6; } .tbar-warn i { background: #f9dfb3; }
.rep-bars { display: grid; gap: 6px; padding: 16px 20px; }
.rep-bar { display: grid; grid-template-columns: 90px 1fr 110px; gap: 10px; align-items: center; font-size: 13.5px; }
.rep-bar .b { height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.rep-bar .b i { display: block; height: 100%; background: var(--main); }
.rep-bar .v { text-align: right; font-variant-numeric: tabular-nums; }
.tabs-inline { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
@media (max-width: 760px) { .rep-bar { grid-template-columns: 64px 1fr 90px; } }

/* ---------- Installable app (Admin → Branding → Install as an app; offline page) ---------- */
.pwa-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.choice.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.choice.inline label { padding: 9px 12px; grid-template-columns: 18px auto; align-items: center; }
.choice.inline input { margin: 0; }
.pwa-tile { width: 56px; height: 56px; border-radius: 22%; display: grid; place-items: center; overflow: hidden; background: var(--surface-2);
  box-shadow: 0 1px 3px rgba(0,0,0,.18), inset 0 0 0 1px rgba(0,0,0,.06); flex: none; }
.pwa-tile img { width: 80%; height: 80%; object-fit: contain; }
.pwa-tile img.own { width: 100%; height: 100%; object-fit: cover; }
.pwa-tile-lg { width: 120px; height: 120px; }
.pwa-tile-sm { width: 44px; height: 44px; }
.pwa-icon-edit { padding: 8px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: repeating-conic-gradient(#f1f4f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.pwa-preview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); }
.pwa-pv { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pwa-pv-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.pwa-home { flex: 1; display: grid; grid-template-columns: repeat(2, 44px); justify-content: center; gap: 12px 22px; justify-items: center; align-content: center; padding: 18px 10px;
  border-radius: 14px; background: linear-gradient(160deg, #2d3c4a, #6a7f8e); }
.pwa-app { display: grid; justify-items: center; gap: 6px; min-width: 0; width: 100%; }
.pwa-app .pwa-tile { width: 44px; height: 44px; }
.pwa-app.ghost .pwa-tile { background: rgba(255,255,255,.22); box-shadow: none; }
.pwa-app-name { color: #fff; font-size: 11px; width: 64px; text-align: center; justify-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.pwa-install { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-content: start; padding: 14px; border-radius: 12px; background: var(--surface);
  box-shadow: 0 6px 20px rgba(19,35,46,.14); border: 1px solid var(--line); }
.pwa-install strong { display: block; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.pwa-install small { display: block; font-size: 12px; overflow-wrap: anywhere; }
.pwa-install-btns { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.pwa-phone { flex: 1; min-height: 170px; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; border: 4px solid #1b2328; background: #1b2328; }
.pwa-status { height: 14px; flex: none; }
.pwa-splash { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; border-radius: 0 0 10px 10px; }
.pwa-splash small { font-size: 12px; }
.pwa-how summary { cursor: pointer; font-weight: 500; color: var(--primary-text); }
.pwa-how ul { margin: 10px 0 8px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
@media (max-width: 760px) { .pwa-preview { grid-template-columns: 1fr; } .pwa-home { padding: 14px; } }
.offline-page { text-align: center; max-width: 520px; }
.offline-page .lead { margin-left: auto; margin-right: auto; }
.offline-icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--primary-text); }
.pwa-ios { position: fixed; inset: auto 12px 12px; z-index: 90; max-width: 420px; margin: 0 auto; padding: 16px 18px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(19,35,46,.22); }
.pwa-ios p { margin: 6px 0 12px; font-size: 14px; }
.warn-text { color: var(--warn); }
.menu-pop [hidden], .pwa-ios[hidden] { display: none; }
/* ---------- Sign-offs and drums waiting for a co-sign ---------- */
.cosign-callout { margin-bottom: 20px; border-color: #e7b65c; background: #fffaf0; }
.cosign-callout-head { display: flex; gap: 14px; align-items: flex-start; padding: 16px 20px 6px; flex-wrap: wrap; }
.cosign-callout-head > div { flex: 1; min-width: 220px; }
.cosign-callout h2 { font-size: 17px; margin: 0 0 2px; }
.cosign-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); flex: none; }
.cosign-ico svg { width: 20px; height: 20px; }
.cosign-list { list-style: none; margin: 0; padding: 4px 20px 14px; display: grid; gap: 6px; }
.cosign-list a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; border: 1px solid #f0dcb0; background: #fff; }
.cosign-list a:hover { border-color: var(--warn); }
.drum-filters > .pill-row { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.toggle-pill.pill-warn.on { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.toggle-pill.pill-warn i { background: var(--warn); }
.drum.cosign { border-color: #e7b65c; box-shadow: inset 0 0 0 1px #e7b65c; }
.drum.mixing { border-color: #9cc3df; }
.drum-wait { color: var(--warn); font-size: 13px; }
.drum.mixing .drum-wait { color: var(--info); }
.signoffs .sub { display: block; }
.overdue-band { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 20px; border-color: #f0b4ad; background: var(--bad-bg); color: var(--ink); text-decoration: none; }
.overdue-band .muted { margin-left: auto; }
.pay-form { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 10px; align-items: end; justify-content: stretch; }
@media (max-width: 760px) { .pay-form { grid-template-columns: 1fr 1fr; } }
.price-lists { margin-bottom: 16px; flex-wrap: wrap; }
.price-lists .tab-aside { margin-left: auto; }
.terms-days { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.team-goal { margin-bottom: 0; }
.team-goal-body { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 24px; padding: 16px 20px 20px; align-items: start; }
.team-goal-nums { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.team-goal-progress .tbar { height: 26px; }
@media (max-width: 760px) { .team-goal-body { grid-template-columns: 1fr; } }
.bulk-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.bulk-bar .check { align-items: center; }
.bulk-bar .bulk-go { margin-left: auto; display: flex; gap: 8px; }
.plist th.sel, .plist td.sel { width: 36px; padding-right: 0; }
.plist td.sel input { width: 18px; height: 18px; accent-color: var(--focus); }
.plist tr.picked td { background: var(--surface-2); }
.wrong-branch { display: grid; gap: 8px; margin: -6px 0 18px; } .wrong-branch .btn { width: 100%; }
.danger-text { color: var(--bad); }
.archive-anyway { align-items: center; flex-wrap: wrap; margin: -6px 0 18px; background: var(--bad-bg); }
.archive-anyway span { flex: 1 1 320px; }
.restore-all { align-items: center; flex-wrap: wrap; margin: -6px 0 18px; }
.restore-all > span:first-child { flex: 1 1 320px; }
.restore-all-go { display: flex; gap: 8px; flex-wrap: wrap; }
/* Queue numbers (client, Oct 23 2026): big on the release queue */
.queue-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.queue-head .queue-name { display: block; margin: 0; }
.queue-time { display: block; color: var(--muted); font-size: 13px; }
.queue-no { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 64px; padding: 0 10px; border-radius: 14px;
  background: var(--main, #0095da); color: #fff; font-size: 38px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; flex: none; }
.queue-no.sm { min-width: 34px; height: 34px; font-size: 18px; border-radius: 8px; }
.queue-no.lg { min-width: 56px; height: 56px; font-size: 32px; vertical-align: middle; }
.held-list { list-style: none; margin: 0; padding: 8px 28px 16px; }
.held-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.terms-approval { border-color: var(--warn, #b54708); }
.inline-decline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-decline .input { min-width: 220px; }
.reorder-kpis .kpi.on { border-color: var(--main); box-shadow: inset 0 0 0 1px var(--main); }
.reorder-kpis .kpi.warnk .k-val { color: var(--warn, #b54708); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .g-3 { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
/* Customer photo and ID (Oct 23 2026) */
.cust-files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.cust-files figure { margin: 0; }
.cust-files img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.cust-files figcaption { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.import-sum p { margin: 0; }
/* New sale: a product without sizes keeps its (empty) Size cell, so Qty, Price and Amount stay under their headings */
@media (min-width: 1100px) {
  td[data-sale-sizecell].hide { display: table-cell !important; }
  td[data-sale-sizecell].hide > * { display: none !important; }
}
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--ink); font-size: 14px; }
.checklist-t td.write-in { border-bottom: 1px solid var(--line-strong, #9aa5ae); min-height: 28px; height: 30px; }
.checklist-t td.center { text-align: center; }

/* Executive page (client, Oct 23 2026) */
.exec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.exec-tile { display: flex; flex-direction: column; gap: 6px; padding: 22px 26px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.exec-tile:hover { border-color: var(--line-strong); }
.exec-tile:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.exec-wide { grid-column: 1 / -1; }
.exec-grid > .card { margin-top: 0; }
.exec-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.exec-top .k-label { color: var(--ink-2); font-weight: 500; }
.exec-open { font-size: 13px; color: var(--main); white-space: nowrap; }
.exec-big { font-size: 44px; line-height: 1.1; font-weight: 500; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.exec-mid { font-size: 28px; line-height: 1.2; font-weight: 500; letter-spacing: -.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.exec-chg { margin-top: 8px; font-size: 14px; font-weight: 500; }
.exec-sales { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 28px; align-items: center; }
.exec-bars { padding: 0; }
.exec-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.exec-list li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 8px; }
.exec-list li:first-child { border-top: 0; padding-top: 0; }
.exec-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.exec-list .sub { display: block; font-size: 12.5px; color: var(--ink-3); }
.exec-list .v { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.exec-cat { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.exec-empty { margin-top: 8px; font-size: 14px; }
.exec-first td { font-weight: 500; }
.exec-meter { display: block; height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.exec-meter i { display: block; height: 100%; background: var(--main); }
@media (max-width: 1080px) { .exec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .exec-sales { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .exec-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } .exec-tile { padding: 18px; } .exec-big { font-size: 34px; } }

/* Schedule views and tags (client, Oct 23 2026) */
.sched-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sched-views { gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); flex-wrap: nowrap; }
.sched-views a { display: inline-flex; align-items: center; height: 42px; padding: 0 18px; text-decoration: none; color: var(--ink-2); font-weight: 500; border-right: 1px solid var(--line); }
.sched-views a:last-child { border-right: 0; }
.sched-views a.on { background: var(--ink); color: var(--surface); }
.sched-views a:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.sched-tagfilter .input { min-width: 220px; }
.sched-tags { font-size: 11.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.sched-tags::before { content: "@ "; color: var(--ink-3); }
.sched-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: hidden; }
.sched-mhead { padding: 10px; font: 500 11px var(--mono); letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.sched-mday { min-height: 112px; padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sched-mday:nth-child(7n) { border-right: 0; }
.sched-mday.out { background: var(--surface-2); }
.sched-mday.out .sched-mnum { color: var(--ink-3); }
.sched-mnum { align-self: flex-start; font-weight: 600; font-size: 13.5px; text-decoration: none; color: var(--ink); padding: 2px 7px; border-radius: 999px; }
.sched-mnum:hover { background: var(--surface-2); }
.sched-mday.today .sched-mnum { background: var(--main); color: #fff; }
.sched-mwd { display: none; }
.sched-mitem { display: block; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--tc) 12%, var(--surface)); border-left: 3px solid var(--tc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-mitem b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sched-mitem.on { outline: 2px solid var(--tc); }
.sched-mitem.done, .sched-mitem.cancelled { opacity: .6; }
.sched-mitem.cancelled { text-decoration: line-through; }
.sched-more { font-size: 12px; color: var(--primary-text); text-decoration: none; padding: 0 6px; }
.sched-minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 20px; }
.sched-minis.year { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sched-mini-h { display: block; font-weight: 600; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.sched-mini-h:hover { color: var(--primary-text); }
.sched-mini-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.sched-mini-w { font: 500 10px var(--mono); color: var(--ink-3); text-align: center; padding-bottom: 4px; }
.sched-mini-d { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 3px; border-radius: 6px; text-decoration: none; color: var(--ink-2); min-height: 34px; }
.sched-mini-d b { font-weight: 500; font-size: 12.5px; }
.sched-mini-d.has { background: var(--surface-2); color: var(--ink); }
.sched-mini-d.has b { font-weight: 600; }
.sched-mini-d:hover { outline: 1px solid var(--line-strong); }
.sched-mini-d.today b { color: #fff; background: var(--main); border-radius: 999px; padding: 0 5px; }
.sched-mini-d .dots { display: flex; gap: 2px; height: 6px; }
.sched-mini-d .dots i, .sched-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 999px; }
.sched-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }
.sched-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sched-legend i { width: 8px; height: 8px; }
.sched-agenda-h { font-size: 17px; margin-bottom: 10px; }
.sched-agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sched-agenda a { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); border-left: 3px solid var(--tc); background: color-mix(in srgb, var(--tc) 7%, var(--surface)); }
.sched-agenda a:hover { background: color-mix(in srgb, var(--tc) 14%, var(--surface)); }
.sched-agenda-d { font-weight: 600; font-size: 13.5px; }
.sched-agenda small { display: block; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.sched-agenda strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.sched-tagbox { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px 16px; margin-top: 16px; }
.sched-tagbox legend { padding: 0 6px; }
.sched-tagrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.sched-tagrow > .muted { width: 100%; }
.tagpick { position: relative; display: inline-flex; cursor: pointer; }
.tagpick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tagpick span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 14px; background: var(--surface); }
.tagpick small { color: var(--ink-3); font-size: 12px; }
.tagpick input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.tagpick input:checked + span small { color: inherit; opacity: .75; }
.tagpick input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.sched-people { margin-top: 12px; }
.sched-people summary { cursor: pointer; }
.sched-remind { margin-top: 14px; max-width: 280px; }
.sched-detail dd .sub { display: block; font-size: 12.5px; }
@media (max-width: 1100px) { .sched-minis.year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .sched-bar { flex-direction: column; align-items: stretch; }
  .sched-views a { flex: 1; justify-content: center; padding: 0 8px; }
  .sched-tagfilter .input { width: 100%; min-width: 0; }
  /* The month becomes a list of the days that have something */
  .sched-month { grid-template-columns: 1fr; }
  .sched-mhead, .sched-mday.out { display: none; }
  .sched-mday { min-height: 0; border-right: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sched-mday:not(:has(.sched-mitem)):not(.today) { display: none; }
  .sched-mwd { display: inline; font-weight: 400; color: var(--ink-2); }
  .sched-mnum { min-width: 70px; }
  .sched-mitem { white-space: normal; flex: 1 1 100%; font-size: 13.5px; padding: 6px 8px; }
  .sched-minis, .sched-minis.year { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 14px; }
  .sched-wrap.view-quarter:not(.has-sel) .sched-detail, .sched-wrap.view-year:not(.has-sel) .sched-detail { display: block; }
}
@media (max-width: 420px) { .sched-minis, .sched-minis.year { grid-template-columns: 1fr; } }
/* Month: the calendar takes the full width until an entry is picked; the year shows three months a row */
@media (min-width: 1101px) { .sched-wrap.view-month:not(.has-sel) { grid-template-columns: minmax(0, 1fr); } }
.sched-wrap.view-month:not(.has-sel) .sched-detail { display: none; }
.sched-minis.year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1500px) { .sched-minis.year { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sched-mday.out { background: var(--bg, #f6f8fa); }
.sched-mday.today .sched-mwd { color: inherit; }
.drum-mixer { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.drum-mixer .ico { width: 14px; height: 14px; }
.mixer-edit { margin-top: 14px; }
.mixer-edit summary { cursor: pointer; }

/* Remittance (client, Oct 30 2026) */
.rem-big { font-size: 34px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.rem-kpis .kpi .k-val { font-size: 26px; }
.tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--warn, #b54708); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.chk-mark summary { list-style: none; display: inline-flex; }
.chk-mark summary::-webkit-details-marker { display: none; }
.chk-form { display: grid; gap: 8px; margin-top: 10px; max-width: 320px; }
.chk-form .seg label { height: 38px; padding: 0 12px; font-size: 14px; }

/* Schedule: type filter, steps with a note, reopen, notes and activity (client, Nov 2 2026) */
.sched-tagfilter { display: flex; gap: 10px; flex-wrap: wrap; }
.sched-tagfilter #sched-type { min-width: 170px; }
a.sched-kpi { text-decoration: none; color: inherit; cursor: pointer; }
a.sched-kpi:hover { border-color: var(--tc); }
a.sched-kpi.on { outline: 2px solid var(--tc); outline-offset: -1px; }
.sched-stepform { margin-top: 16px; }
.sched-stepform .sched-actions { margin-top: 10px; }
.sched-reopen, .sched-cancel { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sched-reopen .input, .sched-cancel .input { flex: 1 1 160px; min-width: 0; }
.sched-log { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.sched-log h3 { font-size: 15px; margin-bottom: 10px; }
.sched-noteform { display: grid; gap: 8px; justify-items: start; margin-bottom: 14px; }
.sched-noteform textarea { width: 100%; }
.sched-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.sched-timeline li { position: relative; font-size: 13.5px; }
.sched-timeline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 999px; background: var(--line-strong, #9aa5ae); }
.sched-timeline li.k-note::before { background: var(--main); }
.sched-timeline li.k-close::before { background: var(--ok, #16794c); }
.sched-tl-head { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 12.5px; }
.sched-tl-head strong { color: var(--ink); font-weight: 600; }
.sched-tl-ev { color: var(--ink-2); margin-top: 2px; }
.sched-tl-note { margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); white-space: normal; overflow-wrap: anywhere; }
.k-close .sched-tl-note { background: color-mix(in srgb, var(--ok, #16794c) 10%, var(--surface)); }
.sched-tl-tag { display: block; font-size: 11.5px; font-weight: 600; color: var(--ok, #16794c); margin-bottom: 2px; }
.sched-detail dd .sub { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.sched-tagfilter .input { width: auto; }
@media (min-width: 761px) { .sched-tagfilter { flex-wrap: nowrap; } }
@media (max-width: 760px) { .sched-tagfilter { flex-direction: column; } .sched-tagfilter .input { width: 100%; } }
.home-rooms { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px 14px; margin-top: 16px; }
.home-rooms legend { padding: 0 6px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; margin-top: 8px; }
.home-grid label { display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
/* Repack steps (client, Nov 2 2026) */
.repack-steps { list-style: none; display: flex; gap: 0; margin: 0 0 20px; padding: 0; counter-reset: step; flex-wrap: wrap; }
.repack-steps li { counter-increment: step; flex: 1 1 0; min-width: 110px; padding: 10px 12px 10px 38px; position: relative; font-size: 13.5px; color: var(--ink-3); border-top: 3px solid var(--line); }
.repack-steps li::before { content: counter(step); position: absolute; left: 10px; top: 9px; width: 20px; height: 20px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; text-align: center; line-height: 20px; }
.repack-steps li.done { color: var(--ink-2); border-top-color: var(--ok, #16794c); }
.repack-steps li.done::before { content: "✓"; background: var(--ok, #16794c); color: #fff; }
.repack-steps li.now { color: var(--ink); font-weight: 600; border-top-color: var(--main); }
.repack-steps li.now::before { background: var(--main); color: #fff; }

/* Payment Tracker: follow-ups and payments forwarded to the cashier (client, Nov 3 2026) */
.sale-edit .kv { grid-template-columns: 120px minmax(0, 1fr); }
.followups { list-style: none; margin: 0; padding: 0; }
.followups li { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.followups li:last-child { border-bottom: 0; }
.followups .sub { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.report-row .sub { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.pt-age { display: inline-block; min-width: 0; }
.pt-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pt-row-late td:first-child { box-shadow: inset 3px 0 0 var(--bad, #c0392b); }
.pt-table td:first-child .mono { white-space: nowrap; }
.pt-table td:nth-child(4) { white-space: nowrap; }
@media (max-width: 760px) { .pt-row-late td:first-child { box-shadow: none; } }

/* Sales: Payments by method, beside the list (tap one to tally GCash, the bank…) */
.side-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; align-self: start; }
.side-stack > .card + .card { margin-top: 0; }
.pm-card .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pm-card .card-foot { justify-content: flex-start; }
.pm-card tr.pm-on td { background: var(--info-bg); }
.pm-card tr.pm-on td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.link-quiet { color: inherit; text-decoration: none; }
.link-quiet:hover { text-decoration: underline; }
.sales-main { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 1400px) {
  .sales-main { grid-template-columns: minmax(0, 1fr); }
  .sales-main .side-stack { order: -1; }
  .pm-card tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .pm-card tbody tr { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
  .pm-card tbody td { border-bottom: 0; }
}

/* ===== Display screens (TV / monitor at the branch): big type, no menu, refreshes itself ===== */
.ds-body { background: var(--bg); min-height: 100vh; overflow-x: hidden; }
.ds { min-height: calc(100vh - 4px); display: flex; flex-direction: column; padding: clamp(14px, 2.2vw, 36px); gap: clamp(12px, 1.8vw, 28px); }
.ds-head { display: flex; align-items: center; gap: clamp(10px, 1.4vw, 22px); }
.ds-logo { height: clamp(40px, 5vw, 76px); width: auto; }
.ds-title { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.ds-title strong { font-size: clamp(20px, 2.4vw, 40px); font-weight: 600; letter-spacing: -.01em; }
.ds-title span { color: var(--ink-2); font-size: clamp(14px, 1.4vw, 24px); }
.ds-clock { margin-left: auto; font: 500 clamp(22px, 3vw, 52px) var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.ds h2 { margin: 0 0 clamp(8px, 1vw, 16px); font-size: clamp(16px, 1.7vw, 30px); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.ds ul { list-style: none; margin: 0; padding: 0; }
.ds-empty { color: var(--ink-3); font-size: clamp(16px, 1.6vw, 28px); margin: 0; }
.ds-empty[hidden] { display: none; }
.ds-foot { text-align: center; color: var(--ink-2); font-size: clamp(14px, 1.5vw, 26px); }
/* Queue */
.ds-queue { flex: 1; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(12px, 1.8vw, 28px); }
.ds-ready, .ds-side > section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(14px, 1.8vw, 30px); }
.ds-side { display: flex; flex-direction: column; gap: clamp(12px, 1.8vw, 28px); }
.ds-side > section { flex: 1; }
.ds-ready { border-top: 6px solid var(--ok); }
.ds-ready h2 { color: var(--ok); }
.ds-ready ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(130px, 13vw, 240px), 1fr)); gap: clamp(10px, 1.2vw, 20px); }
.ds-ready .ds-num { background: var(--ok-bg); border-radius: var(--radius); padding: clamp(10px, 1.2vw, 20px) 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ds-ready .ds-num b { font: 700 clamp(56px, 7.5vw, 140px)/1 var(--font); color: var(--ok); font-variant-numeric: tabular-nums; }
.ds-num span { font-size: clamp(14px, 1.4vw, 26px); color: var(--ink); overflow-wrap: anywhere; }
.ds-num em { font-style: normal; font-size: clamp(11px, 1vw, 16px); color: var(--ink-3); }
.ds-small { display: flex; flex-wrap: wrap; gap: clamp(8px, 1vw, 16px); }
.ds-small .ds-num { min-width: clamp(70px, 7vw, 130px); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; display: flex; flex-direction: column; align-items: center; }
.ds-small .ds-num b { font: 700 clamp(30px, 3.4vw, 64px)/1.05 var(--font); font-variant-numeric: tabular-nums; }
.ds-small .ds-num span { font-size: clamp(12px, 1.1vw, 20px); color: var(--ink-2); }
.ds-num.new { animation: ds-call 1s ease-in-out 4; }
@keyframes ds-call { 50% { transform: scale(1.06); box-shadow: 0 0 0 6px var(--ok); } }
/* Drums */
.ds-drums { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(200px, 18vw, 320px), 1fr)); gap: clamp(10px, 1.2vw, 20px); }
.ds-drum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(12px, 1.3vw, 22px); display: flex; flex-direction: column; gap: 8px; }
.ds-drum-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ds-drum-top b { font: 700 clamp(24px, 2.4vw, 44px)/1 var(--mono); }
.ds-drum-top span { font-weight: 600; font-size: clamp(13px, 1.1vw, 20px); text-transform: uppercase; letter-spacing: .05em; }
.ds-drum-name { font-size: clamp(15px, 1.35vw, 24px); line-height: 1.25; min-height: 2.5em; }
.ds-bar { height: clamp(12px, 1.2vw, 22px); background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.ds-bar i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.ds-drum-l { color: var(--ink-2); font-size: clamp(14px, 1.2vw, 22px); }
.ds-drum-l strong { color: var(--ink); font-size: 1.25em; }
.ds-drum.low { border-color: var(--bad); }
.ds-drum.low .ds-bar i { background: var(--bad); }
.ds-drum.low .ds-drum-top span { color: var(--bad); }
.ds-drum.coming .ds-drum-top span { color: var(--info); }
/* Corner buttons: sound on, full screen; they hide once used */
.ds-tools { position: fixed; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.ds-tool { font: 500 13px var(--font); padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; opacity: .8; }
.ds-tool[hidden] { display: none; }
@media (max-width: 760px) {
  .ds-queue { grid-template-columns: 1fr; }
  .ds-clock { font-size: 20px; }
}
.display-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.select-search { margin-bottom: 8px; }
.select-search-note { margin: 4px 0 0; }

/* Admin → Roles and access */
table.ra th.ra-what { text-align: left; font-weight: 500; min-width: 220px; width: 30%; white-space: normal; color: var(--ink); position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.ra thead th.ra-what { z-index: 2; }
table.ra th.ra-role { text-align: center; font-size: 12px; line-height: 1.25; min-width: 84px; white-space: normal; vertical-align: bottom; padding-left: 6px; padding-right: 6px; }
table.ra td.ra-cell { padding-left: 6px; padding-right: 6px; }
table.ra td.ra-cell { text-align: center; }
table.ra td.ra-cell input { width: 18px; height: 18px; cursor: pointer; }
table.ra tr.ra-group th, table.ra tr.ra-group td { background: var(--surface-2); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding-top: 10px; padding-bottom: 10px; }
table.ra td.ra-changed, table.ra tr:hover td.ra-changed { box-shadow: inset 0 0 0 2px var(--warn); background: var(--warn-bg); }
table.ra-one th.ra-role { min-width: 120px; }
.ra-mark { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--warn-bg); box-shadow: inset 0 0 0 2px var(--warn); vertical-align: -1px; }
.ra-warn { background: var(--warn-bg); color: var(--warn); justify-content: flex-start; }

/* Import check: Fix this row */
.imp-fix { margin-top: 8px; }
.imp-fix > summary { list-style: none; display: inline-flex; cursor: pointer; }
.imp-fix > summary::-webkit-details-marker { display: none; }
.imp-fix[open] > summary { margin-bottom: 10px; }
.imp-fix-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); max-width: 900px; }
.imp-fix-field .input { width: 100%; min-width: 0; }
.imp-fix-field { min-width: 0; }
@media (max-width: 900px) { .imp-fix-form { grid-template-columns: minmax(0, 1fr); } }
.imp-fix-field .check { display: flex; gap: 6px; align-items: flex-start; margin-top: 4px; color: var(--ink-2); }
.imp-fix-actions { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.imp-fix-bar { position: sticky; bottom: 12px; z-index: 5; margin: 16px auto 0; max-width: 640px; display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 12px; background: var(--surface); box-shadow: 0 6px 24px rgba(0,0,0,.18); border: 1px solid var(--line); }
.imp-fix-bar[hidden] { display: none; }

/* Executive → Wastage: records behind a row, Admin deletes */
.waste-recs { margin-top: 6px; }
.waste-recs > summary { cursor: pointer; display: inline; }
.waste-recs ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; min-width: 420px; }
.waste-recs li { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.waste-del { display: flex; gap: 8px; flex-wrap: wrap; }
.waste-del .input { flex: 1 1 200px; min-width: 0; }

/* Live pages: a card that just came in flashes for a few seconds */
.live-new { animation: live-new 3s ease-out 1; }
@keyframes live-new { 0%, 40% { box-shadow: 0 0 0 3px var(--ok); } 100% { box-shadow: 0 0 0 0 transparent; } }
li.live-new { animation: live-new-li 3s ease-out 1; border-radius: 8px; }
@keyframes live-new-li { 0%, 40% { background: var(--ok-bg); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .live-new, li.live-new { animation: none; outline: 2px solid var(--ok); } }

/* Promos on New sale */
.promo-callout { background: var(--ok-bg); color: var(--ink); justify-content: flex-start; }
.sale-free { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.sale-free.hide { display: none; }
.sale-disc { display: flex; gap: 6px; align-items: center; margin-top: 6px; color: var(--ink-2); }
.sale-disc.hide { display: none; }
.sale-disc .input-sm { padding: 4px 8px; min-height: 0; height: 32px; width: 84px; text-align: right; }

/* Admin → Promos form: add by search */
.promo-add { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface-2); }
.promo-add-head { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.promo-add-q { flex: 1 1 320px; min-width: 0; }
.promo-add-pct { flex: 0 0 110px; }
.promo-matches { margin-top: 10px; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px 12px; }
.promo-matches .check { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.promo-matches .promo-all { border-bottom: 2px solid var(--line); }
.promo-one { margin-top: 12px; }
.promo-one > summary { cursor: pointer; }

/* Locations: Mains and Partners prices (Nov 27 2026) */
.partner-set { margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.partner-set legend { padding: 0 6px; }
.partner-set .check { align-items: flex-start; }
.mains-price { color: var(--ink-3); }
.below-cost { color: var(--bad); }
.input.is-bad { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.mp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; align-items: stretch; }
.mp-stats .card.mp-stat { padding: 12px 16px; margin: 0; }
.sale-disc input::-webkit-inner-spin-button, .sale-disc input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sale-disc input[type=number] { -moz-appearance: textfield; }

/* Package builder on New sale and orders (Nov 30 2026) */
.pkg-builder { margin-bottom: 16px; }
.pkg-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.pkg-pick { flex: 2 1 320px; min-width: 0; }
.pkg-pick select { flex: 1; min-width: 0; }
.pkg-budget { flex: 1 1 160px; }
.pkg-status { flex: 1 1 200px; display: flex; flex-direction: column; font-size: 15px; padding-bottom: 4px; }
.pkg-status span { font-size: 13px; }
.pkg-status.hint-ok span { color: var(--ok); }
.pkg-status.hint-bad, .pkg-status.hint-bad strong { color: var(--bad); }

/* Package builder page (Nov 30 2026) */
.pkgb-cats { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }
.pkgb-cat { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; }
.pkgb-cat span { font: 500 12px var(--mono, monospace); color: var(--ink-3); }
.pkgb-cat.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pkgb-cat.on span { color: rgba(255, 255, 255, .75); }
.pkgb-new { border-style: dashed; color: var(--ink-2); font-weight: 500; }
.pkgb-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.pkgb-sec .card-head { align-items: flex-start; }
.pkgb-sec-total { font-size: 17px; white-space: nowrap; }
.pkgb-t td { vertical-align: middle; }
.pkgb-name { width: 100%; min-width: 150px; }
.pkgb-name strong { display: block; }
.pkgb-on { width: 36px; }
.pkgb-on input { width: 20px; height: 20px; accent-color: var(--primary); }
.pkgb-row.is-off td:not(.pkgb-on):not(:last-child) { opacity: .45; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.stepper .btn { min-width: 36px; min-height: 40px; padding: 0; font-size: 18px; }
.stepper .input { width: 50px; border: 0; text-align: center; box-shadow: none; padding: 6px 2px; }
.pkgb-t td { padding-left: 8px; padding-right: 8px; }
.pkgb-t td.num { white-space: nowrap; }
.pkgb-add { display: flex; gap: 8px; justify-content: flex-start; }
.pkgb-add .input { flex: 1; max-width: 420px; }
.pkgb-sums div { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 2px 0; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  [data-print-area] .pkgb-row.is-off, [data-print-area] .pkgb-sec.is-empty { display: none; }
  [data-print-area] .stepper { border: 0; }
  [data-print-area] .stepper .btn { display: none; }
  [data-print-area] .pkgb-on { display: none; }
  [data-print-area] .grid.g-main { display: block; }
  [data-print-area] aside.card { margin-top: 12px; }
  [data-print-area] .input { border: 0; padding: 0; background: none; box-shadow: none; min-height: 0; height: auto; outline: 0; -webkit-appearance: none; appearance: none; }
  [data-print-area] .input::placeholder { color: transparent; }
  [data-print-area] aside.card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
  [data-print-area] aside.card > h2, [data-print-area] aside.card > .pkgb-sums, [data-print-area] aside.card > .sale-total, [data-print-area] aside.card > .pkg-status, [data-print-area] aside.card > p { grid-column: 1 / -1; }
  [data-print-area] [data-pkgb-new] { display: contents; }
  [data-print-area] .help:not(.pkg-status) { display: none; }
  [data-print-area] textarea.input { resize: none; min-height: 0; }
}
/* Release receipt acknowledgement (Nov 30 2026) */
.ack-box { margin-top: 20px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ack-box p { margin: 0 0 4px; }
.final-agree { align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.final-agree input { width: 20px; height: 20px; margin-top: 2px; }
