:root {
  --bg: #faf8f5; --card: #fff; --text: #2a2622; --muted: #7a7168; --line: #e6e0d8;
  --accent: #8c2f39; --accent-text: #fff; --ok: #2f7d4f; --warn: #a15c00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171514; --card: #211e1c; --text: #ece6df; --muted: #a0968b; --line: #36312d; --accent: #c4545f; --accent-text: #fff; --ok: #5bbd82; --warn: #e0a040; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 80px; }
h1 { font-size: 1.6rem; margin: 8px 0 4px; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=date], textarea, select {
  width: 100%; padding: 10px 12px; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }
button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); padding: 9px 14px; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
button.danger { color: #c0392b; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }
.error { color: #c0392b; margin: 8px 0; }
.notice { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid var(--warn); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.success { background: color-mix(in srgb, var(--ok) 14%, transparent); border: 1px solid var(--ok); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); vertical-align: middle; }
.badge.open { color: var(--ok); border-color: var(--ok); }
.badge.closed { color: var(--warn); border-color: var(--warn); }

/* позиции меню */
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 38px; height: 38px; padding: 0; font-size: 1.2rem; line-height: 1; }
.stepper input { width: 52px; text-align: center; padding: 8px 4px; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.item.on .name { font-weight: 600; }
.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 16px; }

/* таблицы */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; border-top: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.zero td { color: var(--muted); }
td.total { font-weight: 700; font-size: 1.05rem; }
.link-box { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.link-box input { flex: 1; font-size: .9rem; }
.guest { padding: 10px 0; border-top: 1px solid var(--line); }
.guest:first-child { border-top: 0; }
.guest .items { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: .25s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 480px) { .stepper button { width: 42px; height: 42px; } }
