/* Sumo Inventory v2 — dark, high-contrast, kitchen-friendly theme.
   Mobile-first: staff use phones in the restaurant. All touch targets >= 48px. */

:root {
  --bg: #141414;
  --bg2: #1d1d1d;
  --card: #232323;
  --card2: #2b2b2b;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --border: #383838;
  --accent: #c0392b;
  --accent-hi: #e74c3c;
  --ok: #2ecc71;
  --warn: #f39c12;
  --info: #3498db;
  --danger: #e74c3c;
  --radius: 12px;
  --tap: 48px; /* minimum touch target */
  /* Zebra striping for schedule grids: translucent tint for day cells,
   * opaque tint for the sticky name column (must occlude scrolled cells). */
  --zebra-cell: rgba(255,255,255,.045);
  --zebra-label: #262626;
  color-scheme: dark; /* native controls (date picker, scrollbars) match */
}

/* Light theme: variable overrides + light versions of the hardcoded dark
 * tints. Dark stays the default — this block only applies with
 * data-theme="light" on <html>. */
[data-theme="light"] {
  --bg: #f6f4ef;
  --bg2: #ffffff;
  --card: #ffffff;
  --card2: #ece8df;
  --text: #211d17;
  --muted: #6f675b;
  --border: #d9d2c4;
  --accent: #c0392b;
  --accent-hi: #d64541;
  --ok: #1e8e4f;
  --warn: #a86a12;
  --info: #2471a3;
  --danger: #c0392b;
  --zebra-cell: rgba(33,29,23,.055);
  --zebra-label: #efeadd;
  color-scheme: light;
}
[data-theme="light"] .error { background: #fdecea; }
[data-theme="light"] .notice { background: #e9f2fa; }
[data-theme="light"] .banner { background: #fdf3e1; }
[data-theme="light"] .warn-box { background: #fdf3e1; color: #7a5a12; }
[data-theme="light"] .flag-warn { background: #fdf3e1; }
[data-theme="light"] .flag-info { background: #e9f2fa; }
[data-theme="light"] .day-chip.active { background: #f7e3de; }
[data-theme="light"] pre.email { background: #ffffff; }
[data-theme="light"] .bulk-track { background: rgba(0,0,0,.12); }
[data-theme="light"] #update-banner { background: #e1f2e6; color: #14532d; border-color: #2e7d32; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

/* Double-tap zoom off (pinch zoom still works): rapid taps on steppers and
 * cards must never zoom the page. */
html { touch-action: manipulation; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}

#app { max-width: 760px; margin: 0 auto; min-height: 100vh; }

.loading { padding: 48px 20px; text-align: center; color: var(--muted); }

/* ---------- Top nav ---------- */
.topnav {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 56px; padding: 8px 12px;
  background: rgba(29,29,29,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.topnav .brand { font-weight: 800; font-size: 16px; letter-spacing: .5px; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.topnav .brand .dot { color: var(--accent-hi); }
.topnav .user { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.logo-badge.nav-logo { width: 30px; height: 30px; }
.logo-badge.nav-logo img { width: 24px; height: 24px; }
.topnav .brand-btn { background: none; border: 0; padding: 10px 8px; margin: -10px 0 -10px -8px; cursor: pointer; color: inherit; font: inherit; }
.topnav .user { font-size: 13px; color: var(--muted); }
/* Narrow phones: the brand + icon buttons can squeeze the user chip to
   "Gabe · Su…". The signed-in name must never shrink — the brand text
   absorbs all the shrinking (with ellipsis) and the role suffix is hidden. */
@media (max-width: 600px) {
  .topnav { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .topnav > div:first-child { min-width: 0; flex: 1 1 auto; }
  .topnav .brand-btn { max-width: 100%; overflow: hidden; }
  .topnav .brand { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topnav .brand .nav-logo { flex: 0 0 auto; }
  .topnav .user { flex: 0 0 auto; max-width: 45vw; }
  .topnav .user-role { display: none; }
  .topnav > div:last-child { flex: 0 0 auto; }
}
/* Tiny build stamp in the header so we can confirm which version a phone is
 * actually running (PWA caching can delay updates). */
.app-v { font-size: 10px; opacity: .45; margin-left: 6px; white-space: nowrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); min-width: var(--tap);
  padding: 10px 20px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--card2); color: var(--text); font-size: 16px; font-weight: 600;
  font-family: inherit; cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; }
.btn-small { min-height: 44px; min-width: 44px; padding: 8px 14px; font-size: 14px; }

/* ---------- Views ---------- */
.view { padding: 16px; }
.view h1 { font-size: 22px; margin: 6px 0 12px; }
.view h2 { font-size: 18px; margin: 20px 0 10px; }
.muted { color: var(--muted); }
.error { color: var(--danger); background: #2a1414; border: 1px solid var(--danger);
  padding: 10px 12px; border-radius: var(--radius); margin: 10px 0; }
.notice { background: #14232e; border: 1px solid var(--info); color: var(--text);
  padding: 12px; border-radius: var(--radius); margin: 10px 0; }
.banner { background: #2a1c10; border: 1px solid var(--warn); padding: 12px 14px;
  border-radius: var(--radius); margin: 12px 0; }
.banner a { color: var(--warn); font-weight: 700; }

/* ---------- Menu cards (Home) ---------- */
.menu-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 560px) { .menu-grid { grid-template-columns: 1fr 1fr 1fr; } }
.menu-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 12px; min-height: 110px; text-align: center; color: var(--text);
  font-size: 16px; font-weight: 700; cursor: pointer; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.menu-card .ico { font-size: 28px; }
.menu-card:active { border-color: var(--accent); }

/* ---------- Phase 2: manager/superadmin redesign ---------- */
/* "Fix item" disclosure (quick order + order editor + item editor advanced). */
.oedit-fix { margin-top: 8px; }
.oedit-fix > summary {
  list-style: none; cursor: pointer; min-height: 44px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 10px 4px; -webkit-tap-highlight-color: transparent;
}
.oedit-fix > summary::-webkit-details-marker { display: none; }
.oedit-fix > summary::before { content: "▸"; font-size: 12px; }
.oedit-fix[open] > summary::before { content: "▾"; }
.oedit-fix[open] > summary { color: var(--text); }
.oedit-fix .oedit-meta { margin-top: 4px; }
.oedit-fix > .btn { margin-top: 8px; }

/* "••• More" overflow menu (schedule builder toolbar). */
.menu-pop { position: relative; display: inline-block; }
.menu-pop > summary {
  list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.menu-pop > summary::-webkit-details-marker { display: none; }
.menu-pop-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 220px; background: var(--card); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.45); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.menu-pop-body .btn { justify-content: flex-start; width: 100%; }

/* Staffing tables: sticky position column so horizontal scroll keeps row labels. */
.bulk-par th:first-child, .bulk-par td:first-child {
  position: sticky; left: 0; z-index: 2; background: var(--bg);
}
.bulk-par thead th:first-child { z-index: 3; }

/* ---------- PIN pad ---------- */
.pin-dots { font-size: 34px; letter-spacing: 12px; text-align: center; margin: 22px 0; min-height: 52px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 340px; margin: 0 auto; }
.pin-key { min-height: 72px; font-size: 26px; border-radius: 50%; width: 84px; height: 84px;
  justify-self: center; background: var(--card2); border: 0; color: var(--text); cursor: pointer; }
.pin-key:active { background: var(--accent); }
.pin-pad-wrap { max-width: 400px; margin: 0 auto; padding-top: env(safe-area-inset-top); }

/* ---------- Count view ---------- */
/* Multi-location: per-area rows inside an item group card */
.area-row { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.area-row-head { display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.total-line { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--accent); }
/* Checkbox lists (item locations in manage + modal) */
.check-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
/* Specificity (0,2,0)+ beats .field label/.field input so these never blow up
   into giant full-width boxes inside admin forms. */
.check-list .check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  margin-bottom: 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer; }
.check-list .check input { width: 18px; height: 18px; margin: 0; padding: 0; flex: 0 0 auto;
  accent-color: var(--accent); }
/* Vendor day picker chips */
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.day-chip { min-height: 44px; min-width: 54px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  font-size: 13px; font-weight: 700; cursor: pointer; }
.day-chip.active { border-color: var(--accent); background: #331714; color: var(--text); }
/* Vendor per-day coverage editor */
.cov-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.cov-row .cov-day { flex: 0 0 60px; font-weight: 700; font-size: 14px; }
.cov-row input { width: 72px; min-height: 44px; font-size: 16px; text-align: center;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); }
/* Push-update banner: static (never overlays the PIN pad or nav). */
#update-banner { position: relative; z-index: 9999;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: #14331f; color: #e8f5e9; font-size: 14px; font-weight: 600;
  border-bottom: 1px solid #2e7d32; }
#update-banner button { background: #2e7d32; color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; font-size: 14px; font-weight: 700; min-height: 44px; }
/* Draft order manual override editor */
.order-edit { border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; margin: 8px 0; background: var(--bg2); }
.oedit-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.oedit-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; }
select.oedit-name { white-space: normal; min-height: 44px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; }
.oedit-step { display: flex; align-items: center; gap: 4px; }
.oedit-step input, input[data-daddqty] { width: 60px; min-height: 44px; text-align: center;
  font-size: 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); }
/* Per-line par/unit fixers inside order editing (edit-order + quick order). */
.oedit-meta { display: flex; gap: 14px; align-items: center; margin: 2px 0 10px; padding-left: 2px;
  font-size: 13px; color: var(--muted); }
.oedit-metalab { display: flex; gap: 6px; align-items: center; }
.oedit-meta input { width: 70px; min-height: 40px; text-align: center; font-size: 15px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.oedit-meta select { min-height: 40px; font-size: 14px; max-width: 110px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
/* Review warnings (e.g. max-on-hand below one case) */
.warn-box { border: 1px solid #b7791f; border-radius: 10px; background: #2e230f;
  color: #f5d78e; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.warn-box div { margin: 4px 0; }

.item-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 16px; margin: 12px 0; }
.item-card.flash { border-color: var(--warn); box-shadow: 0 0 0 2px var(--warn); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item-name { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.item-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pill { flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); }
.pill-not { color: var(--muted); }
.pill-counted { color: var(--ok); border-color: var(--ok); }
.pill-zero { color: var(--info); border-color: var(--info); }
.pill-done { color: #fff; background: #2e7d32; border-color: #2e7d32; }
.pill-review { color: var(--warn); border-color: var(--warn); }

.hint { font-size: 13px; color: var(--warn); margin-top: 6px; min-height: 18px; }
.done-on { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.readonly-count { font-size: 24px; font-weight: 800; margin-top: 10px; }
.admin-extras { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.unit-edit { display: flex; gap: 8px; align-items: center; padding: 4px 2px; }
/* 2026-10-01: user-select:none is REQUIRED on iOS — without it, Safari treats
 * taps on the button text as text-selection gestures (Copy/Look Up menu)
 * instead of firing click, so the button appears dead. */
.unit-edit { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.oedit-metalab { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Bottom-sheet presentation for the unit picker modal. */
.sheet-back { align-items: flex-end; padding: 0; }
.sheet-back .modal { max-width: 560px; width: 100%; border-radius: 18px 18px 0 0;
  border-bottom: none; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.unit-sheet-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0;
  max-height: 50vh; max-height: 50dvh; overflow-y: auto; }
.unit-opt { display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 16px; font-size: 18px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg2); color: var(--text);
  cursor: pointer; }
.unit-opt.sel { border-color: var(--accent); font-weight: 600; }
.unit-sheet-cancel { width: 100%; min-height: 52px; }

/* ---------- AI dictate results ---------- */
.ai-drafts { margin-top: 10px; }
.ai-draft { display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--border); border-radius: 10px; margin: 6px 0; background: var(--card); }
.ai-draft input[type=checkbox] { width: 28px; height: 28px; }
.conf { font-size: 13px; color: var(--muted); }

/* ---------- Review / orders ---------- */
.flag-warn { background: #2a1c10; border-left: 4px solid var(--warn); padding: 10px 12px; margin: 8px 0; border-radius: 8px; }
.flag-info { background: #14232e; border-left: 4px solid var(--info); padding: 10px 12px; margin: 8px 0; border-radius: 8px; }
pre.email { background: #0d0d0d; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; font-size: 13px; white-space: pre-wrap; word-wrap: break-word; max-height: 260px; overflow: auto; }
.pill-draft { color: var(--muted); } .pill-sent { color: var(--info); border-color: var(--info); }
.pill-received { color: var(--ok); border-color: var(--ok); }
.pill-archived { color: var(--muted); border-color: var(--muted); opacity: .75; }

/* ---------- Usage report ---------- */
.urow { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--card); border-radius: 14px; margin-bottom: 8px;
  box-shadow: var(--shadow-1); }
.urow-name { font-weight: 700; font-size: 16px; }
.urow-cost { font-weight: 700; font-size: 16px; white-space: nowrap; }
.urow-total { background: var(--card2); }

/* ---------- Count extras: skip tick + question box ---------- */
.count-more { margin-top: 10px; }
.count-more summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.skip-row { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 10px 0; cursor: pointer; }
.skip-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--primary); }


/* ---------- Admin ---------- */
.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin: 10px 0; }
.field { margin: 8px 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; min-height: var(--tap); font-size: 16px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-box { border: 2px solid var(--danger); border-radius: var(--radius); padding: 14px; margin: 12px 0; }
.confirm-box label { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.confirm-box input[type=checkbox] { width: 28px; height: 28px; flex: 0 0 auto; }
table.bulk-par { width: 100%; border-collapse: collapse; }
table.bulk-par th { text-align: left; font-size: 13px; color: var(--muted); padding: 8px 4px; border-bottom: 2px solid var(--border); }
table.bulk-par th:nth-child(n+2), table.bulk-par td:nth-child(n+2) { text-align: center; }
table.bulk-par td { padding: 8px 4px; border-bottom: 1px solid var(--border); }
table.bulk-par input { width: 90px; min-height: 44px; font-size: 16px; text-align: center;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg2); color: var(--text); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; max-width: 420px; width: 100%;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; }
.modal h3 { margin-top: 0; }
.modal p { overflow-wrap: anywhere; }
/* Schedule builder: right-edge fade hints at horizontal scroll on phones. */
.sched-grid-fade { position: relative; }
@media (max-width: 860px) {
  .sched-grid-fade::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 34px;
    background: linear-gradient(to right, transparent, var(--bg)); pointer-events: none; }
}
/* Builder conflict highlight: overlapping shifts get a red edge. */
.shift-conflict { border-left: 3px solid var(--danger) !important; }
/* Builder REQ chip: approved time off covering the cell's day (amber outline). */
.req-chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--warn); border: 1.5px solid var(--warn); border-radius: 6px; padding: 1px 6px; }
/* Builder REQ chip, pending variant: same chip, dimmed, display-only. */
.req-chip-pending { opacity: 0.45; }
/* Builder shortage line: shortages-only, one compact line under the day label. */
.sched-cov { font-size: 11px; font-weight: 700; color: var(--danger); line-height: 1.35; margin-top: 2px; }
/* Team day view: group header + zebra-striped person cards. */
.sched-day-group { padding: 10px 8px 6px; font-weight: 800; font-size: 13px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--accent); border-top: 1px solid var(--border); }
.sched-day-group:first-child { border-top: 0; }
.admin-card.sched-zebra, .card.sched-zebra { background: var(--zebra-label); }
/* Visible keyboard focus on the dark theme. */
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

/* Builder "+" cells: thumb-sized tap targets. */
.sched-add { min-height: 44px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ---------- Print ---------- */
@media print {
  .topnav, .no-print, .btn, button { display: none !important; }
  body { background: #fff; color: #000; }
  #app { max-width: 100%; }
  .item-card, pre.email, .order-card { background: #fff; color: #000; border-color: #999; }
  .order-card-head { background: #fff !important; color: #000; border-bottom: 2px solid #000; }
  .order-card-qty { color: #000; }
  pre.email { max-height: none; overflow: visible; border: none; padding: 0; font-size: 14px; }
}

/* ---------- Order card template (vendor-facing) ---------- */
.order-wrap { margin-bottom: 20px; }
.order-status-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.order-card { background: #fff; border-radius: 14px; overflow: hidden; margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); border: 1px solid var(--border); }
.order-card-head { background: #c62828; color: #fff; font-weight: 800; font-size: 22px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 14px 12px; letter-spacing: .5px; }
.logo-badge { display: inline-flex; width: 46px; height: 46px; border-radius: 50%;
  background: #fff; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.logo-badge img { width: 36px; height: 36px; object-fit: contain; }
.order-card-body { padding: 18px; }
.order-card-vendor { font-size: 20px; font-weight: 800; color: #1b1b1b; }
.order-card-date { color: #6b6b6b; margin-top: 2px; font-size: 15px; }
.order-card-meta { color: #6b6b6b; font-size: 14px; margin-top: 2px; }
.order-card-lines { margin-top: 12px; border-top: 1px solid #eee; }
.order-card-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #eee; }
.order-card-item { font-size: 16px; color: #1b1b1b; }
.order-card-qty { color: #c62828; font-weight: 800; font-size: 16px; white-space: nowrap; }
.order-card-foot { margin-top: 12px; font-weight: 800; font-size: 16px; color: #1b1b1b; }
.order-card-actions { display: flex; gap: 10px; padding: 0 18px 18px; flex-wrap: wrap; }
.order-card-actions .btn { flex: 1; }
.order-card-contact { flex-basis: 100%; font-size: 13px; color: #666; text-align: center; }

/* ---------- Settings checkbox row ---------- */
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; cursor: pointer; }
.check-row input[type="checkbox"] { width: 24px; height: 24px; margin-top: 2px; flex-shrink: 0; }

/* ---------- Guided tour ---------- */
#tour-ov { position: fixed; inset: 0; z-index: 2000; pointer-events: none; }
#tour-ov .tour-dim { position: absolute; inset: 0; background: rgba(0,0,0,.55); pointer-events: auto; }
/* Spotlight ring: positioned over the highlighted control; its huge shadow
   dims the whole screen except the ring's transparent interior. */
#tour-ov .tour-ring { position: absolute; border: 3px solid var(--accent-hi, #e63946);
  border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); pointer-events: none; }
#tour-ov .tour-card { position: absolute; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  background: var(--bg2, #fff); border-radius: 14px; padding: 16px;
  box-shadow: 0 10px 32px rgba(0,0,0,.4); pointer-events: auto; }
#tour-ov .tour-step { font-size: 12px; color: var(--muted, #888); }
#tour-ov .tour-card h3 { margin: 2px 0 6px; font-size: 17px; }
#tour-ov .tour-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
#tour-ov .tour-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Bulk edit tab ---- */
.bulk-wrap { position: relative; }
.bulk-scroll { max-height: 58vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-right: 50px; }
.bulk-slider { position: absolute; top: 0; right: 2px; bottom: 0; width: 44px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 0; }
.bulk-jump { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--border);
  background: var(--card2); font-size: 14px; line-height: 1; padding: 0; color: var(--text); flex: none; }
.bulk-track { position: relative; flex: 1; width: 8px; min-height: 48px;
  background: rgba(255,255,255,.14); border-radius: 4px; }
.bulk-thumb { position: absolute; top: 0; left: -7px; width: 22px; height: 42px;
  border-radius: 11px; background: #8e8e93; touch-action: none; cursor: grab;
  box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.bulk-thumb:active { cursor: grabbing; background: #6e6e73; }
.bulk-row { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--card); }
.bulk-row.dirty { border-color: #e8a13d; box-shadow: 0 0 0 1px #e8a13d33; }
.bulk-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px;
  background: none; border: 0; text-align: left; font-size: 15px; color: inherit; }
.bulk-chev { color: var(--muted); width: 14px; flex: none; font-size: 12px; }
.bulk-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-dirty { color: #e8a13d; font-size: 12px; flex: none; }
.bulk-sum { font-size: 12px; flex: none; color: var(--muted); }
.bulk-fields { padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.bulk-area-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.bulk-area-row input { flex: 1; }
.bulk-savebar { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0 calc(4px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); margin-top: 10px; }
.bulk-savebar .btn { flex: 1; }
.bulk-nomatch { text-align: center; padding: 18px 0 6px; }

/* Schedule builder: add-shift affordance — dashed outline, visible at rest. */
.sched-add { border-style: dashed !important; opacity: .8; }
.sched-add:hover, .sched-add:active { opacity: 1; }

/* Manager availability grid cells: tappable dots with full detail on tap. */
.avail-cell { background: none; border: 0; padding: 0; min-height: 44px; min-width: 44px;
  font-size: 18px; cursor: pointer; color: inherit; }

/* Sticky review-page action bar (Approve stays reachable on long pages). */

/* Global "Saved" toast: green pill at top-center, slides down on save, auto-dismisses. */
#saved-toast { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; z-index: 10000;
  transform: translate(-50%, -90px); transition: transform .28s ease;
  background: #146c39; color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 22px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.35);
  pointer-events: none; white-space: nowrap; }
#saved-toast.show { transform: translate(-50%, 0); }

/* Orders bulk-select: large checkbox targets on order rows. */
.bulk-check { display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 48px; cursor: pointer; flex: none; }
.bulk-check input { width: 26px; height: 26px; accent-color: var(--accent); cursor: pointer; }
.order-wrap[data-bulkrow] { cursor: pointer; }

/* Inline missing-count fix on the review/approve page: blocking items drop
 * down into per-location count inputs so the user never leaves the screen. */
.block-fix-list { list-style: none; margin: 8px 0; padding: 0; }
.block-fix-list li { margin: 8px 0; }
.block-toggle { width: 100%; text-align: left; }
.block-form { display: grid; gap: 8px; margin: 8px 0 4px; padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
.block-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text); }
.block-row input { width: 110px; min-height: var(--tap); }
.bulk-area-row input { min-height: var(--tap); }
/* Builder week-start select: unstyled selects render ~30px tall. */
#sched-weekstart { min-height: var(--tap); font-size: 16px; }

/* ================= Redesign Phase 1 — design system (2026-10-02) ============
 * Apple-clean, KISS. Same palette (all :root color values unchanged); only
 * derived tokens, spacing, type, and depth change. */

/* Derived tokens — same hues, new usage. No new colors. */
:root {
  --shadow-1: 0 1px 2px rgba(0,0,0,.35);
  --shadow-2: 0 8px 28px rgba(0,0,0,.45);
  --accent-tint: rgba(192,57,43,.14);
  --ring: 0 0 0 3px rgba(192,57,43,.25);
}

/* ---------- Type & views ---------- */
.view h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 4px 0 16px; }
/* Section headers: quiet, uppercase, muted — one hierarchy per screen. */
.sec-head, .view h2 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 24px 4px 10px; }
.item-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.item-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn-block { width: 100%; }
.btn-quiet { background: transparent; border: 1px solid var(--border); }
/* Quiet text-link actions (login forgot-PIN, footer links). Still 44px+ targets. */
.linklike { background: none; border: 0; color: var(--muted); font-size: 14px; min-height: 44px;
  font-family: inherit; cursor: pointer; padding: 10px 12px; }
.linklike:active { color: var(--text); }

/* ---------- Top nav: blurred, 56px, ••• overflow ---------- */
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent;
  color: var(--text); font-size: 20px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: inherit; }
.iconbtn:active { background: var(--card2); }
.nav-icons { display: flex; gap: 2px; align-items: center; flex: 0 0 auto; }
/* ••• overflow popover (plain <details>, no JS needed to open). */
.ovf { position: relative; display: inline-block; }
.ovf summary { list-style: none; cursor: pointer; }
.ovf summary::-webkit-details-marker { display: none; }
.ovf .pop { position: absolute; right: 0; top: 52px; min-width: 230px; background: var(--card);
  border-radius: 14px; box-shadow: var(--shadow-2); padding: 8px; z-index: 120; }
.ovf .pop button { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 48px;
  padding: 10px 14px; border: 0; background: none; color: var(--text); font-size: 16px;
  font-family: inherit; border-radius: 10px; text-align: left; cursor: pointer; }
.ovf .pop button:active { background: var(--card2); }

/* ---------- Segmented control (iOS-style mode toggles) ---------- */
.seg { display: flex; background: var(--card2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-1); font-weight: 700; }

/* ---------- Chips (area/vendor tabs, filters) ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; }
.chip { flex: none; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 0;
  background: var(--card); color: var(--muted); font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; }
.chip.on { background: var(--accent-tint); color: var(--accent-hi); font-weight: 700; }
.chip .pill-mini { margin-left: 6px; font-size: 12px; opacity: .8; }

/* ---------- Fields & inputs ---------- */
.field { margin: 10px 0; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 4px 2px; }
.input { width: 100%; min-height: var(--tap); font-size: 16px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg2); color: var(--text); font-family: inherit; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }

/* ---------- Cards vs grouped lists ----------
 * Card (sparse): shadow, NO border. Grouped list (dense rows): hairline separators. */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 16px; margin: 12px 0; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-1);
  overflow: hidden; margin: 12px 0; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; width: 100%;
  background: none; border: 0; color: inherit; font: inherit; text-align: left; }
.lrow + .lrow { border-top: 1px solid var(--border); }
.lrow .t { flex: 1; min-width: 0; }
.lrow .t .a { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .t .b { font-size: 13px; color: var(--muted); margin-top: 2px; }
.lrow .chev { color: var(--muted); font-size: 18px; flex: none; }

/* ---------- Sticky bars ---------- */
.stickybar { position: sticky; bottom: 0; z-index: 40; background: rgba(20,20,20,.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); margin: 16px -16px -16px; }
.stickybar-top { position: sticky; top: 56px; z-index: 40; background: rgba(20,20,20,.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); padding: 10px 16px; margin: 0 -16px 12px; }

/* ---------- Count controls ---------- */
.stepper { display: flex; align-items: stretch; gap: 8px; margin-top: 12px; }
.stepper button { flex: 0 0 64px; min-height: 56px; border-radius: 12px; border: 0;
  background: var(--card2); color: var(--text); font-size: 28px; cursor: pointer; font-family: inherit; }
.stepper button:active { background: var(--accent); color: #fff; }
.stepper input { flex: 1; min-width: 0; min-height: 56px; font-size: 24px; font-weight: 700;
  text-align: center; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text); font-family: inherit; }
/* Quick actions: 0 · Full · Clear (ES-safe, wet-hand friendly). */
.qgrid3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.qgrid3 .btn { min-height: 52px; font-size: 16px; font-weight: 700; padding: 8px 4px; }
/* Fractional quick-add row: 6 compact buttons, numeric labels need no translation. */
.qgrid6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.qgrid6 .btn { min-height: 48px; font-size: 14px; font-weight: 700; padding: 8px 2px; }
/* Progress bar (count sticky footer). */
.prog { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; margin-top: 6px; }
.prog i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
/* Collapsible dictate bar / AI check (plain <details>). */
details.dict { margin-top: 10px; }
details.dict summary { list-style: none; }
details.dict summary::-webkit-details-marker { display: none; }
/* Manager inline par/unit on count cards. */
.admin-extras { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--border); }
.admin-extras .field { flex: 1; margin: 0; }
/* Two-column count cards on desktop. */
.countcards { display: block; }

/* Light-theme corrections for the translucent blurred chrome. */
[data-theme="light"] .topnav { background: rgba(255,255,255,.88); }
[data-theme="light"] .stickybar, [data-theme="light"] .stickybar-top { background: rgba(246,244,239,.94); }

/* ---------- Desktop: real layouts, not a stretched phone column ---------- */
@media (min-width: 1024px) {
  #app { max-width: 1120px; }
  .view { padding: 20px 24px; }
  .countcards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
  .countcards .item-card { margin: 0; }
  .menu-grid { grid-template-columns: repeat(4, 1fr); }
  .twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .stickybar { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
  .stickybar-top { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; }
}

/* Hardening 5: draft progress bars + empty-draft badges. */
.draft-progress { height: 6px; background: var(--line); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.draft-progress-bar { height: 100%; background: var(--ok); border-radius: 3px; transition: width .2s; }
.badge-empty { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: var(--line); color: var(--muted); margin-left: 8px; vertical-align: middle; }
