/* DDK Staff — layout: one task per screen on phones (single column, sticky action bar);
   admin console widens to a side-nav + content grid on desktop. */
:root {
  --bg: #f2f5f1;          /* pale pistachio-white */
  --surface: #ffffff;
  --surface-2: #e8eee8;
  --ink: #17201b;
  --muted: #56645c;
  --line: #d5ddd6;
  --accent: #25553f;       /* deep pistachio */
  --accent-ink: #ffffff;
  --accent-soft: #dcebe1;
  --cone: #c98a3e;         /* waffle-cone gold, used for "next step" */
  --cone-soft: #f6e6cf;
  --ok: #1f7a4a;  --ok-soft: #d7efe0;
  --warn: #9a5b00; --warn-soft: #fbead0;
  --bad: #b42318;  --bad-soft: #fbe0dc;
  --shadow: 0 1px 2px rgba(23,32,27,.06), 0 4px 16px rgba(23,32,27,.06);
  --font: "Anuphan", "Noto Sans Thai", "Leelawadee UI", "Thonburi", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 14px;
  --tap: 56px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101512; --surface: #18201b; --surface-2: #212b25; --ink: #e9efe9; --muted: #9fb0a5;
    --line: #2d3a32; --accent: #7cc39b; --accent-ink: #0d1a13; --accent-soft: #1f3529;
    --cone: #e2a65c; --cone-soft: #3a2c1b; --ok: #6fd39a; --ok-soft: #173525;
    --warn: #f0b45a; --warn-soft: #3a2a12; --bad: #ff8a7a; --bad-soft: #3d1a16;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.45; -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--cone); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.boot { height: 100vh; display: grid; place-items: center; }
.boot-mark { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- staff shell ---------- */
.screen { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.screen-body { flex: 1; display: flex; flex-direction: column; gap: 16px; padding-bottom: 120px; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.topbar h1 { flex: 1; font-size: 1.25rem; }
.icon-btn { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.ghost { border-color: transparent; background: transparent; }

.hello { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 2px; }
.hello .who { font-size: 1.5rem; font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: .9rem; }
.chip svg { width: 16px; height: 16px; }
button.chip { cursor: pointer; min-height: 40px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.pill.plain { background: var(--surface-2); color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .95rem; }
.banner svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.info { background: var(--accent-soft); color: var(--accent); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }

/* Buttons */
.btn { min-height: var(--tap); padding: 0 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn svg { width: 24px; height: 24px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.cone { background: var(--cone); color: #1d1206; border-color: var(--cone); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.block { width: 100%; }
.btn.big { min-height: 72px; font-size: 1.15rem; border-radius: 18px; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn.sm svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.actionbar-in { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }

/* Today: step list */
.next-card { background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.next-card .label { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.next-card h2 { font-size: 1.5rem; }
.next-card .btn { background: var(--accent-ink); color: var(--accent); border-color: transparent; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; position: relative; }
.step + .step { border-top: 1px dashed var(--line); }
.step .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .95rem;
  background: var(--surface-2); color: var(--muted); }
.step .dot svg { width: 20px; height: 20px; }
.step.done .dot { background: var(--ok-soft); color: var(--ok); }
.step.next .dot { background: var(--cone); color: #1d1206; }
.step.locked { opacity: .55; }
.step .title { font-weight: 600; }
.step .sub { font-size: .85rem; color: var(--muted); }
.step button { cursor: pointer; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left; }
.tile svg { width: 30px; height: 30px; color: var(--accent); }
.tile span { font-weight: 600; line-height: 1.25; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 600; font-size: .95rem; }
.input, select.input, textarea.input { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-size: 1.05rem; }
textarea.input { min-height: 104px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; margin-top: 2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg button.on.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.seg button.on.warn { background: var(--cone); border-color: var(--cone); color: #1d1206; }

/* Login keypad */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 420px; margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 52px; height: 52px; border-radius: 14px; }
.brand .name { font-weight: 700; font-size: 1.15rem; line-height: 1.2; }
.pin-dots { display: flex; justify-content: center; gap: 14px; padding: 8px 0; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent); }
.pin-dots i.on { background: var(--accent); }
.phone-display { font-family: var(--mono); font-size: 1.9rem; text-align: center; letter-spacing: .06em; min-height: 48px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 1.6rem; font-weight: 600; cursor: pointer; }
.keypad button:active { background: var(--accent-soft); }
.keypad button.fn { font-size: 1rem; background: transparent; border-color: transparent; }

/* Camera */
.cam-wrap { position: relative; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 62vh; width: 100%; }
.cam-wrap video, .cam-wrap img, .cam-wrap canvas { width: 100%; height: 100%; object-fit: cover; }
.cam-wrap video.mirror { transform: scaleX(-1); }
.cam-guide { position: absolute; inset: 12% 18% 22%; border: 3px dashed rgba(255,255,255,.75); border-radius: 50%; pointer-events: none; }
.shutter { width: 84px; height: 84px; border-radius: 50%; border: 6px solid var(--surface); background: var(--cone); box-shadow: 0 0 0 3px var(--cone); cursor: pointer; margin: 0 auto; display: block; }
.cam-modal { position: fixed; inset: 0; z-index: 60; background: #0b0f0c; color: #fff; display: flex; flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); gap: 14px; }
.cam-modal .cam-wrap { flex: 1; max-height: none; aspect-ratio: auto; }
.cam-modal .row { display: flex; gap: 10px; align-items: center; justify-content: center; }
.cam-modal .btn { background: #1f2a23; color: #fff; border-color: #2e3b33; }
.cam-modal .btn.primary { background: var(--cone); color: #1d1206; border-color: var(--cone); }

/* Location card */
.loc { display: flex; gap: 14px; align-items: center; }
.loc-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.loc-ring svg { width: 30px; height: 30px; }
.loc.ok .loc-ring { background: var(--ok-soft); color: var(--ok); }
.loc.bad .loc-ring { background: var(--bad-soft); color: var(--bad); }
.loc.wait .loc-ring { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }
.dist { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; }

/* Success */
.success { position: fixed; inset: 0; z-index: 70; background: var(--ok); color: #fff; display: grid; place-items: center; text-align: center; padding: 24px; }
.success .tick { width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; margin: 0 auto 20px; animation: pop .4s ease-out; }
.success .tick svg { width: 72px; height: 72px; }
.success h1 { font-size: 1.8rem; }
.success .time { font-family: var(--mono); font-size: 2.4rem; margin-top: 6px; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }

/* Progress */
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .2s; }
.progress .txt { font-size: .9rem; color: var(--muted); display: flex; justify-content: space-between; }

/* Checklist items */
.items { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.item.done { border-color: var(--ok); box-shadow: inset 4px 0 0 var(--ok); }
.item.problem { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.item-head { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.tickbox { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; background: var(--surface); }
.tickbox svg { width: 26px; height: 26px; opacity: 0; }
.item.done .tickbox { background: var(--ok); border-color: var(--ok); color: #fff; }
.item.done .tickbox svg { opacity: 1; }
.item-head .t { flex: 1; font-weight: 600; }
.item-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; }
.need-photo { font-size: .85rem; color: var(--warn); display: inline-flex; gap: 4px; align-items: center; }
.need-photo svg { width: 16px; height: 16px; }

/* Stock */
.sec-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.sec-tabs button { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; font-size: .9rem; }
.sec-tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sec-tabs button.complete:not(.on) { border-color: var(--ok); color: var(--ok); }
.stock-row { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.stock-row .name { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.stock-row.filled { border-color: var(--accent); }
.stock-row.odd { border-color: var(--warn); }
.stock-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stock-inputs .lbl { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; height: 52px; }
.stepper button { border: 0; background: var(--surface-2); font-size: 1.5rem; cursor: pointer; }
.stepper input { border: 0; text-align: center; font-family: var(--mono); font-size: 1.2rem; width: 100%; min-width: 0; background: var(--surface); }
.kg { position: relative; }
.kg input { font-family: var(--mono); font-size: 1.2rem; padding-right: 40px; text-align: right; height: 52px; }
.kg::after { content: "kg"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.row .grow { flex: 1; min-width: 0; }
.day-head { font-weight: 700; margin-top: 8px; font-size: .95rem; color: var(--muted); }

/* Bottom sheet / dialogs */
.sheet-bg { position: fixed; inset: 0; z-index: 80; background: rgba(10,15,12,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 20px max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 14px; max-height: 88vh; overflow-y: auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 760px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }
.sheet .btns { display: flex; flex-direction: column; gap: 8px; }
.photo-view { max-height: 80vh; border-radius: 12px; margin: 0 auto; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 90;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); font-weight: 500; box-shadow: var(--shadow); }
#toast.bad { background: var(--bad); color: #fff; }

.offline-bar { background: var(--warn-soft); color: var(--warn); font-size: .9rem; padding: 8px 12px; border-radius: 10px; display: flex; gap: 8px; align-items: center; }
.offline-bar svg { width: 18px; height: 18px; }
.demo-bar { background: var(--cone-soft); color: var(--ink); font-size: .85rem; padding: 6px 12px; text-align: center; }

/* ---------- admin console ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 8px 14px; }
.side .brand img { width: 40px; height: 40px; border-radius: 10px; }
.side a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.side a svg { width: 20px; height: 20px; color: var(--muted); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side a.on svg { color: var(--accent); }
.side .sep { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 4px; }
.side .badge { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: .75rem; padding: 0 7px; font-weight: 700; }
.main { min-width: 0; padding: 24px max(16px, env(safe-area-inset-right)) 60px 28px; display: flex; flex-direction: column; gap: 18px; }
.main-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters .field { min-width: 150px; }
.filters .input { min-height: 44px; padding: 8px 12px; font-size: .95rem; }
.admin .btn { min-height: 44px; font-size: .95rem; border-radius: 10px; }
.admin .btn svg { width: 20px; height: 20px; }
.admin body, .admin { font-size: 15px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat .v { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .k { font-size: .85rem; color: var(--muted); }
.stat.bad .v { color: var(--bad); } .stat.warn .v { color: var(--warn); }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
.tbl td.wrap { white-space: normal; min-width: 220px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl .c { text-align: center; }
table.stock-grid th, table.stock-grid td { padding: 6px 8px; font-size: .85rem; border-right: 1px solid var(--line); }
table.stock-grid th.day { text-align: center; background: var(--accent-soft); color: var(--accent); }
table.stock-grid td.sec { background: var(--surface-2); font-weight: 700; }
table.stock-grid td.flag { background: var(--warn-soft); }
.mini-thumbs { display: flex; gap: 6px; }
.mini-thumbs img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; cursor: zoom-in; border: 1px solid var(--line); }
.cl-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.cl-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.cl-item svg { width: 22px; height: 22px; }
.shift-grid td { vertical-align: top; min-width: 120px; }
.shift-chip { display: block; background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 4px 8px; font-size: .85rem; margin-bottom: 4px; cursor: pointer; border: 0; width: 100%; text-align: left; font-family: var(--mono); }
.add-cell { border: 1px dashed var(--line); background: transparent; border-radius: 8px; width: 100%; min-height: 30px; color: var(--muted); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .main { padding: 14px max(16px, env(safe-area-inset-right)) 60px max(16px, env(safe-area-inset-left)); }
  .menu-toggle { display: grid; }
}

.view, .att-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.items h2.area { margin: 14px 0 0; padding-top: 6px; font-size: 1.1rem; color: var(--accent); }
.items h2.area:first-child { margin-top: 0; }
.item-head .t .cat { display: block; font-size: .78rem; font-weight: 500; color: var(--muted, #6b7a72); margin-bottom: 2px; }

/* Stock pre-fill from the last count */
.prefill-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft, rgba(37,85,63,.12)); color: var(--text); font-size: .9rem; line-height: 1.4; }
.prefill-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.prefill-note { flex-wrap: nowrap; }
.prefill-note span { min-width: 0; }
.stock-row.prefilled { border-style: dashed; border-color: var(--warn); }
.stock-row.prefilled .stepper input, .stock-row.prefilled .kg input { color: var(--muted); }
.stock-row .prev { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stock-row.filled .prev .confirm { display: none; }
.confirm-all { margin-top: 4px; }
.name-edit { min-width: 200px; padding: 8px 10px; min-height: 40px; }
.stock-row .prev .confirm { white-space: nowrap; flex: none; }
.stock-row .prev span { min-width: 0; }
[hidden]{display:none!important}

/* Leave */
.lv-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.lv-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.price-edit { width: 90px; min-height: 40px; padding: 6px 8px; text-align: right; }

/* petty cash */
.pc-card { text-align: center; padding: 18px 16px; }
.pc-bal { font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 4px 0; }
.pc-bal.neg { color: var(--bad, #c0392b); }
.pc-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-amt.in { color: var(--ok, #1d8a4e); }
.shift-tpl { display: block; font-size: .72rem; color: var(--muted, #777); font-weight: 400; }
.dow-row { display: flex; gap: 6px; flex-wrap: wrap; }
.leave-chip { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: #fdecc8; color: #7a5200; margin: 2px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }

.pc-bal.in { color: var(--ok, #1d8a4e); font-size: 1.6rem; }
.pc-owed { text-align: center; padding: 14px 16px; }
.sec-tabs .left:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--warn); color: #fff; font-size: .72rem; font-weight: 700; }
.btn.dim { opacity: .65; }
@keyframes flashrow { 0%, 60% { box-shadow: 0 0 0 3px var(--warn); } 100% { box-shadow: 0 0 0 0 transparent; } }
.stock-row.flash { animation: flashrow 1.6s ease-out; }
.code-display { font-family: var(--mono); font-size: 1.9rem; text-align: center; letter-spacing: .1em; min-height: 48px; }
.setup-code { font-family: var(--mono); font-size: 2.6rem; font-weight: 700; letter-spacing: .18em; text-align: center; padding: 14px; border: 2px dashed var(--line); border-radius: 14px; }
.route { display: contents; }
