:root {
  --bg: #0f1115;
  --panel: #191c23;
  --panel-2: #21252e;
  --line: #2c313c;
  --text: #eef1f6;
  --muted: #9aa3b2;
  --brand: #ff5a1f;
  --brand-2: #ffb01f;
  --green: #22c55e;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --red: #ef4444;
  --radius: 14px;
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.topbar .brand { font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 9px; }
.topbar .brand b { color: var(--brand); }
.topbar .brand img.logo { width: 26px; height: 26px; display: block; }

/* Hamburger + slide-out navigation (signed-in screens only) */
.navbtn {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 38px; padding: 8px; margin-right: 2px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.navbtn span { display: block; height: 2px; border-radius: 2px; background: var(--text); }
.drawer-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); opacity: 0;
  pointer-events: none; transition: opacity .2s; z-index: 90;
}
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 264px; z-index: 91;
  background: var(--panel); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .22s ease;
  display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer .dhead { display: flex; gap: 10px; align-items: center; padding: 6px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer .dhead img { width: 34px; height: 34px; }
.drawer .dname { font-weight: 800; font-size: .95rem; }
.drawer .drole { color: var(--muted); font-size: .75rem; }
.drawer a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 600;
  border-radius: 10px;
}
.drawer a:hover { background: var(--panel-2); }
.drawer a.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--brand); }
.drawer a .ic { width: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.drawer a.on .ic, .drawer a:hover .ic { color: var(--brand); }
.drawer .dfoot { margin-top: auto; padding: 12px 4px 4px; border-top: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
.pill {
  font-size: .72rem; padding: 3px 9px; border-radius: 999px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.pill.live { color: var(--green); }
.pill.test { color: var(--amber); }
.wrap { padding: 18px; max-width: 1280px; margin: 0 auto; }
.grid { display: grid; gap: 14px; }
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--text); padding: 12px 16px; border-radius: 12px; font-size: .95rem;
  font-weight: 600; cursor: pointer; transition: transform .05s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ghost { background: transparent; }
.btn.green { background: var(--green); border-color: var(--green); color: #04210f; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.muted { color: var(--muted); }
.tag {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 6px; font-weight: 700;
}
.tag.kitchen { background: #3a2417; color: var(--brand-2); }
.tag.bar { background: #142a3a; color: #7cc4ff; }
.tag.queued { background: #33291a; color: var(--amber); }
.tag.preparing { background: #1d2b3f; color: #7cc4ff; }
.tag.ready { background: #14321f; color: var(--green); }
.tag.in_kitchen { background: #33291a; color: var(--amber); }
.tag.completed { background: #14321f; color: var(--green); }
.tag.voided { background: #3a1a1a; color: var(--red); }
.tag.refunded { background: #3a1a1a; color: var(--red); }
input, select, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; font-size: .95rem; width: 100%;
}
label { font-size: .8rem; color: var(--muted); display: block; margin: 0 0 5px; }
.row { display: flex; gap: 10px; align-items: center; }
.hub {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-top: 20px;
}
.hub a.card { text-decoration: none; color: var(--text); display: block; transition: border-color .15s; }
.hub a.card:hover { border-color: var(--brand); }
.hub .emoji { font-size: 2rem; }
.hub h3 { margin: 10px 0 4px; }
.notice {
  background: #2a2113; border: 1px solid #5a4a1f; color: var(--brand-2);
  padding: 10px 14px; border-radius: 10px; font-size: .85rem;
}

/* Topbar utility icons (search, checklist, share screen) */
.uicon {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: none; color: var(--muted); display: inline-flex;
  align-items: center; justify-content: center; cursor: pointer; flex: none;
}
.uicon:hover { color: var(--text); border-color: var(--muted); }

/* ---- Mobile: every screen works on a phone or small tablet ----------------
   Columns already collapse per page; this layer fixes the shared chrome:
   scrollable tables, wrapping topbar, honest tap targets, tighter padding. */
@media (max-width: 700px) {
  .wrap { padding: 12px 10px; }
  .topbar { flex-wrap: wrap; gap: 6px; padding: 8px 10px; position: sticky; top: 0; z-index: 40; }
  .topbar .pill { font-size: .72rem; padding: 5px 9px; }
  .card { padding: 14px 12px; }
  /* Tables scroll sideways instead of crushing or overflowing the page. */
  .card table, .panel table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card table th, .card table td { white-space: nowrap; }
  .btn { min-height: 42px; }
  input, select, textarea { font-size: 16px; } /* stops iOS zoom-on-focus */
  .form-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
  .form-grid { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
}
