/* Inventory for Kitchen Fantasy. Light only. Colors come from the store's logo:
   plum pot, marigold lid, tomato heart, charcoal script. */
:root {
  --paper: #fbf8f3; --paper-2: #f4efe7; --card: #ffffff; --rule: #e6dfd4; --rule-2: #d6ccbe;
  --ink: #2a2421; --ink-2: #5a514b; --muted: #8a8077;
  --plum: #64113f; --plum-2: #7d2253; --plum-tint: #f6e9ef; --btn: #64113f; --btn-hover: #7d2253;
  --marigold: #ffb400; --marigold-tint: #fff4d6;
  --tomato: #c73e1d; --tomato-tint: #fbe9e4;
  --olive: #4f7a2b; --olive-tint: #edf3e4;
  --amber: #a5620a; --amber-tint: #fdf1dc;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, "Courier New", monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--plum); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.005em; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
svg.i { width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 26px; height: 58px; padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand .store { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.brand .app { font-size: 17px; font-weight: 700; color: var(--plum); }
.nav { display: flex; gap: 22px; align-self: stretch; }
.nav a { display: flex; align-items: center; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--ink); border-bottom-color: var(--plum); }
.who { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--muted); }
button.link { background: none; border: 0; padding: 0; font: 500 13px var(--sans); color: var(--ink-2); cursor: pointer; }
button.link:hover { color: var(--plum); text-decoration: underline; text-underline-offset: 3px; }
.demo-bar { background: var(--marigold-tint); color: var(--ink-2); border-bottom: 1px solid var(--rule); padding: 6px 20px; font-size: 13px; }

main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 100px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--sans); padding: 9px 14px; border-radius: 6px; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-2); text-decoration: none; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 13px; }
input, select { font: 16px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--rule-2); border-radius: 6px; padding: 10px 12px; width: 100%; }
input:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--marigold) 45%, transparent); outline-offset: 0; border-color: var(--marigold); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.page-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title h1 { font-size: 24px; }
.page-title .sub { color: var(--muted); font-size: 14px; }

/* ---------- search + list ---------- */
.lookup { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 28px; align-items: start; }
.searchbox { position: sticky; top: 58px; z-index: 10; background: var(--paper); padding: 2px 0 12px; }
.searchrow { display: flex; gap: 8px; }
.search-input { position: relative; flex: 1; }
.search-input svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-input input { padding: 12px 12px 12px 40px; font-size: 16px; }
.scan-btn { background: var(--ink); color: var(--paper); border-color: var(--ink); white-space: nowrap; }
.scan-btn:hover { background: var(--btn); border-color: var(--btn); color: #fff; }
.opts { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.opts label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; cursor: pointer; }
.opts input { width: auto; accent-color: var(--plum); }
.count { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list li { border-bottom: 1px solid var(--rule); }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 14px; padding: 11px 6px 11px 2px; color: var(--ink); }
.item-row:hover { background: var(--paper-2); text-decoration: none; }
.item-row.sel { background: var(--plum-tint); box-shadow: inset 3px 0 0 var(--plum); padding-left: 10px; }
.item-row .name { font-weight: 500; line-height: 1.3; }
.item-row .meta { color: var(--muted); font-size: 12.5px; }
.item-row .right { grid-row: 1 / span 2; grid-column: 2; text-align: right; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.price .was { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: 12.5px; margin-right: 5px; }
.qty { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.qty::before { content: ""; width: 7px; height: 7px; border-radius: 1px; background: var(--olive); }
.qty.low { color: var(--amber); } .qty.low::before { background: var(--marigold); }
.qty.out { color: var(--tomato); } .qty.out::before { background: var(--tomato); }
.note { color: var(--muted); padding: 22px 2px; line-height: 1.6; }
.note kbd { font: 12px var(--mono); border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--card); }

/* ---------- item detail ---------- */
.detail { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; }
.detail-empty { display: grid; place-items: center; min-height: 360px; color: var(--muted); text-align: center; padding: 30px; }
.d-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--rule); }
.crumbs { font-size: 12.5px; color: var(--muted); }
.d-head h1 { font-size: 22px; line-height: 1.25; margin: 4px 0 4px; }
.d-head .subs { color: var(--ink-2); font-size: 14px; }
.d-price { display: flex; align-items: baseline; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.d-price .now { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.d-price .sale { font-size: 13px; font-weight: 600; color: var(--tomato); background: var(--tomato-tint); padding: 2px 8px; border-radius: 4px; }
.d-price .was { color: var(--muted); text-decoration: line-through; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--rule); }
.facts div { padding: 14px 24px; border-right: 1px solid var(--rule); }
.facts div:last-child { border-right: 0; }
.facts small { display: block; font-size: 12px; color: var(--muted); }
.facts b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 1px; }
.facts b.out { color: var(--tomato); } .facts b.low { color: var(--amber); }
.block { padding: 18px 24px; border-bottom: 1px solid var(--rule); }
.block:last-child { border-bottom: 0; }
.block h2 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.spec { display: grid; grid-template-columns: 150px minmax(0, 1fr); margin: 0; font-size: 14.5px; }
.spec dt, .spec dd { padding: 6px 0; border-top: 1px dashed var(--rule); margin: 0; }
.spec dt:first-of-type, .spec dd:first-of-type { border-top: 0; }
.spec dt { color: var(--muted); }
.spec dd { overflow-wrap: anywhere; }
.sold { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 6px; margin-bottom: 12px; }
.sold div { padding: 10px 14px; border-right: 1px solid var(--rule); }
.sold div:last-child { border-right: 0; }
.sold b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.sold small { color: var(--muted); font-size: 12.5px; }
.mgr { background: color-mix(in srgb, var(--plum-tint) 55%, var(--card)); }
.mgr h2 .tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--plum); border: 1px solid currentColor; border-radius: 3px; padding: 0 5px; }
.barcode { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.barcode svg { background: #fff; border-radius: 4px; max-width: 100%; height: auto; }
.codes { display: flex; flex-wrap: wrap; gap: 6px 14px; font: 13.5px var(--mono); color: var(--ink-2); }
.flags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.flag { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--rule); }
.back { display: none; }

/* ---------- tables (reorder, reports, staff) ---------- */
.sheet { background: var(--card); border: 1px solid var(--rule); border-radius: 8px; margin-bottom: 18px; overflow: hidden; }
.sheet-h { display: flex; align-items: baseline; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.sheet-h h2 { font-size: 16px; }
.sheet-h .sub { color: var(--muted); font-size: 13px; }
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--paper-2); white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.tick { width: 34px; padding-right: 0; }
td.tick span { display: inline-block; width: 15px; height: 15px; border: 1.5px solid var(--rule-2); border-radius: 2px; vertical-align: middle; }
tr.go { cursor: pointer; }
tr.go:hover td { background: var(--paper-2); }
td .sm { display: block; color: var(--muted); font-size: 12.5px; }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 8px; background: var(--card); margin-bottom: 18px; }
.figures div { padding: 16px 18px; border-right: 1px solid var(--rule); }
.figures div:last-child { border-right: 0; }
.figures small { display: block; color: var(--muted); font-size: 12.5px; }
.figures b { display: block; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 6px 12px; font: 500 13px var(--sans); color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule-2); }
.seg button.on { background: var(--ink); color: var(--paper); }
.empty-sheet { padding: 30px 18px; color: var(--muted); }

/* ---------- scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 60; background: #0d0a08; display: flex; flex-direction: column; }
.scanner video { flex: 1; width: 100%; object-fit: cover; }
.scanner .aim { position: absolute; left: 12%; right: 12%; top: 38%; height: 20%; border: 2px solid rgba(255,255,255,.75); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(13,10,8,.55); pointer-events: none; }
.scanner .laser { position: absolute; left: 14%; right: 14%; top: 48%; height: 2px; background: var(--tomato); box-shadow: 0 0 10px var(--tomato); opacity: .85; }
.scanner .bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); color: #f2ebe3; background: linear-gradient(transparent, rgba(13,10,8,.85)); font-size: 14px; }
.scanner .bar span { flex: 1; }

/* ---------- sign in ---------- */
.auth { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 20px 0; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card img.logo { width: 220px; height: auto; display: block; margin: 0 0 22px -6px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card p { color: var(--ink-2); margin: 0 0 18px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 11px 14px; }
.err { color: var(--tomato); font-size: 13.5px; min-height: 20px; margin: 8px 0 0; }
.demo-choices { display: grid; gap: 10px; margin-top: 6px; }
.demo-choices .btn { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; text-align: left; }
.demo-choices .btn small { font-weight: 400; opacity: .85; font-size: 12.5px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 22px; }

#toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 9px 14px; border-radius: 6px; font-size: 14px; z-index: 70; max-width: calc(100% - 32px); }
.tabbar { display: none; }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .lookup { grid-template-columns: minmax(0, 1fr); }
  .lookup .detail-pane { display: none; }
  .back { display: inline-flex; margin-bottom: 12px; }
}
@media (max-width: 700px) {
  .top { gap: 12px; padding: 0 14px; height: 54px; }
  .nav { display: none; }
  .who .synced { display: none; }
  main { padding: 14px 14px 110px; }
  .searchbox { top: 54px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); border-top: 1px solid var(--rule); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 4px 0; }
  .tabbar a svg.i { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--plum); }
  .tabbar a:hover { text-decoration: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(2) { border-right: 0; }
  .facts div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures div:nth-child(2) { border-right: 0; }
  .figures div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .d-head, .block { padding-left: 16px; padding-right: 16px; }
  .facts div { padding: 12px 16px; }
  .spec { grid-template-columns: 118px minmax(0, 1fr); }
  .tablewrap td:first-child, .tablewrap th:first-child { min-width: 170px; }
  .tablewrap td.tick, .tablewrap th.tick { min-width: 0; }
  #toast { bottom: 90px; }
}
@media print {
  .top, .tabbar, .demo-bar, .no-print, #toast { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .sheet { border-color: #999; break-inside: avoid; border-radius: 0; }
  th { background: #eee; }
}
