:root {
  --ink: #1d2126; --muted: #6b7280; --line: #e3dfd7; --soft: #f7f5f1; --bg: #fbfaf8;
  --teal: #0f766e; --teal-soft: #e6f2f0; --danger: #b42318; --amber: #b45309;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; }
a { color: var(--teal); }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--danger); min-height: 18px; font-size: 14px; }
.ok { color: var(--teal); font-size: 14px; }

/* layout */
.shell { display: flex; min-height: 100vh; }
nav.side { width: 220px; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; flex-shrink: 0; }
nav.side .brand { font-weight: 800; font-size: 18px; padding: 0 8px 4px; }
nav.side .shop { color: var(--muted); font-size: 13px; padding: 0 8px 16px; }
nav.side a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
nav.side a.on { background: var(--teal-soft); color: var(--teal); }
nav.side .bottom { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
main { flex: 1; padding: 24px 28px 60px; max-width: 1200px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
@media (max-width: 800px) {
  .shell { flex-direction: column; }
  nav.side { width: auto; display: flex; overflow-x: auto; gap: 4px; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  nav.side .brand, nav.side .shop { display: none; }
  nav.side .bottom { margin: 0; border: 0; padding: 0; display: flex; }
  nav.side a { white-space: nowrap; }
  main { padding: 16px; }
}

/* parts */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 24px; font-weight: 800; margin-top: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid #efece6; vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--soft); }
td.r, th.r { text-align: right; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--soft); }
.pill.open { background: #fdf2e3; color: var(--amber); }
.pill.voided { background: #fde8e6; color: var(--danger); }
.pill.completed { background: var(--teal-soft); color: var(--teal); }
button, .btn { font: inherit; font-weight: 700; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--teal); color: #fff; cursor: pointer; }
button.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.link { background: none; color: var(--teal); padding: 4px 6px; }
button.danger { background: none; color: var(--danger); padding: 4px 6px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-soft); border-color: var(--teal); }
input.money { width: 92px; text-align: right; }
input.small { width: 110px; }
label.f { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
label.f input, label.f textarea, label.f select { margin-top: 5px; font-weight: 400; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 7px 12px; }
.tabs button.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 8px; }
.bars div { flex: 1; background: var(--teal); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div.zero { background: var(--line); }
.hours { display: flex; gap: 3px; font-size: 10px; color: var(--muted); }
.hours span { flex: 1; text-align: center; }
.swatch { width: 26px; height: 26px; border-radius: 7px; display: inline-block; cursor: pointer; border: 2px solid transparent; }
.swatch.on { border-color: var(--ink); }
.catlist div { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.catlist div.on { background: var(--teal-soft); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.menuwrap { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
@media (max-width: 900px) { .menuwrap { grid-template-columns: 1fr; } }
.savebar { position: sticky; bottom: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; box-shadow: 0 -4px 16px rgba(0,0,0,.05); }
.code { font-size: 46px; font-weight: 800; letter-spacing: 10px; font-variant-numeric: tabular-nums; }
.modal { position: fixed; inset: 0; background: rgba(20,24,28,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal .box { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.auth { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.auth .brand { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.switch input { width: auto; }
