/* Chip Runner — calm utility, system sans, big tap targets. */

:root {
  --ink: #1a1a1a;
  --ink-soft: #5a5a5a;
  --ink-faint: #9a9a9a;
  --paper: #fafaf7;
  --paper-line: #e5e3dc;
  --canvas: #ececea;
  --accent: #c96442;
  --accent-soft: #f4d8cc;
  --success: #2f7d4f;
  --success-soft: #d6ead8;

  --r-card: 14px;
  --r-btn: 12px;

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
             "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", "Menlo", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

/* ───────── App shell ───────── */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 28px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  min-height: 100vh;
}

.screen-wide {
  max-width: 1080px;
  background: var(--paper);
  padding: 28px 28px 40px;
}

/* ───────── Header / titles ───────── */

.eyebrow-sm {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.title-xl {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 6px 0 0;
}

.title-lg {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
}

.subhead {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

.subhead-sm {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 2px 0 0;
}

.club-badge {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

/* ───────── Layout helpers ───────── */

.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.center { align-items: center; justify-content: center; }
.mt-2 { margin-top: 2px; } .mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; } .mt-24 { margin-top: 24px; }

.spacer { flex: 1; }

/* ───────── Boxes / cards ───────── */

.box {
  border: 2px solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
  padding: 14px;
}

.box-row {
  border: 2px solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.box-row.dark {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.box-row .name { font-size: 17px; font-weight: 600; }
.box-row .meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.box-row.dark .meta { color: rgba(250,250,247,0.7); }
.box-row .chev { font-size: 22px; color: var(--ink-faint); }
.box-row.dark .chev { color: rgba(250,250,247,0.7); }

/* ───────── Buttons ───────── */

.btn {
  border: 2px solid var(--ink);
  border-radius: var(--r-btn);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 16px;
  padding: 14px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.large { font-size: 18px; padding: 16px 18px; }
.btn.full { width: 100%; }
.btn.ghost { border-color: var(--ink-faint); color: var(--ink-soft); }

.back-chip {
  width: 36px; height: 36px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.checkout-link {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-ui);
}

/* ───────── Inputs ───────── */

.field {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  font-family: var(--font-ui);
  font-size: 17px;
  padding: 14px 14px;
  width: 100%;
  color: var(--ink);
  outline: none;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.field-mono {
  font-family: var(--font-mono);
  letter-spacing: 4px;
  font-size: 22px;
  text-align: center;
  font-weight: 700;
}

.placeholder {
  border: 2px dashed var(--ink-faint);
  border-radius: 8px;
  background: rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
  padding: 12px;
}

/* ───────── Member display + keypad ───────── */

.member-display {
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  padding: 18px 14px;
  text-align: center;
}
.member-display .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.member-display .value {
  font-size: 30px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 4px;
  font-family: var(--font-mono);
  min-height: 36px;
  line-height: 1;
}
.member-display .value.empty { color: var(--ink-faint); letter-spacing: 0; }

.keypad { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.keypad .key {
  height: 56px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-ui);
}
.keypad .key:active { background: var(--ink); color: var(--paper); }
.keypad .key.empty { border: none; background: transparent; cursor: default; }

/* ───────── Customer Home ───────── */

.home-meta { display: flex; justify-content: space-between; align-items: center; }
.home-meta .member { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; }
.home-meta .seat { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.home-meta .out {
  width: 36px; height: 36px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.time-card {
  text-align: center;
  padding: 18px 12px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
}
.time-card .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ink-soft);
}
.time-card .clock {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 4px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.time-card .buy-prompt {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

.action-card {
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-ui);
  text-align: left;
}
.action-card.dark { background: var(--ink); color: var(--paper); }
.action-card .kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-soft);
}
.action-card.dark .kicker { color: rgba(250,250,247,0.7); }
.action-card .title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2px;
}

/* ───────── Buy Time tiles ───────── */

.tier {
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
}
.tier.selected { background: var(--ink); color: var(--paper); }
.tier .hours { display: flex; align-items: baseline; gap: 6px; }
.tier .hours .num { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.tier .hours .unit { font-size: 16px; opacity: 0.7; }
.tier .label { font-size: 13px; opacity: 0.7; margin-top: 2px; }
.tier .price { font-size: 24px; font-weight: 700; text-align: right; }

/* ───────── Status / Confirmation ───────── */

.confirm-card {
  border: 2px solid var(--success);
  border-radius: 14px;
  padding: 22px 18px;
  text-align: center;
  background: var(--success-soft);
}
.confirm-card .check {
  width: 64px; height: 64px;
  border-radius: 32px;
  margin: 0 auto;
  border: 3px solid var(--success);
  background: var(--paper);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700;
}
.confirm-card .head { font-size: 22px; font-weight: 700; margin-top: 12px; color: var(--success); }
.confirm-card .body { font-size: 14px; color: var(--ink-soft); margin-top: 4px; line-height: 1.4; }

/* Neutral confirm (non-payment requests) */
.confirm-card.neutral { border-color: var(--ink); background: var(--paper); }
.confirm-card.neutral .check { border-color: var(--ink); color: var(--ink); }
.confirm-card.neutral .head { color: var(--ink); }

/* ───────── Request lists (customer home pending/completed) ───────── */

.req-mini-list { display: flex; flex-direction: column; gap: 8px; }
.req-mini {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.req-mini.done { opacity: 0.6; }
.req-mini .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.req-mini .label { font-size: 14px; font-weight: 600; }
.req-mini .status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.req-mini .detail { font-size: 12px; color: var(--ink-soft); }

.empty-line { font-size: 13px; color: var(--ink-faint); padding: 6px 0; }

/* ───────── House dashboard ───────── */

.dash-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-ui);
}
.tab.active { background: var(--ink); color: var(--paper); }

.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-row {
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
}
.req-row.urgent { background: var(--accent-soft); }
.req-row .type-pill {
  width: 110px;
  text-align: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 6px 0;
  text-transform: uppercase;
}
.req-row .type-pill.time { background: #1f3a5a; }
.req-row .type-pill.waitress { background: #2f4a3a; }
.req-row .type-pill.chips { background: #6b3a3a; }

.req-row .col-cell { display: flex; flex-direction: column; }
.req-row .col-cell .k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.req-row .col-cell .v { font-size: 16px; font-weight: 700; margin-top: 2px; }
.req-row .col-cell .v.urgent { color: var(--accent); }
.req-row .col-cell.wait { width: 80px; }
.req-row .col-cell.table { width: 110px; }
.req-row .col-cell.member { flex: 1; min-width: 0; }
.req-row .col-cell.member .v { font-size: 14px; font-weight: 500; }
.req-row .col-cell.member .v .muted { color: var(--ink-soft); font-weight: 400; }

.req-row.done { opacity: 0.55; background: var(--paper); }
.req-row.done .type-pill { background: var(--ink-faint); }
.req-row.done .type-pill.waitress { background: var(--ink-faint); }
.req-row.done .type-pill.chips { background: var(--ink-faint); }

/* Stack the row on small screens (phone runner view) */
@media (max-width: 600px) {
  .req-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .req-row .col-cell.wait,
  .req-row .col-cell.table,
  .req-row .col-cell.member { width: 100%; }
  .req-row .type-pill { width: auto; align-self: flex-start; padding: 4px 10px; }
  .req-row .btn { width: 100%; }
}

/* ───────── Error / banner ───────── */

.error {
  margin-top: 12px;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

/* ───────── Stripe payment field skin ───────── */

#payment-element {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  padding: 12px;
}

/* ───────── Misc ───────── */

.divider { border-top: 1px dashed var(--paper-line); margin: 12px 0; }

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.summary-line.total { font-size: 18px; font-weight: 800; }
