:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --line: #ffffff;
  --muted: #9a9a9a;
  --accent: #c8a06a;      /* warm espresso/cream */
  --accent-ink: #0d0d0d;
  --danger: #d9534f;
  --ok: #5ca66a;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--line); font-family: var(--font); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 460px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding: 20px; }
.brand { text-align: center; padding: 16px 0; }
.brand img { width: 96px; height: auto; }
.brand h1 { font-size: 14px; letter-spacing: 3px; font-weight: 600; margin: 8px 0 0; }
.card { background: var(--surface); border: 1px solid #262626; border-radius: var(--radius); padding: 20px; margin: 12px 0; }
button { width: 100%; padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent; color: var(--line); font-size: 17px; font-weight: 600; cursor: pointer; margin-top: 10px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button:disabled { opacity: .35; cursor: not-allowed; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad button { margin: 0; }
.pin-display { text-align: center; font-size: 28px; letter-spacing: 10px; min-height: 40px; }
.balance { font-size: 44px; font-weight: 700; text-align: center; }
.balance small { display: block; font-size: 14px; color: var(--muted); letter-spacing: 1px; font-weight: 400; }
.badge { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.ready { background: var(--accent); color: var(--accent-ink); }
.badge.warn { background: #3a2f1c; color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--line); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; }
.hidden { display: none !important; }
#reader { border-radius: var(--radius); overflow: hidden; }
.muted { color: var(--muted); text-align: center; font-size: 14px; }
.linkbtn { background: none; border: none; color: var(--accent); width: auto; padding: 8px; font-size: 14px; }
/* View tabs (Scan / Orders) */
.stafftabs { display: flex; gap: 8px; margin: 0 0 12px; }
.stafftabs button { margin: 0; padding: 12px 0; font-size: 15px; border: 1px solid #333; border-radius: 12px; color: var(--muted); }
.stafftabs button.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.ord-badge { display: inline-block; margin-left: 8px; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 800; }

/* Kitchen display (iPad) */
#orders { width: 100%; }
.ord-card { background: var(--surface); border: 1px solid #262626; border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; position: relative; }
.ord-card.status-ready { border-color: var(--ok); }
.ord-card.fresh { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(200,160,106,.35); }
.ord-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ord-who { font-size: 20px; font-weight: 800; }
.ord-meta { color: var(--muted); font-size: 15px; }
.ord-meta.late { color: var(--danger); font-weight: 800; }
.ord-pay { display: inline-block; margin: 6px 0 4px; font-size: 11px; letter-spacing: 1px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.ord-pay.paid { background: rgba(92,166,106,.18); color: var(--ok); }
.ord-pay.unpaid { background: rgba(200,160,106,.18); color: var(--accent); }
.ord-line { font-size: 18px; font-weight: 600; padding: 6px 0 0; }
.ord-mods { color: var(--muted); font-size: 14px; font-weight: 400; margin-top: 2px; }
.ord-btn { margin-top: 14px; padding: 14px; font-size: 17px; }

/* Sold-out panel */
.so-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #262626; }
.so-name { font-size: 15px; }
.so-name.off { color: var(--danger); text-decoration: line-through; }
.so-btn { width: auto; margin: 0; padding: 8px 14px; font-size: 13px; border: 1px solid #333; }
.so-btn.selling { border-color: var(--ok); color: var(--ok); }

/* iPad: wider layout + two-column queue */
@media (min-width: 700px) {
  .wrap { max-width: 900px; }
  #queueWrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .ord-card { margin: 0; }
}

.phone-row { display: flex; gap: 8px; margin-top: 14px; align-items: stretch; }
.phone-row input { flex: 1; min-width: 0; margin: 0; padding: 14px 12px; border-radius: 10px; border: 1px solid #333; background: #0d0d0d; color: #fff; font-size: 16px; }
.phone-row button { flex: 0 0 auto; width: auto; margin: 0; padding: 14px 22px; font-size: 16px; white-space: nowrap; }
