/* Kedai Oma Nana — POS. Material 3 Baseline theme (Google's default M3
   color scheme, seed #6750A4) applied as a tokens-only reskin — component
   markup/layout is unchanged, only color/shape/elevation/type tokens. */

:root {
  --paper:        #FFFBFE; /* Surface */
  --paper-soft:   #F7F2FA; /* Surface Container Low */
  --paper-deep:   #F3EDF7; /* Surface Container */
  --ink:          #1C1B1F; /* On Surface */
  --ink-soft:     #49454F; /* On Surface Variant */
  --ink-mute:     #79747E; /* Outline */
  --accent:       #6750A4; /* Primary */
  --accent-deep:  #4F378B; /* Primary, deeper tone for hover/active */
  --line:         #CAC4D0; /* Outline Variant */
  --line-strong:  #938F99; /* Outline */
  --white:        #FFFFFF;
  --alert:        #B3261E; /* Error */
  --ok:           #146C2E; /* Success (M3 extended-color convention) */
  --new:          #7D5260; /* Tertiary */
  --cooking:      #825500; /* in-progress amber */
  --ready:        #146C2E; /* = success */
  --served:       #79747E; /* = outline, muted/done */

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 8px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.08), 0 12px 28px rgba(0, 0, 0, 0.14);

  --font: "Roboto", system-ui, -apple-system, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Strong easing curves — the built-in CSS ease-out/ease-in-out are too
     weak to feel intentional. Use these for anything entering/exiting or
     moving on screen; see emil-design-eng skill. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* { box-sizing: border-box; }

/* Reduced motion means gentler, not zero — collapse every animation/
   transition to near-instant rather than deleting them, so state changes
   (color, opacity) still register, just without the movement. Applies
   site-wide (this file + login.css + print.css + prebook.html, since
   they share one document). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html, body { margin: 0; padding: 0; min-height: 100vh; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.005em;
}
.mono { font-family: var(--mono); font-feature-settings: "zero"; letter-spacing: 0; }
.muted { color: var(--ink-mute); }
.eyebrow { font-size: 11px; letter-spacing: 0.14em; color: var(--ink-mute); font-weight: 500; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
h1 { font-size: 36px; }
h2 { font-size: 26px; }
h3 { font-size: 18px; }
h4 { font-size: 14px; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(103, 80, 164, 0.12);
}

/* ─── App shell ─────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--paper);
}
.role-rail {
  position: sticky; top: 0;
  height: 100vh;
  background: var(--ink);
  color: var(--paper);
  padding: 24px 16px;
  display: flex; flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(0,0,0,0.2);
}

/* Print-server live status pill (in rail-foot) */
.print-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.print-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 8px;
}
.print-status-online .dot   { background: #4CAF50; box-shadow: 0 0 6px rgba(76, 175, 80, 0.6); }
.print-status-offline .dot  { background: #E46962; box-shadow: 0 0 6px rgba(228, 105, 98, 0.5); }
.print-status-disabled .dot { background: #79747E; }
.print-status-checking .dot { background: #FFB300; animation: ps-pulse 1.4s ease-in-out infinite; }
@keyframes ps-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.app.rail-collapsed .print-status { padding: 6px; justify-content: center; }

/* Collapse toggle — small floating button on the right edge of the rail */
.rail-toggle {
  position: absolute;
  right: -12px;
  top: 24px;
  width: 24px; height: 24px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  padding: 0;
}
.rail-toggle:hover { background: var(--accent-deep); border-color: var(--accent); }

/* Collapsed rail — narrow strip, labels hidden, screen gets full width */
.app.rail-collapsed { grid-template-columns: 56px 1fr; }
.app.rail-collapsed .role-rail { padding: 16px 6px; gap: 14px; align-items: center; }
.app.rail-collapsed .rail-brand { padding: 0; justify-content: center; }
.app.rail-collapsed .rail-brand-text { display: none; }
.app.rail-collapsed .rail-nav { width: 100%; }
.app.rail-collapsed .rail-tab { padding: 10px 4px; text-align: center; }
.app.rail-collapsed .rail-tab-label { font-size: 11px; }
.app.rail-collapsed .rail-tab-desc { display: none; }
.app.rail-collapsed .rail-foot { padding: 0; }
.app.rail-collapsed .rail-user { justify-content: center; }
.app.rail-collapsed .rail-user-text,
.app.rail-collapsed .rail-signout,
.app.rail-collapsed .rail-clock { display: none; }
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.rail-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--white);
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
  letter-spacing: 0.05em;
}
.rail-brand-name { font-size: 15px; font-weight: 500; }
.rail-brand-sub  { font-size: 11px; color: rgba(255, 255, 255, 0.5); margin-top: 2px; }

.rail-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rail-tab {
  text-align: left;
  padding: 12px 12px;
  border-radius: var(--r-md);
  color: rgba(255, 255, 255, 0.7);
  transition: background .15s, color .15s;
  display: flex; flex-direction: column;
  gap: 2px;
}
.rail-tab:hover { background: rgba(255,255,255,0.04); color: var(--paper); }
.rail-tab.active {
  background: rgba(103, 80, 164, 0.24);
  color: var(--paper);
  box-shadow: inset 2px 0 0 var(--accent);
}
.rail-tab-label { font-size: 14px; font-weight: 500; }
.rail-tab-desc  { font-size: 10px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.45); text-transform: uppercase; }

.rail-foot {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  font-size: 11px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 16px;
}
.rail-foot .rail-user { display: flex; align-items: center; gap: 10px; }
.rail-foot .rail-clock { color: var(--accent); font-size: 13px; align-self: flex-end; }
.rail-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
}
.rail-clock { color: var(--accent); font-size: 13px; }

.screen { min-height: 100vh; overflow: hidden; }

/* ─── Atoms ─────────────────────────────────────────────── */
.swatch {
  position: relative;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.15), inset 0 1px 2px rgba(255,255,255,0.15);
  overflow: hidden;
}
.swatch-rim {
  position: absolute; inset: 0;
  border-radius: inherit;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 6px);
  pointer-events: none;
}
.swatch-initials {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  font-size: 11px;
  font-family: var(--mono);
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pill-new      { background: #FFDDB3; color: #2A1800; }
.pill-cooking  { background: #FFDCA8; color: #3D2200; }
.pill-ready    { background: #C3EFC9; color: #00210A; }
.pill-served   { background: #E6E0E9; color: var(--ink-soft); }
.pill-paid_deposit  { background: #C3EFC9; color: #00210A; }
.pill-awaiting_deposit { background: #FFDDB3; color: #2A1800; }
.pill-verified { background: #C3EFC9; color: #00210A; }
.pill-checked_in { background: #E6E0E9; color: var(--ink-soft); }
.pill-cancelled { background: #F9DEDC; color: #410E0B; }
.pill-open { background: #FFDDB3; color: #2A1800; }
.pill-closed { background: #E6E0E9; color: var(--ink-soft); }
.pill-waiting   { background: #FFDDB3; color: #2A1800; }
.pill-matched   { background: #C3EFC9; color: #00210A; }
.pill-confirmed { background: #C3EFC9; color: #00210A; }

/* Buttons — M3 "Filled Button" convention: primary actions use the Primary
   color, not on-surface/ink. */
.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: transform 120ms var(--ease-out), background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }
.btn-primary:active:not(:disabled) { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary.full { width: 100%; padding: 14px 18px; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 14px;
  transition: transform 120ms var(--ease-out), background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--paper-soft); border-color: var(--line-strong); }
.btn-ghost:active:not(:disabled) { transform: scale(0.97); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-ghost.full { width: 100%; }
.btn-ghost-sm {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  font-size: 12px;
  transition: transform 120ms var(--ease-out), background .15s;
}
.btn-ghost-sm:hover { background: var(--paper-soft); }
.btn-ghost-sm:active:not(:disabled) { transform: scale(0.96); }
.btn-link { color: var(--ink); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.icon-x {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px;
  color: var(--ink-mute);
  transition: transform 120ms var(--ease-out), background .15s, color .15s;
}
.icon-x:hover { background: var(--paper-deep); color: var(--ink); }
.icon-x:active { transform: scale(0.92); }

/* ─── Cashier ───────────────────────────────────────────── */
.cashier {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}
.cashier-menu { padding: 16px 20px; overflow-y: auto; min-height: 0; }
.menu-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; position: sticky; top: 0; background: var(--paper); padding-bottom: 8px; z-index: 5; }
.search-wrap { position: relative; }
.search {
  background: var(--white);
  font-size: 15px;
  padding: 10px 56px 10px 14px;
  border-radius: var(--r-lg);
  width: 100%;
}
.search-sm { padding: 8px 12px; font-size: 13px; max-width: 220px; }
.kbd-hint {
  position: absolute;
  right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 11px;
  color: var(--ink-mute);
  background: var(--paper-deep);
  border-radius: var(--r-sm);
  padding: 3px 7px;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.cat-bar { display: flex; gap: 6px; overflow-x: auto; }
.cat-chip {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  transition: transform 100ms var(--ease-out), background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.cat-chip:hover { border-color: var(--line-strong); }
.cat-chip:active { transform: scale(0.96); }
.cat-chip.active { background: var(--accent); color: var(--white); border-color: var(--accent); }

.prebook-banner {
  background: linear-gradient(0deg, rgba(103,80,164,0.12), rgba(103,80,164,0.12)), var(--white);
  border: 1px solid rgba(103, 80, 164, 0.35);
  border-radius: var(--r-md);
  padding: 8px 12px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 10px;
}
.banner-label { font-size: 11px; letter-spacing: 0.12em; color: var(--accent-deep); }
.prebook-chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: left;
  font-size: 13px;
  transition: transform 100ms var(--ease-out), border-color .12s;
}
.prebook-chip:hover { border-color: var(--ink); }
.prebook-chip:active { transform: scale(0.98); }
.prebook-chip .mono { font-size: 11px; color: var(--ink-mute); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.product-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px;
  text-align: left;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.product-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.product-card:active { transform: scale(0.98); transition-duration: 80ms; }
.product-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.product-name { font-size: 14px; font-weight: 500; }
.product-desc { font-size: 11px; color: var(--ink-mute); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.product-price { font-size: 13px; color: var(--ink); font-weight: 500; }
.stock-low { font-size: 10px; color: var(--alert); background: rgba(179,38,30,0.08); padding: 2px 6px; border-radius: var(--r-sm); }

/* Cart panel */
.cashier-cart {
  background: var(--white);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 12px 16px;
  height: 100vh; height: 100dvh;
  overflow-y: auto; min-height: 0;
}
.cart-head { display: flex; justify-content: space-between; align-items: center; min-height: 22px; margin-bottom: 8px; }
.badge-prebook {
  background: var(--accent);
  color: var(--white);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 10px;
  letter-spacing: 0.12em;
}
.cart-fields { display: grid; grid-template-columns: 1fr 72px; gap: 8px; margin-bottom: 8px; }
.cart-fields input { padding: 8px 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 10px; color: var(--ink-mute); letter-spacing: 0.1em; text-transform: uppercase; }

.cart-list {
  flex: 1; min-height: 120px;
  border-top: 1px solid var(--line);
  margin: 0 -16px;
  padding: 4px 16px;
  overflow-y: auto;
}
.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 16px;
  color: var(--ink-mute);
}
.empty-mark {
  font-size: 26px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--paper-soft);
  display: grid; place-items: center;
  margin-bottom: 14px;
  color: var(--ink-soft);
}
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto 30px;
  gap: 4px 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  animation: slide-in .25s ease-out;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cart-line-name { font-size: 14px; font-weight: 500; }
.cart-line-mods { font-size: 10px; color: var(--ink-mute); margin-top: 2px; letter-spacing: 0.02em; }
.cart-line-note { grid-column: 1 / -1; display: block; width: 100%; margin-top: 0; padding: 3px 8px; background: transparent; border: 1px dashed var(--line); border-radius: 6px; font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.cart-line-note:focus { outline: none; border-color: var(--accent-deep); background: var(--paper-soft); }
.cart-line-note::placeholder { color: var(--ink-mute); opacity: 0.6; }
.cart-line-qty {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-soft);
  border-radius: var(--r-sm);
  padding: 2px;
}
.cart-line-qty button {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 16px;
  color: var(--ink-soft);
}
.cart-line-qty button:hover { background: var(--white); color: var(--ink); }
.cart-line-sub { font-size: 13px; min-width: 80px; text-align: right; }
.cart-line-x {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  font-size: 16px;
}
.cart-line-x:hover { background: rgba(179,38,30,0.1); color: var(--alert); }

.cart-totals { padding: 6px 0 2px; border-top: 1px solid var(--line); }
.total-row {
  display: flex; justify-content: space-between;
  padding: 3px 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.total-credit { color: var(--ok); }
.total-grand {
  font-size: 20px;
  color: var(--ink);
  font-weight: 500;
  align-items: baseline;
}
.total-row + .total-grand { padding-top: 6px; margin-top: 3px; border-top: 1px solid var(--line); }
.cart-actions { display: grid; grid-template-columns: auto auto 1fr 1.3fr; gap: 6px; margin-top: 8px; }
.cart-actions .btn-sm { padding: 0 12px; min-height: 44px; font-size: 14px; white-space: nowrap; }

/* ─── Sheet (modal) ─────────────────────────────────────── */
.sheet-wrap {
  position: fixed; inset: 0;
  background: rgba(28, 27, 31, 0.4);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 24px;
  animation: fade-in .2s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--white);
  border-radius: var(--r-xl);
  width: clamp(300px, 92vw, 560px);
  min-width: 280px;
  min-height: 220px;
  max-width: 96vw;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: rise .25s cubic-bezier(.2,.7,.3,1);
  resize: both;
  overflow: hidden;
}
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-wide { width: clamp(320px, 94vw, 860px); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 24px 24px 16px; }
.sheet-product { display: flex; gap: 14px; align-items: flex-start; }
.sheet-product h3 { margin-bottom: 2px; }
.sheet-body { padding: 0 24px 16px; overflow-y: auto; flex: 1; }
.sheet-foot { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px 20px; border-top: 1px solid var(--line); gap: 12px; }
.sheet-foot .btn-primary { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
@media (max-width: 600px) {
  .sheet-wrap { padding: 8px; }
  .sheet, .sheet-wide { width: 100%; max-width: 100%; }
}

.mod-group { margin-bottom: 18px; }
.mod-group-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.mod-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mod-opt {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13px;
  text-align: left;
  transition: transform 100ms var(--ease-out), background .12s, color .12s, border-color .12s;
}
.mod-opt:hover { background: var(--paper-soft); }
.mod-opt:active { transform: scale(0.97); }
.mod-opt.picked {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.mod-opt.picked .mono { color: var(--white); }

.qty-stepper {
  display: flex; align-items: center;
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 8px;
}
.qty-stepper button {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  font-size: 16px;
  color: var(--ink-soft);
  display: grid; place-items: center;
  transition: transform 80ms var(--ease-out), background .12s, color .12s;
}
.qty-stepper button:hover { background: var(--white); color: var(--ink); }
.qty-stepper button:active { transform: scale(0.9); }
.qty-stepper .mono { padding: 0 8px; font-size: 14px; min-width: 24px; text-align: center; }
.qty-sm button { width: 26px; height: 26px; font-size: 14px; }

/* Checkout */
.checkout-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 0; }
.checkout-summary { padding: 4px 24px 20px; border-right: 1px solid var(--line); }
.big-due { display: flex; flex-direction: column; gap: 4px; padding: 12px 0 16px; }
.big-num { font-size: 32px; font-weight: 500; letter-spacing: -0.02em; }
.due-rows { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.due-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--ink-soft); }
.tip-group { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.tip-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tip-chip {
  padding: 10px;
  background: var(--paper);
  border-radius: var(--r-md);
  font-size: 13px;
  transition: transform 100ms var(--ease-out), background .12s, color .12s;
}
.tip-chip:hover { background: var(--paper-soft); }
.tip-chip:active { transform: scale(0.96); }
.tip-chip.active { background: var(--accent); color: var(--white); }

.checkout-splits { padding: 4px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.split-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.split-row { display: grid; grid-template-columns: 1fr 140px 28px; gap: 8px; align-items: center; }
.split-row:has(.row-x:not(:last-child)) { grid-template-columns: 1fr 140px 28px; }
.method-toggle { display: flex; background: var(--paper); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.method { flex: 1; padding: 8px; font-size: 11px; letter-spacing: 0.08em; border-radius: var(--r-sm); color: var(--ink-soft); }
.method:hover { background: var(--paper-soft); }
.method.active { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }
.amount-input { font-family: var(--mono); text-align: right; padding: 10px; }
.row-x {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  color: var(--ink-mute);
}
.row-x:hover { background: rgba(179,38,30,0.1); color: var(--alert); }
.balance {
  display: flex; justify-content: space-between;
  padding: 12px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-top: 8px;
}
.balance.ok    { background: rgba(20, 108, 46, 0.1);  color: var(--ok); }
.balance.short { background: rgba(179, 38, 30, 0.1); color: var(--alert); }
.balance.over  { background: rgba(103, 80, 164, 0.16); color: var(--ink); }

.qris-auto-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  background: rgba(103, 80, 164, 0.12);
  color: var(--ink-soft);
}
.qris-auto-status.matched { background: rgba(20, 108, 46, 0.1); color: var(--ok); }

/* ─── Kitchen Display ───────────────────────────────────── */
.kds { padding: 24px 28px; height: 100vh; overflow-y: auto; }
.kds-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.station-toggle { display: flex; background: var(--white); border-radius: var(--r-md); padding: 4px; gap: 2px; border: 1px solid var(--line); }
.station-tab { padding: 8px 16px; font-size: 13px; border-radius: var(--r-sm); color: var(--ink-soft); transition: transform 100ms var(--ease-out), background .15s, color .15s; }
.station-tab:hover { background: var(--paper-soft); }
.station-tab:active { transform: scale(0.96); }
.station-tab.active { background: var(--accent); color: var(--white); }

.kds-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.kds-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-mute);
}
.kds-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--new);
  display: flex; flex-direction: column; gap: 10px;
  animation: pop-in .3s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.kds-new     { border-top-color: var(--new); }
.kds-cooking { border-top-color: var(--cooking); background: linear-gradient(0deg, rgba(130,85,0,0.05), transparent); }
.kds-ready   { border-top-color: var(--ready); background: linear-gradient(0deg, rgba(20,108,46,0.06), transparent); }
.pb-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; }
.pb-detail-grid > div { display: flex; flex-direction: column; gap: 4px; }
.pb-detail-grid .muted { font-size: 10px; letter-spacing: 0.12em; }

.admin-override-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #FFEACC; border-bottom: 1px solid #E6B368; font-size: 13px; flex-wrap: wrap; }
.admin-override-bar strong { font-weight: 600; }

.cashier-locked { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px; background: var(--paper); }
.cashier-locked-card { max-width: 480px; width: 100%; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 36px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.cashier-locked-card .lock-icon { font-size: 44px; }
.cashier-locked-card h2 { margin: 0; }
.cashier-locked-card .lock-info { display: flex; flex-direction: column; gap: 6px; width: 100%; background: var(--paper-soft); border-radius: var(--r-sm); padding: 14px 18px; font-size: 13px; text-align: left; }
.cashier-locked-card .lock-info > div { display: flex; justify-content: space-between; gap: 12px; }

.wifi-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; flex-wrap: wrap; }
.wifi-bar strong { font-weight: 600; color: var(--ink); }
.wifi-bar input { border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.display-wifi { display: inline-flex; align-items: center; gap: 8px; }
.starlink-mark { display: inline-flex; align-items: center; color: var(--ink-mute); }

.kds-card.urgent {
  background: rgba(179, 38, 30, 0.07);
  border-color: var(--alert);
  border-top-color: var(--alert) !important;
  animation: pulse-urgent 1.2s ease-in-out infinite;
}
.kds-card.urgent .kds-short,
.kds-card.urgent .kds-timer.alert { color: #8C1D18; }
@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(179, 38, 30, 0.28); }
}

.kds-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.kds-id { display: flex; flex-direction: column; }
.kds-short { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.kds-customer { font-size: 12px; color: var(--ink-mute); }
.kds-items { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 10px; }
.kds-items li { display: flex; gap: 12px; align-items: flex-start; }
.kds-qty { font-size: 15px; color: var(--accent-deep); min-width: 28px; font-weight: 500; }
.kds-item-body { flex: 1; }
.kds-name { font-size: 15px; font-weight: 500; }
.kds-mods { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.kds-note { font-size: 12px; color: var(--alert); margin-top: 3px; padding: 2px 6px; background: rgba(179, 38, 30, 0.08); border-radius: 4px; display: inline-block; }
.kds-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }
.kds-timer { font-size: 13px; color: var(--ink-mute); }
.kds-timer.alert { color: var(--alert); font-weight: 500; }
.btn-advance {
  background: var(--accent);
  color: var(--white);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  letter-spacing: 0.02em;
  font-family: var(--mono);
  transition: transform 80ms var(--ease-out), background .12s;
}
.btn-advance:hover { background: var(--accent-deep); }
.btn-advance:active { transform: scale(0.95); }

/* ─── Waitress ──────────────────────────────────────────── */
.waitress { padding: 24px 28px; height: 100vh; overflow-y: auto; }
.waitress-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; }
.floor-legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-mute); }
.floor-legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ready { background: var(--ready); }
.dot-pending { background: var(--cooking); }

.waitress-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.col-title { font-size: 11px; letter-spacing: 0.14em; color: var(--ink-mute); margin-bottom: 12px; }
.run-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.run-card {
  background: var(--white);
  border-radius: var(--r-md);
  border: 1px solid rgba(20,108,46,0.3);
  border-left: 4px solid var(--ready);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  animation: pop-in .3s;
}
.run-card header { display: flex; justify-content: space-between; align-items: baseline; }
.run-short { font-size: 20px; font-weight: 600; }
.run-table { color: var(--ink-mute); font-size: 12px; }
.run-customer { font-size: 13px; }
.run-items { list-style: none; padding: 0; margin: 0; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.run-items .mono { color: var(--accent-deep); margin-right: 4px; }
.run-card footer { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }

.pending-list { display: flex; flex-direction: column; gap: 6px; }
.pending-row {
  display: grid;
  grid-template-columns: 50px 40px 1fr auto auto;
  gap: 12px;
  padding: 10px 12px;
  background: var(--white);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  align-items: center;
  font-size: 13px;
}
.pending-short { font-weight: 600; }
.pending-table { color: var(--ink-mute); font-size: 11px; }
.pending-items { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-pills { display: flex; gap: 4px; }

/* ─── Customer Display (kiosk) ──────────────────────────── */
/* Kiosk mode: no rail, just the customer-facing screen. */
.app.kiosk { grid-template-columns: 1fr; }
.app.kiosk .screen { padding: 0; }

.display { background: var(--ink); height: 100vh; height: 100dvh; padding: 12px; overflow: hidden; box-sizing: border-box; }
.display-frame {
  background: var(--paper);
  border-radius: var(--r-xl);
  height: 100%;
  padding: clamp(16px, 2vw, 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(12px, 1.5vh, 20px);
  position: relative;
  overflow: hidden;
  --display-scale: 1;
}
.display-frame::after {
  content: ""; position: absolute; top: 0; right: 0; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(103,80,164,0.18), transparent 70%);
  pointer-events: none;
}

/* Header row */
.display-head { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; gap: 12px; }
.display-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 48px; height: 48px;
  background: var(--ink); color: var(--accent);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 600; letter-spacing: 0.04em;
  flex: 0 0 48px;
}
.brand-name { font-size: clamp(18px, 2.2vw, 22px); font-weight: 500; }
.display-head-right { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.display-clock { font-size: clamp(20px, 2.4vw, 26px); color: var(--ink-soft); }
.display-signout {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-soft); padding: 6px 12px;
  border-radius: 8px; font-size: 11px; cursor: pointer;
  letter-spacing: 0.05em;
}
.display-signout:hover { background: var(--paper-soft); color: var(--ink); }

/* Order section (middle, expands) */
.display-order { display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: relative; z-index: 1; }
.display-order .eyebrow { margin-bottom: 10px; display: block; font-size: 13px; flex: 0 0 auto; }
.display-items {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: calc(10px * var(--display-scale, 1));
  font-size: calc(16px * var(--display-scale, 1));
  flex: 1 1 0;
  overflow: hidden;
}
.display-items li {
  display: grid;
  grid-template-columns: calc(50px * var(--display-scale, 1)) 1fr auto;
  gap: calc(16px * var(--display-scale, 1));
  padding: calc(10px * var(--display-scale, 1)) 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  animation: slide-in .3s;
}
.d-qty { font-size: calc(22px * var(--display-scale, 1)); color: var(--accent-deep); font-weight: 500; }
.d-line { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.d-line span:first-child { font-size: calc(18px * var(--display-scale, 1)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-mods { font-size: calc(12px * var(--display-scale, 1)); color: var(--ink-mute); }
.d-sub { font-size: calc(16px * var(--display-scale, 1)); }

.display-code-row { display: flex; justify-content: space-between; padding: 8px 0; margin-top: 4px; font-size: 14px; }
.display-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 12px; border-top: 2px solid var(--ink); flex: 0 0 auto; }
.display-total .eyebrow { font-size: 14px; }
.display-total-num { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.02em; }

/* Bottom row: fixed-square QR (left, full-bleed) + wifi panel (right, flexible) */
.display-bottom {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  position: relative; z-index: 1;
}
.display-pay {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  width: 200px; height: 200px;
  min-width: 200px; min-height: 200px;
  box-sizing: border-box;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex: 0 0 auto;
}
.display-pay canvas { display: block; }
@media (max-width: 900px) {
  .display-bottom { grid-template-columns: 170px minmax(0, 1fr); }
  .display-pay { width: 170px !important; min-width: 170px !important; height: 170px; min-height: 170px; }
}
@media (max-width: 600px) {
  .display-bottom { grid-template-columns: 140px minmax(0, 1fr); }
  .display-pay { width: 140px !important; min-width: 140px !important; height: 140px; min-height: 140px; }
}
.qr-wrap { width: 100%; height: 100%; min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; }
.qr-wrap canvas { display: block; max-width: 100%; max-height: 100%; }
.display-pay-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 4px; padding: 6px; text-align: center; }
.display-pay-hint { font-size: 13px; color: var(--ink-soft); }

.display-wifi-panel {
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(10px, 1.5vh, 14px) clamp(12px, 1.8vw, 18px);
  display: flex; flex-direction: column; gap: 8px;
  justify-content: flex-start;
  height: 100%;
  box-sizing: border-box;
}
.wifi-head { display: flex; align-items: center; gap: 10px; }
.wifi-head .eyebrow { font-size: 11px; letter-spacing: 0.14em; }
.wifi-network { display: flex; align-items: baseline; gap: 10px; }
.wifi-network .muted { font-size: 10px; letter-spacing: 0.12em; }
.wifi-network-name { font-size: clamp(15px, 1.8vw, 18px); font-weight: 500; color: var(--ink); }
.wifi-pw { padding: 6px 12px; background: var(--white); border-radius: 8px; border: 1px dashed var(--line); display: flex; align-items: baseline; gap: 10px; }
.wifi-pw .muted { font-size: 10px; letter-spacing: 0.12em; }
.wifi-pw-value { font-size: clamp(20px, 2.6vw, 26px); font-weight: 600; color: var(--accent-deep); letter-spacing: 0.05em; }
.wifi-thanks { font-size: 10px; color: var(--ink-mute); margin-top: auto; padding-top: 4px; }

.qr-ph { position: relative; background: var(--white); border: 8px solid var(--white); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-sm); }
.qr-ph span { position: absolute; background: var(--ink); }

/* Very narrow viewport (phones) — keep side-by-side but shrink QR */
@media (max-width: 500px) {
  .display-bottom { height: clamp(140px, 18vh, 180px); }
  .wifi-pw-value { font-size: 22px; }
}

/* ─── Admin ─────────────────────────────────────────────── */
.admin { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.admin.admin-stacked { display: flex; flex-direction: column; }
.admin-rail { background: var(--paper-soft); padding: 24px 12px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); }
.admin-topbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--paper-soft); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.admin-topbar .admin-brand { padding: 0; }
.admin-topbar-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-topbar-select { display: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); font-size: 13px; }
.admin-topbar .admin-tab { padding: 8px 14px; }
.admin-role-switch {
  padding: 6px 10px;
  border: 1px solid var(--accent-deep);
  border-radius: var(--r-sm);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  cursor: pointer;
  appearance: auto;
}
.admin-role-switch:hover { background: var(--paper); }
.admin-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-topbar-right .print-status { margin-bottom: 0; background: var(--white); border-color: var(--line); color: var(--ink-soft); }
.admin-topbar-right .print-status-online .dot { box-shadow: 0 0 4px rgba(76, 175, 80, 0.5); }
.admin-signout {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.admin-signout:hover { background: var(--paper); color: var(--ink); }
.admin-brand { font-size: 11px; letter-spacing: 0.16em; color: var(--ink-mute); padding: 4px 12px 12px; }
.admin-tab { padding: 10px 14px; border-radius: var(--r-sm); text-align: left; font-size: 14px; color: var(--ink-soft); transition: transform 100ms var(--ease-out), background .12s, color .12s; }
.admin-tab:hover { background: var(--white); }
.admin-tab:active { transform: scale(0.97); }
.admin-tab.active { background: var(--accent); color: var(--white); }

.admin.admin-stacked .admin-main { height: auto; }
.admin-main { padding: 32px 40px; overflow-y: auto; height: 100vh; }
.admin-pane { display: flex; flex-direction: column; gap: 24px; }
.pane-head { display: flex; justify-content: space-between; align-items: flex-end; }
.pane-head h2 { margin-top: 4px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi-card.accent { background: var(--accent); color: var(--white); border-color: var(--accent); }
.kpi-card.accent .kpi-label, .kpi-card.accent .kpi-delta { color: rgba(255,255,255,0.7); }
.kpi-label { font-size: 10px; letter-spacing: 0.12em; color: var(--ink-mute); }
.kpi-value { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }
.kpi-delta { font-size: 11px; color: var(--ink-mute); }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.panel-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; }
.panel-card.no-pad { padding: 0; overflow: auto; }
.panel-card.no-pad .data-table { min-width: 1100px; }
.admin-main { overflow-x: auto; }
.panel-card h3 { margin-bottom: 14px; }

.bar-chart { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; align-items: end; height: 200px; padding-top: 20px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-wrap { width: 100%; height: 100%; position: relative; display: flex; align-items: flex-end; }
.bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: opacity .15s;
  position: relative;
}
.bar-col:hover .bar { opacity: 0.85; }
.bar-tip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--ink-soft);
  white-space: nowrap;
  padding: 2px 4px;
  opacity: 0; transition: opacity .15s;
}
.bar-col:hover .bar-tip { opacity: 1; }
.bar-label { font-size: 10px; color: var(--ink-mute); }

.top-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.top-list li { display: grid; grid-template-columns: 30px 1fr 80px 30px; gap: 12px; align-items: center; font-size: 13px; }
.top-list .rank { color: var(--ink-mute); }
.top-name { font-weight: 500; }
.top-bar { background: var(--paper-soft); height: 8px; border-radius: 4px; overflow: hidden; }
.top-bar > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s ease-out; }

/* EOD */
.eod-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.eod-big { display: flex; flex-direction: column; gap: 4px; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.eod-big-num { font-size: 42px; font-weight: 600; letter-spacing: -0.02em; }
.eod-rows { display: flex; flex-direction: column; gap: 12px; }
.eod-row-line { display: grid; grid-template-columns: 60px 1fr 110px; gap: 12px; align-items: center; font-size: 13px; }
.eod-bar { background: var(--paper-soft); height: 10px; border-radius: 5px; overflow: hidden; }
.eod-bar > div { height: 100%; background: var(--accent); }
.eod-row-line .mono { text-align: right; }

.reco { display: flex; flex-direction: column; gap: 8px; }
.reco-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; }
.reco-total { font-weight: 500; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 12px 16px; font-size: 11px; letter-spacing: 0.08em; color: var(--ink-mute); text-transform: uppercase; background: var(--paper-soft); font-weight: 500; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--paper); }
.row-actions { text-align: right; }

.chip-station, .chip-role {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-radius: var(--r-sm);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-family: var(--mono);
}
.chip-bar     { background: #d8e0e8; color: #2c4760; }
.chip-kitchen { background: #f0d9b8; color: #6b4520; }
.chip-none    { background: var(--paper-deep); }
.chip-admin   { background: var(--ink); color: var(--paper); }
.chip-cashier { background: #C3EFC9; color: #00210A; }

/* Loyalty */
.loyalty-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.loyalty-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.loyalty-card header { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
.loyalty-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--white); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.loyalty-name { font-size: 15px; font-weight: 500; }
.tier { font-size: 10px; padding: 3px 8px; border-radius: var(--r-sm); letter-spacing: 0.08em; font-family: var(--mono); }
.tier-golden { background: var(--accent); color: var(--white); }
.tier-regular { background: var(--paper-deep); color: var(--ink-soft); }
.tier-new { background: rgba(20,108,46,0.15); color: var(--ok); }
.loyalty-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.loyalty-stats > div { display: flex; flex-direction: column; gap: 2px; }
.loyalty-stats .mono { font-size: 16px; font-weight: 500; }
.loyalty-stats .muted { font-size: 10px; letter-spacing: 0.08em; }
.loyalty-card footer { display: flex; justify-content: space-between; font-size: 11px; }

/* ─── Pre-book (public) ─────────────────────────────────── */
.prebook { padding: 32px 40px; min-height: 100vh; overflow-y: auto; height: 100vh; }
.prebook-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; padding: 24px 0 32px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.prebook-hero h1 { margin-top: 8px; margin-bottom: 8px; max-width: 16ch; text-wrap: balance; }
.prebook-hero-meta { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; font-size: 12px; }
.prebook-hero-meta > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.prebook-hero-meta .muted { letter-spacing: 0.1em; }

.prebook-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.prebook-menu { display: flex; flex-direction: column; gap: 4px; max-height: 600px; overflow-y: auto; margin-top: 8px; }
.prebook-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  text-align: left;
  font-size: 14px;
  transition: background .12s;
}
.prebook-item:hover { background: var(--paper); }
.prebook-item-body { display: flex; flex-direction: column; gap: 2px; }
.prebook-form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prebook-cart { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prebook-cart-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; font-size: 13px; }
.prebook-pay { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.prebook-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 20px; }
.prebook-done .empty-mark { background: var(--ok); color: var(--white); font-size: 28px; }

/* ─── Receipt ───────────────────────────────────────────── */
.receipt {
  background: transparent;
  width: min(420px, 100%);
  display: flex; flex-direction: column;
  align-items: center;
  gap: 16px;
}
.receipt-paper {
  background: var(--white);
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 28px, rgba(28,27,31,0.02) 28px, rgba(28,27,31,0.02) 29px);
  padding: 28px 24px;
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  position: relative;
  --notch: 14px;
  mask:
    radial-gradient(circle at bottom, transparent 8px, #000 8.5px) bottom / 18px 18px repeat-x,
    linear-gradient(#000, #000) center / 100% calc(100% - 9px) no-repeat;
}
.receipt-brand { font-size: 16px; font-weight: 600; text-align: center; letter-spacing: 0.12em; }
.receipt-sub { text-align: center; color: var(--ink-mute); font-size: 11px; }
.receipt-rule { border-top: 1px dashed var(--line-strong); margin: 12px 0; }
.receipt-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); }
.receipt-items { width: 100%; border-collapse: collapse; }
.receipt-items td { padding: 3px 0; font-size: 12px; }
.r-right { text-align: right; white-space: nowrap; }
.r-mod { font-size: 11px; color: var(--ink-mute); padding-left: 12px !important; }
.r-row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 12px; }
.r-total { font-size: 14px; font-weight: 600; padding-top: 6px; margin-top: 4px; border-top: 1px solid var(--ink); }
.receipt-thanks { text-align: center; color: var(--ink-mute); font-size: 11px; }
.receipt-actions { display: flex; gap: 8px; justify-content: center; }

/* ─── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  /* Own keyframe (not the shared `rise`) because the toast also needs
     translateX(-50%) for horizontal centering — reusing `rise` clobbered
     that mid-animation and caused a visible snap once it ended. */
  animation: toast-rise 220ms var(--ease-out);
  letter-spacing: 0.02em;
}
@keyframes toast-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateX(-50%); }
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1000px) {
  .cashier { grid-template-columns: 1fr; height: auto; min-height: 100dvh; }
  .cashier-menu { height: auto; }
  .cashier-cart { height: auto; min-height: 60vh; width: 100%; border-top: 1px solid var(--line); border-left: none; }
  .dash-grid, .eod-row, .checkout-body, .display-body, .prebook-hero, .prebook-grid, .waitress-cols { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .role-rail { position: static; height: auto; flex-direction: row; gap: 8px; padding: 12px; overflow-x: auto; }
  .role-rail .rail-brand, .role-rail .rail-foot { display: none; }
  .rail-nav { flex-direction: row; flex: 0 0 auto; }
  .rail-tab { white-space: nowrap; padding: 8px 12px; }
  .rail-tab-desc { display: none; }
  .admin { grid-template-columns: 1fr; }
  .admin-rail { flex-direction: row; overflow-x: auto; }
  .admin-topbar { padding: 12px 16px; }
  .admin-topbar-tabs { display: none; }
  .admin-topbar-select { display: block; flex: 1; }
  .admin-main { padding: 20px 16px; }
}
