/* Luna Restaurant — modern warm theme. Mobile-first. */
:root {
  --bg: #FAF6EC;
  --bg-elev: #FFFFFF;
  --bg-soft: #F1E9D6;
  --ink: #2A2622;
  --ink-soft: #5D544A;
  --muted: #8B7E6E;
  --line: #E6DDC8;
  --accent: #C3553A;
  --accent-deep: #9B3F2A;
  --accent-soft: #F6D9CC;
  --green: #2F4A3A;
  --green-soft: #D8E2D6;
  --gold: #B8884B;
  --warn: #B45309;
  --shadow-sm: 0 1px 2px rgba(42,38,34,0.06), 0 2px 6px rgba(42,38,34,0.04);
  --shadow-md: 0 4px 16px rgba(42,38,34,0.08), 0 2px 4px rgba(42,38,34,0.04);
  --shadow-lg: 0 12px 36px rgba(42,38,34,0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --serif: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--accent-deep); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
h1 { font-size: 1.85rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

.muted { color: var(--muted); }
.center { text-align: center; }
.hide { display: none !important; }
.serif { font-family: var(--serif); }

/* ======= Layout ======= */
.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 120px;
}
.app-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* ======= Header ======= */
.brand {
  padding: 28px 0 12px;
  text-align: center;
}
.brand .moon { font-size: 2rem; line-height: 1; }
.brand h1 {
  font-size: 2.2rem;
  margin-top: 4px;
}
.brand .tagline {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.04em;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.topbar .title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .title h1 { font-size: 1.4rem; }

.table-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.table-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #C8E6CB; }

/* ======= Category nav ======= */
.cat-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 14px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.cat-chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.cat-chip .ic { font-size: 1rem; }

/* ======= Menu sections ======= */
.cat-section {
  scroll-margin-top: 70px;
  margin-top: 22px;
}
.cat-section h2 {
  font-size: 1.55rem;
  margin-bottom: 2px;
}
.cat-section .sub {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 14px;
}

.item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.item:last-child { border-bottom: none; }
.item .body { flex: 1; min-width: 0; }
.item .name {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.item .desc {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.4;
  margin-bottom: 8px;
}
.item .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.price {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  color: var(--gold);
  white-space: nowrap;
}

.tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green);
}
.tag.v { background: #DDEBD9; color: #2F4A3A; }
.tag.vg { background: #C9E0C2; color: #1F3826; }
.tag.gf { background: #F1E0BD; color: #7A5817; }

.add-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--bg-elev);
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.add-btn:hover { background: var(--accent); color: #fff; }
.add-btn:active { transform: scale(0.94); }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 3px;
  gap: 0;
}
.qty-stepper button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}
.qty-stepper .qty {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ======= Cart bar (sticky bottom) ======= */
.cart-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(250,246,236,0) 0%, rgba(250,246,236,1) 30%);
  pointer-events: none;
  z-index: 50;
}
.cart-bar .inner {
  max-width: 720px;
  margin: 0 auto;
  pointer-events: auto;
}
.cart-bar button {
  width: 100%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  transition: transform 0.12s ease;
}
.cart-bar button:active { transform: translateY(1px); }
.cart-bar .count {
  background: var(--accent);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.cart-bar .total { font-family: var(--serif); font-size: 1.05rem; }

/* ======= Sheet (cart / order success / bill) ======= */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.5);
  z-index: 100;
  display: none;
  animation: fadeIn 0.18s ease;
}
.sheet-backdrop.open { display: block; }
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -16px 48px rgba(0,0,0,0.18);
  max-height: 92vh;
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.sheet.open { transform: translateY(0); }
.sheet .grip {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--line);
  margin: 12px auto 0;
}
.sheet header {
  padding: 12px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sheet h2 { font-size: 1.4rem; }
.sheet .close {
  background: var(--bg-soft);
  border: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.sheet .body {
  padding: 8px 20px 20px;
  overflow-y: auto;
  flex: 1;
}
.sheet .footer {
  padding: 12px 20px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}

.cart-line {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .name { font-weight: 600; margin-bottom: 4px; }
.cart-line .price-row { color: var(--muted); font-size: 0.88rem; }
.cart-line .note-input {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ink-soft);
}
.cart-line .qty-stepper { background: var(--bg-soft); color: var(--ink); }
.cart-line .qty-stepper button { color: var(--ink); }

.totals { padding: 12px 0; }
.totals .row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  font-size: 0.95rem;
}
.totals .row.total {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 0.98rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.12s ease;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); }
.btn-ghost { background: var(--bg-soft); color: var(--ink); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

.success-burst {
  text-align: center;
  padding: 24px 12px;
}
.success-burst .icon {
  font-size: 3.6rem;
  display: block;
  margin: 8px 0 12px;
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.success-burst h2 {
  font-size: 1.7rem;
  margin-bottom: 6px;
}
.success-burst p {
  color: var(--ink-soft);
  margin: 6px 0;
}

/* ======= Order tracker ======= */
.tracker {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.tracker .head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.tracker .head .id { font-family: var(--serif); font-weight: 600; }
.tracker .head .when { color: var(--muted); font-size: 0.82rem; }
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.step {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  position: relative;
}
.step .dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--line);
  margin: 0 auto 4px;
  border: 2px solid var(--bg-elev);
  outline: 2px solid var(--line);
}
.step.done .dot { background: var(--green); outline-color: var(--green); }
.step.current .dot { background: var(--accent); outline-color: var(--accent-soft); animation: pulse 1.4s infinite; }
.step.done, .step.current { color: var(--ink); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(195, 85, 58, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(195, 85, 58, 0); }
}
.tracker .items {
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.tracker .items li { padding: 2px 0; }

/* ======= Kitchen display ======= */
.kitchen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 12px 0;
}
.k-card {
  background: var(--bg-elev);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.k-card.placed { border-left-color: var(--accent); }
.k-card.preparing { border-left-color: var(--gold); }
.k-card.ready { border-left-color: var(--green); }
.k-card .head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.k-card .table {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
}
.k-card .order-id { color: var(--muted); font-size: 0.82rem; }
.k-card .timer {
  font-family: 'SF Mono', ui-monospace, Menlo, monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.k-card .timer.warn { color: var(--warn); font-weight: 700; }
.k-card ul {
  list-style: none;
  margin: 0; padding: 0;
  flex: 1;
}
.k-card li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.k-card li .qty {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}
.k-card li .nm { flex: 1; }
.k-card li .note {
  display: block;
  font-size: 0.78rem;
  color: var(--warn);
  font-style: italic;
  margin-top: 2px;
}
.k-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.k-card .actions button {
  flex: 1;
  border: none;
  background: var(--ink);
  color: var(--bg);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}
.k-card .actions .ghost {
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state .moon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

/* ======= Manager dashboard ======= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.kpi .label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi .value {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--ink);
}
.kpi .sub { color: var(--muted); font-size: 0.82rem; }

.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.t-card {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--line);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.t-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.t-card.free      { border-top-color: var(--line); }
.t-card.seated    { border-top-color: var(--gold); }
.t-card.ordered   { border-top-color: var(--accent); }
.t-card.billing   { border-top-color: var(--green); }
.t-card .head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.t-card h3 { font-size: 1.2rem; }
.t-card .cap { color: var(--muted); font-size: 0.82rem; }
.t-card .status {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--ink-soft);
}
.t-card.seated .status   { background: #F4E5C7; color: #7A5817; }
.t-card.ordered .status  { background: var(--accent-soft); color: var(--accent-deep); }
.t-card.billing .status  { background: var(--green-soft); color: var(--green); }
.t-card .meta {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

/* Section heading */
.sec {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 22px 0 12px;
}
.sec h2 { font-size: 1.3rem; }

/* QR modal */
.qr-modal-content { text-align: center; padding: 8px 4px 4px; }
.qr-modal-content img { width: 240px; height: 240px; margin: 6px auto 12px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.qr-modal-content .url { font-size: 0.78rem; color: var(--muted); word-break: break-all; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(28px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
  z-index: 200;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Spinner */
.spin {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rot 0.8s linear infinite;
  display: inline-block;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* Bill receipt */
.receipt {
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px dashed var(--line);
}
.receipt h3 { text-align: center; margin-bottom: 4px; }
.receipt .when { text-align: center; color: var(--muted); font-size: 0.82rem; margin-bottom: 14px; }
.receipt .line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line);
  font-size: 0.92rem;
}
.receipt .line:last-of-type { border-bottom: none; }
.receipt .line .nm { flex: 1; }
.receipt .line .qty-x { color: var(--muted); margin: 0 8px; }
.receipt .ttl { font-family: var(--serif); font-weight: 700; }

/* Tip presets */
.tip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 12px 0 6px;
}
.tip-btn {
  border: 1.5px solid var(--line);
  background: var(--bg-elev);
  padding: 10px 6px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.tip-btn.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Pay methods */
.pay-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 12px;
}
.pay-btn {
  background: var(--bg-elev);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 8px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink);
}
.pay-btn .ic { font-size: 1.4rem; }
.pay-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }

/* Larger screens */
@media (min-width: 720px) {
  .app { padding: 0 24px 120px; }
  .item .desc { font-size: 0.95rem; }
}

@media (min-width: 1024px) {
  .brand h1 { font-size: 2.6rem; }
}

/* ======================================================================
   Phase 2 styles — admin employee cards, regen, kiosk redesign,
   route cards, tablet responsiveness pass
   ====================================================================== */

/* ---- Admin: tabs ---- */
.tab-pane { animation: fadeIn 0.18s ease; }

/* ---- Admin: employee cards ---- */
.emp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.emp-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.emp-card.inactive { opacity: 0.55; }
.emp-card-top {
  display: flex;
  gap: 14px;
  align-items: center;
}
.emp-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-soft);
  border: 2px solid var(--line);
  flex-shrink: 0;
}
.emp-photo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}
.emp-card-info { flex: 1; min-width: 0; }
.emp-card-info h3 {
  font-size: 1.05rem;
  font-family: var(--serif);
  margin-bottom: 4px;
  word-break: break-word;
}
.emp-meta {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}
.badge-warn {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #FBE8C8;
  color: var(--warn);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}
.emp-code-block {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--line);
}
.emp-code-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.emp-code-value {
  font-family: 'SF Mono', ui-monospace, Menlo, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--ink);
  flex: 1;
  text-align: center;
}
.emp-code-shown { color: var(--accent-deep); }
.emp-code-eye {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.emp-code-eye:hover { background: var(--bg); }
.emp-actions {
  display: flex;
  gap: 6px;
}
.btn-sm { padding: 8px 12px !important; font-size: 0.85rem !important; }
.emp-actions .btn { flex: 1; }

/* ---- Admin: form ---- */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.form-input {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-elev);
  color: var(--ink);
}
.form-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-error { color: var(--accent-deep); font-size: 0.85rem; margin: 6px 0 0; min-height: 1.2em; text-align: center; }
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 460px) { .row-2 { grid-template-columns: 1fr; } }

.photo-row {
  display: flex;
  gap: 14px;
  align-items: center;
}
.photo-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.photo-circle img { width: 100%; height: 100%; object-fit: cover; }
.ph-icon { font-size: 2rem; }

.day-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.88rem;
  background: var(--bg-elev);
  user-select: none;
}
.day-chip input { display: none; }
.day-chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---- Admin: regen / code reveal ---- */
.code-old, .code-new {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 8px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 10px;
  display: inline-block;
  margin: 4px auto;
}
.code-old {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(139,126,110,0.6);
}
.code-new { color: var(--accent-deep); }

/* ---- Admin: attendance table responsive wrap ---- */
.att-table-wrap {
  overflow-x: auto;
  background: var(--bg-elev);
  border-radius: 14px;
  border: 1px solid var(--line);
}
.att-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.att-table thead { background: var(--bg-soft); }
.att-table th, .att-table td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}
.att-table tbody tr { border-top: 1px solid var(--line); }

.att-photos {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}
.att-photos img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.ph-cap { font-size: 0.82rem; text-align: center; margin: 0 0 6px; }

/* ---- Camera wrap (used in admin + checkin) ---- */
.cam-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.cam-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
  transform: scaleX(-1); /* mirror selfie */
}
.cam-wrap canvas { display: none; }
.cam-wrap.hide { display: none; }

/* ---- Kiosk (check-in page) ---- */
.kiosk { max-width: 520px; padding: 8px 14px 100px; }
.kiosk .brand { padding: 18px 0 6px; }
.kiosk .brand h1 { font-size: 2rem; }
.card-box {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: var(--shadow-sm);
}
.step-label {
  text-align: center;
  font-weight: 600;
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0 0 14px;
}
.code-input {
  width: 100%;
  padding: 18px;
  font-size: 2rem;
  text-align: center;
  letter-spacing: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: inherit;
  background: var(--bg);
}
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.pad-key {
  padding: 22px;
  font-size: 1.5rem;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.08s;
}
.pad-key:active { background: var(--ink); color: var(--bg); }
.pad-key.pad-aux { font-size: 1rem; background: var(--bg-soft); }

/* Mode picker */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0;
}
.mode-btn {
  padding: 28px 14px;
  background: var(--bg-elev);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  box-shadow: var(--shadow-sm);
}
.mode-btn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mode-btn:active { transform: translateY(0); }
.mode-btn[data-mode="checkin"]:hover { border-color: var(--green); }
.mode-btn[data-mode="checkout"]:hover { border-color: var(--accent); }
.mode-ic { font-size: 2.6rem; }
.mode-label { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.mode-sub { font-size: 0.82rem; color: var(--muted); }

@media (max-width: 360px) {
  .mode-grid { grid-template-columns: 1fr; }
}

/* Done photo preview */
.done-photo {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

/* Role route cards */
.route-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
@media (min-width: 520px) { .route-grid { grid-template-columns: 1fr 1fr; } }
.route-card {
  display: block;
  background: var(--bg-elev);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.route-card .route-label {
  display: block;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.route-card .route-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.route-card .route-cta {
  display: inline-block;
  font-weight: 600;
  font-size: 0.88rem;
}
.route-allowed { border-color: var(--green); color: var(--ink); }
.route-allowed:hover { background: var(--green-soft); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.route-allowed .route-cta { color: var(--green); }
.route-denied { border-style: dashed; opacity: 0.7; }
.route-denied .route-label { color: var(--muted); }
.route-denied .route-cta { color: var(--accent-deep); }

/* ---- Tablet / desktop responsive pass ---- */
@media (min-width: 768px) {
  .app-wide { padding: 8px 28px 60px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 16px 0; }
  .topbar .title h1 { font-size: 1.6rem; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .tables-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .kitchen-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
  .emp-grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
}
@media (min-width: 1024px) {
  .tables-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .kitchen-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
}

/* On phones, top bars often have too many items to fit; allow wrap */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; padding: 10px 0; }
  .topbar > div:last-child { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
  .topbar .title h1 { font-size: 1.2rem; }
  .table-pill { font-size: 0.78rem; padding: 5px 10px; }
  .kpi .value { font-size: 1.4rem; }
  .att-table th, .att-table td { padding: 8px; font-size: 0.84rem; }
  .sec h2 { font-size: 1.15rem; }
  .sheet { max-height: 95vh; }
  .pad-key { padding: 18px; font-size: 1.3rem; }
}

/* Wider screen sheet (admin form) — make it dock as a side panel on big screens */
@media (min-width: 980px) {
  .sheet {
    left: auto;
    right: 0;
    bottom: 0;
    top: 0;
    max-height: none;
    width: 460px;
    border-radius: 18px 0 0 18px;
    transform: translateX(100%);
  }
  .sheet.open { transform: translateX(0); }
}

/* ======================================================================
   Phase 3 — logo, fancy customer cards, big tracker banner, login tile
   ====================================================================== */

/* Brand logo */
.brand-logo {
  display: block;
  max-width: 240px;
  width: 64%;
  height: auto;
  margin: 4px auto 8px;
}
@media (min-width: 720px) { .brand-logo { max-width: 280px; } }

/* Login mode tile — third option */
.mode-grid-3 {
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 520px) {
  .mode-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.mode-btn.mode-login:hover { border-color: var(--gold); }
.mode-btn.mode-login .mode-ic { color: var(--gold); }

/* ---- Fancy customer item cards ---- */
.item-fancy {
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}
.item-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bg-soft), var(--accent-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 720px) {
  .item-thumb { width: 80px; height: 80px; font-size: 2.4rem; border-radius: 18px; }
}

/* ---- Customer order tracker — fancier banner ---- */
.tracker-fancy {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
}
.tracker-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-soft) 100%);
  position: relative;
}
.tracker-fancy.preparing .tracker-banner { background: linear-gradient(135deg, #FBE8C8, var(--bg-soft)); }
.tracker-fancy.ready .tracker-banner     { background: linear-gradient(135deg, var(--green-soft), #FFF7E0); animation: shimmer 2.4s ease-in-out infinite; }
.tracker-fancy.served .tracker-banner    { background: linear-gradient(135deg, #E2EBE0, #F4EFD9); }
.tracker-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}
.tracker-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}
.tracker-sub { font-size: 0.85rem; color: var(--ink-soft); }
.tracker-when {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

@keyframes shimmer {
  0%, 100% { box-shadow: 0 0 0 0 rgba(195,85,58,0); }
  50% { box-shadow: inset 0 0 30px rgba(184,136,75,0.18); }
}

.progress-bar {
  height: 4px;
  background: var(--line);
  position: relative;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.tracker-fancy .steps {
  padding: 12px 14px 6px;
  background: var(--bg-elev);
}
.tracker-fancy .step .step-label {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
}
.tracker-fancy .step.done .step-label { color: var(--green); font-weight: 600; }
.tracker-fancy .step.current .step-label { color: var(--accent-deep); font-weight: 700; }
.tracker-fancy .items {
  list-style: none;
  margin: 0;
  padding: 8px 16px 14px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  background: var(--bg-elev);
  border-top: 1px dashed var(--line);
}
.tracker-fancy .items li { padding: 2px 0; }

/* ======================================================================
   Phase 4 — manager order editing
   ====================================================================== */
.order-row {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.order-row.editable { border-color: var(--accent-soft); }
.order-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  margin-bottom: 4px;
}
.order-row-server { font-size: 0.82rem; margin-bottom: 6px; color: var(--ink-soft); }

.order-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.order-item-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
}
.order-item-line:last-child { border-bottom: none; }
.line-name { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.line-name .nm { white-space: normal; }
.qty-static { color: var(--muted); font-weight: 600; min-width: 26px; }

.line-qty-stepper {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 2px;
}
.line-qty-stepper button {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.line-qty-stepper button:hover { background: var(--accent); color: #fff; }
.line-qty-stepper .qty {
  min-width: 22px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 4px;
}

.line-trail {
  display: flex;
  align-items: center;
  gap: 8px;
}
.line-del {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--accent-deep);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.line-del:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Add-item picker */
.add-item-search { position: sticky; top: 0; background: var(--bg); padding: 4px 0 10px; z-index: 5; }
.add-item-list { display: flex; flex-direction: column; gap: 16px; }
.add-item-cat h4 {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.add-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 6px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.add-item-row:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.add-item-row .ai-thumb {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bg-soft), var(--accent-soft));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.add-item-row .ai-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.add-item-row .ai-name { font-weight: 600; }
.add-item-row .ai-desc { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-item-row .ai-price { font-family: var(--serif); font-weight: 700; color: var(--gold); }
