/* Kedai Oma Nana — POS prototype. Modern minimalist, paper-and-ink palette. */

:root {
  --paper:        #efe9df;
  --paper-soft:   #e6dfd2;
  --paper-deep:   #ddd4c2;
  --ink:          #3a2a1a;
  --ink-soft:     #5a4633;
  --ink-mute:     #8a7560;
  --accent:       #c4a878;
  --accent-deep:  #a98558;
  --line:         rgba(58, 42, 26, 0.12);
  --line-strong:  rgba(58, 42, 26, 0.22);
  --white:        #faf6ee;
  --alert:        #b8553a;
  --ok:           #5a7a3d;
  --new:          #b8895a;
  --cooking:      #d97a3a;
  --ready:        #5a7a3d;
  --served:       #8a7560;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 0 rgba(58, 42, 26, 0.06), 0 2px 8px rgba(58, 42, 26, 0.05);
  --shadow-md: 0 1px 0 rgba(58, 42, 26, 0.06), 0 12px 32px -12px rgba(58, 42, 26, 0.18);
  --shadow-lg: 0 20px 60px -20px rgba(58, 42, 26, 0.35);

  --font: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
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(--ink);
  box-shadow: 0 0 0 3px rgba(58, 42, 26, 0.08);
}

/* ─── 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);
}
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.rail-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--ink);
  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(239, 233, 223, 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(239, 233, 223, 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(196, 168, 120, 0.16);
  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(239, 233, 223, 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(--ink);
  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: #f4e3cc; color: #7a4a1e; }
.pill-cooking  { background: #f0c89a; color: #6b3e15; }
.pill-ready    { background: #cfdcb8; color: #3d5a1e; }
.pill-served   { background: #d8d0c0; color: var(--ink-soft); }
.pill-paid_deposit  { background: #cfdcb8; color: #3d5a1e; }
.pill-awaiting_deposit { background: #f4e3cc; color: #7a4a1e; }
.pill-verified { background: #cfdcb8; color: #3d5a1e; }
.pill-checked_in { background: #d8d0c0; color: var(--ink-soft); }
.pill-cancelled { background: #e8ccc4; color: #7a3320; }
.pill-open { background: #f4e3cc; color: #7a4a1e; }
.pill-closed { background: #d8d0c0; color: var(--ink-soft); }

/* Buttons */
.btn-primary {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: transform .1s, background .15s;
}
.btn-primary:hover:not(:disabled) { background: #2a1e10; }
.btn-primary:active { transform: translateY(1px); }
.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;
}
.btn-ghost:hover { background: var(--paper-soft); border-color: var(--line-strong); }
.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;
}
.btn-ghost-sm:hover { background: var(--paper-soft); }
.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);
}
.icon-x:hover { background: var(--paper-deep); color: var(--ink); }

/* ─── Cashier ───────────────────────────────────────────── */
.cashier {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: 100vh;
}
.cashier-menu { padding: 24px 28px; overflow-y: auto; }
.menu-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; position: sticky; top: 0; background: var(--paper); padding-bottom: 12px; z-index: 5; }
.search-wrap { position: relative; }
.search {
  background: var(--white);
  font-size: 15px;
  padding: 14px 56px 14px 18px;
  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: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  transition: all .12s;
  white-space: nowrap;
}
.cat-chip:hover { border-color: var(--line-strong); }
.cat-chip.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

.prebook-banner {
  background: linear-gradient(0deg, rgba(196,168,120,0.15), rgba(196,168,120,0.15)), var(--white);
  border: 1px solid rgba(196, 168, 120, 0.4);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.banner-label { font-size: 11px; letter-spacing: 0.12em; color: var(--accent-deep); }
.prebook-chip {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-align: left;
  font-size: 13px;
  transition: border-color .12s;
}
.prebook-chip:hover { border-color: var(--ink); }
.prebook-chip .mono { font-size: 11px; color: var(--ink-mute); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.product-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  text-align: left;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.product-card:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.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: 6px; }
.product-price { font-size: 13px; color: var(--ink); font-weight: 500; }
.stock-low { font-size: 10px; color: var(--alert); background: rgba(184,85,58,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: 24px 24px 20px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.cart-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.cart-head h2 { font-size: 22px; margin-top: 2px; }
.badge-prebook {
  background: var(--accent);
  color: var(--ink);
  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: 16px; }
.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: 200px;
  border-top: 1px solid var(--line);
  margin: 0 -24px;
  padding: 8px 24px;
  overflow-y: auto;
}
.cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px;
  color: var(--ink-mute);
}
.empty-mark {
  font-size: 32px;
  width: 64px; height: 64px;
  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 28px;
  gap: 10px;
  padding: 12px 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 { display: block; width: 100%; margin-top: 4px; padding: 4px 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: 26px; height: 26px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 14px;
  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: 24px; height: 24px;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  font-size: 16px;
}
.cart-line-x:hover { background: rgba(184,85,58,0.1); color: var(--alert); }

.cart-totals { padding: 16px 0 8px; border-top: 1px solid var(--line); }
.total-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.total-credit { color: var(--ok); }
.total-grand {
  font-size: 22px;
  color: var(--ink);
  font-weight: 500;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.cart-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 12px; }

/* ─── Sheet (modal) ─────────────────────────────────────── */
.sheet-wrap {
  position: fixed; inset: 0;
  background: rgba(20, 14, 8, 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: min(520px, 100%);
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: rise .25s cubic-bezier(.2,.7,.3,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
.sheet-wide { width: min(720px, 100%); }
.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; }

.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: all .12s;
}
.mod-opt:hover { background: var(--paper-soft); }
.mod-opt.picked {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.mod-opt.picked .mono { color: var(--accent); }

.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;
}
.qty-stepper button:hover { background: var(--white); color: var(--ink); }
.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: all .12s;
}
.tip-chip:hover { background: var(--paper-soft); }
.tip-chip.active { background: var(--ink); 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(184,85,58,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(90, 122, 61, 0.1);  color: var(--ok); }
.balance.short { background: rgba(184, 85, 58, 0.1); color: var(--alert); }
.balance.over  { background: rgba(196, 168, 120, 0.2); color: var(--ink); }

/* ─── 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); }
.station-tab:hover { background: var(--paper-soft); }
.station-tab.active { background: var(--ink); 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(217,122,58,0.04), transparent); }
.kds-ready   { border-top-color: var(--ready); background: linear-gradient(0deg, rgba(90,122,61,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: #fff4d6; border-bottom: 1px solid #e6c982; 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(220, 53, 53, 0.07);
  border-color: #d33;
  border-top-color: #d33 !important;
  animation: pulse-urgent 1.2s ease-in-out infinite;
}
.kds-card.urgent .kds-short,
.kds-card.urgent .kds-timer.alert { color: #b71c1c; }
@keyframes pulse-urgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 53, 0); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 53, 53, 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(184, 85, 58, 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(--ink);
  color: var(--white);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  letter-spacing: 0.02em;
  font-family: var(--mono);
  transition: background .12s;
}
.btn-advance:hover { background: #2a1e10; }

/* ─── 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(90,122,61,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 ──────────────────────────────────── */
.display { background: var(--ink); min-height: 100vh; padding: 24px; }
.display-frame {
  background: var(--paper);
  border-radius: var(--r-xl);
  min-height: calc(100vh - 48px);
  padding: 40px 48px;
  display: flex; flex-direction: column;
  gap: 32px;
  position: relative;
  overflow: hidden;
}
.display-frame::after {
  content: ""; position: absolute; top: 0; right: 0; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(196,168,120,0.2), transparent 70%);
  pointer-events: none;
}
.display-head { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.display-brand { display: flex; align-items: center; gap: 16px; }
.brand-mark {
  width: 56px; height: 56px;
  background: var(--ink);
  color: var(--accent);
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 600;
  letter-spacing: 0.04em;
}
.brand-name { font-size: 22px; font-weight: 500; }
.display-clock { font-size: 28px; color: var(--ink-soft); }

.display-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; flex: 1; position: relative; z-index: 1; }
.display-order .eyebrow { margin-bottom: 16px; display: block; font-size: 13px; }
.display-items {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
  max-height: 480px; overflow-y: auto;
}
.display-items li {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  animation: slide-in .3s;
}
.d-qty { font-size: 22px; color: var(--accent-deep); font-weight: 500; }
.d-line { display: flex; flex-direction: column; gap: 2px; }
.d-line span:first-child { font-size: 18px; }
.d-mods { font-size: 12px; color: var(--ink-mute); }
.d-sub { font-size: 16px; }

.display-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 24px; padding-top: 20px; border-top: 2px solid var(--ink); }
.display-total .eyebrow { font-size: 14px; }
.display-total-num { font-size: 40px; font-weight: 600; letter-spacing: -0.02em; }

.display-pay {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  height: fit-content;
}
.display-pay .eyebrow { font-size: 12px; }
.display-pay-amount { display: flex; justify-content: space-between; align-items: baseline; width: 100%; padding-top: 16px; border-top: 1px solid var(--line); }
.display-pay-amount > span { font-size: 13px; color: var(--ink-mute); }
.display-pay-amount .mono { font-size: 20px; font-weight: 500; }
.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); }

.display-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-mute); position: relative; z-index: 1; padding-top: 20px; border-top: 1px solid var(--line); }

/* ─── 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: 16px; padding: 14px 32px; background: var(--paper-soft); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.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-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: all .12s; }
.admin-tab:hover { background: var(--white); }
.admin-tab.active { background: var(--ink); 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(--ink); color: var(--white); border-color: var(--ink); }
.kpi-card.accent .kpi-label, .kpi-card.accent .kpi-delta { color: rgba(239,233,223,0.6); }
.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: #cfdcb8; color: #3d5a1e; }

/* 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(--ink); 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(--ink); }
.tier-regular { background: var(--paper-deep); color: var(--ink-soft); }
.tier-new { background: rgba(90,122,61,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(58,42,26,0.02) 28px, rgba(58,42,26,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;
  animation: rise .25s;
  letter-spacing: 0.02em;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .cashier { grid-template-columns: 1fr; }
  .cashier-cart { position: static; height: auto; width: 100%; border-top: 1px solid var(--line); border-left: none; top: auto; }
  .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; }
}
