/* Concessions — one stylesheet for customer and volunteer screens.
   Pattonville Pirates green & white (from phs.psdr3.org theme: #007336 / #00c25a).
   No web fonts: pages must load fast on weak cellular. */
:root {
  --accent: #007336;        /* Pirates green: header, primary actions */
  --accent-ink: #ffffff;
  --accent-2: #00c25a;      /* bright green: highlights */
  --accent-deep: #004d24;
  --bg: #f3f6f4;
  --surface: #ffffff;
  --ink: #111814;
  --dark: #1d2922;          /* neutral action buttons (START, PAID) so they differ from green "done" buttons */
  --muted: #56645c;
  --line: #d6ddd8;
  --ok: #007336;
  --ok-bg: #dff5e8;
  --warn: #9a5b00;
  --warn-bg: #fff3d6;
  --bad: #b3261e;
  --bad-bg: #fde7e5;
  --new: #334155;
  --new-bg: #e6eaef;
  --gold: #b7791f;          /* scholarship / thank-you accents */
  --gold-bg: #fdf4e3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shared pieces ---------- */
.topbar {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent)); color: var(--accent-ink);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.topbar h1 { font-size: 20px; }
.topbar .sub { opacity: .85; font-size: 14px; }
.topbar .spacer { flex: 1; }
.topbar a { color: var(--accent-ink); }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1400px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stack > * + * { margin-top: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 12px; border: 2px solid transparent;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 18px;
  cursor: pointer; text-decoration: none; user-select: none; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 72px; font-size: 22px; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn.plain { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ok { background: var(--ok); }
.btn.dark { background: var(--dark); }
.btn.bad { background: var(--bad); }
.btn.small { min-height: 40px; font-size: 15px; padding: 0 14px; }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.pill.new { background: var(--new-bg); color: var(--new); }
.pill.building { background: var(--warn-bg); color: var(--warn); }
.pill.ready, .pill.paid { background: var(--ok-bg); color: var(--ok); }
.pill.unpaid { background: var(--bad-bg); color: var(--bad); }
.pill.picked_up, .pill.cancelled { background: #eceef1; color: var(--muted); }

.notice { border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.info { background: var(--ok-bg); color: var(--accent-deep); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* ---------- brand & scholarships ---------- */
.brand { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }
.cause {
  display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; border-left: 6px solid var(--gold);
}
.cause .icon { font-size: 30px; line-height: 1; }
.cause b { color: var(--accent-deep); }
.give { border: 2px solid var(--gold); background: var(--gold-bg); border-radius: var(--radius); padding: 14px; }
.give h3 { font-size: 17px; }
.give p { margin: 4px 0 10px; color: var(--muted); font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid var(--gold); background: var(--surface);
  color: var(--ink); font-weight: 700; font-size: 16px; cursor: pointer; touch-action: manipulation;
}
.chip[aria-pressed="true"] { background: var(--gold); color: #fff; }
.pill.donor { background: var(--gold-bg); color: var(--gold); }
.thanks { background: var(--gold-bg); color: #7a4f12; border-radius: 12px; padding: 12px 14px; font-weight: 600; text-align: center; }

/* ---------- customer: menu ---------- */
.catbar {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 12px -16px 0; padding: 10px 16px; background: var(--bg);
}
.catbar::-webkit-scrollbar { display: none; }
.catbar a {
  flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  color: var(--accent-deep); font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.menu-cat { scroll-margin-top: 64px; }
.menu-cat h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 4px 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.menu-cat .item:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.menu-cat .item:last-of-type { border-radius: 0 0 var(--radius) var(--radius); border-bottom: 0; }
.menu-cat .item:only-of-type { border-radius: var(--radius); }
.pic { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; line-height: 1; object-fit: cover; }
.demand .pic { margin: 0 auto 8px; }
.item .info { flex: 1; min-width: 0; }
.item .name { overflow-wrap: anywhere; }
.item .name { font-weight: 700; font-size: 18px; }
.item .price { color: var(--muted); }
.item.soldout .name, .item.soldout .price { color: #9aa1ab; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface);
  color: var(--accent); font-size: 26px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.stepper button.plus { background: var(--accent); color: var(--accent-ink); }
.stepper button:disabled { border-color: var(--line); color: #b8bec6; background: var(--surface); }
.stepper .qty { width: 36px; text-align: center; font-size: 20px; font-weight: 700; }

.cartbar {
  position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
}
.cartbar .inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.cartbar .summary { flex: 1; font-weight: 700; font-size: 18px; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 640px; border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lines td:last-child { text-align: right; }
.lines tr.total td { font-weight: 800; font-size: 20px; border-bottom: 0; }

/* ---------- customer: status ---------- */
.status-hero { text-align: center; padding: 28px 16px; }
.status-hero .label { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.status-hero .order-no { font-size: 76px; font-weight: 900; letter-spacing: -.02em; line-height: 1; margin: 6px 0 14px; }
.status-hero .state { font-size: 26px; font-weight: 800; }
body.is-ready { background: var(--ok-bg); }
body.is-ready .status-hero .state { color: var(--ok); font-size: 40px; }
.steps { display: flex; gap: 6px; margin: 18px 0 4px; }
.steps div { flex: 1; height: 8px; border-radius: 4px; background: var(--line); }
.steps div.on { background: var(--accent); }
body.is-ready .steps div.on { background: var(--ok); }
.qr { width: 180px; height: 180px; margin: 0 auto; display: block; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .v { font-weight: 700; text-align: right; }

/* ---------- volunteer screens ---------- */
.conn { font-weight: 800; font-size: 14px; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); white-space: nowrap; }
body.offline .conn { background: var(--bad); color: #fff; }
body.offline .needs-net { opacity: .35; pointer-events: none; }
.offline-banner { display: none; background: var(--bad); color: #fff; text-align: center; padding: 10px; font-weight: 800; }
body.offline .offline-banner { display: block; }

.role-grid { display: grid; gap: 14px; }
.role-grid .btn { min-height: 88px; font-size: 24px; justify-content: flex-start; padding: 0 24px; }

.pin-input { font-size: 34px; letter-spacing: .3em; text-align: center; width: 100%; padding: 14px; border-radius: 12px; border: 2px solid var(--line); }
.pin-input:focus { outline: none; border-color: var(--accent); }

.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.col h2 { font-size: 16px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; display: flex; gap: 8px; align-items: center; }
.col h2 .count { background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 14px; }
.col .empty { color: var(--muted); padding: 18px; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); }
.ocard { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; border-left: 8px solid var(--new); }
.ocard.building { border-left-color: var(--warn); }
.ocard.ready { border-left-color: var(--ok); }
.ocard.fresh { animation: flash 1.6s ease-out 2; }
@keyframes flash { 0% { background: #fff6bf; } 100% { background: var(--surface); } }
.ocard .head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ocard .no { font-size: 30px; font-weight: 900; }
.ocard .age { margin-left: auto; color: var(--muted); font-weight: 700; }
.ocard .age.late { color: var(--bad); }
.ocard ul { list-style: none; margin: 0 0 12px; padding: 0; font-size: 20px; }
.ocard li { padding: 3px 0; }
.ocard li b { display: inline-block; min-width: 2.2em; }
.ocard .slot { font-size: 40px; font-weight: 900; }
.ocard .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; padding: 28px; text-align: center; max-width: 480px; width: 100%; }
.modal .big-slot { font-size: 120px; font-weight: 900; line-height: 1; color: var(--ok); margin: 10px 0; }
.modal.full .big-slot { font-size: 44px; color: var(--bad); }

.demand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.demand { text-align: center; padding: 22px 14px; }
.demand .name { font-size: 22px; font-weight: 800; }
.demand .qty { font-size: 88px; font-weight: 900; line-height: 1.05; }
.demand .qty.zero { color: #c3c8cf; }
.demand.soldout { opacity: .55; }
.demand-list .kv .v { font-size: 22px; }

.lookup { display: flex; gap: 10px; }
.lookup input { flex: 1; min-width: 0; font-size: 34px; font-weight: 800; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); }
.lookup input:focus { outline: none; border-color: var(--accent); }
.pickup-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .pickup-layout { grid-template-columns: 1fr; } }
.result .no { font-size: 56px; font-weight: 900; line-height: 1; }
.result .slotbox { text-align: center; background: var(--ok-bg); color: var(--ok); border-radius: var(--radius); padding: 10px; }
.result .slotbox .n { font-size: 96px; font-weight: 900; line-height: 1; }
.result .slotbox.none { background: var(--warn-bg); color: var(--warn); }
.result .slotbox.none .n { font-size: 30px; padding: 20px 0; }
.result .due { font-size: 40px; font-weight: 900; }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.readylist button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 20px; font-weight: 800; }
.readylist .slot { color: var(--ok); }

.scanner video { width: 100%; border-radius: 12px; background: #000; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.tile .k { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.tile .v { font-size: 34px; font-weight: 900; }
.tile.alert { background: var(--bad-bg); }
.tile.alert .v { color: var(--bad); }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .name { flex: 1; font-weight: 700; font-size: 18px; }
.btn.state-on { background: var(--ok); }
.btn.state-off { background: var(--bad); }
.section-title { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }

/* ---------- printable sign ---------- */
.sign { text-align: center; padding: 40px 20px; }
.sign h1 { font-size: 56px; font-weight: 900; color: var(--accent); }
.sign .brand { color: var(--accent-deep); font-size: 18px; }
.sign .cause-line { font-size: 22px; color: var(--gold); font-weight: 700; margin-top: 18px; }
.sign .qr-big { width: min(80vw, 520px); height: auto; margin: 28px auto; display: block; }
.sign .url { font-size: 26px; font-weight: 700; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}
