/* ═══════════════ REX DINNER POS — retro diner theme ═══════════════ */

:root {
  --cream: #f4ecd8;
  --cream-dark: #eadfc4;
  --paper: #fbf6e9;
  --red: #c1272d;
  --red-dark: #921a1f;
  --red-neon: #ff2e3a;
  --teal: #177e75;
  --teal-dark: #0e5c55;
  --teal-neon: #35e0d2;
  --ink: #241d15;
  --ink-soft: #5c5142;
  --shadow: 0 3px 10px rgba(36, 29, 21, .18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Oswald', 'Segoe UI', sans-serif;
  background: var(--cream);
  background-image:
    radial-gradient(rgba(36,29,21,.035) 1px, transparent 1px),
    radial-gradient(rgba(36,29,21,.03) 1px, transparent 1px);
  background-size: 22px 22px, 34px 34px;
  background-position: 0 0, 11px 11px;
  color: var(--ink);
  min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ─────────── Neon sign header ─────────── */
.sign {
  background:
    radial-gradient(ellipse at 50% 0%, #3a2521 0%, #1c1210 55%, #120b0a 100%);
  text-align: center;
  padding: 26px 16px 30px;
  position: relative;
  overflow: hidden;
}
.sign::before, .sign::after {
  content: '✦';
  position: absolute;
  color: rgba(255,255,255,.35);
  font-size: 22px;
  top: 24px;
}
.sign::before { left: 8%; }
.sign::after { right: 8%; top: auto; bottom: 28px; }

.sign-rex {
  font-family: 'Alfa Slab One', serif;
  font-size: clamp(52px, 9vw, 92px);
  line-height: .95;
  color: #ff5b63;
  letter-spacing: .06em;
  text-shadow:
    0 0 6px rgba(255,46,58,.9),
    0 0 18px rgba(255,46,58,.75),
    0 0 42px rgba(255,46,58,.5),
    0 3px 0 #6e0d12;
}
.sign-dinner {
  font-family: 'Staatliches', sans-serif;
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: .28em;
  padding-left: .28em; /* balance tracking */
  color: #bffff9;
  text-shadow:
    0 0 5px rgba(53,224,210,.95),
    0 0 16px rgba(53,224,210,.75),
    0 0 36px rgba(53,224,210,.5);
  margin-top: 2px;
}
.sign-tag {
  display: inline-block;
  margin-top: 12px;
  font-family: 'Staatliches', sans-serif;
  font-size: 15px;
  letter-spacing: .18em;
  padding: 5px 22px 4px;
  color: #fff;
  background: var(--red);
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(255,46,58,.5);
}

/* checkerboard strip */
.checker-strip {
  height: 22px;
  background: repeating-conic-gradient(#161310 0% 25%, var(--cream) 0% 50%) 0 0 / 22px 22px;
  border-top: 3px solid #161310;
  border-bottom: 3px solid #161310;
}
.checker-strip--thin { height: 14px; background-size: 14px 14px; }

/* ─────────── Status bar ─────────── */
.statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 40;
}
.status-chip {
  display: flex;
  flex-direction: column;
  padding: 4px 16px;
  border-right: 2px dotted var(--cream-dark);
}
.status-label {
  font-family: 'Staatliches', sans-serif;
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--ink-soft);
}
.status-value {
  font-family: 'Staatliches', sans-serif;
  font-size: 22px;
  letter-spacing: .04em;
  line-height: 1.05;
}
.status-value--money { color: var(--red); }
.status-value--fund { color: var(--teal-dark); }
.status-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─────────── Buttons ─────────── */
.btn {
  font-family: 'Staatliches', sans-serif;
  font-size: 17px;
  letter-spacing: .08em;
  padding: 9px 18px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
  color: #fff;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--teal-neon); outline-offset: 2px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--red { background: var(--red); }
.btn--red:hover:not(:disabled) { background: var(--red-dark); }
.btn--teal { background: var(--teal); }
.btn--teal:hover:not(:disabled) { background: var(--teal-dark); }
.btn--ghost { background: var(--paper); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: var(--cream-dark); }
.btn--big { font-size: 22px; padding: 12px 22px; width: 100%; }
.btn--full { width: 100%; }

/* ─────────── Layout ─────────── */
.layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  align-items: start;
}

/* ─────────── Menu ─────────── */
.menu-section { margin-bottom: 30px; }

.section-banner {
  display: inline-block;
  font-family: 'Staatliches', sans-serif;
  font-size: 26px;
  letter-spacing: .12em;
  color: #fff;
  padding: 6px 28px 4px;
  transform: skewX(-8deg);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  margin-bottom: 16px;
}
.section-banner > span { display: inline-block; transform: skewX(8deg); }
.section-banner--red { background: var(--red); }
.section-banner--teal { background: var(--teal); }
.section-note {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 600;
  color: var(--ink-soft);
  margin: -8px 0 14px 4px;
  font-size: 15px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.item-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 rgba(36,29,21,.75);
  padding: 12px 10px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform .09s ease, box-shadow .09s ease, background .15s ease;
  user-select: none;
}
.item-card:hover { transform: translateY(-2px); box-shadow: 4px 5px 0 rgba(36,29,21,.75); background: #fffdf4; }
.item-card:active { transform: translateY(1px) scale(.98); box-shadow: 2px 2px 0 rgba(36,29,21,.75); }
.item-card:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.item-card.pop { animation: pop .25s ease; }
@keyframes pop {
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.item-emoji { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 1px rgba(36,29,21,.25)); }
.item-name {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.15;
}
.item-sub {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.25;
}
.item-price {
  font-family: 'Staatliches', sans-serif;
  font-size: 19px;
  color: var(--red);
  letter-spacing: .05em;
  margin-top: auto;
}
.item-card--combo .item-name { color: var(--teal-dark); font-style: normal; font-family: 'Staatliches', sans-serif; font-size: 18px; letter-spacing: .05em; }

/* ─────────── Order panel / receipt ─────────── */
.order-panel {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.receipt {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px 12px 4px 4px;
  box-shadow: var(--shadow), 4px 4px 0 rgba(36,29,21,.7);
  padding: 0 16px 16px;
  overflow: hidden;
}
.receipt-head {
  font-family: 'Staatliches', sans-serif;
  font-size: 24px;
  letter-spacing: .16em;
  text-align: center;
  color: #fff;
  background: var(--red);
  margin: 0 -16px 14px;
  padding: 10px 0 8px;
  border-bottom: 2px solid var(--ink);
}
.receipt-star { color: #ffd9a0; font-size: 16px; vertical-align: 3px; }

.order-lines {
  min-height: 90px;
  max-height: 320px;
  overflow-y: auto;
  margin: 12px 0;
  border-top: 2px dashed var(--cream-dark);
  border-bottom: 2px dashed var(--cream-dark);
  padding: 8px 0;
}
.order-empty {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  padding: 18px 6px;
  font-size: 14px;
}
.order-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 2px;
  font-size: 15px;
}
.order-line-name { font-weight: 500; line-height: 1.2; }
.order-line-price { font-family: 'Staatliches', sans-serif; font-size: 16px; min-width: 58px; text-align: right; }
.qty-controls { display: flex; align-items: center; gap: 6px; }
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: var(--cream);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .12s;
}
.qty-btn:hover { background: var(--cream-dark); }
.qty-btn--del { background: #f6d5d6; color: var(--red-dark); }
.qty-btn--del:hover { background: #efb9bb; }
.qty-num { font-family: 'Staatliches', sans-serif; font-size: 17px; min-width: 20px; text-align: center; }

.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'Staatliches', sans-serif;
  font-size: 26px;
  letter-spacing: .08em;
  color: var(--red);
  margin-bottom: 12px;
}
.receipt .btn + .btn { margin-top: 8px; }

/* donation fund on the guest check */
.fund-use {
  border: 2px dashed var(--teal);
  border-radius: 10px;
  background: #eef7f2;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.fund-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Staatliches', sans-serif;
  font-size: 16px;
  letter-spacing: .06em;
  color: var(--teal-dark);
  cursor: pointer;
  user-select: none;
}
.fund-check input {
  width: 18px; height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
}
.fund-breakdown {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1.5px dashed rgba(23,126,117,.35);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.fund-breakdown b { font-family: 'Staatliches', sans-serif; letter-spacing: .04em; }
.fund-breakdown .fb-comp { color: var(--teal-dark); }
.fund-breakdown .fb-due { color: var(--red); }

.comped-tag {
  display: inline-block;
  font-family: 'Staatliches', sans-serif;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--teal-dark);
  background: #dff0e8;
  border: 1.5px solid var(--teal);
  border-radius: 999px;
  padding: 1px 10px;
  margin-top: 4px;
}

.fund-balance-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 10px 16px;
}
.fund-balance-label {
  font-family: 'Staatliches', sans-serif;
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--ink-soft);
}
.fund-balance-value {
  font-family: 'Staatliches', sans-serif;
  font-size: 28px;
  color: var(--teal-dark);
}

/* ─────────── Shift log ─────────── */
.shift-log {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.shift-log-title {
  font-family: 'Staatliches', sans-serif;
  font-size: 20px;
  letter-spacing: .1em;
  margin-bottom: 8px;
}
.sales-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.sale-entry {
  border: 1.5px solid var(--cream-dark);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffdf6;
}
.sale-entry.voided { opacity: .55; }
.sale-entry.voided .sale-total, .sale-entry.voided .sale-items { text-decoration: line-through; }
.sale-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.sale-total { font-family: 'Staatliches', sans-serif; font-size: 18px; color: var(--teal-dark); }
.sale-items { font-size: 13px; line-height: 1.35; margin-top: 3px; }
.void-btn {
  border: none;
  background: none;
  color: var(--red);
  font-size: 12px;
  font-family: 'Staatliches', sans-serif;
  letter-spacing: .08em;
  text-decoration: underline;
  padding: 2px 4px;
}
.void-btn:hover { color: var(--red-dark); }
.voided-tag { font-family: 'Staatliches', sans-serif; color: var(--red); font-size: 12px; letter-spacing: .1em; }

/* ─────────── Inputs ─────────── */
.text-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
  color: var(--ink);
}
.text-input:focus { outline: 3px solid var(--teal-neon); outline-offset: 1px; }
.text-input--slim { padding: 7px 12px; font-size: 14px; }

/* ─────────── Overlays & modals ─────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 10, .78);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}
.hidden { display: none !important; }

.clockin-card {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 12px 50px rgba(0,0,0,.55);
  max-width: 440px;
  width: 100%;
  overflow: hidden;
  text-align: center;
  padding-bottom: 26px;
}
.clockin-card .sign--small { padding: 22px 14px 24px; }
.clockin-card .sign--small .sign-rex { font-size: 56px; }
.clockin-card .sign--small .sign-dinner { font-size: 30px; }
.clockin-card .sign--small .sign-tag { font-size: 12px; margin-top: 8px; }
.clockin-title {
  font-family: 'Yellowtail', cursive;
  font-size: 34px;
  color: var(--red);
  margin: 20px 0 14px;
  font-weight: 400;
}
.clockin-card .text-input { width: calc(100% - 52px); margin-bottom: 14px; }
.clockin-card .btn--big { width: calc(100% - 52px); }
.clockin-hint { font-size: 13px; color: var(--ink-soft); margin-top: 14px; padding: 0 30px; }

.modal {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 12px 50px rgba(0,0,0,.55);
  max-width: 560px;
  width: 100%;
  padding: 24px 26px;
  margin: auto;
}
.modal-title {
  font-family: 'Staatliches', sans-serif;
  font-size: 28px;
  letter-spacing: .08em;
  color: var(--red);
  margin-bottom: 14px;
}
.modal-label {
  display: block;
  font-family: 'Staatliches', sans-serif;
  letter-spacing: .1em;
  font-size: 15px;
  color: var(--ink-soft);
  margin: 14px 0 6px;
}
.modal-hint { font-size: 13px; color: var(--ink-soft); margin-top: 10px; line-height: 1.45; }
.modal-btns { display: flex; gap: 10px; margin-top: 16px; }
.modal-btns .btn { flex: 1; }

.end-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.end-stat {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.end-stat-label { font-family: 'Staatliches', sans-serif; font-size: 12px; letter-spacing: .12em; color: var(--ink-soft); }
.end-stat-value { font-family: 'Staatliches', sans-serif; font-size: 22px; color: var(--teal-dark); }

.log-textarea {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffdf6;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.45;
  padding: 10px 12px;
  resize: vertical;
  color: var(--ink);
}

/* ─────────── History ─────────── */
.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.history-entry {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.history-info { flex: 1; min-width: 160px; }
.history-when { font-size: 13px; color: var(--ink-soft); }
.history-who { font-family: 'Staatliches', sans-serif; font-size: 18px; letter-spacing: .04em; }
.history-total { font-family: 'Staatliches', sans-serif; font-size: 20px; color: var(--red); }
.history-entry .btn { font-size: 14px; padding: 6px 12px; }

/* ─────────── Footer & toast ─────────── */
.footer { text-align: center; }
.footer p {
  font-family: 'Staatliches', sans-serif;
  letter-spacing: .2em;
  background: #161310;
  color: var(--cream);
  padding: 12px 0 14px;
  font-size: 15px;
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  font-family: 'Staatliches', sans-serif;
  font-size: 17px;
  letter-spacing: .06em;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2px solid var(--cream);
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  z-index: 200;
  animation: toast-in .25s ease;
}
.toast--error { background: var(--red-dark); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ─────────── Responsive ─────────── */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; }
  .order-panel { position: static; }
  .status-chip { padding: 4px 10px; }
}
@media (max-width: 560px) {
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .statusbar { padding: 10px 12px; }
  .status-actions { margin-left: 0; width: 100%; }
  .status-actions .btn { flex: 1; }
  .modal { padding: 18px 16px; }
}
