/* CoffeeShop — black · white · coffee brown */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --accent: #7A3E16;
  --ink: #181716;
  --muted: #77706a;
  --line: #e7e1da;
  --paper: #ffffff;
  --cream: #f4f1ee;
  --ok: #2f7a4a;
  --warn: #b7791f;
  --radius: 16px;
  color: var(--ink);
  background: var(--cream);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.4;
}

body { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.error { color: #b42318; }
[hidden] { display: none !important; }

.primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: .8rem 1.4rem; font-weight: 600;
}
.primary:disabled { opacity: .5; cursor: progress; }
.ghost {
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem 1rem;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- status pills (shared) ---------- */
.pill {
  display: inline-block; padding: .2rem .65rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.pill.received  { background: #f1ebe5; color: var(--accent); }
.pill.preparing { background: #fdf3e1; color: var(--warn); }
.pill.ready     { background: #e5f3ea; color: var(--ok); }
.pill.collected { background: #eee; color: var(--muted); }

.live-dot { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.live-dot::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #c9c2bb; }
.live-dot[data-state="live"]::before { background: #2fb15c; box-shadow: 0 0 0 3px #2fb15c33; }
.live-dot[data-state="offline"]::before { background: #d64545; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 12px;
  font-size: .9rem; z-index: 50; box-shadow: 0 8px 30px #0003;
}
.toast.ok { background: var(--ok); }
.toast.error { background: #b42318; }

/* =================== CUSTOMER =================== */
.customer .phone {
  max-width: 440px; min-height: 100vh; margin: 0 auto; background: var(--paper);
  position: relative; padding-bottom: 84px;
}
.hero {
  background: #1d1611; color: #fff; padding: 1.6rem 1.4rem 1.4rem;
  display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 1rem;
  border-bottom: 4px solid var(--accent);
}
.brand { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; opacity: .8; }
.hero h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 1.7rem; line-height: 1.15; margin: .4rem 0; }
.announcement { font-size: .88rem; opacity: .85; }
.hero-cup { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }

.content { padding: 1.2rem 1.2rem 1.6rem; }
.section-title { font-family: Georgia, serif; font-weight: 500; font-size: 1.5rem; margin-bottom: .8rem; }
.search {
  display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line);
  border-radius: 999px; padding: .55rem .9rem;
}
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.search input { border: 0; outline: 0; flex: 1; background: transparent; }
.filters { display: flex; gap: .4rem; margin: .9rem 0 1rem; overflow-x: auto; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .38rem .9rem; font-size: .85rem; white-space: nowrap; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.menu-list { display: grid; gap: .8rem; }
.menu-item {
  display: grid; grid-template-columns: 84px 1fr auto; gap: .9rem; align-items: center;
  padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius);
}
.menu-item img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--cream); }
.menu-text h3 { font-size: 1rem; }
.price { font-weight: 700; color: var(--accent); margin: .1rem 0 .2rem; }
.add {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent);
  color: #fff; font-size: 1.4rem; line-height: 1;
}

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(440px, 100%); display: grid; grid-template-columns: repeat(3, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding: .45rem 0 .65rem;
}
.tabbar button, .tabbar a {
  border: 0; background: none; display: grid; justify-items: center; gap: .15rem;
  font-size: .75rem; color: var(--muted); text-decoration: none; position: relative;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.tabbar .active { color: var(--accent); font-weight: 600; }
.badge {
  position: absolute; top: -4px; right: calc(50% - 24px); background: var(--accent); color: #fff;
  border-radius: 999px; font-size: .68rem; min-width: 18px; padding: 0 5px; line-height: 18px;
}

.bar { display: flex; justify-content: space-between; align-items: center; padding: 1.3rem 1.2rem .4rem; }
.bar h1 { font-family: Georgia, serif; font-weight: 500; font-size: 1.6rem; }
.track-list { display: grid; gap: 1rem; }
.track-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.track-card.status-ready { border-color: var(--ok); box-shadow: 0 0 0 3px #2f7a4a1f; }
.track-card.status-collected { opacity: .65; }
.track-head { display: grid; grid-template-columns: 56px 1fr auto; gap: .8rem; align-items: center; }
.track-head img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.order-no { font-size: .78rem; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.ready-banner { margin-top: .8rem; background: #e5f3ea; color: var(--ok); padding: .6rem .8rem; border-radius: 10px; font-weight: 600; }

.stepper { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.stepper li { position: relative; text-align: center; font-size: .72rem; color: var(--muted); padding-top: 22px; }
.stepper li::before {
  content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 12px; border-radius: 50%; background: var(--line); z-index: 1;
}
.stepper li::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.stepper li:first-child::after { display: none; }
.stepper li.done, .stepper li.current { color: var(--ink); }
.stepper li.done::before, .stepper li.done::after, .stepper li.current::after { background: var(--accent); }
.stepper li.current::before { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.stepper li.current { font-weight: 700; }

.sheet { border: 0; border-radius: 22px; padding: 0; width: min(400px, 92vw); }
.sheet::backdrop { background: #0007; }
.sheet-inner { padding: 1.2rem; display: grid; gap: .5rem; position: relative; }
.product-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 16px; background: var(--cream); }
.sheet h2 { font-family: Georgia, serif; font-weight: 500; font-size: 1.5rem; margin-top: .4rem; }
.close {
  position: absolute; top: 1.6rem; right: 1.6rem; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: #fffd; font-size: 1.3rem; line-height: 1; z-index: 2;
}
.sheet .primary { margin-top: .6rem; }

/* =================== KITCHEN =================== */
.kitchen { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: #14100d; color: #fff; padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: 1.6rem;
  position: sticky; top: 0; height: 100vh;
}
.logo { font-family: Georgia, serif; font-size: 1.35rem; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav button {
  text-align: left; border: 0; background: transparent; color: #cfc6bd; padding: .6rem .8rem; border-radius: 10px;
}
.sidebar nav button.active { background: #ffffff14; color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: .4rem; }
.side-foot a { color: #cfc6bd; }
.sidebar .live-dot { color: #cfc6bd; }

.board { padding: 2rem 2.2rem; max-width: 1100px; }
.board-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1.4rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--accent); font-weight: 700; }
.board-head h1 { font-family: Georgia, serif; font-weight: 500; font-size: 2rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1rem; display: grid; }
.stat span { font-size: .8rem; color: var(--muted); }
.stat strong { font-size: 1.8rem; }
.queue-filter { margin-bottom: .6rem; font-size: .88rem; color: var(--muted); }

.queue { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.queue th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.queue td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.queue tr:last-child td { border-bottom: 0; }
.queue .order-no { font-size: .95rem; color: var(--ink); }
.queue .right { text-align: right; }
.row-collected { opacity: .55; }
.row-ready { background: #f5fbf7; }
.cell-item { display: flex; gap: .7rem; align-items: center; }
.cell-item img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.small-btn { padding: .45rem .9rem; font-size: .85rem; }

.menu-admin { display: grid; gap: .8rem; margin-top: 1rem; }
.admin-card {
  display: grid; grid-template-columns: 80px 1fr auto; gap: 1rem; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem;
}
.admin-card img { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; }
.key { word-break: break-all; font-family: ui-monospace, Menlo, monospace; }

.settings-form { display: grid; gap: 1rem; max-width: 460px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem; }
.settings-form label { display: grid; gap: .3rem; font-size: .85rem; font-weight: 600; }
.settings-form input:not([type="color"]) { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; font-weight: 400; }
.settings-form input[type="color"] { width: 64px; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.settings-form .primary { justify-self: start; }
.note { margin-top: 1.2rem; max-width: 460px; font-size: .88rem; color: var(--muted); background: #fff8f1; border-left: 3px solid var(--accent); padding: .9rem 1rem; border-radius: 0 10px 10px 0; }
.note strong { color: var(--ink); display: block; margin-bottom: .2rem; }

@media (max-width: 760px) {
  .kitchen { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { display: flex; }
  .side-foot { margin: 0; }
  .board { padding: 1.2rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .queue th:nth-child(3), .queue td:nth-child(3) { display: none; }
}
