/* Copyright (c) 2026 Dow Furniture. Burl Home. All rights reserved. Proprietary and confidential: see LICENSE. */
/* Burl Home — touch-friendly POS UI in the Burl Home brand (Ink, Bone, Burl Amber; Sora + Figtree).
   Every tappable control is at least 48px tall (Burl Home kit; Apple asks for 44). */
/* App colors come from the Burl Home theme kit (burl-home.css, --bh-*). Status colors (green / amber / red / blue)
   and chart colors stay separate so meaning never depends on the brand palette. */
:root {
  --navy: var(--bh-primary); --navy-dark: var(--bh-primary-hover); --navy-deep: var(--bh-text);
  --sage: var(--bh-honey); --sage-soft: rgba(233,178,98,.20);
  --bg: var(--bh-bg); --panel: var(--bh-surface); --panel-2: #FBF8F2; --sidebar: var(--bh-surface);
  --ink: var(--bh-text); --muted: var(--bh-text-muted); --faint: #676E77; --line: var(--bh-border); --field: #ffffff; --field-line: #D6CCBC;
  --brand: var(--bh-primary); --brand-hover: var(--bh-primary-hover); --brand-soft: rgba(150,87,26,.09); --on-brand: var(--bh-on-primary);
  --nav-active: var(--bh-surface-muted); --focus: var(--bh-focus);
  --accent: #4E6B4A; --accent-soft: rgba(78,107,74,.13);
  --warn: #96571A; --warn-soft: rgba(233,178,98,.24); --bad: #B42318; --bad-soft: rgba(180,35,24,.10);
  --info: #3B6E99; --info-soft: rgba(59,110,153,.11);
  --radius: var(--bh-radius-md); --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24,34,46,.06), 0 4px 16px rgba(24,34,46,.06);
  --shadow-lg: var(--bh-shadow-raised), 0 24px 64px rgba(24,34,46,.18);
  --tap: 48px;               /* Burl Home kit: every touch control at least 48px */
  --font: var(--bh-font-body); --font-display: var(--bh-font-display);
  --mark-ring: var(--bh-ink); --mark-mid: var(--bh-amber); --mark-eye: var(--bh-amber);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --sage-soft: rgba(233,178,98,.14);
  --panel-2: #202B38; --faint: #8E99A6; --field: #1B2531; --field-line: #3A4859;
  --brand-soft: rgba(192,122,44,.16);
  --accent: #A9CFA4; --accent-soft: rgba(169,207,164,.14); --warn: #E9B262; --warn-soft: rgba(233,178,98,.16);
  --bad: #F4AAA2; --bad-soft: rgba(244,170,162,.14); --info: #8FB8DD; --info-soft: rgba(143,184,221,.15);
  --shadow: 0 1px 2px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px rgba(0,0,0,.7);
  --mark-ring: var(--bh-bone); --mark-eye: var(--bh-honey); color-scheme: dark;
}}
:root[data-theme="dark"] {
  --sage-soft: rgba(233,178,98,.14);
  --panel-2: #202B38; --faint: #8E99A6; --field: #1B2531; --field-line: #3A4859;
  --brand-soft: rgba(192,122,44,.16);
  --accent: #A9CFA4; --accent-soft: rgba(169,207,164,.14); --warn: #E9B262; --warn-soft: rgba(233,178,98,.16);
  --bad: #F4AAA2; --bad-soft: rgba(244,170,162,.14); --info: #8FB8DD; --info-soft: rgba(143,184,221,.15);
  --shadow: 0 1px 2px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px rgba(0,0,0,.7);
  --mark-ring: var(--bh-bone); --mark-eye: var(--bh-honey); color-scheme: dark;
}
:root[data-text="large"] { font-size: 112%; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-family: var(--font); }
body { margin: 0; background: var(--bg); color: var(--ink); display: flex; min-height: 100vh; font-size: 15px; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
a { color: var(--navy); }

/* ---------- sidebar ---------- */
.sidebar { width: 248px; flex-shrink: 0; height: 100vh; position: sticky; top: 0; padding: 16px 12px 12px; display: flex; flex-direction: column; overflow-y: auto;
  background: var(--sidebar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 14px; line-height: 1.15; font-weight: 700; }
.brand.bh-brand { flex-direction: column; align-items: flex-start; gap: 2px; text-decoration: none; color: var(--ink); }
.bh-brand .bh-row { display: flex; align-items: center; gap: 10px; }
.bh-brand .store { font-size: 12px; font-weight: 600; color: var(--muted); padding-left: 42px; }
/* Burl Home logo: the burl mark (drawn inline so it follows light/dark) + the Sora word mark */
.bh-mark { width: 32px; height: 32px; flex-shrink: 0; fill: none; stroke: var(--mark-ring); stroke-width: 7; }
.bh-mark .r2 { stroke: var(--mark-mid); } .bh-mark .eye { fill: var(--mark-eye); stroke: none; }
.bh-word { font-family: var(--font-display); font-size: 21px; letter-spacing: -.03em; line-height: 1; color: var(--ink); white-space: nowrap; }
.bh-word b { font-weight: 700; } .bh-word { font-weight: 300; }
.auth-brand.bh-brand .bh-word { font-size: 24px; } .auth-brand .bh-mark { width: 40px; height: 40px; }
h1, h2, .term-amt, .stat .v, .ns-total b, .change-amt, .big-price, .plan .amt { font-family: var(--font-display); }
h1, h2 { font-weight: 600; letter-spacing: -.02em; }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.logo { background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 14px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; letter-spacing: -.5px; flex-shrink: 0; }
.search-btn { display: flex; align-items: center; gap: 8px; margin: 0 4px 6px; padding: 0 10px; min-height: var(--tap); border-radius: 10px; border: none; background: var(--brand-soft); color: var(--muted); cursor: pointer; font: inherit; }
.search-btn kbd { margin-left: auto; font-family: var(--font); font-size: 12px; color: var(--faint); }
nav { display: flex; flex-direction: column; gap: 1px; }
nav .sec { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 4px; }
nav a { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 0 10px; min-height: var(--tap); border-radius: 10px; font-size: 15px; }
nav a svg { color: var(--navy); }
nav a:hover { background: var(--brand-soft); }
nav a.active { background: var(--nav-active); color: var(--brand); font-weight: 700; } nav a.active svg { color: var(--brand); }
nav a .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--faint); }
nav a .count.hot { background: var(--bad); color: #fff; border-radius: 999px; padding: 1px 7px; }
nav a.active .count { color: var(--muted); }
nav a .count.hot, nav a.active .count.hot { background: #B42318; color: #fff; }   /* (fixed red, so the number reads in light and dark) */
nav a .count:empty { display: none; }
.dt-mode { margin-top: 6px; font-size: 12px; padding: 8px 10px; border-radius: 10px; color: var(--muted); }
.copyright { font-size: 11px; color: var(--faint); padding: 6px 10px 0; line-height: 1.4; }
@media (max-width: 1000px) { .sidebar .copyright { display: none; } }
.user-chip { margin-top: auto; padding: 10px 6px 4px; border-top: 1px solid var(--line); }
.user-chip .who { display: flex; align-items: center; gap: 10px; }
.user-chip .who b { display: block; font-size: 14px; } .user-chip .who small { color: var(--muted); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sage); color: #1d1d1f; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.user-chip .actions { margin-top: 8px; gap: 6px; }
.user-chip .btn, .user-chip button { min-height: 36px; padding: 0 10px; font-size: 13px; background: transparent; }

/* ---------- page ---------- */
main { flex: 1; padding: 22px 32px 120px; min-width: 0; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin: 4px 0 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 .actions { margin-left: auto; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--panel); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .v { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
a.stat { text-decoration: none; color: inherit; display: block; } a.stat:hover { box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 28px 16px; text-align: center; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.hidden { display: none !important; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; height: var(--tap); }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--brand-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
tr.tot td { font-weight: 700; border-top: 2px solid var(--navy); background: var(--brand-soft); }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; font-size: 16px; padding: 0 12px; min-height: var(--tap); border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--field); color: var(--ink); width: 100%; }
textarea { padding: 10px 12px; min-height: 84px; resize: vertical; }
select { padding-right: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: var(--panel-2); color: var(--muted); }
input[type="checkbox"], input[type="radio"], input.check { width: 22px; height: 22px; min-height: 0; padding: 0; accent-color: var(--brand); vertical-align: middle; cursor: pointer; }
input[type="color"] { padding: 4px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
label > input, label > select, label > textarea { margin-top: 5px; }
label:has(> input.check) { display: flex; align-items: center; gap: 10px; min-height: var(--tap); color: var(--ink); font-size: 15px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
td input { min-height: 40px; }
td input.qty { width: 72px; } td input.price { width: 110px; }

/* ---------- buttons ---------- */
button, .btn { font: inherit; font-size: 15px; font-weight: 500; border: none; background: var(--brand-soft); color: var(--navy); padding: 0 16px; min-height: var(--tap); min-width: var(--tap);
  border-radius: 11px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: transform .08s, background .15s; }
button:hover, .btn:hover { background: rgba(59,72,117,.16); }
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .4; cursor: default; transform: none; }
button.primary, .btn.primary { background: var(--brand); color: var(--on-brand); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--brand-hover); }
button.dt { background: var(--accent); color: #fff; font-weight: 600; min-height: 50px; padding: 0 20px; font-size: 16px; }
button.dt:hover { filter: brightness(1.05); }
button.danger { color: var(--bad); background: var(--bad-soft); }
button.small { font-size: 14px; padding: 0 12px; }
button.link { background: none; color: var(--navy); padding: 0 6px; min-width: 0; font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button.link:disabled { opacity: 1; }
button.wide { width: 100%; min-height: 50px; font-size: 17px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input { max-width: 340px; }

/* ---------- badges & tags ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); text-transform: capitalize; }
.b-sent, .b-delivered, .b-Delivered, .b-resolved { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.b-not_sent, .b-open, .b-new { background: var(--info-soft); color: var(--info); box-shadow: none; }
.b-changed, .b-parts, .b-scheduled { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.b-error, .b-void { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; text-decoration: none; }
.tag-cust { background: var(--brand); color: var(--on-brand); }
.tag-stock { background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.tag-special { background: var(--sage); color: #1d1d1f; }

/* ---------- order editor ---------- */
.search-results { border-radius: var(--radius-sm); max-height: 320px; overflow: auto; margin-top: 6px; background: var(--panel); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.search-results div { padding: 0 12px; min-height: 48px; cursor: pointer; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.search-results div:hover { background: var(--brand-soft); }
.totals td { border: none; padding: 4px 8px; height: auto; }
.totals tr.grand td { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 10px; }
.dt-panel { box-shadow: 0 0 0 2px var(--sage), var(--shadow); }
.dt-panel .status { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.errors { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0; }
.errors ul { margin: 4px 0 0; padding-left: 18px; }
.ok-box { background: var(--accent-soft); color: var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0; }
pre.xml { background: #1c1c1e; color: #e3e8f2; padding: 14px; border-radius: var(--radius-sm); overflow: auto; max-height: 55vh; font-size: 12px; line-height: 1.45; }
.day-group h2 { display: flex; justify-content: space-between; align-items: center; }
.price-box { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; }
.price-box table td { border: none; padding: 3px 6px; height: auto; }
.price-box .big { font-size: 22px; font-weight: 700; color: var(--navy); }
.inline { display: flex; gap: 6px; } .inline select { width: 72px; flex-shrink: 0; }
.loc-cell { font-variant-numeric: tabular-nums; text-align: center; }
.loc-zero { color: var(--faint); opacity: .6; }
td select.loc { width: 170px; }
.sp-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.special-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.special-bar button { background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.special-bar button.neg b { color: var(--bad); }
.lockbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--brand); color: var(--on-brand); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.lockbar.open { background: var(--warn-soft); color: var(--warn); }
.lockbar button.primary { background: #fff; color: #1d1d1f; }
.lockbar.change { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); }
.lockbar.change button.primary { background: var(--bad); color: #fff; }
.lockbar.quote { background: var(--info-soft); color: var(--info); }
.lockbar.quote input { min-height: 36px; }
.split-box { border-radius: var(--radius-sm); padding: 12px; max-width: 520px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.split-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.split-total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.split-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.split-row select { flex: 1; }
.split-row .pct { display: flex; align-items: center; gap: 4px; width: 118px; }
.split-row .pct input { width: 90px; }
.change-box { margin-top: 12px; padding: 16px; border-radius: var(--radius); background: var(--bad-soft); text-align: center; box-shadow: inset 0 0 0 2px var(--bad); }
.change-amt { font-size: 38px; font-weight: 700; color: var(--bad); margin: 4px 0 10px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.change-hint { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 8px; font-size: 14px; }
.change-hint b { font-size: 16px; }

/* ---------- tabs & chips & segmented ---------- */
.tabs { display: inline-flex; gap: 2px; flex-wrap: wrap; margin-bottom: 16px; background: var(--line); border-radius: 12px; padding: 3px; }
.tab { background: none; border-radius: 9px; padding: 0 16px; min-height: 40px; font-weight: 500; color: var(--ink); }
.tab:hover { background: rgba(255,255,255,.35); }
.tab.on { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; color: var(--ink); }
a.tab { text-decoration: none; display: inline-flex; }
.seg { display: inline-flex; background: var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; color: var(--ink); border-radius: 9px; min-height: 40px; padding: 0 16px; font-weight: 500; }
.seg button.on { background: var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { border-radius: 999px; padding: 0 16px; min-height: var(--tap); font-weight: 500; background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.chip small { color: var(--muted); margin-left: 4px; font-weight: 400; }
.chip.small-chip { font-size: 14px; }
.chip.on, .chip.small-chip.on { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.chip.on small { color: rgba(255,255,255,.8); }
.spsum { margin: -2px 0 12px; font-size: 15px; color: var(--muted); } .spsum b { color: var(--ink); }

/* ---------- grouped lists (iOS Settings style) ---------- */
.group-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 22px 4px 7px; font-weight: 500; }
.group { background: var(--panel); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; position: relative; }
.li + .li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.li.tap { cursor: pointer; } .li.tap:hover { background: var(--panel-2); } .li.tap:active { background: var(--brand-soft); }
.li .main { flex: 1; min-width: 0; } .li .main b { display: block; font-weight: 600; font-size: 16px; } .li .main small { color: var(--muted); font-size: 14px; }
.li .end { text-align: right; } .li .end b { display: block; font-variant-numeric: tabular-nums; } .li .end small { color: var(--muted); font-size: 13px; }
.li .chev { color: var(--faint); }
.li input, .li select { border: none; background: transparent; padding: 0; min-height: 40px; }
.li input:focus, .li select:focus { outline: none; }
.li label { margin: 0; flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.navy { background: var(--brand-soft); color: var(--navy); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill svg.i { width: 14px; height: 14px; }
.check-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; flex-shrink: 0; }
.check-dot svg.i { width: 16px; height: 16px; }
.field { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: var(--radius); padding: 0 14px; min-height: 54px; box-shadow: var(--shadow); }
.field svg.i { color: var(--faint); }
.field input { flex: 1; border: none; outline: none; background: none; font-size: 18px; min-height: 52px; padding: 0; }
.field input:focus { outline: none; }
.stepper { display: inline-flex; align-items: center; background: var(--bg); border-radius: 11px; }
.stepper button { width: var(--tap); background: none; font-size: 22px; color: var(--navy); padding: 0; }
.stepper span { min-width: 30px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- sheets (modal) ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.34); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; animation: fadeIn .2s; }
.modal-card { background: var(--panel); border-radius: 18px; padding: 22px; width: min(760px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: sheetIn .28s cubic-bezier(.2,.9,.3,1.1); }
.modal-card.narrow { width: min(460px, 100%); }
.modal-card h2 { font-size: 20px; }
.modal-card .sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-card .sheet-actions.stack { flex-direction: column-reverse; } .modal-card .sheet-actions.stack button { width: 100%; min-height: 50px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ---------- spotlight (⌘K) ---------- */
.spot { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 55; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: fadeIn .15s; }
.spot-card { width: min(640px, 100%); background: var(--panel); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: sheetIn .2s; }
.spot-field { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.spot-field svg.i { color: var(--faint); width: 22px; height: 22px; }
.spot-field input { border: none; font-size: 20px; min-height: 60px; padding: 0; background: none; }
.spot-field input:focus { outline: none; }
.spot-res { max-height: 56vh; overflow: auto; padding: 6px 0; }
.spot-res .lbl { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 10px 18px 4px; }
.spot-res .li { min-height: 50px; padding: 6px 18px; cursor: pointer; } .spot-res .li + .li::before { display: none; }
.spot-res .li.sel { background: var(--nav-active); color: var(--ink); } .spot-res .li.sel small { color: var(--muted); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: rgba(30,30,32,.95); color: #fff; padding: 12px 14px 12px 18px; border-radius: 14px; z-index: 60;
  max-width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 14px; animation: toastIn .25s; }
.toast.err { background: #c4161c; } .toast.ok { background: #1f7a36; }
.toast button { background: rgba(255,255,255,.18); color: #fff; min-height: 36px; font-weight: 600; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ---------- New Sale ---------- */
.ns { max-width: 880px; padding-bottom: 40px; }
.ns-steps { display: flex; gap: 6px; margin: 2px 0 22px; }
.ns-step { flex: 1; background: none; padding: 0; text-align: left; display: block; min-height: var(--tap); border-radius: 0; color: var(--faint); }
.ns-step:hover { background: none; } .ns-step:active { transform: none; }
.ns-step .bar { height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.ns-step.done .bar, .ns-step.on .bar { background: var(--brand); }
.ns-step span { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; }
.ns-step.on span { color: var(--ink); font-weight: 600; } .ns-step.done span { color: var(--muted); }
.ns-bar { position: fixed; left: 248px; right: 0; bottom: 0; z-index: 30; padding: 12px 32px calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 14px;
  background: var(--sidebar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); }
.ns-total small { display: block; color: var(--muted); font-size: 13px; } .ns-total b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ns-bar .go { margin-left: auto; min-width: 230px; min-height: 52px; font-size: 17px; border-radius: 13px; }
.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.method { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); border-radius: var(--radius); padding: 16px; min-height: 88px; text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; white-space: normal; border: 2px solid transparent; }
.method:hover { background: var(--panel); border-color: var(--brand-soft); }
.method svg.i { color: var(--navy); width: 24px; height: 24px; }
.method small { color: var(--muted); font-weight: 400; }
.method.on { border-color: var(--brand); background: var(--brand-soft); }
.bigamount { font-size: 46px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-align: center; padding: 8px 0 2px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 360px; margin: 12px auto 0; }
.keypad button { min-height: 58px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); font-size: 24px; font-weight: 400; }
.quick { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.change-line { text-align: center; margin-top: 12px; font-size: 17px; } .change-line b { color: var(--accent); font-size: 24px; }
.done { text-align: center; padding: 36px 0; }
.big-check { width: 92px; height: 92px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 0 auto 18px; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.big-check svg.i { width: 50px; height: 50px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.done h2 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; } .done p { color: var(--muted); margin: 0 0 20px; font-size: 16px; line-height: 1.5; }
.done .actions { justify-content: center; }
.note { color: var(--faint); font-size: 13px; margin: 8px 4px 0; }

/* ---------- New Sale (one page) ---------- */
.sale { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); gap: 0 18px; align-items: start; max-width: 1280px; }
.sale-title { grid-column: 1 / -1; }
.sale-main { min-width: 0; }
.sale-side { position: sticky; top: 16px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; }
.sale .card { padding: 16px 18px; }
.sale-lines { margin-top: 12px; border-top: 1px solid var(--line); }
.sale-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 100px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sale-line .main { cursor: pointer; min-width: 0; } .sale-line .main b { display: block; font-weight: 600; } .sale-line .main small { color: var(--muted); font-size: 13px; }
.sale-line .ext { text-align: right; font-variant-numeric: tabular-nums; }
.price-cell { display: flex; gap: 4px; align-items: center; }
.price-in { width: 108px; text-align: right; }
.price-in.below { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad-soft); }
button.adj { min-width: 0; padding: 0 10px; font-size: 13px; font-weight: 600; }
td button.adj { margin-left: 4px; }
.item-search { display: grid; grid-template-columns: minmax(0, 1fr) 190px 170px; gap: 8px; align-items: center; }
.item-search select { min-height: 54px; border-radius: var(--radius); box-shadow: var(--shadow); border: none; background: var(--panel); }
.result-list { max-height: 360px; overflow-y: auto; }
.line-extra { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; margin-top: -2px; }
.line-extra .det { flex: 1; min-height: 40px; font-size: 14px; }
.so-chk { display: flex; align-items: center; gap: 8px; margin: 0; min-height: 40px; padding: 0 12px; border-radius: 10px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-size: 14px; white-space: nowrap; cursor: pointer; }
.so-chk.on { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); font-weight: 600; }
@media (max-width: 760px) { .item-search { grid-template-columns: 1fr 1fr; } .item-search .field { grid-column: 1 / -1; } .line-extra { flex-wrap: wrap; } }
.line-det { display: block; font-size: 13px; color: var(--ink); opacity: .8; font-style: italic; margin-top: 2px; }
.side-card { padding: 16px; }
.side-card .totals td { padding: 5px 0; }
.side-card .totals input, .side-card .totals select { min-height: 38px; }
.side-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin: 4px 0 6px; }
.disc-in { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.disc-in input { width: 92px; text-align: right; }
.seg.mini { padding: 2px; } .seg.mini button { min-height: 44px; padding: 0 10px; font-size: 14px; }
.pay-methods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pm { flex-direction: column; gap: 2px; min-height: 58px; padding: 6px 2px; background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; white-space: normal; }
.pm svg.i { color: var(--navy); } .pm.on { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); font-weight: 600; }
.go-btn { width: 100%; min-height: 54px; font-size: 16px; white-space: normal; line-height: 1.25; padding: 6px 14px; }
.ns-preview { margin-top: 10px; min-height: 22px; }
@media (max-width: 1060px) { .sale { grid-template-columns: 1fr; } .sale-side { position: static; } }
@media (max-width: 640px) { .sale-line { grid-template-columns: 1fr auto; } }

/* ---------- charts (validated categorical palette; dark mode has its own steps) ---------- */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-other: #9a9893; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-other: #6f6e69; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-other: #6f6e69; }
.pie-wrap { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.pie { width: 240px; height: 240px; flex-shrink: 0; }
.pie path { stroke: var(--panel); stroke-width: 2; transition: opacity .15s; cursor: default; }
.pie:hover path { opacity: .55; } .pie path:hover { opacity: 1; }
.pie text { font-size: 13px; font-weight: 600; fill: #fff; pointer-events: none; }
.legend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 240px; }
.legend li { display: flex; align-items: center; gap: 10px; min-height: 36px; border-bottom: 1px solid var(--line); }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend .nm { flex: 1; color: var(--ink); } .legend .amt { font-variant-numeric: tabular-nums; color: var(--ink); } .legend .pc { width: 56px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.viz-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--panel); color: var(--ink); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.bar-cell { position: relative; min-width: 140px; }
.bar-cell span { display: block; height: 10px; border-radius: 0 4px 4px 0; background: var(--series-1); }
.rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 28px; }

/* ---------- service ---------- */
.prio { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.prio button { min-width: 0; padding: 0; background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.prio button.on { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.prio button.on.hi { background: var(--bad); }
.prio-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.prio-pill { display: inline-grid; place-items: center; min-width: 30px; height: 26px; border-radius: 8px; font-weight: 700; font-size: 13px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.prio-pill.hi { background: var(--bad); color: #fff; box-shadow: none; } .prio-pill.mid { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo button { position: absolute; top: 4px; right: 4px; min-height: 32px; min-width: 32px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; }
.photo-add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--field-line); display: grid; place-items: center; color: var(--navy); cursor: pointer; font-weight: 600; text-align: center; padding: 6px; }
.photo-add input { display: none; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: none; }
.timeline small { color: var(--muted); display: block; margin-top: 2px; }

/* ---------- misc carried over ---------- */
.logo-preview { border: 1px dashed var(--field-line); border-radius: var(--radius-sm); min-height: 90px; display: grid; place-items: center; padding: 10px; background: #fff; }
.logo-preview img { max-height: 110px; max-width: 100%; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.brand-card { border-radius: var(--radius-sm); padding: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.ft-like { font-size: 22px; font-weight: 800; color: var(--navy); text-transform: uppercase; text-align: center; }
.filters select { max-width: 210px; }
.big-price { font-size: 32px; font-weight: 700; color: var(--navy); margin: 4px 0 12px; }
#cTbl tr.uncounted td { background: var(--warn-soft); }
#cTbl .cQty { font-weight: 800; }

/* ---------- sign-in ---------- */
body.signed-out .sidebar, body.signed-out main, body.signed-out .mbar, body.signed-out .tabbar { display: none !important; }
.auth { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: var(--bg); overflow: auto; z-index: 40; }
.auth-card { background: var(--panel); border-radius: 20px; padding: 32px; width: min(440px, 100%); box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 22px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; font-size: 18px; line-height: 1.15; font-weight: 700; }
.auth-brand small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.auth-logo { display: block; max-height: 90px; max-width: 70%; margin: 0 auto 16px; }
.code-input { font-size: 26px !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; min-height: 56px !important; }
.steps { padding-left: 18px; } .steps li { margin-bottom: 14px; }
.qr { margin: 10px 0; min-height: 40px; } .qr img, .qr canvas { border: 8px solid #fff; box-shadow: 0 0 0 1px var(--line); border-radius: 8px; }
code.key { display: inline-block; font-size: 15px; background: var(--brand-soft); padding: 6px 10px; border-radius: 8px; letter-spacing: .08em; margin-top: 6px; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 14px; }
.codes code { font-size: 16px; background: var(--brand-soft); padding: 8px 10px; border-radius: 8px; text-align: center; letter-spacing: .06em; }

.inv-tools { margin: -4px 0 12px; align-items: center; }
.inv-tools .show-all { margin: 0 0 0 auto; display: flex; gap: 8px; align-items: center; white-space: nowrap; font-size: 14px; color: var(--muted); }
.cost-reveal { margin: 10px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }
.cost-reveal summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; color: var(--muted); }
.cost-reveal[open] summary { color: var(--ink); }
@media (max-width: 700px) {
  /* phones: one swipeable row each, so the list starts higher on the screen */
  #locBtns, #catBtns, .inv-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 2px; }
  #locBtns::-webkit-scrollbar, #catBtns::-webkit-scrollbar, .inv-tools::-webkit-scrollbar { display: none; }
  #locBtns > *, #catBtns > *, .inv-tools > * { flex-shrink: 0; white-space: nowrap; }
  .inv-tools .show-all { margin-left: 4px; }
}

/* ---------- iPad portrait / narrow: a slimmer sidebar, names still spelled out ---------- */
.mbar, .tabbar, .menu-scrim, .menu-head { display: none; }
@media (min-width: 701px) and (max-width: 1000px) {
  .sidebar { width: 200px; padding: 14px 8px 10px; }
  .search-btn kbd, .dt-mode, .bh-brand .store { display: none; }
  .bh-word { font-size: 18px; } .bh-brand .bh-mark { width: 28px; height: 28px; }
  nav a { font-size: 14px; gap: 8px; padding: 0 8px; } nav .sec { padding: 10px 8px 2px; }
  main { padding: 18px 20px 120px; } .ns-bar { left: 200px; padding-left: 20px; padding-right: 20px; }
}

/* ---------- phone: top bar, bottom tabs, sidebar as a full menu ---------- */
@media (max-width: 700px) {
  :root { --tabbar-h: calc(62px + env(safe-area-inset-bottom)); }
  body { flex-direction: column; }
  .mbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 35; padding: calc(4px + env(safe-area-inset-top)) 8px 4px;
    background: var(--sidebar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
  .mbar-btn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px; border: none; border-radius: 10px; background: var(--brand-soft); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
  .mbar-btn svg { color: var(--navy); }
  .mbar-brand { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
  .mbar { background: var(--bh-topbar); border-bottom-color: transparent; }
  .mbar .bh-mark { width: 26px; height: 26px; --mark-ring: var(--bh-bone); --mark-eye: var(--bh-honey); }
  .mbar .bh-word { font-size: 18px; color: var(--bh-topbar-text); }
  .mbar-btn { background: var(--bh-topbar-field); color: var(--bh-topbar-text); } .mbar-btn svg { color: var(--bh-honey); }

  /* the sidebar becomes a slide-in menu showing every screen by name */
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 70; width: min(330px, 88vw); height: 100%; padding: calc(10px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-105%); transition: transform .25s cubic-bezier(.2,.9,.3,1); box-shadow: var(--shadow-lg); border-right: 1px solid var(--line); background: var(--panel); }
  body.menu-open .sidebar { transform: none; }
  .menu-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; } .menu-head b { font-size: 22px; }
  .menu-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.34); }
  body.menu-open .menu-scrim { display: block; animation: fadeIn .2s; }
  body.menu-open { overflow: hidden; }
  .sidebar .search-btn, .sidebar .bh-brand { display: none; }
  .sidebar nav a { font-size: 17px; min-height: 50px; }
  .sidebar .copyright { display: block; }

  /* bottom tabs: icon over a spelled-out name */
  .tabbar { display: flex; flex-direction: row; gap: 2px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 34; height: var(--tabbar-h); padding: 4px 4px env(safe-area-inset-bottom);
    background: var(--sidebar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 0 2px; border-radius: 10px;
    text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; }
  .tabbar a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabbar a svg { color: inherit; width: 24px; height: 24px; }
  .tabbar a.active { color: var(--brand); background: var(--nav-active); }

  main { padding: 14px 16px calc(var(--tabbar-h) + 100px); } h1 { font-size: 26px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .li { padding: 10px 12px; } .li .end { max-width: 36%; } .li .end small { font-size: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat { padding: 14px; } .stat .v { font-size: 22px; }
  .ns-bar { left: 0; bottom: var(--tabbar-h); padding: 10px 16px; } .ns-bar .go { min-width: 0; flex: 1; } .ns-total b { font-size: 22px; }
  .toast { bottom: calc(var(--tabbar-h) + 16px); }
  .modal { align-items: flex-end; padding: 0; } .modal-card { border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .prio { grid-template-columns: repeat(5, 1fr); }
}
@media print {
  .sidebar, .mbar, .tabbar, .menu-scrim, .no-print, .dt-panel, .ns-bar, .toast { display: none !important; }
  body { background: #fff; color: #000; } main { padding: 0; } .card { box-shadow: none; }
}

/* ---------- list calendar (Sales Orders, Quotes) ---------- */
.dp-wrap { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.dp-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.dp-btn.on { background: var(--nav-active); color: var(--brand); font-weight: 700; } .dp-btn.on svg { color: var(--brand); }
.dp-x { min-width: var(--tap); padding: 0; font-size: 20px; background: none; color: var(--muted); }
.dp-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; width: min(340px, calc(100vw - 32px)); padding: 14px; border-radius: 16px;
  background: var(--panel); box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: fadeIn .15s; }
.dp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; } .dp-head b { font-size: 16px; }
.dp-nav { min-width: var(--tap); padding: 0; font-size: 22px; background: none; color: var(--ink); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow span { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); padding: 2px 0 4px; }
.dp-day { min-height: var(--tap); padding: 2px 0; border-radius: 10px; background: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.1; }
.dp-day b { font-weight: 600; font-size: 15px; } .dp-day small { font-size: 10px; font-weight: 700; color: var(--brand); min-height: 11px; }
.dp-day:hover { background: var(--brand-soft); }
.dp-day.today b { text-decoration: underline; text-underline-offset: 3px; }
.dp-day.in { background: var(--nav-active); border-radius: 0; } .dp-day.edge { background: var(--brand); color: var(--on-brand); border-radius: 10px; } .dp-day.edge small { color: var(--on-brand); }
.dp-day.anchor { box-shadow: 0 0 0 2px var(--brand) inset; }
.dp-hint { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.dp-foot { display: flex; justify-content: space-between; align-items: center; }
.list-sum { margin: 0 0 10px; color: var(--muted); font-size: 14px; } .list-sum b { color: var(--ink); }

/* ---------- card terminal window ---------- */
.term-box { text-align: center; display: grid; gap: 6px; justify-items: center; padding: 6px 0; }
.term-box h2 { margin: 0; font-size: 22px; }
.term-box p { margin: 0 0 6px; max-width: 34ch; }
.term-amt { font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.term-approved h2 { color: var(--good, var(--accent)); }
.term-declined h2, .term-error h2 { color: var(--bad); }
.term-unknown h2, .term-cancelled h2 { color: var(--warn); }
.term-spin { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: termspin .9s linear infinite; margin: 6px 0 10px; }
@keyframes termspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .term-spin { animation-duration: 3s; } }
.term-pick { width: 100%; }
.card-tries { margin-top: 8px; font-size: 13px; } .card-tries summary { cursor: pointer; color: var(--muted); min-height: var(--tap); display: flex; align-items: center; }
.tax-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; font-weight: 400; }
.tax-row { text-align: right; } .tax-row .tax-ctl { justify-content: flex-end; }
.rep-pick { display: block; max-width: 460px; margin: 0 0 14px; } .rep-pick select { font-size: 17px; font-weight: 600; min-height: 48px; }

/* ---------- Today: personal tiles ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
.dash-tile { min-width: 0; } .dash-tile.wide { grid-column: 1 / -1; }
.dash-tile > .card, .dash-tile > .stats { margin-bottom: 16px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.goal-head h2 { margin: 0; } .goal-head span { font-variant-numeric: tabular-nums; }
.goal-bar { position: relative; height: 14px; border-radius: 999px; background: var(--brand-soft); margin: 12px 0 8px; overflow: visible; }
.goal-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--brand); max-width: 100%; }
.goal-bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; border-radius: 2px; }
.goal-sub { font-size: 13px; }
.qlinks { display: flex; flex-wrap: wrap; gap: 8px; } .qlinks .btn { text-decoration: none; }
.tile-list { display: grid; gap: 4px; } .tile-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.link-row { gap: 8px; margin-bottom: 6px; } .link-row .inline { display: flex; gap: 6px; } .link-row input { min-width: 0; }

/* ---------- Returns: pick the item ---------- */
.ret-list { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; margin: 4px 0 12px; }
.ret-item { display: grid; justify-items: start; justify-content: stretch; gap: 2px; text-align: left; width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: 10px; background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font: inherit; cursor: pointer; }
.ret-item small { color: var(--muted); font-size: 13px; }
.ret-item.on { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-soft); }
.ret-loc { min-height: 40px; font-size: 14px; max-width: 100%; }

/* ---------- In Stock on phones: one card per item instead of a wide table ---------- */
.stock-cards { display: none; }
@media (max-width: 700px) {
  #spRes table { display: none; }
  #spRes .card { padding: 14px; }
  .stock-cards { display: grid; gap: 8px; }
  #spRes .table-wrap { overflow: visible; }
  .stock-card { display: grid; gap: 10px; min-width: 0; padding: 12px; border-radius: 12px; background: var(--panel-2);
    box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); cursor: pointer; }
  .stock-card:active { background: var(--brand-soft); }
  .sc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .sc-name { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; } .sc-name b { font-size: 16px; line-height: 1.25; }
  .sc-name small { color: var(--muted); font-size: 12px; line-height: 1.35; }
  .sc-price { font-family: var(--font-display); font-weight: 600; font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .sc-locs { display: grid; grid-template-columns: repeat(auto-fit, minmax(54px, 1fr)); gap: 5px; }
  .sc-loc { display: grid; gap: 1px; align-content: space-between; padding: 6px 7px; border-radius: 8px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
  .sc-loc small { font-size: 10px; color: var(--muted); line-height: 1.2; overflow-wrap: anywhere; }
  .sc-loc b { font-size: 17px; font-variant-numeric: tabular-nums; color: var(--faint); }
  .sc-loc.has b { color: var(--ink); } .sc-loc.total { background: var(--brand-soft); box-shadow: none; } .sc-loc.total b { color: var(--ink); }
}
.spo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1.5px dashed var(--sage); }
.loc-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto auto; grid-template-areas: "code name name name name" ". kind up dn del" ". tax tax tax tax";
  gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.loc-row .lCode { grid-area: code; } .loc-row .lName { grid-area: name; } .loc-row .lKind { grid-area: kind; }
.loc-row .lTax { grid-area: tax; margin: 0; font-size: 14px; display: flex; gap: 8px; align-items: center; } .loc-row .lTax input { max-width: 110px; }
.loc-row .lUp { grid-area: up; } .loc-row .lDn { grid-area: dn; } .loc-row .lDel { grid-area: del; }
.loc-row input[readonly] { background: var(--panel-2); color: var(--muted); text-align: center; font-weight: 700; }

/* Screen saver: blurs whatever is open after idle minutes (Settings → Store) */
body.saver-on > *:not(#saver) { filter: blur(18px) saturate(.8); pointer-events: none; user-select: none; }
#saver { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; cursor: pointer;
  background: color-mix(in srgb, var(--bg, #F6F2EA) 72%, transparent); backdrop-filter: blur(22px) saturate(.85); -webkit-backdrop-filter: blur(22px) saturate(.85);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
#saver .saver-card { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--ink); }
#saver .bh-mark { width: 72px; height: 72px; }
#saver .saver-time { font: 600 56px/1 var(--bh-font-display, "Sora", sans-serif); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
#saver .saver-store { font-weight: 600; font-size: 18px; }
#saver .saver-hint { color: var(--muted, #5E6670); font-size: 15px; margin-top: 8px; }
@media (prefers-reduced-motion: no-preference) { #saver { animation: saverIn .35s ease-out; } @keyframes saverIn { from { opacity: 0; } } }

/* Leads */
.lead-list { display: grid; gap: 12px; }
.lead.new { border-left: 4px solid var(--bad, #B42318); }
.lead.in_progress { border-left: 4px solid var(--warn, #96571A); }
.lead-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lead-name { font-size: 18px; }
.lead-product { font-weight: 600; margin-top: 6px; }
.lead-msg { white-space: pre-wrap; margin: 6px 0; max-width: 70ch; }
.lead-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.lead-actions { margin-top: 10px; flex-wrap: wrap; }
.lead-card .lead-mini { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.lead-card .lead-mini .muted { grid-column: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card .lead-mini small { grid-row: 1 / span 2; grid-column: 2; align-self: center; color: var(--muted); }

/* ---- Floor mode (iPad on the sales floor): no sidebar, big touch targets ---- */
body.floor-on .sidebar, body.floor-on .tabbar, body.floor-on .mbar { display: none !important; }
body.floor-on main { padding: 0 0 40px; }
.floor { max-width: 1280px; margin: 0 auto; }
.fl-bar { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.fl-bar input { flex: 1; min-width: 0; font-size: 20px; min-height: 56px; border-radius: 14px; padding: 0 18px; }
.fl-exit { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; font-size: 22px; flex-shrink: 0; }
.fl-btn { min-height: 56px; padding: 0 18px; font-size: 17px; border-radius: 14px; white-space: nowrap; }
.fl-count { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 12px; background: var(--on-brand); color: var(--brand); font-weight: 800; }
.fl-chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.fl-chip { flex-shrink: 0; min-height: 48px; padding: 0 18px; border-radius: 24px; font-size: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); }
.fl-chip.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.fl-filters { display: flex; gap: 12px; align-items: center; padding: 8px 16px; flex-wrap: wrap; }
.fl-filters select { max-width: 260px; min-height: 48px; font-size: 16px; }
.fl-toggle { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 16px; min-height: 48px; }
.fl-toggle input { width: 22px; height: 22px; }
.fl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 8px 16px; }
.fl-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 16px; min-height: 170px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow); font: inherit; cursor: pointer; }
.fl-card:active { transform: scale(.985); }
.fl-cat { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fl-name { font-size: 19px; font-weight: 800; line-height: 1.2; }
.fl-sub { font-size: 13px; color: var(--muted); }
.fl-price { font-size: 24px; font-weight: 800; margin-top: auto; }
.fl-price s { font-size: 15px; font-weight: 600; color: var(--muted); }
.fl-price.big { font-size: 34px; }
.fl-where { font-size: 14px; color: var(--muted); }
.fl-where.in { color: var(--accent); }
.fl-out { color: var(--bad); }
.fl-order { font-size: 13px; color: var(--info); }
.fl-empty { grid-column: 1 / -1; padding: 60px 16px; text-align: center; font-size: 18px; color: var(--muted); }
.fl-feats { margin: 10px 0; padding-left: 22px; font-size: 16px; line-height: 1.5; }
.fl-stock table td { font-size: 16px; padding: 8px 6px; }
.fl-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.fl-big { min-height: 56px; padding: 0 22px; font-size: 17px; border-radius: 14px; }
.fl-qty { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.fl-qty button { width: 48px; height: 48px; font-size: 24px; border-radius: 10px; }
.fl-qty span { min-width: 40px; text-align: center; font-size: 22px; font-weight: 800; }
.fl-list td { font-size: 16px; padding: 10px 6px; }
.ft-qr { position: absolute; right: .18in; bottom: .42in; text-align: center; font-size: 7pt; color: #555; line-height: 1.1; }
.ft-qr svg { display: block; width: .85in; height: .85in; }
@media (max-width: 700px) { .fl-bar { flex-wrap: wrap; } .fl-bar input { order: 3; flex-basis: 100%; } .fl-grid { grid-template-columns: 1fr; } }
.review-ask { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; max-width: 720px;
  padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); text-align: left; }
.review-ask small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.done .review-ask { margin: 0 auto 18px; }
.fl-step { width: 48px; height: 48px; min-height: 48px; padding: 0; font-size: 20px; border-radius: 12px; }
.po-filters { flex-wrap: wrap; gap: 10px; align-items: end; } .po-filters label { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; } .po-filters select, .po-filters input { min-width: 150px; }
