/* Layout: one narrow centred column for the public site, a working list + side panel for staff. */
:root {
  --bg: #f6f4f1;
  --surface: #ffffff;
  --sunk: #ece8e2;
  --ink: #1b1611;
  --muted: #6c6258;
  --line: #ddd6cc;
  --accent: #5f3e1f;      /* logo brown */
  --accent-ink: #ffffff;
  --accent-soft: #f3e7d8;
  --velvet: #5f3e1f;      /* logo background brown */
  --tan: #dbb07d;         /* logo gold-tan */
  --ok: #2f7a4c; --ok-soft: #e3f1e8;
  --warn: #9a6a0c; --warn-soft: #f7ecd2;
  --bad: #a8321f; --bad-soft: #f8e1dc;
  --info: #335f96; --info-soft: #e1eaf6;
  --font-display: "Frank Ruhl Libre", "Times New Roman", serif;
  --font-body: "Assistant", "Segoe UI", system-ui, sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110e; --surface: #1d1915; --sunk: #100d0b; --ink: #f0e9e1; --muted: #a79c90; --line: #352e27;
    --accent: #dbb07d; --accent-ink: #2a1a0c; --accent-soft: #3a2b1c; --velvet: #4e3218;
    --ok: #7cc79a; --ok-soft: #1d3326; --warn: #e2b55a; --warn-soft: #3a2f17;
    --bad: #ee8b78; --bad-soft: #3d201a; --info: #8db4e6; --info-soft: #1c2a3d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14110e; --surface: #1d1915; --sunk: #100d0b; --ink: #f0e9e1; --muted: #a79c90; --line: #352e27;
  --accent: #dbb07d; --accent-ink: #2a1a0c; --accent-soft: #3a2b1c; --velvet: #4e3218;
  --ok: #7cc79a; --ok-soft: #1d3326; --warn: #e2b55a; --warn-soft: #3a2f17;
  --bad: #ee8b78; --bad-soft: #3d201a; --info: #8db4e6; --info-soft: #1c2a3d;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.55;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px/1 var(--font-body); padding: 13px 20px; border-radius: 999px;
  border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  text-decoration: none; cursor: pointer; transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: var(--sunk); border-color: var(--line); color: var(--ink); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { opacity: .55; cursor: wait; }

label.field, div.field { display: grid; gap: 6px; min-width: 0; }
label.field > span, div.field > label { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
label.field > span em, div.field > label em { font-style: normal; font-weight: 400; }
input, select, textarea {
  font: 400 17px/1.4 var(--font-body); color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 11px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-online { background: #efe7f7; color: #6b3fa0; }
.st-received { background: var(--info-soft); color: var(--info); }
.st-in_work { background: var(--warn-soft); color: var(--warn); }
.st-ready { background: var(--ok-soft); color: var(--ok); }
.st-picked_up, .st-cancelled { background: var(--sunk); color: var(--muted); }

.notice { padding: 12px 14px; border-radius: 8px; font-size: 15px; }
.notice.error { background: var(--bad-soft); color: var(--bad); }
.notice.demo { background: var(--warn-soft); color: var(--warn); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* address suggestions */
.addr-box { position: relative; min-width: 0; }
.addr-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .14); }
.addr-list li { padding: 9px 10px; border-radius: 6px; cursor: pointer; font-size: 15px; line-height: 1.3; color: var(--ink); }
.addr-list li:hover, .addr-list li[aria-selected="true"] { background: var(--accent-soft); }
.addr-list li.addr-credit { cursor: default; font-size: 11px; color: var(--muted); padding: 4px 10px 2px; }
.addr-list li.addr-credit:hover { background: none; }

/* + Add a product (Work needed) */
.addprod { grid-column: 1 / -1; border: 1px dashed var(--accent, #9a6a3a); border-radius: 12px; padding: 12px; display: grid; gap: 10px; background: var(--accent-soft); }
.addprod > b { font-size: 15px; }
.addprod-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.addprod-btns { display: flex; gap: 8px; justify-content: flex-end; }
.addprod p { margin: 0; font-size: 13px; color: var(--muted); }
