:root {
  --pink: #D71920;
  --pink-dark: #b3141a;
  --yellow: #FFC72C;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #faf7f8;
  --card: #ffffff;
  --border: #eadce1;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tap: 48px;
  --font-head: 'Oswald', Arial, sans-serif;
  --font-body: 'Open Sans', Arial, sans-serif;
  font-family: var(--font-body);
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  max-width: 430px;
  margin: 0 auto;
}
.sandbox-banner {
  position: sticky; top: 0; z-index: 100;
  background: var(--yellow); color: var(--ink);
  font-weight: 800; font-size: 12px; text-align: center;
  padding: 8px 10px; letter-spacing: 0.02em;
}
.staff-header {
  background: var(--pink); color: #fff;
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
}
.staff-header img { width: 40px; height: 40px; border-radius: 8px; }
.staff-header h1 { margin: 0; font-size: 18px; font-weight: 700; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; }
.staff-header { display: flex; align-items: center; gap: 10px; }
.role-wrap { margin-left: auto; font-size: 12px; font-weight: 700; }
.role-wrap select { display: block; margin-top: 4px; font-size: 13px; }
.staff-header .sub { margin: 2px 0 0; font-size: 12px; opacity: 0.95; }
.badge-est {
  display: inline-block; background: var(--yellow); color: var(--ink);
  font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px;
  text-transform: uppercase; vertical-align: middle;
}
main { padding: 12px; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; margin-bottom: 10px;
}
.card h2 { margin: 0 0 8px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 16px; border-radius: 10px;
  border: none; font-weight: 700; font-size: 15px; cursor: pointer;
  width: 100%;
}
.btn-primary { background: var(--pink); color: #fff; }
.btn-accent { background: var(--yellow); color: var(--ink); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.btn-danger { background: #fff; border: 1px solid #e00; color: #c00; }
.btn.row { width: auto; flex: 1; }
.row { display: flex; gap: 8px; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 16px;
  margin-bottom: 8px;
}
label { display: block; font-size: 13px; font-weight: 600; margin: 6px 0 4px; }
[data-kitchen-settings] fieldset { border: 1px solid var(--border); border-radius: 10px; margin: 12px 0; padding: 8px 12px 12px; }
[data-kitchen-settings] legend { font-weight: 700; padding: 0 4px; }
[data-kitchen-settings] .option-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; }
[data-kitchen-settings] input[type="checkbox"],
[data-kitchen-settings] input[type="radio"] { width: 22px; min-height: 22px; margin: 0; }
[data-kitchen-settings] input[type="number"] { width: 5rem; display: inline-block; margin: 0 6px; }
.tabs {
  position: sticky; top: 0; z-index: 80;
  display: flex; background: #fff; border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 0 auto; min-width: 72px; border: none; background: transparent; padding: 14px 8px;
  font-size: 15px; font-weight: 800; color: var(--muted); min-height: 52px;
}
.tabs button.active { color: #fff; background: var(--pink); }
.group-card {
  display: block; width: 100%; text-align: left; margin-bottom: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.group-card strong { display: block; font-size: 20px; margin-bottom: 4px; }
.group-card span { color: var(--muted); font-size: 14px; font-weight: 600; }
.tabs button[hidden] { display: none; }
.subnav {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0;
  scrollbar-width: none;
}
.subnav:empty { display: none; }
.subnav button {
  flex: 0 0 auto; border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 8px 12px; font-size: 13px; font-weight: 700; min-height: 40px;
}
.subnav button.active { background: var(--pink); color: #fff; border-color: var(--pink); }
.settings-switch { display: none; }
.office-nav { display: flex; flex-direction: column; gap: 8px; }
.office-nav h2 { margin: 0; }
.office-back { display: none; margin-bottom: 10px; }
.office.is-open .office-nav { display: none; }
.office.is-open .office-back { display: inline-flex; width: auto; }
@media (min-width: 768px) {
  body { max-width: 1100px; }
  .login-wrap { max-width: 420px; margin: 0 auto; }
  .staff-header .btn { width: auto; margin-left: auto; }
  #app:not(.hidden) {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto auto 1fr;
    align-items: start;
  }
  .staff-header { grid-column: 1 / -1; }
  .tabs {
    grid-column: 1; grid-row: 2 / span 2;
    flex-direction: column; position: sticky; top: 0;
    min-height: calc(100vh - 88px); border-bottom: none; border-right: 1px solid var(--border);
  }
  .tabs button { width: 100%; text-align: left; font-size: 17px; padding: 16px 14px; }
  #subnav, main { grid-column: 2; }
  #group-home:not(.hidden) { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  #group-home h2, #group-home > .muted { grid-column: 1 / -1; }
  .office { display: block; }
  .office.is-open .office-nav { display: none; }
  .office.is-open .office-back { display: inline-flex !important; width: auto; }
}
.hidden { display: none !important; }
.login-wrap { padding: 24px 16px; }
.login-wrap .logo { width: 96px; height: 96px; border-radius: 16px; display: block; margin: 0 auto 12px; }
.pass-dots { display: flex; gap: 10px; justify-content: center; margin: 16px 0; }
.pass-dots span {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--pink); background: transparent;
}
.pass-dots span.on { background: var(--pink); }
.numpad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 0 auto;
}
.numpad button {
  min-height: 56px; font-size: 22px; font-weight: 700;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.numpad button.wide { grid-column: span 1; }
#error-box, .ok-box {
  padding: 10px 12px; border-radius: 8px; margin: 8px 0; font-size: 14px; font-weight: 600;
}
#error-box { background: #ffe4e8; color: #8b0020; }
.ok-box { background: #e6f7e9; color: #0a5c1f; }
#reader { width: 100%; border-radius: 12px; overflow: hidden; background: #000; min-height: 220px; }
.scan-result { font-size: 15px; }
.big-qty { font-size: 36px; font-weight: 800; text-align: center; margin: 8px 0; }
.search-list { max-height: 280px; overflow: auto; }
.search-list button {
  display: block; width: 100%; text-align: left; padding: 12px;
  border: none; border-bottom: 1px solid var(--border); background: #fff; font-size: 14px;
}
.stock-row {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.stock-row .low { color: #c00; font-weight: 800; }
.stock-group { margin: 16px 0 8px; }
.stock-group-title { font-size: 13px; margin: 0 0 4px; letter-spacing: 0.02em; }
.stock-sub { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.stock-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.stock-chip {
  border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 6px 10px; font-size: 12px; font-weight: 700;
}
.stock-chip.active { background: var(--pink); color: #fff; border-color: transparent; }
.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.table th { font-size: 11px; color: var(--muted); }
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #f0e6ea;
}
.chip.draft { background: #fff3c4; }
.chip.approved { background: #d4f5d8; }
.chip.cancelled { background: #f0f0f0; color: var(--muted); }
/* v5 staff modules */
.so-row { align-items: center; }
.so-row > span:last-child { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.so-row input[type=checkbox], #lo-show-done { width: 26px; height: 26px; min-height: 0; margin: 0; padding: 0; flex: none; }
.live-order .btn { flex: 1 1 auto; min-width: 90px; }
.not-connected { background: #fff3c4; border: 1px solid var(--yellow); border-radius: 8px; padding: 8px 10px; font-size: 13px; }

/* Sales graph + Cook plan (Marlon, 27 Sep 2026). Brand red bars; no chart library. */
.sales-chart { display: flex; align-items: flex-end; gap: 4px; height: 130px; margin-top: 12px; }
.sales-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.sales-chart .bar { width: 100%; background: var(--pink); border-radius: 3px 3px 0 0; }
.sales-chart .bar.bar-zero { background: var(--border, #e5e5e5); }
.sales-chart .bar-n { font-size: 10px; font-weight: 700; min-height: 12px; }
.sales-chart span { font-size: 9px; margin-top: 4px; }
.day-row { display: grid; grid-template-columns: 78px 1fr auto; gap: 8px; align-items: center; font-size: 13px; margin: 4px 0; }
.day-bar { height: 10px; background: #f1f1f1; border-radius: 5px; overflow: hidden; }
.day-bar i { display: block; height: 100%; background: var(--pink); }
.badge-est { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--yellow); color: #111; font-size: 12px; font-family: var(--font-body); vertical-align: middle; }
.empty { background: #fafafa; border: 1px dashed var(--border, #ddd); border-radius: 8px; padding: 10px; color: var(--muted); }
.cook-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid #eee; }
.cook-row .ready input { width: 70px; margin-left: 4px; }
.cook-row .cook-n { grid-column: 1 / -1; font-size: 15px; }

/* Settings (27 Sep): header button replaces the Seat dropdown; the switcher sits in the Settings card */
#open-settings { margin-left: auto; }
#tab-settings .role-wrap { margin-left: 0; display: block; font-size: 14px; }
#tab-settings .role-wrap select { width: 100%; max-width: 320px; font-size: 16px; padding: 8px; }

/* Emergency banner (store / GM / admin while the app is open) */
.emergency-banner { position: sticky; top: 0; z-index: 1000; background: #b00012; color: #fff; padding: 12px 14px; box-shadow: 0 4px 14px rgba(0,0,0,.35); animation: em-pulse 1s ease-in-out infinite alternate; }
.emergency-banner.hidden { display: none; }
.emergency-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; }
.emergency-row + .emergency-row { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.35); padding-top: 8px; }
.emergency-row strong { font-family: 'Oswald', sans-serif; letter-spacing: .06em; font-size: 20px; }
.emergency-actions { margin-left: auto; display: flex; gap: 6px; }
@keyframes em-pulse { from { background: #b00012; } to { background: #D71920; } }
.emergency-note { background: #ffe4e8; border: 1px solid #D71920; border-radius: 8px; padding: 8px 10px; font-size: 14px; font-weight: 700; }
