/* Shop ERP — one stylesheet. Colours only through the tokens below (light and dark); the details are listed in DESIGN.md. */
:root {
  --ground: #F3F4F6; --surface: #FFFFFF; --panel: #F6F6F7; --panel-2: #EDEEF0;
  --ink: #111111; --ink-2: #4B4F57; --ink-3: #8C9098; --line: #E3E5E8;
  --brand: #1F6F54; --on-brand: #FFFFFF; --brand-soft: #E3F1EC;
  --accent: #2F6FEB; --ok: #2E8B57; --warn: #B7791F; --warn-soft: #FBF1DC; --stop: #E0453A; --stop-soft: #FBE4E2;
  --radius: 14px; --radius-sm: 10px;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0F1113; --surface: #17191C; --panel: #1F2226; --panel-2: #282C31;
    --ink: #F2F3F5; --ink-2: #B9BDC5; --ink-3: #80858E; --line: #2E3238;
    --brand: #3FA783; --on-brand: #06120D; --brand-soft: #173128;
    --accent: #6C9BF5; --ok: #55B884; --warn: #D9A44A; --warn-soft: #33290F; --stop: #F0665C; --stop-soft: #3A1917;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.35 var(--f-body); font-variant-numeric: tabular-nums; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { opacity: .45; cursor: default; }
.app { max-width: 720px; margin: 0 auto; min-height: 100vh; background: var(--surface); display: flex; flex-direction: column; }
.view { flex: 1; padding: 0 16px 24px; }

/* screen header */
.apphead { display: flex; align-items: center; gap: 10px; padding: 14px 0 10px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.apphead h1 { margin: 0; font-size: 20px; font-weight: 700; }
.back { color: var(--accent); font-weight: 600; padding: 6px 8px 6px 0; }
.grow { flex: 1; min-width: 0; }
.where { color: var(--ink-3); font-size: 13px; }

/* home */
.hub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.hubbtn { background: var(--panel); border-radius: var(--radius); padding: 16px 14px; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; }
.hubbtn b { font-size: 17px; }
.hubbtn small { color: var(--ink-3); font-size: 12.5px; }
.hubbtn.main { background: var(--brand); color: var(--on-brand); grid-column: 1 / -1; }
.hubbtn.main small { color: inherit; opacity: .8; }

/* blocks, rows */
.label { margin: 18px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.inset { background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row b { font-weight: 600; }
.meta { color: var(--ink-3); font-size: 12.5px; }
.num { font-weight: 700; white-space: nowrap; }
.num.minus { color: var(--stop); }
.num.zero { color: var(--ink-3); }
.empty { color: var(--ink-3); text-align: center; padding: 22px 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { background: var(--panel-2); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; }
.chip.minus { background: var(--stop-soft); color: var(--stop); }
.chip.zero { color: var(--ink-3); font-weight: 500; }
.prod { padding: 11px 12px; border-top: 1px solid var(--line); }
.prod:first-child { border-top: 0; }
.prod .row { padding: 4px 0; border: 0; }
.arch { opacity: .55; }
.bar { margin: 10px 0; }

.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--panel-2); flex: none; }
.strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 8px; }
.strip img { height: 260px; border-radius: var(--radius-sm); background: var(--panel); min-width: 150px; object-fit: cover; }
.pre { white-space: pre-wrap; color: var(--ink-2); font-size: 13.5px; background: var(--panel); border-radius: var(--radius); padding: 12px; }
.warnt { color: var(--warn); }
.right { text-align: right; }
.chip.picked { background: var(--brand); color: var(--on-brand); }

/* controls */
.field { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; outline: none; }
.field:focus { border-color: var(--accent); }
.form label { display: block; margin: 12px 0 4px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cta { display: block; width: 100%; background: var(--brand); color: var(--on-brand); border-radius: var(--radius); padding: 14px; font-size: 16px; font-weight: 700; text-align: center; }
.cta.ghost { background: var(--panel-2); color: var(--ink); }
.cta.danger { background: var(--stop-soft); color: var(--stop); }
.cta.small { display: inline-block; width: auto; padding: 7px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.stack > * + * { margin-top: 8px; }
.seg { display: inline-flex; background: var(--panel-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; max-width: 100%; }
.seg button { padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper button { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); font-size: 18px; font-weight: 700; text-align: center; }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; }
.qb { background: var(--panel-2); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700; }
.footbar { position: sticky; bottom: 0; background: var(--surface); padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.total b { font-size: 20px; }

/* banners, tiles */
.banner { background: var(--brand-soft); border-radius: var(--radius); padding: 11px 12px; margin-top: 10px; font-size: 13.5px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.stop { background: var(--stop-soft); color: var(--stop); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tile { background: var(--panel); border-radius: var(--radius); padding: 11px 12px; }
.tile small { display: block; color: var(--ink-3); font-size: 12px; }
.tile b { font-size: 18px; }
.tile.wide { grid-column: 1 / -1; }
.tile.wide b { font-size: 24px; }
.plus { color: var(--ok); }

/* toast, modal */
.toast { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translateX(-50%); background: #111; color: #fff; border-radius: 999px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 20; }
.toast.on { opacity: 1; }
.toast.bad { background: var(--stop); }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
.modal[hidden] { display: none; }
.mbox { background: var(--surface); border-radius: var(--radius); padding: 16px; width: 100%; max-width: 380px; }
.mbox p { margin: 0 0 12px; font-weight: 600; white-space: pre-line; }
.mbtns { margin-top: 12px; }
.mbtns > * + * { margin-top: 8px; }
