/* Oasis POS — спокойная тема «вода и тень пальмы».
   Один акцент интерфейса — глубокий бирюзовый; шафрановый используется только для итога к оплате.
   Главный узнаваемый элемент — панель заказа в виде бумажного чека с отрывным краем. */

/* Oasis POS — фирменные цвета логотипа: оранжевый #F86E16, почти чёрный #141414, белый.
   Оранжевый — заливка главных действий (всегда с тёмным текстом, 6.35:1). Оранжевый текст — #A84A07 (5.76:1 на белом),
   в тёмной теме #FF9A52. Главный узнаваемый элемент — панель заказа в виде бумажного чека; «лента» логотипа
   повторяется только в активном пункте меню (чёрная плашка с оранжевой кромкой). */
:root {
  --bg: #F4F3F1;
  --surface: #FFFFFF;
  --surface-2: #F8F7F5;
  --surface-3: #ECEAE6;
  --ink: #141414;
  --ink-2: #474747;
  --muted: #666666;
  --line: #E3E1DD;
  --line-strong: #CBC8C2;
  --brand: #F86E16;
  --brand-hover: #FF8A3D;
  --brand-ink: #141414;
  --brand-text: #A84A07;
  --brand-soft: #FDEBDD;
  --ribbon: #141414;
  --ribbon-ink: #FFFFFF;
  --saffron: #F86E16;
  --saffron-soft: #FDE3CF;
  --danger: #B3372E;
  --danger-soft: #F8E1DE;
  --warn: #8A5A00;
  --warn-soft: #FFF1CC;
  --ok: #1F7A3A;
  --ok-soft: #DDF0E2;
  --paper: #FFFFFF;
  --shadow-1: 0 1px 2px rgba(20, 20, 20, .08);
  --shadow-2: 0 12px 32px -14px rgba(20, 20, 20, .35);
  --focus: #1A73E8;
  --chart-bar: #E25F0A;
  --chart-bar-2: #141414;
  --chart-grid: #E6E4E0;

  --font: "Segoe UI Variable Text", "Segoe UI", "SF Pro Text", -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "SF Pro Display", -apple-system, Roboto, "Noto Sans", Arial, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --tap: 48px;
  --nav-w: 236px;
  --header-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0F0F;
    --surface: #1A1A1A;
    --surface-2: #212121;
    --surface-3: #2A2A2A;
    --ink: #F2F2F0;
    --ink-2: #C4C4C4;
    --muted: #9C9C9C;
    --line: #2C2C2C;
    --line-strong: #404040;
    --brand: #F86E16;
    --brand-hover: #FF8A3D;
    --brand-ink: #141414;
    --brand-text: #FF9A52;
    --brand-soft: #3A2412;
    --ribbon: #000000;
    --ribbon-ink: #FFFFFF;
    --saffron: #F86E16;
    --saffron-soft: #4A2A10;
    --danger: #FF7A6B;
    --danger-soft: #3B1C19;
    --warn: #F2C14E;
    --warn-soft: #362A10;
    --ok: #7CD18E;
    --ok-soft: #173220;
    --paper: #F7F4EE;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, .8);
    --focus: #4BE597;
    --chart-bar: #F86E16;
    --chart-bar-2: #E8E8E8;
    --chart-grid: #2A2A2A;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; }
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .5em; }
a { color: var(--brand-text); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 8px; top: -60px; background: var(--brand); color: var(--brand-ink); padding: 10px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Кнопки ---------- */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s, transform .06s;
  touch-action: manipulation;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--surface); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.btn-lg { min-height: 56px; padding: 0 22px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field > label { font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1rem;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 0; }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.input.num { text-align: right; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form-grid .span-all { grid-column: 1 / -1; }

/* ---------- Каркас ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: var(--header-h) 1fr; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; display: block; flex: none; }
.loc-select { display: flex; align-items: center; gap: 8px; }
.loc-select select { min-height: 40px; font-weight: 600; max-width: 180px; }
.who { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.who b { font-size: .9rem; }
.who span { font-size: .78rem; color: var(--muted); }

.sidenav {
  background: var(--surface); border-right: 1px solid var(--line); padding: 10px 10px 24px;
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.nav-list, .nav-sub { list-style: none; margin: 0; padding: 0; }
.nav-list > li + li { margin-top: 2px; }
.navlink, .nav-group > button {
  appearance: none; width: 100%; display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  color: var(--ink-2); text-decoration: none; font: inherit; font-size: .95rem; font-weight: 600; text-align: left; cursor: pointer;
}
.navlink svg, .nav-group > button svg { width: 22px; height: 22px; flex: none; }
.navlink:hover, .nav-group > button:hover { background: var(--surface-2); color: var(--ink); }
.nav-group > button .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .15s; opacity: .7; }
.nav-group > button[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-group > button.has-current { color: var(--ink); }
.nav-sub { margin: 2px 0 6px 23px; padding-left: 12px; border-left: 2px solid var(--line); }
.nav-sub .navlink { min-height: 40px; font-size: .9rem; font-weight: 500; padding: 0 10px; }
/* Активный пункт — «лента» логотипа: чёрная плашка с оранжевой кромкой */
.navlink[aria-current="page"] { background: var(--ribbon); color: var(--ribbon-ink); box-shadow: inset 4px 0 0 var(--brand); }
.navlink[aria-current="page"] svg { color: var(--brand); }
.nav-toggle { display: none; }
.nav-scrim { display: none; }

.main { padding: 20px; min-width: 0; }
.main:focus { outline: none; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin-right: auto; }

@media (max-width: 1099px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-flex; }
  .sidenav {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; width: min(300px, 86vw); z-index: 60;
    transform: translateX(-102%); transition: transform .2s ease-out; box-shadow: var(--shadow-2); padding-top: 14px;
  }
  .shell.nav-open .sidenav { transform: none; }
  .shell.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .45); }
}
@media (max-width: 760px) {
  :root { --header-h: 56px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--header-h) 1fr auto; }
  .main { padding: 14px 12px calc(24px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-text { display: none; }
  .who { display: none; }
  .loc-select .lbl { display: none; }
  .loc-select select { max-width: 150px; }
  h1 { font-size: 1.35rem; }
}

/* ---------- Панели, таблицы ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin-right: auto; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tab { appearance: none; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink-2); padding: 12px 14px; min-height: 46px; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 140px; flex: 0 1 180px; }
.filters .grow { flex: 1 1 220px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data .num { text-align: right; }
table.data th { font-size: .8rem; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line-strong); border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }
table.data tr.row-low td { background: var(--warn-soft); }
table.data tr.row-neg td { background: var(--danger-soft); }
table.data tr.row-muted td { color: var(--muted); }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions .btn + .btn { margin-left: 6px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--brand-soft); color: var(--brand-text); }
.neg { color: var(--danger); font-weight: 700; }

/* ---------- Вход ---------- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 24px 24px; box-shadow: var(--shadow-2); }
.login-card .brand { justify-content: center; margin: 0 0 6px; font-size: 1.5rem; }
.login-logo { display: block; width: 176px; height: 176px; margin: -6px auto 4px; }
.login-sub { text-align: center; color: var(--muted); margin-bottom: 20px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 16px; min-height: 18px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); transition: background-color .1s, border-color .1s; }
.pin-dots span.on { background: var(--ink); border-color: var(--ink); }
.pin-dots.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key {
  appearance: none; min-height: 66px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 1.6rem; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation;
}
.key:hover { background: var(--surface-3); }
.key:active { background: var(--brand-soft); }
.key.key-fn { font-size: 1rem; color: var(--ink-2); }
.key.key-go { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-size: 1.05rem; }
.key[disabled] { opacity: .5; }
.key svg { width: 26px; height: 26px; vertical-align: middle; }

/* ---------- Касса ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.pos-left { min-width: 0; }
.open-orders { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.oo-chip {
  appearance: none; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  min-height: 52px; padding: 6px 14px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-align: left;
}
.oo-chip b { font-size: .95rem; }
.oo-chip span { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.oo-chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.oo-chip[aria-pressed="true"] span { color: var(--ink-2); }
.oo-new { border-style: dashed; color: var(--brand-text); flex-direction: row; align-items: center; gap: 6px; font-weight: 700; }
.oo-new svg { width: 18px; height: 18px; }

.cat-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.cat-tile {
  appearance: none; flex: none; min-height: 50px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font: inherit; font-weight: 650; font-size: 1rem; cursor: pointer;
}
.cat-tile[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item-tile {
  appearance: none; position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  min-height: 112px; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  box-shadow: var(--shadow-1); touch-action: manipulation; overflow: hidden;
}
.item-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cat-color, var(--brand)); }
.item-tile:hover { border-color: var(--line-strong); }
.item-tile:active { transform: scale(.98); background: var(--surface-2); }
.item-tile .it-name { font-weight: 650; font-size: 1.02rem; line-height: 1.25; }
.item-tile .it-price { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; }
.item-tile .it-qty { position: absolute; top: 8px; right: 8px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .85rem; display: grid; place-items: center; }

/* Чек — главный характерный элемент */
.ticket-col { position: sticky; top: calc(var(--header-h) + 16px); }
.ticket {
  position: relative; background: var(--paper); color: #1E1E1E;
  border-radius: var(--r-md) var(--r-md) 0 0; box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h) - 48px); max-height: calc(100dvh - var(--header-h) - 48px);
  --paper-ink-2: #5A5A5A; --paper-line: #DCD8CC;
}
.ticket::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background:
    linear-gradient(-45deg, transparent 7px, var(--paper) 7px) 0 0 / 14px 10px repeat-x,
    linear-gradient(45deg, transparent 7px, var(--paper) 7px) 0 0 / 14px 10px repeat-x;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .08));
}
.ticket-head { padding: 16px 16px 10px; border-bottom: 1px dashed var(--paper-line); display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; }
.ticket-head h2 { font-size: 1.15rem; color: #141414; }
.ticket-head .muted { color: var(--paper-ink-2); }
.ticket .input { background: #fff; color: #1E1E1E; border-color: #C9C4B6; min-height: 42px; }
.ticket-table { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.ticket-table label { font-size: .85rem; color: var(--paper-ink-2); font-weight: 600; white-space: nowrap; }
.ticket-lines { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 1 1 auto; min-height: 80px; }
.tl { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px dotted var(--paper-line); }
.tl-name { font-weight: 600; line-height: 1.25; }
.tl-sum { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.tl-ctrl { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; color: var(--paper-ink-2); font-size: .88rem; }
.tl-ctrl .price { margin-right: auto; font-variant-numeric: tabular-nums; }
.qty-btn {
  appearance: none; width: 44px; height: 40px; border-radius: 10px; border: 1px solid #C9C4B6; background: #fff; color: #141414;
  font: inherit; font-size: 1.3rem; font-weight: 700; cursor: pointer; display: grid; place-items: center; touch-action: manipulation;
}
.qty-btn:active { background: #EFEBE0; }
.qty-btn svg { width: 18px; height: 18px; }
.qty-val { min-width: 34px; text-align: center; font-weight: 700; font-size: 1.05rem; color: #141414; font-variant-numeric: tabular-nums; }
.ticket-empty { padding: 28px 16px; text-align: center; color: var(--paper-ink-2); }
.ticket-foot { padding: 12px 16px 18px; border-top: 1px dashed var(--paper-line); display: flex; flex-direction: column; gap: 10px; }
.tf-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; color: var(--paper-ink-2); }
.tf-row .input { max-width: 130px; text-align: right; }
.disc-quick { display: flex; gap: 6px; }
.disc-quick button { appearance: none; border: 1px solid #C9C4B6; background: #fff; color: #141414; border-radius: 8px; min-height: 36px; min-width: 44px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.tf-total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 2px; color: #141414; }
.tf-total span { font-weight: 600; }
.tf-total b { color: #141414; font-family: var(--font-display); font-size: 2rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; box-shadow: inset 0 -.32em 0 #FCD3B4; padding: 0 2px; }
.pay-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-btn {
  appearance: none; min-height: 64px; border-radius: 12px; border: 1.5px solid #141414; background: #fff; color: #141414;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; touch-action: manipulation;
}
.pay-btn svg { width: 22px; height: 22px; }
.pay-btn.cash { background: #F86E16; border-color: #F86E16; color: #141414; }
.pay-btn[disabled] { opacity: .45; cursor: not-allowed; }
.ticket .btn-cancel { appearance: none; background: none; border: 0; color: #A3332A; font: inherit; font-weight: 600; min-height: 40px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ticket .btn-cancel[disabled] { opacity: .4; cursor: not-allowed; }
.ticket :focus-visible { outline-color: #1A73E8; }

.ticket-bar { display: none; }
.ticket-close { display: none; }
.ticket .ticket-close { color: #141414; }
.ticket .ticket-close:hover { background: #EFEBE0; }
.nav-short { display: none; }

@media (max-width: 1080px) {
  .pos { grid-template-columns: minmax(0, 1fr) 320px; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}
@media (max-width: 760px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .item-tile { min-height: 96px; padding: 12px 12px 12px 16px; }
  .ticket-col { position: fixed; inset: 0; top: 0; z-index: 40; background: rgba(8, 20, 18, .5); padding: 12px 8px 20px; display: none; }
  .ticket-col.open { display: flex; align-items: flex-end; }
  .ticket { width: 100%; max-height: calc(100dvh - 40px); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .ticket-close { display: inline-flex; }
  .ticket-bar {
    display: flex; position: fixed; left: 8px; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 25;
    align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 16px;
    background: var(--ink); color: var(--surface); box-shadow: var(--shadow-2);
  }
  .ticket-bar .tb-info { margin-right: auto; line-height: 1.2; min-width: 0; }
  .ticket-bar .tb-info b { display: block; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
  .ticket-bar .tb-info span { font-size: .8rem; opacity: .75; }
  .ticket-bar .btn { background: var(--brand); border-color: var(--brand); color: #141414; }
  .pos-left { padding-bottom: 76px; }
}

/* ---------- Отчёты ---------- */
.period { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { appearance: none; border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; color: var(--ink-2); min-height: 40px; padding: 0 14px; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.period .field { flex: 0 1 160px; }

.rep-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.hero-num { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 4px; }
.hero-num .big { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 750; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-2); font-size: .92rem; margin-bottom: 12px; }
.hero-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }

.chart-box { position: relative; }
.chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-box .bar { fill: var(--chart-bar); }
.chart-box .bar-hit { fill: transparent; cursor: default; }
.chart-box .bar-hit:hover + .bar, .chart-box .bar.active { fill: var(--brand-hover); }
.chart-box .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart-box .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 8px; font-size: .82rem; line-height: 1.35; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow-2); z-index: 2; }
.chart-tip b { font-variant-numeric: tabular-nums; }
details.table-view { margin-top: 10px; }
details.table-view summary { cursor: pointer; color: var(--brand-text); font-weight: 600; min-height: 36px; display: flex; align-items: center; }

.ledger { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.ledger li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ledger li .op { display: inline-block; width: 1.1em; color: var(--muted); font-weight: 700; }
.ledger li.sub { font-weight: 700; border-bottom-color: var(--line-strong); }
.ledger li.total { font-weight: 750; font-size: 1.15rem; border-bottom: 0; padding-top: 12px; }
.ledger li.total .val { box-shadow: inset 0 -.35em 0 var(--saffron-soft); }
.ledger li .note { color: var(--muted); font-weight: 400; font-size: .85rem; }

.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 10px 0 8px; background: var(--surface-3); }
.split span { display: block; height: 100%; }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; color: var(--ink-2); }
.split-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.c-cash { background: var(--chart-bar); }
.c-card { background: #2F6DB5; }
.c-transfer { background: #8C8C8C; }
@media (prefers-color-scheme: dark) { .c-card { background: #6FA3E0; } .c-transfer { background: #B8B8B8; } }

.rep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rep-grid .wide { grid-column: 1 / -1; }
.rep-grid .panel + .panel { margin-top: 0; }
@media (max-width: 960px) { .rep-top, .rep-grid { grid-template-columns: minmax(0, 1fr); } }
.rep-top .panel + .panel { margin-top: 0; }

/* ---------- Справочники: техкарта ---------- */
.lines { display: flex; flex-direction: column; gap: 8px; }
.line-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(80px, 1fr) minmax(90px, 1fr) minmax(90px, 1fr) 44px; gap: 8px; align-items: end; }
.line-row.no-price { grid-template-columns: minmax(0, 2.2fr) minmax(90px, 1fr) minmax(90px, 1fr) 44px; }
.line-row .sum { min-height: 44px; display: flex; align-items: center; justify-content: flex-end; font-variant-numeric: tabular-nums; font-weight: 600; padding-right: 4px; }
.line-head { font-size: .8rem; color: var(--muted); font-weight: 600; }
.line-row .unit-hint { font-size: .78rem; color: var(--muted); }
@media (max-width: 600px) {
  .line-row, .line-row.no-price { grid-template-columns: 1fr 1fr 44px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); }
  .line-row > :first-child { grid-column: 1 / -1; }
  .line-row .sum { grid-column: 1 / 3; justify-content: flex-start; min-height: 0; }
  .line-head { display: none; }
}
.lines-total { display: flex; justify-content: flex-end; gap: 16px; flex-wrap: wrap; padding: 10px 4px 0; font-variant-numeric: tabular-nums; }
.lines-total b { font-size: 1.15rem; }
.calc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.calc div { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.calc span { display: block; font-size: .8rem; color: var(--muted); }
.calc b { font-variant-numeric: tabular-nums; font-size: 1.1rem; }

/* ---------- Модальные окна ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2);
}
dialog.modal.lg { width: min(880px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(8, 20, 18, .55); }
dialog.modal[open] { animation: pop .16s ease-out; display: flex; flex-direction: column; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 8px; }
.modal-head h2 { margin-right: auto; }
.modal-body { padding: 8px 20px 12px; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  dialog.modal, dialog.modal.lg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .modal-foot .btn { flex: 1 1 auto; }
}
.paid-total { text-align: center; padding: 10px 0 6px; }
.paid-total .big { font-family: var(--font-display); font-size: 2.6rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.paid-check { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; margin: 0 auto 8px; }
.paid-check svg { width: 30px; height: 30px; }
.change-calc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; align-items: end; }
.change-calc output { min-height: 44px; display: flex; align-items: center; justify-content: flex-end; font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- Тосты ---------- */
.toasts { position: fixed; z-index: 1000; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow-2); font-size: .95rem; animation: pop .16s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--brand); }
.toast button { appearance: none; background: none; border: 0; color: inherit; opacity: .8; font-size: 1.2rem; line-height: 1; cursor: pointer; margin-left: auto; padding: 0 2px; min-width: 28px; min-height: 28px; }
@media (max-width: 760px) { .toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: none; } }

.loading { padding: 40px; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Печать чека 58 мм ---------- */
#print-area { display: none; }
@media print {
  @page { size: 58mm auto; margin: 0; }
  html, body { background: #fff !important; color: #000 !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .receipt { width: 58mm; padding: 3mm 3mm 6mm; font: 11px/1.35 "Courier New", Courier, monospace; color: #000; }
  .receipt h1 { font: 700 15px/1.2 Arial, sans-serif; text-align: center; margin: 0 0 1mm; }
  .receipt .c { text-align: center; }
  .receipt hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; }
  .receipt table { width: 100%; border-collapse: collapse; }
  .receipt td { padding: .5mm 0; vertical-align: top; }
  .receipt td.r { text-align: right; white-space: nowrap; padding-left: 2mm; }
  .receipt .total td { font-size: 14px; font-weight: 700; }
}

/* =====================================================================
   Этап 2 — компоненты
   ===================================================================== */
[hidden] { display: none !important; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn-dark:hover { background: #2B2B2B; border-color: #2B2B2B; color: #fff; }
@media (prefers-color-scheme: dark) { .btn-dark { background: #F2F2F0; color: #141414; border-color: #F2F2F0; } .btn-dark:hover { background: #fff; color: #141414; } }
.btn-primary { font-weight: 700; }
.sub-h { margin: 20px 0 8px; font-size: 1rem; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; }
.chk-grid .check { min-height: 40px; }
.fs { border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 14px 10px; margin: 0; min-width: 0; }
.fs legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; font-variant-numeric: tabular-nums; }
.day-h { margin: 18px 0 8px; font-size: .95rem; color: var(--ink-2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.dot.on { background: #2BA84A; box-shadow: 0 0 0 3px color-mix(in srgb, #2BA84A 25%, transparent); }
.dot.off { background: #D23A2A; box-shadow: 0 0 0 3px color-mix(in srgb, #D23A2A 25%, transparent); }
.hint-box { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); margin-bottom: 14px; }
.hint-box svg { width: 22px; height: 22px; flex: none; color: var(--brand-text); }
.hint-box p { margin: 0; }
.out-big { min-height: 44px; display: flex; align-items: center; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 18px; height: 18px; }
.seg-sm button { min-height: 34px; font-size: .85rem; padding: 0 12px; }
.badge svg { width: 13px; height: 13px; }
.badge:has(svg)::before { display: none; }
.who { text-decoration: none; color: inherit; border-radius: 8px; padding: 2px 6px; }
.who:hover { background: var(--surface-2); }
.login-logo.small { width: 96px; height: auto; }
.cp-title { text-align: center; font-size: 1.4rem; margin-bottom: 2px; }
.login-card .field + .field { margin-top: 10px; }

/* ---------- Предупреждения ---------- */
.alerts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.alert { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; font-size: .9rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
.alert::before { content: "!"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: .8rem; font-weight: 800; flex: none; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert.warn::before { background: var(--warn); color: var(--warn-soft); }
.alert.danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert.danger::before { background: var(--danger); color: var(--danger-soft); }
.alert:hover { text-decoration: underline; }

/* ---------- Касса: смена и инструменты ---------- */
.shift-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px 8px 14px; margin: -4px 0 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.shift-bar.closed { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.shift-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); flex: none; }
.shift-dot.ok { background: #2BA84A; }
.shift-dot.bad { background: #D23A2A; }
.shift-text { font-weight: 600; margin-right: auto; font-size: .92rem; }
.shift-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pos-search { flex: 1 1 180px; max-width: 320px; }
.pos-search .input { min-height: 42px; }

/* Плитки блюд: кнопка «i» и стоп-лист */
.item-cell { position: relative; display: flex; }
.item-cell .item-tile { flex: 1; width: 100%; padding-right: 40px; }
.it-info {
  appearance: none; position: absolute; right: 6px; bottom: 6px; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; z-index: 1;
}
.it-info svg { width: 20px; height: 20px; }
.it-info:hover { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand); }
.item-tile .it-qty { background: var(--brand); color: #141414; }
.it-mod { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); font-size: .8rem; font-weight: 800; vertical-align: 1px; }
.it-stop { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 6px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .02em; }
.item-cell.stopped .item-tile { background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 10px, var(--surface-2) 10px, var(--surface-2) 20px); color: var(--muted); cursor: not-allowed; }
.item-cell.stopped .item-tile::before { background: var(--danger); }
.item-cell.stopped .it-name { text-decoration: line-through; text-decoration-thickness: 1.5px; }

/* Зал */
.hall-view { margin-bottom: 8px; }
.hall + .hall { margin-top: 18px; }
.hall-name { font-size: 1rem; margin-bottom: 8px; }
.floor {
  --cell: minmax(0, 1fr);
  position: relative; display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-template-rows: repeat(var(--rows), minmax(84px, auto));
  gap: 8px; padding: 12px; border-radius: var(--r-lg); background-color: var(--surface);
  background-image: radial-gradient(circle, var(--line) 1.2px, transparent 1.3px); background-size: 24px 24px; border: 1px solid var(--line);
}
.table-btn {
  appearance: none; grid-column: calc(var(--x) + 1); grid-row: calc(var(--y) + 1); min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px;
  border-radius: 14px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
  font-variant-numeric: tabular-nums; touch-action: none; transition: box-shadow .12s;
}
.table-btn b { font-size: 1.15rem; line-height: 1.1; }
.table-btn span { font-size: .8rem; }
.table-btn.round { border-radius: 50%; aspect-ratio: 1; justify-self: center; height: 100%; max-height: 110px; }
.table-btn.rect { grid-column: calc(var(--x) + 1) / span 2; }
.table-btn.free { border-style: dashed; color: var(--ink-2); }
.table-btn.free:hover { border-color: var(--brand); border-style: solid; }
.table-btn.busy { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.table-btn.busy .t-time { color: var(--brand); font-weight: 700; }
@media (prefers-color-scheme: dark) { .table-btn.busy { background: #F2F2F0; color: #141414; border-color: #F2F2F0; } .table-btn.busy .t-time { color: #A84A07; } }
.table-btn.current { box-shadow: 0 0 0 3px var(--brand); }
.t-seats { color: var(--muted); }
.hall-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.hall-legend .lg { width: 14px; height: 14px; border-radius: 4px; border: 2px dashed var(--line-strong); display: inline-block; }
.hall-legend .lg.busy { background: var(--ink); border: 2px solid var(--ink); margin-left: 8px; }
@media (max-width: 760px) { .floor { gap: 5px; padding: 8px; grid-template-rows: repeat(var(--rows), minmax(64px, auto)); background-size: 18px 18px; } .table-btn b { font-size: 1rem; } .table-btn span { font-size: .7rem; } }

/* Чек-панель: тип заказа, клиент, отправка */
.t-type { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #F1EEE6; color: #5A5A5A; vertical-align: 2px; }
.ticket-table.span2 { grid-column: 1 / -1; color: #5A5A5A; }
.ticket-table svg { width: 18px; height: 18px; }
.ticket-client { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.btn-paper { background: #fff; color: #141414; border-color: #C9C4B6; }
.btn-paper:hover { background: #F5F2EA; }
.client-chip { appearance: none; flex: 1; display: flex; gap: 10px; align-items: center; text-align: left; min-height: 48px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid #F86E16; background: #FFF4EC; color: #141414; font: inherit; cursor: pointer; }
.client-chip svg { width: 20px; height: 20px; color: #A84A07; flex: none; }
.client-chip span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.client-chip small { color: #5A5A5A; font-size: .78rem; }
.ticket .btn-ghost { color: #141414; }
.ticket .btn-ghost:hover { background: #EFEBE0; }
.ticket .btn-dark { background: #141414; color: #fff; border-color: #141414; }
.ticket .btn-dark[disabled] { background: #E9E5DB; color: #8A8A8A; border-color: #E9E5DB; opacity: 1; }
.tl-name { display: flex; flex-direction: column; gap: 2px; }
.tl-mods { font-size: .82rem; color: #5A5A5A; font-weight: 500; }
.tl-comment { font-size: .82rem; color: #A84A07; font-weight: 600; font-style: italic; }
.tl.sent { background: #FAF8F2; }
.sent-badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; font-size: .72rem; font-weight: 700; color: #1F7A3A; background: #E3F2E6; padding: 1px 7px 1px 5px; border-radius: 6px; }
.sent-badge svg { width: 12px; height: 12px; }
.qty-btn.ghost { border-color: transparent; background: transparent; color: #5A5A5A; margin-right: auto; }
.qty-btn.ghost svg { width: 18px; height: 18px; }
.qty-btn[disabled] { opacity: .35; cursor: not-allowed; }
.tl-ctrl .price { margin-right: 0; }
.disc-all { appearance: none; border: 1px solid #C9C4B6; background: #fff; color: #141414; border-radius: 8px; min-height: 36px; padding: 0 10px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; margin-left: auto; }
.tf-row label { flex: 1; }
.type-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: #F1EEE6; margin-bottom: 12px; }
.type-seg button { appearance: none; border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; min-height: 40px; padding: 0 12px; border-radius: 9px; color: #5A5A5A; cursor: pointer; }
.type-seg button[aria-pressed="true"] { background: #141414; color: #fff; }
.print-err { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: .9rem; }

/* Модификаторы */
.mod-form { display: flex; flex-direction: column; gap: 14px; }
.mod-group { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px 12px; margin: 0; }
.mod-group.invalid { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.mod-group legend { font-weight: 700; padding: 0 6px; }
.mod-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.mod-opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; }
.mod-opt input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.mod-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.mod-opt:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.mod-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.mod-price { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.mod-err { margin: 6px 0 0; }
.mod-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mod-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr) auto 44px; gap: 8px; align-items: center; }
@media (max-width: 600px) { .mod-row { grid-template-columns: 1fr 1fr; } }

/* Выбор клиента */
.pick-list { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pick { appearance: none; width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 10px 14px; min-height: 56px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.pick:hover { border-color: var(--brand); background: var(--brand-soft); }
.pick span { color: var(--ink-2); font-size: .88rem; font-variant-numeric: tabular-nums; }
.pick span:last-child { grid-column: 1 / -1; color: var(--muted); }
.new-client summary { cursor: pointer; font-weight: 700; color: var(--brand-text); min-height: 40px; display: flex; align-items: center; }

/* Z-отчёт: купюры */
.den-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.den-grid .field label { font-variant-numeric: tabular-nums; }

/* Карточка блюда */
.dish-card { display: flex; flex-direction: column; gap: 14px; }
.dish-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dish-price { font-family: var(--font-display); font-size: 1.6rem; font-weight: 750; margin-right: 8px; font-variant-numeric: tabular-nums; }
.dish-row h3 { font-size: .82rem; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.dish-row p { font-size: 1.05rem; margin: 0; }
.dish-row.allergens { padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); }
.dish-row.allergens h3, .dish-row.allergens p { color: var(--warn); font-weight: 700; }

/* ---------- Кухня ---------- */
.kitchen-head { gap: 10px; }
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.kitchen-empty { grid-column: 1 / -1; font-size: 1.1rem; padding: 48px 16px; }
.k-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.k-card header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--ink); color: var(--surface); }
@media (prefers-color-scheme: dark) { .k-card header { background: #000; color: #fff; } }
.k-num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; }
.k-table { font-weight: 600; opacity: .85; margin-right: auto; }
.k-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.05rem; padding: 3px 10px; border-radius: 8px; background: rgba(255, 255, 255, .14); }
.k-card.warn { border-color: #E9B300; }
.k-card.warn .k-timer { background: #F2C14E; color: #141414; }
.k-card.late { border-color: #D23A2A; }
.k-card.late .k-timer { background: #D23A2A; color: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.k-card ul { list-style: none; margin: 0; padding: 0; }
.k-item { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.k-item.st-ready { background: var(--ok-soft); }
.k-line { display: flex; align-items: baseline; gap: 8px; }
.k-qty { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand-text); }
.k-name { font-size: 1.25rem; font-weight: 700; flex: 1; line-height: 1.2; }
.k-mods { font-size: 1rem; color: var(--ink-2); font-weight: 600; }
.k-comment { font-size: 1.05rem; font-weight: 800; color: var(--danger); background: var(--danger-soft); padding: 4px 8px; border-radius: 6px; width: fit-content; }
.k-next { width: 100%; min-height: 54px; font-size: 1.05rem; }
.k-item.st-ready .k-next { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .k-item.st-ready .k-next { color: #0F2A16; } }
.k-all { border-radius: 0; border: 0; min-height: 52px; background: var(--surface-2); }

/* ---------- Киоск табеля ---------- */
.kiosk { min-height: 100dvh; padding: 16px; max-width: 1100px; margin: 0 auto; }
.kiosk-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.kiosk-head div { margin-right: auto; }
.kiosk-head h1 { font-size: 1.6rem; }
.kiosk-head p { margin: 0; text-transform: none; }
.kiosk-head p::first-letter { text-transform: uppercase; }
.kiosk-hint { font-size: 1.15rem; color: var(--ink-2); margin-bottom: 12px; }
.kiosk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kiosk-emp { appearance: none; display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 150px; padding: 18px 10px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.15rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-1); text-align: center; }
.kiosk-emp:hover { border-color: var(--brand); }
.kiosk-emp:active { transform: scale(.98); }
.kiosk-ava { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; font-weight: 800; background: var(--brand); color: #141414; }
.kiosk-pin, .kiosk-done { max-width: 380px; margin: 10px auto; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-2); }
.kiosk-pin h2, .kiosk-done h2 { font-size: 1.5rem; }
.kiosk-pin #kp-err { min-height: 1.4em; margin: 0; }
.kiosk-big { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin: 8px 0; font-variant-numeric: tabular-nums; }
.kiosk-done.in .paid-check { background: var(--ok-soft); color: var(--ok); }
.kiosk-done.out .paid-check { background: var(--brand-soft); color: var(--brand-text); }

/* ---------- Доставка ---------- */
.dboard { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; padding-bottom: 8px; }
.dcol { background: var(--surface-3); border-radius: var(--r-lg); padding: 10px; min-height: 160px; display: flex; flex-direction: column; gap: 8px; }
.dcol h2 { font-size: 1rem; padding: 4px 4px 2px; display: flex; justify-content: space-between; }
.dcard { background: var(--surface); border-radius: var(--r-md); padding: 10px 12px; box-shadow: var(--shadow-1); border-left: 4px solid var(--brand); }
.dcard header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.dcard header span { color: var(--muted); font-size: .85rem; }
.dcard p { margin: 0 0 4px; font-size: .92rem; }
.dcard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 760px) { .dboard { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; } .dcol { scroll-snap-align: start; } }

/* ---------- Чек-листы ---------- */
.cl-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.cl-wrap .panel + .panel { margin-top: 0; }
.cl.complete { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.cl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-head h2 { margin-right: auto; }
.cl-progress { font-variant-numeric: tabular-nums; font-size: 1.05rem; color: var(--ink-2); }
.cl-progress b { font-size: 1.4rem; color: var(--ink); }
.cl.complete .cl-progress b { color: var(--ok); }
.cl-bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin: 10px 0 12px; overflow: hidden; }
.cl-bar span { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .25s; }
.cl.complete .cl-bar span { background: var(--ok); }
.cl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cl-item {
  appearance: none; width: 100%; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  min-height: 64px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 1.08rem; font-weight: 600; text-align: left; cursor: pointer; touch-action: manipulation;
}
.cl-item:hover { border-color: var(--brand); }
.cl-box { grid-row: 1 / span 2; width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--line-strong); display: grid; place-items: center; background: var(--surface); }
.cl-box svg { width: 24px; height: 24px; }
.cl-text { line-height: 1.3; }
.cl-who { grid-column: 2; font-size: .82rem; font-weight: 500; color: var(--muted); }
.cl-item.done { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.cl-item.done .cl-box { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .cl-item.done .cl-box { color: #0F2A16; } }
.cl-item.done .cl-text { color: var(--ink-2); }
.cl-item[disabled] { opacity: .6; }
@media (max-width: 760px) { .cl-wrap { grid-template-columns: minmax(0, 1fr); } }
.cl-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.cl-edit-row { display: grid; grid-template-columns: 1fr 44px 44px; gap: 6px; }

/* ---------- Инструкции ---------- */
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ins-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1); border-top: 4px solid var(--brand); }
.ins-card:hover { border-color: var(--brand); }
.ins-card h2 { font-size: 1.2rem; }
.ins-card p { margin: 0; font-size: .9rem; }
.ins-doc { max-width: 760px; }
.ins-title { font-size: 1.9rem; margin: 14px 0 4px; }
.ins-body { font-size: 1.15rem; line-height: 1.6; }
.ins-body h2 { font-size: 1.3rem; margin: 26px 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--brand); width: fit-content; }
.ins-body ul { margin: 0 0 8px; padding-left: 0; list-style: none; }
.ins-body li { position: relative; padding: 6px 0 6px 28px; }
.ins-body li::before { content: ""; position: absolute; left: 6px; top: 1.05em; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.ins-body p { margin: 0 0 12px; }
textarea.mono-ish { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .92rem; line-height: 1.5; }
details > .ins-body { font-size: 1rem; margin-top: 8px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }

/* ---------- Склад: инвентаризация ---------- */
.inv-input { max-width: 140px; margin-left: auto; min-height: 40px; }
.inv-input[aria-invalid="true"] { border-color: var(--danger); }
.inv-table td { padding-top: 6px; padding-bottom: 6px; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 0; margin-top: 12px; background: linear-gradient(transparent, var(--bg) 30%); z-index: 5; }
.page-head h2 { margin-right: auto; }

/* ---------- Настройки ---------- */
.settings-wrap { display: grid; grid-template-columns: minmax(0, 640px) auto; gap: 20px; align-items: start; }
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.setting-check { align-items: flex-start; padding: 6px 0; }
.setting-check input { margin-top: 2px; flex: none; }
.setting-check span { display: flex; flex-direction: column; gap: 2px; }
.receipt-preview { position: sticky; top: calc(var(--header-h) + 16px); background: #fff; color: #141414; padding: 14px 10px 22px; box-shadow: var(--shadow-2); border-radius: 4px; }
.receipt-preview .receipt { width: 240px; font: 12px/1.4 "Courier New", Courier, monospace; }
.receipt-preview .receipt h1 { font: 700 15px/1.2 Arial, sans-serif; text-align: center; margin: 0 0 4px; }
.receipt-preview .c { text-align: center; }
.receipt-preview hr { border: 0; border-top: 1px dashed #141414; margin: 6px 0; }
.receipt-preview table { width: 100%; border-collapse: collapse; }
.receipt-preview td.r { text-align: right; white-space: nowrap; }
.receipt-preview .total td { font-weight: 700; font-size: 14px; }
@media (max-width: 900px) { .settings-wrap { grid-template-columns: minmax(0, 1fr); } .receipt-preview { position: static; justify-self: center; } }
.floor-editor-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.floor.editor { grid-template-rows: repeat(var(--rows), 72px); --cell: minmax(64px, 1fr); overflow-x: auto; }
.floor.editor .t-seats { white-space: nowrap; font-size: .72rem; }
.table-btn .t-seats { white-space: nowrap; }
.floor.editor .table-btn { cursor: grab; }
.floor.editor .table-btn:active { cursor: grabbing; }
.fe-side h3 { margin-bottom: 4px; }
@media (max-width: 900px) { .floor-editor-wrap { grid-template-columns: minmax(0, 1fr); } .floor.editor { grid-template-rows: repeat(var(--rows), 48px); gap: 4px; } .floor.editor .table-btn span { display: none; } }

/* ---------- Статистика ---------- */
.abc-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.abc-sum > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; }
.abc-sum b { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; }
.abc-sum span { font-weight: 600; font-variant-numeric: tabular-nums; }
.abc-sum small { color: var(--muted); }
.abc-sum .abc-A { border-left-color: var(--brand); }
.abc-sum .abc-B { border-left-color: var(--ink-2); }
.abc-sum .abc-C { border-left-color: var(--line-strong); }
.abc-badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 800; }
.abc-badge.abc-A { background: var(--brand); color: #141414; }
.abc-badge.abc-B { background: var(--ink); color: var(--surface); }
.abc-badge.abc-C { background: var(--surface-3); color: var(--ink-2); }
.cum, .pctbar { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--surface-3); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.cum span, .pctbar span { display: block; height: 100%; background: var(--ink-2); }
.pctbar.ok span { background: var(--ok); }
.pctbar.warn span { background: #E9B300; }
.pctbar.bad span { background: #D23A2A; }
@media (max-width: 600px) { .abc-sum { grid-template-columns: minmax(0, 1fr); } }
#ch-mode { margin-bottom: 8px; }

/* Чек: прокрутка всего чека, итог и оплата всегда видны */
.ticket { overflow-y: auto; overscroll-behavior: contain; }
.ticket-lines { flex: 0 0 auto; overflow: visible; }
.ticket-foot { position: sticky; bottom: 0; background: var(--paper); box-shadow: 0 -8px 12px -10px rgba(0, 0, 0, .25); z-index: 1; gap: 8px; }
.tf-row label { display: flex; flex-direction: column; line-height: 1.15; }
.tf-note { font-size: .74rem; color: #8A8A8A; font-weight: 500; }
.tf-total b { font-size: 1.8rem; }
@media (max-width: 760px) {
  .alerts { flex-wrap: nowrap; overflow-x: auto; gap: 6px; margin: -4px -12px 12px; padding: 0 12px; scrollbar-width: none; }
  .alert { flex: none; white-space: nowrap; font-size: .82rem; padding: 6px 10px; }
  .abc-sum > div { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 12px; }
  .abc-sum small { width: 100%; }
  .period .seg { width: 100%; }
}
dialog .toasts { position: fixed; }
.form-error { margin: 12px 0 0; color: var(--danger); font-weight: 600; }
.form-error:empty { display: none; }
.ins-doc > .btn { margin-top: 2px; }
.ins-title { margin-top: 12px; }
.item-tile .it-price { white-space: nowrap; }
@media (prefers-color-scheme: dark) { .ticket .btn-dark { background: #141414; color: #fff; border-color: #141414; } }

/* =====================================================================
   Этап 3 — терминальная тема (Касса, Официант, Кухня, Табель, Панель владельца)
   Тёмный графит, оранжевый — только «Оплата», активные элементы и цифры к оплате.
   ===================================================================== */
:root[data-term="dark"] {
  --bg: #121315; --surface: #1B1C1E; --surface-2: #232427; --surface-3: #2C2D31;
  --ink: #F1F0EC; --ink-2: #C9C8C4; --muted: #9C9B97; --line: #2E2F33; --line-strong: #44464B;
  --brand-text: #FF9A52; --brand-soft: #3A2412; --ribbon: #000; --ribbon-ink: #fff;
  --danger: #FF7A6B; --danger-soft: #3B1C19; --warn: #F2C14E; --warn-soft: #362A10; --ok: #7CD18E; --ok-soft: #173220;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5); --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, .8); --focus: #4BE597;
  --chart-grid: #2A2A2A; --chart-bar: #F86E16; --paper: #F7F4EE;
  color-scheme: dark;
}
:root[data-term="light"] { color-scheme: light; }
:root[data-term="dark"] body { background: var(--bg); color: var(--ink); }
:root[data-term="dark"] .btn-dark { background: #F2F2F0; color: #141414; border-color: #F2F2F0; }
:root[data-term="dark"] .table-btn.busy { background: #F2F2F0; color: #141414; border-color: #F2F2F0; }
:root[data-term="dark"] .table-btn.busy .t-time { color: #A84A07; }
:root[data-term="dark"] .k-card header { background: #000; color: #fff; }
:root[data-term="dark"] .k-item.st-ready .k-next { color: #0F2A16; }
:root[data-term="dark"] .cl-item.done .cl-box { color: #0F2A16; }

/* Терминал занимает всю высоту под шапкой, без внутренних отступов main */
.shell.terminal .main { padding: 0; }
.shell.terminal { grid-template-rows: var(--header-h) minmax(0, 1fr); }
.term-empty { padding: 40px 20px; text-align: center; }
.term-empty h1 { margin-bottom: 8px; }
.term-note { grid-column: 1 / -1; padding: 28px; color: var(--muted); text-align: center; }

.term {
  display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "order menu" "actions actions";
  height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h));
}
.term-order { grid-area: order; display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.term-menu { grid-area: menu; display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 10px 12px 0; gap: 10px; }
.term-actions { grid-area: actions; }

/* Шапка меню: открытые заказы и смена */
.term-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.term-orders { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.term-orders::-webkit-scrollbar { display: none; }
.term-orders .oo-chip { min-height: 50px; padding: 4px 12px; background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.term-orders .oo-chip[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.term-orders .oo-new { color: var(--brand-text); }
.term-top .shift-bar { margin: 0; padding: 4px 6px 4px 12px; flex: none; max-width: 52%; }
.term-top .shift-text { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-top .shift-actions .btn { min-height: 38px; }
.term-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.term-search { flex: 1 1 200px; max-width: 360px; }
.term-search .input { min-height: 46px; background: var(--surface); }

.term-body { flex: 1; min-height: 0; overflow: auto; padding-bottom: 10px; }
.term-catalog { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 10px; min-height: 100%; align-items: start; }
.term-cats { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; }
.term-cat {
  appearance: none; min-height: 60px; padding: 8px 12px 8px 16px; text-align: left; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; position: relative; line-height: 1.2;
}
.term-cat::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 0 4px 4px 0; background: var(--cc); }
.term-cat[aria-pressed="true"] { background: var(--cc); border-color: var(--cc); color: #fff; }
.term-cat[aria-pressed="true"]::before { background: #fff; opacity: .7; }

/* Плитки блюд: цвет категории, белый текст */
.term-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; align-content: start; }
.dish { position: relative; }
.dish-btn {
  appearance: none; width: 100%; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  padding: 10px 12px; border-radius: 12px; border: 0; background: var(--cc); color: #fff; font: inherit; cursor: pointer; position: relative;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); touch-action: manipulation;
}
.dish-btn:active { transform: scale(.97); filter: brightness(1.08); }
.dish-name { font-size: 1.02rem; font-weight: 700; line-height: 1.2; padding-right: 26px; }
.dish-foot { display: flex; align-items: center; gap: 6px; padding-right: 34px; }
.dish-price { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; }
.dish-flag { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; background: rgba(255, 255, 255, .22); font-weight: 800; font-size: .85rem; }
.dish-qty { position: absolute; top: 8px; right: 8px; min-width: 28px; height: 28px; padding: 0 7px; border-radius: 999px; background: #F86E16; color: #141414; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.dish-stop { position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 6px; background: #fff; color: #B3372E; font-weight: 800; font-size: .72rem; }
.dish.stopped .dish-btn { background: repeating-linear-gradient(-45deg, #3A3B3F, #3A3B3F 10px, #303135 10px, #303135 20px); color: #A9A8A4; cursor: not-allowed; box-shadow: inset 4px 0 0 var(--cc); }
.dish.stopped .dish-name { text-decoration: line-through; }
.dish-info { appearance: none; position: absolute; right: 6px; bottom: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .28); color: #fff; display: grid; place-items: center; cursor: pointer; }
.dish-info svg { width: 20px; height: 20px; }
.dish-info:hover { background: rgba(0, 0, 0, .45); }
:root[data-term="light"] .dish.stopped .dish-btn { background: repeating-linear-gradient(-45deg, #E9E7E3, #E9E7E3 10px, #F2F0EC 10px, #F2F0EC 20px); color: #6B6B6B; }

/* Заказ слева */
.ord-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.ord-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ord-title h2 { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.ord-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 7px; background: var(--surface-3); color: var(--ink-2); font-size: .8rem; font-weight: 700; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.ord-sub { color: var(--muted); font-size: .86rem; }
.ord-client { appearance: none; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand-soft); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.ord-client svg { width: 20px; height: 20px; color: var(--brand-text); }
.ord-client span { display: flex; flex-direction: column; line-height: 1.2; }
.ord-client small { color: var(--ink-2); }
.ord-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); }
.ord-label .input { min-height: 38px; background: var(--surface-2); }
.ord-chips { display: flex; gap: 6px; padding: 8px 14px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; flex: none; }
.chip-btn { appearance: none; flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-2); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.chip-btn svg { width: 18px; height: 18px; }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip-btn.add { padding: 0 10px; }
.chip-sep { width: 1px; background: var(--line-strong); margin: 4px 4px; flex: none; }
.ord-lines { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; min-height: 0; }
.ord-empty { padding: 26px 16px; color: var(--muted); text-align: center; flex: 1; }
.ord-empty .type-seg { background: var(--surface-3); }
.ord-empty .type-seg button { color: var(--ink-2); }
.ord-empty .type-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.ol-guest { display: flex; justify-content: space-between; padding: 8px 14px 4px; font-size: .8rem; font-weight: 800; color: var(--brand-text); background: var(--surface-2); border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ol { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 9px 12px 9px 14px; border-bottom: 1px solid var(--line); }
.ol.sent { background: color-mix(in srgb, var(--ok) 6%, transparent); }
.ol.wait { opacity: .6; }
.ol-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ol-name { font-size: 1.07rem; font-weight: 700; line-height: 1.2; }
.ol-mods { font-size: .85rem; color: var(--ink-2); }
.ol-cmt { font-size: .85rem; color: var(--brand-text); font-weight: 700; }
.ol-meta { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.ol-st { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--ok); }
.ol-st svg { width: 12px; height: 12px; }
.ol-st.st-new { color: var(--brand-text); }
.ol-course { padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--ink-2); font-weight: 700; }
.ol-qty { display: flex; align-items: center; gap: 2px; }
.qb { appearance: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.qb svg { width: 18px; height: 18px; }
.qb[disabled] { opacity: .3; cursor: not-allowed; }
.qv { min-width: 30px; text-align: center; font-weight: 800; font-size: 1.08rem; font-variant-numeric: tabular-nums; }
.ol-sum { min-width: 74px; text-align: right; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ord-totals { padding: 8px 14px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; color: var(--ink-2); flex: none; }
.ord-totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.ord-total { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 14px 12px; flex: none; }
.ord-total span { font-weight: 700; color: var(--ink-2); }
.ord-total b { font-family: var(--font-display); font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--brand-text); }

/* Нижняя панель действий */
.term-actions {
  display: flex; flex-wrap: nowrap;
  gap: 6px; padding: 8px; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.act {
  appearance: none; flex: 1 1 0; min-width: 0; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; text-align: center; line-height: 1.1;
}
.act svg { width: 22px; height: 22px; }
.act:hover:not([disabled]) { border-color: var(--ink-2); }
.act[disabled] { opacity: .35; cursor: not-allowed; }
.act.kitchen { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.act.pay { flex: 2.2 1 0; background: #F86E16; border-color: #F86E16; color: #141414; flex-direction: row; gap: 12px; font-size: 1.15rem; }
.act.pay b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.act.pay[disabled] { opacity: .45; }

/* Модальные окна терминала крупнее */
dialog.term-modal .btn, dialog.term-modal .input { min-height: 52px; }
dialog.term-modal .modal-head h2 { font-size: 1.35rem; }
.input-lg { min-height: 56px; font-size: 1.25rem; }
.pct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dlg-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 4px; }
.split-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.split-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px 40px 44px; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.split-list .sp-name { display: flex; flex-direction: column; }
.split-list .sp-name small { color: var(--muted); }
.split-list .qty-btn { background: var(--surface-2); color: var(--ink); border-color: var(--line-strong); }
.split-list .qty-val { color: var(--ink); }
.dish-price-big { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; margin-right: 8px; }
.paid-change { font-size: 1.3rem; margin-top: 6px; }
.paid-change b { color: var(--brand-text); font-variant-numeric: tabular-nums; }

/* Экран оплаты */
dialog.modal.pay-modal { width: min(980px, calc(100vw - 24px)); }
.pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; }
.pay-sum { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.pay-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pay-line.small { font-size: .9rem; }
.pay-total { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.pay-line.big { font-size: 1.15rem; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.pay-line.big b { font-size: 1.7rem; color: var(--ink); }
.pay-line.change { opacity: .45; }
.pay-line.change.on { opacity: 1; }
.pay-line.change.on b { color: var(--brand-text); }
.pay-done { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pay-done li { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 10px; border-radius: 10px; background: var(--surface); font-variant-numeric: tabular-nums; }
.pay-done li span { flex: 1; }
.pay-done small { color: var(--muted); margin-left: 6px; }
.pay-input { display: flex; flex-direction: column; gap: 10px; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.pay-m { appearance: none; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 14px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.pay-m svg { width: 26px; height: 26px; }
.pay-m small { font-weight: 500; color: var(--muted); font-size: .75rem; }
.pay-m[aria-checked="true"] { border-color: #F86E16; background: var(--brand-soft); }
.pay-display { display: flex; flex-direction: column; gap: 4px; }
.pay-display label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.pay-entry { width: 100%; min-height: 64px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 2rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.pay-entry:focus { border-color: #F86E16; outline: none; }
.pay-notes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pay-notes .note { min-height: 48px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-notes .exact { grid-column: span 2; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.numpad .key { min-height: 58px; font-size: 1.5rem; border-radius: 12px; }
.pay-actions { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.pay-actions .btn { white-space: normal; line-height: 1.15; padding: 0 10px; }
.btn-xl { min-height: 64px; font-size: 1.2rem; }
#pay-go.ready { box-shadow: 0 0 0 3px color-mix(in srgb, #F86E16 40%, transparent); }
@media (max-width: 760px) {
  .pay { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pay-total { font-size: 1.7rem; }
  .numpad .key { min-height: 50px; }
  .pay-actions { grid-template-columns: 1fr 1fr; }
  .pay-actions #pay-go { grid-column: 1 / -1; }
}

/* Планшет 1024: уже колонка категорий */
@media (max-width: 1180px) {
  .term { grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); }
  .term-catalog { grid-template-columns: 132px minmax(0, 1fr); }
  .term-cat { min-height: 54px; font-size: .92rem; }
  .term-tiles { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .term-top { flex-wrap: wrap; }
  .term-top .shift-bar { max-width: none; flex: 1 1 100%; }
  .act { font-size: .8rem; }
}
/* Узкие экраны: заказ сворачивается в нижний лист */
@media (max-width: 760px) {
  .term { grid-template-columns: minmax(0, 1fr); grid-template-areas: "menu" "actions"; }
  .term-order { position: fixed; inset: auto 0 0 0; top: 20%; z-index: 40; border-radius: 18px 18px 0 0; box-shadow: var(--shadow-2); transform: translateY(102%); transition: transform .2s; }
  .term.ord-open .term-order { transform: none; }
  .term-catalog { grid-template-columns: minmax(0, 1fr); }
  .term-cats { flex-direction: row; overflow-x: auto; position: static; scrollbar-width: none; }
  .term-cat { flex: none; min-height: 46px; }
  .term-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .term-actions { flex-wrap: wrap; }
  .term-actions .act { flex: 1 1 calc(25% - 6px); min-height: 56px; }
  .act.pay { flex: 1 1 100%; min-height: 56px; order: 9; }
}
.act.ord-toggle { display: none; }
@media (max-width: 760px) { .act.ord-toggle { display: flex; flex: 1 1 100% !important; min-height: 48px; flex-direction: row; order: -1; } }

/* Терминалы во всю ширину: боковое меню — выдвижное */
.shell.terminal { grid-template-columns: minmax(0, 1fr); }
.shell.terminal .nav-toggle { display: inline-flex; }
.shell.terminal .sidenav {
  position: fixed; left: 0; top: 0; bottom: 0; height: 100dvh; width: min(300px, 86vw); z-index: 60;
  transform: translateX(-102%); transition: transform .2s ease-out; box-shadow: var(--shadow-2); padding-top: 14px;
}
.shell.terminal.nav-open .sidenav { transform: none; }
.shell.terminal.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
:root[data-term="dark"] .topbar { background: #0B0C0D; border-bottom-color: #222; }
:root[data-term="dark"] .loc-select select { background: var(--surface-2); }
.shift-slot { flex: none; }
.shift-btn { appearance: none; display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.shift-btn.closed { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-grid .act { min-height: 88px; }
@media (max-width: 600px) { .menu-grid { grid-template-columns: 1fr; } }
@media (max-width: 1180px) { .act.pay { font-size: 1rem; gap: 8px; } .act.pay b { font-size: 1.15rem; } .act span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; } }
.act.more { display: none; }
@media (max-width: 760px) {
  .term-actions .act:not(.ord-toggle):not(.pay):not(.kitchen):not(.more) { display: none; }
  .term-actions .act.more { display: flex; }
  .term-actions .act.ord-toggle { flex: 1 1 100% !important; }
  .term-actions .act.more, .term-actions .act.kitchen { flex: 1 1 calc(50% - 6px); }
  .term-actions .act.pay { flex-direction: row; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
}
.k-course { font-size: .78rem; font-weight: 800; color: var(--brand-text); }
.k-item.waiting { opacity: .5; }
.k-item.waiting .k-course { color: var(--muted); }
.menu-grid .act b { font-size: 1.15rem; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--sw); margin-right: 8px; vertical-align: -2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-opt { position: relative; cursor: pointer; }
.sw-opt input { position: absolute; opacity: 0; }
.sw { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--sw); border: 3px solid transparent; font-size: .75rem; font-weight: 700; }
.sw.auto { background: var(--surface-3); color: var(--ink-2); }
.sw-opt input:checked + .sw { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
.sw-opt input:focus-visible + .sw { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Терминал официанта ---------- */
.wt { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100dvh - var(--header-h)); }
.wt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 6px; }
.wt-head h1 { font-size: 1.3rem; }
.wt-head .btn[aria-pressed="true"] { border-color: var(--ok); color: var(--ok); }
.wt-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0 12px; border-radius: 14px; background: var(--surface); position: sticky; top: var(--header-h); z-index: 5; }
.wt-tabs button { appearance: none; min-height: 50px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; position: relative; }
.wt-tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.wt-badge { position: absolute; top: 4px; right: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #F86E16; color: #141414; font-size: .8rem; display: grid; place-items: center; }
.wt-body { padding: 12px; flex: 1; }
.wt-h2 { font-size: 1rem; margin: 12px 2px 8px; color: var(--ink-2); }
.wt-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.wt-table { appearance: none; min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 16px; border: 2px dashed var(--line-strong); background: var(--surface); color: var(--ink-2); font: inherit; cursor: pointer; font-variant-numeric: tabular-nums; }
.wt-table b { font-size: 1.6rem; color: var(--ink); }
.wt-table.busy { border: 2px solid #F2F0EC; background: #F2F0EC; color: #141414; }
.wt-table.busy b { color: #141414; }
.wt-table.pre { border: 2px solid var(--warn); background: var(--warn-soft); color: var(--warn); }
.wt-table.pre b { color: var(--warn); }
.wt-sum { font-weight: 800; }
.wt-min { font-size: .82rem; }
:root[data-term="light"] .wt-table.busy { background: #141414; color: #fff; border-color: #141414; }
:root[data-term="light"] .wt-table.busy b { color: #fff; }
.wt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wt-row { appearance: none; width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; font-size: 1.05rem; }
.wt-rsum { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.wt-ready { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.wt-ready > span { display: flex; flex-direction: column; font-size: 1.05rem; }
.wt-ready .btn { min-height: 52px; }

.wo { display: flex; flex-direction: column; gap: 10px; padding-bottom: 96px; }
.wo-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.wo-head h2 { font-size: 1.2rem; }
.wo-total { font-size: 1.3rem; font-variant-numeric: tabular-nums; color: var(--brand-text); }
.wo .ord-chips { padding: 0; border: 0; }
.wo-lines { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.wo-lines summary { padding: 12px 14px; font-weight: 800; cursor: pointer; min-height: 48px; }
.wo-lines ul { list-style: none; margin: 0; padding: 0 0 6px; }
.wo-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); }
.wo-lines li.sent { background: color-mix(in srgb, var(--ok) 7%, transparent); }
.wo-n { display: flex; flex-direction: column; min-width: 0; }
.wo-n small { color: var(--muted); }
.wo-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; position: sticky; top: calc(var(--header-h) + 62px); z-index: 4; background: var(--bg); padding: 4px 0; }
.wo-cats .term-cat { flex: none; min-height: 48px; }
.wo-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wo-dish { appearance: none; position: relative; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 64px; padding: 10px 14px 10px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.1rem; text-align: left; cursor: pointer; overflow: hidden; }
.wo-dish::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--cc); }
.wo-dish:active { background: var(--surface-2); }
.wo-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.wo-dish .dish-qty { position: static; }
.wo-menu li.stopped .wo-dish { opacity: .5; }
.wo-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); max-width: 760px; margin: 0 auto; }
.wo-bar .act { min-height: 60px; }
.wo-bar .act.kitchen { flex: 1.6 1 0; }
.shell.terminal ~ .toasts, :root[data-term] .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---------- Панель владельца ---------- */
.own { max-width: 760px; margin: 0 auto; padding: 12px 12px 24px; display: flex; flex-direction: column; gap: 12px; }
.own-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.own-bar .input { min-height: 42px; width: auto; flex: 1 1 130px; }
.own-hero { padding: 18px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.own-l { color: var(--ink-2); font-weight: 600; }
.own-big { font-family: var(--font-display); font-size: clamp(2.2rem, 10vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dl { font-weight: 800; font-variant-numeric: tabular-nums; font-size: .95rem; }
.dl small { font-weight: 500; color: var(--muted); }
.dl.up { color: var(--ok); }
.dl.down { color: var(--danger); }
.own-kpi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.own-kpi > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.own-kpi span { color: var(--muted); font-size: .85rem; }
.own-kpi b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.own-kpi .dl { font-size: .8rem; }
.own-card { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.own-card h2 { font-size: 1rem; margin-bottom: 10px; }
.own-chart svg { display: block; width: 100%; height: auto; }
.own-chart .bar { fill: #F86E16; }
.own-chart .prev-line { stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 4 3; }
.own-chart .grid { stroke: var(--line); }
.own-chart .axis-label { fill: var(--muted); font-size: 10px; }
.own-legend { display: flex; gap: 16px; font-size: .82rem; color: var(--ink-2); margin-top: 6px; }
.own-legend i { display: inline-block; width: 14px; height: 4px; margin-right: 6px; vertical-align: middle; }
.lg-now { background: #F86E16; height: 10px !important; border-radius: 2px; }
.lg-prev { border-top: 2px dashed var(--ink-2); }
.own-top, .own-points, .own-now, .own-alerts { list-style: none; margin: 0; padding: 0; }
.own-top { counter-reset: t; }
.own-top li, .own-points li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.own-top li:first-child, .own-points li:first-child { border-top: 0; }
.own-top small, .own-points small { color: var(--muted); grid-column: 1 / -1; }
.own-now li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.own-now li:first-child { border-top: 0; }
.own-now li.own-now-sum { font-weight: 600; border-top: 2px solid var(--line); }
.own-now small { display: block; color: var(--muted); }
.own-alerts { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.own-alerts li { padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .9rem; }
.own-month { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.own-month span { display: block; color: var(--muted); font-size: .85rem; }
.own-month b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.own-upd { text-align: center; }
@media (min-width: 900px) { .own-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Nodex.POS: знак продукта ---------- */
.wordmark { display: inline-flex; align-items: baseline; font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -.01em; color: var(--ink); line-height: 1; white-space: nowrap; }
.wordmark b { font-weight: 800; }
.wordmark span { font-weight: 300; color: #C2540A; }
:root[data-term="dark"] .wordmark span, .dark-surface .wordmark span { color: #FF9A52; }
@media (prefers-color-scheme: dark) { :root:not([data-term="classic"]) .wordmark span { color: #FF9A52; } }
.wordmark.xl { font-size: 2.6rem; }
.brand-sep { width: 1px; height: 26px; background: var(--line-strong); margin: 0 2px; }
.receipt .tiny { font-size: 9px; margin-top: 2mm; }
@media (max-width: 760px) { .brand .wordmark { font-size: 1rem; } .brand-sep { display: none; } }

/* =====================================================================
   §19 Nodex.POS — раскладка терминала (касса, кухня). Цвета и формы «Nodex» (тёмная/светлая) — css/nodex-term.css,
   здесь — базовая раскладка и запасные цвета.
   ===================================================================== */
:root[data-term="classic"] {
  --c-canvas: #8E949C; --c-canvas-2: #9AA0A8; --c-top: #E6E8EC; --c-tile: #1F6B45; --c-tile-2: #2A7D55; --c-tile-hi: #1B5E3D;
  --c-lime: #2BD47D; --c-lime-ink: #04170C; --c-bar: #5E636B; --c-bar-2: #4F545B; --c-line: #C9CDD3; --c-ink: #1E2126; --c-ink-2: #4A4F57;
  --bg: #E6E8EC; --surface: #FFFFFF; --surface-2: #F2F3F5; --surface-3: #E1E4E8; --ink: #1E2126; --ink-2: #4A4F57; --muted: #6A7079;
  --line: #D6D9DE; --line-strong: #B7BCC4; --focus: #1A73E8; --brand-text: #C2540A; --brand-soft: #FDEBDD;
  color-scheme: light;
}
:root[data-term="classic"] body { background: var(--c-canvas); color: var(--c-ink); }

/* ---------- Вход по PIN ---------- */
.pin-screen { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr); height: 100vh; height: 100dvh; background: #fff; }
.pin-photo { position: relative; overflow: hidden; background: #1B1C1E; }
.pin-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 55%; }
.pin-side { display: flex; flex-direction: column; align-items: center; padding: 28px 32px 0; background: #fff; color: #1E2126; min-height: 0; overflow-y: auto; }
.pin-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 8px; }
.pin-brand .wordmark { color: #1E2126; }
.pin-brand .wordmark span { color: #C2540A; }
.pin-venue { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: #4A4F57; }
.pin-venue img { border-radius: 50%; }
.pin-hint { margin: 18px 0 4px; color: #6A7079; text-align: center; font-size: .95rem; min-height: 1.4em; }
.pin-hint.err { color: #B3372E; font-weight: 600; }
.pin-side .pin-dots { margin: 8px 0 14px; }
.pin-side .pin-dots span { border-color: #B7BCC4; }
.pin-side .pin-dots span.on { background: #1E2126; border-color: #1E2126; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 28px; width: 100%; max-width: 330px; }
.pk { appearance: none; display: grid; place-items: center; min-height: 66px; border: 0; background: none; color: #2A2E34; font: inherit; font-size: 2.1rem; font-weight: 300; cursor: pointer; border-radius: 50%; text-decoration: none; font-variant-numeric: tabular-nums; }
.pk:hover { background: #F2F3F5; }
.pk:active { background: #E1E4E8; }
.pk svg { width: 28px; height: 28px; stroke-width: 1.4; color: #6A7079; }
.pin-go { appearance: none; margin-top: 14px; width: 100%; max-width: 330px; min-height: 52px; border: 0; border-radius: 2px; background: #1F6B45; color: #fff; font: inherit; font-weight: 700; letter-spacing: .02em; cursor: pointer; }
.pin-go[disabled] { opacity: .6; }
.pin-login-field { width: 100%; max-width: 330px; margin-top: 18px; }
.pin-login-field .input { background: #fff; color: #1E2126; border-color: #B7BCC4; }
.pin-foot { margin-top: auto; width: calc(100% + 64px); display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; background: #5E636B; color: #E9EBEE; font-size: .82rem; }
.pin-foot a { color: #fff; }
.pin-foot span::first-letter { text-transform: uppercase; }
@media (max-width: 760px) {
  .pin-screen { grid-template-columns: 1fr; }
  .pin-photo { display: none; }
  .pin-side { padding: 20px 16px 0; }
  .pin-foot { width: calc(100% + 32px); }
}
@media (max-height: 760px) and (min-width: 761px) { .pk { min-height: 56px; font-size: 1.8rem; } .pin-hint { margin-top: 10px; } .wordmark.xl { font-size: 2.1rem; } }

/* ---------- Касса без шапки бэк-офиса ---------- */
.shell.chromeless { grid-template-rows: minmax(0, 1fr); }
.shell.chromeless > .topbar { display: none; }
.shell.chromeless .main { height: 100vh; height: 100dvh; }
.ct { height: 100%; display: flex; flex-direction: column; min-height: 0; background: var(--c-canvas, var(--bg)); color: var(--c-ink, var(--ink)); }

/* Верхняя полоса */
.ct-top { flex: none; height: 64px; display: flex; align-items: stretch; background: var(--c-top, var(--surface)); border-bottom: 1px solid var(--c-line, var(--line)); }
.ct-user { display: flex; flex-direction: column; justify-content: center; padding: 0 18px; line-height: 1.2; min-width: 0; }
.ct-user b { font-size: 1.05rem; }
.ct-user span { font-size: .82rem; color: var(--c-ink-2, var(--muted)); }
.ct-warn { color: #B3372E !important; font-weight: 700; }
.ct-top-r { margin-left: auto; display: flex; align-items: stretch; }
.ct-ic { appearance: none; width: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-left: 1px solid var(--c-line, var(--line)); background: none; color: var(--c-ink-2, var(--ink-2)); cursor: pointer; text-decoration: none; font: inherit; }
.ct-ic svg { width: 26px; height: 26px; }
.ct-ic.lbl span { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.ct-ic:hover { background: rgba(0, 0, 0, .05); }

/* Нижняя панель действий */
.ct-bar { flex: none; height: 72px; display: flex; align-items: stretch; background: var(--c-bar, var(--surface)); color: #fff; padding-bottom: env(safe-area-inset-bottom); }
.cb { appearance: none; position: relative; flex: 0 0 auto; min-width: 92px; padding: 0 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-right: 1px solid rgba(255, 255, 255, .08); background: none; color: #fff; font: inherit; cursor: pointer; text-decoration: none; }
.cb svg { width: 26px; height: 26px; }
.cb span { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.cb:hover:not([disabled]) { background: rgba(255, 255, 255, .08); }
.cb[disabled], .cb[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }
.cb.hl { background: var(--c-lime, #2BD47D); color: var(--c-lime-ink, #04170C); }
.cb-gap { flex: 1; }
.cb-n { position: absolute; top: 8px; right: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #F86E16; color: #141414; font-style: normal; font-size: .7rem; font-weight: 800; display: grid; place-items: center; }
.cb.pay { min-width: 210px; flex-direction: row; gap: 14px; background: #F86E16; color: #141414; border: 0; }
.cb.pay span { font-size: .95rem; }
.cb.pay b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.cb.pay[disabled] { opacity: .5; }

/* Экран столов */
.ct-tables { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr); }
.ct-halls { display: flex; flex-direction: column; background: var(--c-canvas-2, var(--surface-2)); border-right: 1px solid rgba(255, 255, 255, .5); }
.ct-hall { appearance: none; min-height: 64px; padding: 0 16px; text-align: left; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .45); background: none; color: var(--c-ink, var(--ink)); font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.ct-hall[aria-pressed="true"] { background: var(--c-lime, var(--brand)); color: var(--c-lime-ink, #141414); }
.ct-grid { min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(120px, 190px); gap: 0; padding: 10px; align-content: start; }
.ct-table { appearance: none; position: relative; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px solid rgba(255, 255, 255, .85); margin: -0.75px; background: rgba(255, 255, 255, .06); color: #fff; font: inherit; cursor: pointer; font-variant-numeric: tabular-nums; min-height: 110px; }
.ct-table.void { border-color: rgba(255, 255, 255, .25); background: none; cursor: default; }
.ct-tname { position: absolute; top: 8px; left: 10px; font-weight: 800; font-size: 1.05rem; }
.ct-plus { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .85); color: var(--c-canvas, #8E949C); display: grid; place-items: center; }
.ct-plus svg { width: 22px; height: 22px; }
.ct-table.free:hover { background: rgba(255, 255, 255, .14); }
.ct-table.busy { background: var(--c-lime, #2BD47D); color: var(--c-lime-ink, #04170C); }
.ct-table.busy b, .ct-table.pre b { font-size: 1.4rem; }
.ct-table.pre { background: #E8C46A; color: #2A2005; }
.ct-tmin { font-size: .85rem; font-weight: 600; }

/* Экран заказа */
.ct-top-order { background: var(--c-top, var(--surface)); }
.ct-guests { display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.ct-gtab { appearance: none; min-width: 92px; padding: 0 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-right: 1px solid var(--c-line, var(--line)); background: var(--c-tile, var(--surface-2)); color: #fff; font: inherit; cursor: pointer; }
.ct-gtab svg { width: 22px; height: 22px; }
.ct-gtab span { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ct-gtab[aria-selected="true"] { background: var(--c-lime, var(--brand)); color: var(--c-lime-ink, #141414); }
.co { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(380px, 43%) minmax(0, 1fr); }
.co-left { display: flex; flex-direction: column; min-height: 0; background: var(--c-bar, var(--surface)); }
.co-head { flex: none; display: grid; grid-template-columns: 40px 1fr 1.3fr 1fr; align-items: center; gap: 8px; padding: 8px 12px; background: var(--c-tile-2, var(--surface-2)); color: #fff; }
.co-h-i svg { width: 26px; height: 26px; opacity: .85; }
.co-h-c { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.co-h-c b { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-h-c small { font-size: .78rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-h-c.r { text-align: right; }
.co-gbar { flex: none; display: flex; justify-content: center; position: relative; padding: 5px 12px; background: var(--c-lime, var(--brand)); color: var(--c-lime-ink, #141414); font-size: .85rem; font-weight: 700; }
.co-gbar span { position: absolute; right: 12px; font-variant-numeric: tabular-nums; }
.co-lines { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0; background: #fff; color: #1E2126; }
.co-line { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 10px 14px 10px 10px; border-bottom: 1px solid #E3E6EA; cursor: pointer; }
.co-line:hover { background: #F4F6F8; }
.co-line.sel { background: #DDF6E8; box-shadow: inset 4px 0 0 #2BD47D; }
.co-line.wait { opacity: .55; }
.co-q { font-weight: 800; font-size: 1.1rem; text-align: right; font-variant-numeric: tabular-nums; }
.co-n { display: flex; flex-direction: column; min-width: 0; }
.co-n b { font-size: 1.08rem; font-weight: 600; line-height: 1.25; }
.co-n small { font-size: .82rem; color: #6A7079; }
.co-n .co-cmt { color: #C2540A; font-weight: 700; }
.co-n .co-st { color: #2E7D32; font-weight: 600; }
.co-line:not(.sent) .co-st { color: #6A7079; }
.co-s { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.co-empty { padding: 30px 16px; text-align: center; color: #8A9098; }
.co-other { padding: 8px 14px; font-size: .82rem; color: #6A7079; background: #F4F6F8; }
.co-sum { flex: none; display: grid; grid-template-columns: 30% 70%; background: #6A7079; color: #fff; }
.co-pct { display: grid; grid-template-columns: 1fr; padding: 6px 8px; background: #fff; color: #6A7079; border-right: 1px solid #C9CDD3; text-align: center; line-height: 1.15; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.co-pct b { font-size: .95rem; color: #1E2126; text-transform: none; letter-spacing: 0; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.co-tot { display: flex; flex-direction: column; }
.co-sub { display: grid; grid-template-columns: 1fr 1fr; flex: 1; }
.co-sub span { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: #E1E4E8; }
.co-sub b { font-size: .98rem; color: #fff; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.co-total { display: flex; align-items: center; justify-content: center; padding: 6px 12px; background: #fff; color: #1E2126; }
.co-total b { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.co-tools { flex: none; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--c-bar, var(--surface-2)); }
.co-t { appearance: none; height: 58px; border: 0; border-right: 1px solid rgba(255, 255, 255, .08); background: none; color: #E9EBEE; display: grid; place-items: center; cursor: pointer; font: inherit; }
.co-t svg { width: 26px; height: 26px; }
.co-t.txt { font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }
.co-t:hover { background: rgba(255, 255, 255, .08); }

.co-right { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cm-nav { flex: none; height: 58px; display: flex; align-items: stretch; background: var(--c-bar-2, var(--surface-2)); color: #fff; }
.cm-nb { appearance: none; width: 64px; border: 0; border-right: 1px solid rgba(255, 255, 255, .08); background: none; color: #E9EBEE; display: grid; place-items: center; cursor: pointer; }
.cm-nb svg { width: 26px; height: 26px; }
.cm-nb[disabled] { opacity: .35; cursor: default; }
.cm-nb.on { background: rgba(255, 255, 255, .12); }
.cm-path { flex: 1; display: flex; align-items: center; padding: 0 14px; font-weight: 700; font-size: .95rem; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-q { flex: 1; min-width: 0; margin: 9px 10px; padding: 0 12px; border: 0; border-radius: 2px; background: #fff; color: #1E2126; font: inherit; font-size: 1rem; }
.cm-course { appearance: none; width: 86px; border: 0; border-left: 1px solid rgba(255, 255, 255, .08); background: none; color: #E9EBEE; font: inherit; font-weight: 700; font-size: 1rem; letter-spacing: .1em; cursor: pointer; }
.cm-course[aria-pressed="true"] { background: var(--c-lime, var(--brand)); color: var(--c-lime-ink, #141414); }
.cm-course[disabled] { cursor: default; }
.cm-course[disabled][aria-pressed="false"] { opacity: .4; }
.cm-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 96px; gap: 2px; padding: 2px; align-content: start; }
.cm-cell { position: relative; display: flex; }
.cm-tile { appearance: none; position: relative; width: 100%; height: 100%; min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 34px 8px; border: 0; border-radius: 1px; background: var(--c-tile, var(--cc)); color: #fff; font: inherit; text-align: center; cursor: pointer; touch-action: manipulation; }
.cm-tile:active { filter: brightness(1.12); }
.cm-tile.grp { background: var(--c-tile-hi, var(--cc)); }
.cm-tile.grp small { font-size: .72rem; opacity: .8; }
.cm-n { font-size: 1rem; font-weight: 600; line-height: 1.2; }
.cm-p { font-size: .82rem; opacity: .92; font-variant-numeric: tabular-nums; }
.cm-cnt { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--c-lime, #2BD47D); color: var(--c-lime-ink, #04170C); font-style: normal; font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.cm-stop { position: absolute; top: 6px; left: 6px; padding: 1px 6px; background: #fff; color: #B3372E; font-style: normal; font-weight: 800; font-size: .68rem; }
.cm-cell.stopped .cm-tile { background: repeating-linear-gradient(-45deg, #7D838B, #7D838B 8px, #737981 8px, #737981 16px); color: #E1E4E8; cursor: not-allowed; }
.cm-cell.stopped .cm-n { text-decoration: line-through; }
.cm-info { appearance: none; position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .7); background: none; color: #fff; font: italic 700 .9rem Georgia, serif; cursor: pointer; display: grid; place-items: center; }
.cm-info:hover { background: rgba(255, 255, 255, .15); }
.cm-empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: #F2F3F5; }

/* Модальные окна классического терминала — плоские */
:root[data-term="classic"] dialog.term-modal { border-radius: 2px; }
:root[data-term="classic"] dialog.term-modal .btn { border-radius: 2px; }
:root[data-term="classic"] dialog.term-modal .btn-primary { background: #1F6B45; border-color: #1F6B45; color: #fff; }
:root[data-term="classic"] .pay-m { border-radius: 2px; background: #1F6B45; border-color: #1F6B45; color: #fff; }
:root[data-term="classic"] .pay-m small { color: #DDF6E8; }
:root[data-term="classic"] .pay-m[aria-checked="true"] { background: #2BD47D; border-color: #2BD47D; color: #04170C; }
:root[data-term="classic"] .pay-m[aria-checked="true"] small { color: #0B5A32; }
:root[data-term="classic"] .pay-sum { border-radius: 2px; background: #F2F3F5; }
:root[data-term="classic"] .pay-total { color: #1E2126; }
:root[data-term="classic"] .pay-entry { border-radius: 2px; }
:root[data-term="classic"] .numpad .key { border-radius: 2px; background: #F2F3F5; border-color: #D6D9DE; color: #1E2126; }
:root[data-term="classic"] .pay-notes .note { border-radius: 2px; background: #DDF6E8; border-color: #B5E6C9; color: #0B5A32; }
:root[data-term="classic"] #pay-go { background: #2BD47D; border-color: #2BD47D; color: #141414; }
:root[data-term="classic"] .menu-grid .act { border-radius: 2px; background: #1F6B45; border-color: #1F6B45; color: #fff; }
:root[data-term="classic"] .menu-grid .act.pay { background: #2BD47D; border-color: #2BD47D; color: #141414; }
.qty-out { display: block; text-align: right; font-size: 2.2rem; font-weight: 800; padding: 6px 12px; margin-bottom: 8px; border: 2px solid var(--line-strong); font-variant-numeric: tabular-nums; }
dialog.qty-modal { width: min(380px, calc(100vw - 24px)); }
.ol-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ol-row { appearance: none; width: 100%; display: grid; grid-template-columns: 80px 1fr auto; grid-template-rows: auto auto; gap: 0 12px; align-items: center; text-align: left; padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.ol-row .muted { grid-column: 2; font-size: .85rem; }
.ol-row .r { grid-column: 3; grid-row: 1 / span 2; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ol-row:hover { background: var(--surface-2); }

/* Тёмная тема классической раскладки */
:root[data-term="dark"] .ct { --c-canvas: #121315; --c-canvas-2: #1B1C1E; --c-top: #0B0C0D; --c-tile: #1B4A34; --c-tile-2: #173F2C; --c-tile-hi: #1B4A34; --c-lime: #2BD47D; --c-lime-ink: #04170C; --c-bar: #1B1C1E; --c-bar-2: #232427; --c-line: #2E2F33; --c-ink: #F1F0EC; --c-ink-2: #C9C8C4; }
:root[data-term="dark"] .co-lines, :root[data-term="dark"] .co-total, :root[data-term="dark"] .co-pct { background: #1B1C1E; color: #F1F0EC; }
:root[data-term="dark"] .co-line { border-bottom-color: #2E2F33; }
:root[data-term="dark"] .co-line:hover { background: #232427; }
:root[data-term="dark"] .co-line.sel { background: #0F2A1C; }
:root[data-term="dark"] .co-pct b, :root[data-term="dark"] .co-total b { color: #F1F0EC; }
:root[data-term="dark"] .ct-table { border-color: #44464B; }

/* Планшет 1024 и узкие мониторы */
@media (max-width: 1180px) {
  .co { grid-template-columns: minmax(340px, 42%) minmax(0, 1fr); }
  .cm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb { min-width: 76px; padding: 0 6px; }
  .cb.pay { min-width: 170px; }
  .ct-tables { grid-template-columns: 160px minmax(0, 1fr); }
  .cm-course { width: 64px; }
}
@media (max-height: 780px) and (min-width: 761px) {
  .ct-top { height: 56px; } .ct-bar { height: 64px; } .co-t { height: 50px; } .cm-nav { height: 52px; }
  .co-total b { font-size: 1.5rem; } .cm-grid { grid-auto-rows: 88px; } .cm-tile { min-height: 88px; }
}
/* Телефон: заказ над меню, панель с прокруткой */
@media (max-width: 760px) {
  .co { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 46%) minmax(0, 1fr); }
  .co-head { grid-template-columns: 1fr 1fr 1fr; } .co-h-i { display: none; }
  .co-sum { grid-template-columns: 1fr 2fr; } .co-sub { display: none; }
  .co-tools .co-t { height: 46px; }
  .cm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 76px; } .cm-tile { min-height: 76px; }
  .cm-course { width: 48px; } .cm-nb { width: 50px; }
  .ct-bar { overflow-x: auto; scrollbar-width: none; height: 62px; }
  .cb { min-width: 72px; } .cb.pay { min-width: 160px; position: sticky; right: 0; }
  .ct-tables { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .ct-halls { flex-direction: row; overflow-x: auto; } .ct-hall { min-height: 48px; flex: none; }
  .ct-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 96px; }
  .ct-top-r .ct-ic { width: 54px; } .ct-ic.lbl { display: none; }
}

.ct-top-order .ct-who { display: flex; flex-direction: column; justify-content: center; padding: 0 16px; min-width: 0; line-height: 1.2; }
.ct-top-order .ct-who b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-top-order .ct-who span { font-size: .78rem; color: var(--c-ink-2, var(--muted)); white-space: nowrap; }
.cm-cnt { top: 6px; left: 6px; }
.cm-stop { top: 6px; left: 6px; }
@media (max-width: 1180px) { .ct-top-order .ct-who { display: none; } }
@media (max-width: 760px) and (min-width: 601px) {
  .co { grid-template-rows: minmax(0, 52%) minmax(0, 1fr); }
  .ct-guests .ct-gtab { min-width: 72px; }
}

/* Классическая тема для Официанта, Кухни, Киоска, Панели владельца */
:root[data-term="classic"] .wt-tabs { background: #5E636B; border-radius: 2px; }
:root[data-term="classic"] .wt-tabs button { color: #E9EBEE; border-radius: 2px; }
:root[data-term="classic"] .wt-tabs button[aria-selected="true"] { background: #2BD47D; color: #04170C; }
:root[data-term="classic"] .wt-head h1 { color: #fff; }
:root[data-term="classic"] .wt-table { border-radius: 2px; border: 1.5px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .06); color: #fff; }
:root[data-term="classic"] .wt-table b { color: #fff; }
:root[data-term="classic"] .wt-table.busy { background: #2BD47D; border-color: #2BD47D; color: #04170C; }
:root[data-term="classic"] .wt-table.busy b { color: #04170C; }
:root[data-term="classic"] .wt-table.pre { background: #E8C46A; border-color: #E8C46A; color: #2A2005; }
:root[data-term="classic"] .wt-table.pre b { color: #2A2005; }
:root[data-term="classic"] .wo-dish { border-radius: 2px; background: #1F6B45; color: #fff; border: 0; }
:root[data-term="classic"] .wo-dish::before { display: none; }
:root[data-term="classic"] .wo-cats { background: #8E949C; }
:root[data-term="classic"] .wo-cats .term-cat { border-radius: 2px; background: #1B5E3D; color: #fff; border: 0; }
:root[data-term="classic"] .wo-cats .term-cat::before { display: none; }
:root[data-term="classic"] .wo-cats .term-cat[aria-pressed="true"] { background: #2BD47D; color: #04170C; }
:root[data-term="classic"] .wo-lines, :root[data-term="classic"] .wt-row { border-radius: 2px; }
:root[data-term="classic"] .wo-bar { background: #5E636B; border: 0; }
:root[data-term="classic"] .wo-bar .act { background: none; border: 0; color: #fff; border-radius: 0; }
:root[data-term="classic"] .wo-bar .act.kitchen { background: #2BD47D; color: #04170C; }
:root[data-term="classic"] .chip-btn { border-radius: 2px; background: #1F6B45; color: #fff; border: 0; }
:root[data-term="classic"] .chip-btn[aria-pressed="true"] { background: #2BD47D; color: #04170C; }
:root[data-term="classic"] .wo-head h2, :root[data-term="classic"] .wo-head .muted { color: #fff; }
:root[data-term="classic"] .wo-total { color: #fff; }
:root[data-term="classic"] .k-card { border-radius: 2px; }
:root[data-term="classic"] .k-card header { background: #1F6B45; color: #fff; }
:root[data-term="classic"] .kitchen-head h1, :root[data-term="classic"] #k-upd { color: #fff; }
:root[data-term="classic"] .kiosk-head h1, :root[data-term="classic"] .kiosk-head p, :root[data-term="classic"] .kiosk-hint { color: #fff; }
:root[data-term="classic"] .kiosk-emp { border-radius: 2px; }
:root[data-term="classic"] .kiosk-ava { background: #1F6B45; color: #fff; }
:root[data-term="classic"] .term-note { color: #F2F3F5; }
:root[data-term="classic"] .own-hero, :root[data-term="classic"] .own-kpi > div, :root[data-term="classic"] .own-card { border-radius: 2px; }
:root[data-term="classic"] .own-upd { color: #F2F3F5; }
:root[data-term="classic"] .shell.terminal .topbar { background: #E6E8EC; }

/* Классическая тема для Официанта, Кухни, Киоска, Панели владельца */
:root[data-term="classic"] .wt-tabs { background: #5E636B; border-radius: 2px; }
:root[data-term="classic"] .wt-tabs button { color: #E9EBEE; border-radius: 2px; }
:root[data-term="classic"] .wt-tabs button[aria-selected="true"] { background: #2BD47D; color: #04170C; }
:root[data-term="classic"] .wt-head h1 { color: #fff; }
:root[data-term="classic"] .wt-table { border-radius: 2px; border: 1.5px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .06); color: #fff; }
:root[data-term="classic"] .wt-table b { color: #fff; }
:root[data-term="classic"] .wt-table.busy { background: #2BD47D; border-color: #2BD47D; color: #04170C; }
:root[data-term="classic"] .wt-table.busy b { color: #04170C; }
:root[data-term="classic"] .wt-table.pre { background: #E8C46A; border-color: #E8C46A; color: #2A2005; }
:root[data-term="classic"] .wt-table.pre b { color: #2A2005; }
:root[data-term="classic"] .wo-dish { border-radius: 2px; background: #1F6B45; color: #fff; border: 0; }
:root[data-term="classic"] .wo-dish::before { display: none; }
:root[data-term="classic"] .wo-cats { background: #8E949C; }
:root[data-term="classic"] .wo-cats .term-cat { border-radius: 2px; background: #1B5E3D; color: #fff; border: 0; }
:root[data-term="classic"] .wo-cats .term-cat::before { display: none; }
:root[data-term="classic"] .wo-cats .term-cat[aria-pressed="true"] { background: #2BD47D; color: #04170C; }
:root[data-term="classic"] .wo-lines, :root[data-term="classic"] .wt-row { border-radius: 2px; }
:root[data-term="classic"] .wo-bar { background: #5E636B; border: 0; }
:root[data-term="classic"] .wo-bar .act { background: none; border: 0; color: #fff; border-radius: 0; }
:root[data-term="classic"] .wo-bar .act.kitchen { background: #2BD47D; color: #04170C; }
:root[data-term="classic"] .chip-btn { border-radius: 2px; background: #1F6B45; color: #fff; border: 0; }
:root[data-term="classic"] .chip-btn[aria-pressed="true"] { background: #2BD47D; color: #04170C; }
:root[data-term="classic"] .wo-head h2, :root[data-term="classic"] .wo-head .muted, :root[data-term="classic"] .wo-total { color: #fff; }
:root[data-term="classic"] .wo-head .btn { background: #5E636B; border-color: #5E636B; color: #fff; border-radius: 2px; }
:root[data-term="classic"] .k-card { border-radius: 2px; }
:root[data-term="classic"] .k-card header { background: #1F6B45; color: #fff; }
:root[data-term="classic"] .kitchen-head h1, :root[data-term="classic"] #k-upd { color: #fff; }
:root[data-term="classic"] .kiosk-head h1, :root[data-term="classic"] .kiosk-head p, :root[data-term="classic"] .kiosk-hint { color: #fff; }
:root[data-term="classic"] .kiosk-emp { border-radius: 2px; }
:root[data-term="classic"] .kiosk-ava { background: #1F6B45; color: #fff; }
:root[data-term="classic"] .term-note { color: #F2F3F5; }
:root[data-term="classic"] .own-hero, :root[data-term="classic"] .own-kpi > div, :root[data-term="classic"] .own-card { border-radius: 2px; }
:root[data-term="classic"] .own-upd { color: #F2F3F5; }
:root[data-term="classic"] .shell.terminal .topbar { background: #E6E8EC; }
:root[data-term="classic"] .seg { border-radius: 2px; }

/* =====================================================================
   Склад: документы, акты приготовления, заказы поставщикам
   ===================================================================== */
.doc-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.doc-filters .field { margin: 0; min-width: 140px; }
.doc-new { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.row-draft td { background: var(--surface-2); }
.row-draft td:first-child { box-shadow: inset 3px 0 0 var(--line-strong); }
.doc-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }
.modal.doc-modal { width: min(1080px, calc(100vw - 24px)); }
.doc-form { display: grid; gap: 14px; }
.doc-head { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
.doc-head .field { margin: 0; }
.doc-head .span2 { grid-column: span 2; }
.doc-head .span-all { grid-column: 1 / -1; }
.prod-preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: grid; gap: 10px; }
.prod-preview:empty { display: none; }
.prod-preview h4 { margin: 0; font-size: .95rem; }
.pv-item { display: grid; gap: 2px; }
.pv-item > span { color: var(--muted); font-size: .86rem; }
.pv-item ul { margin: 4px 0 0; padding-left: 18px; font-size: .88rem; columns: 2 260px; }
.ao-group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.ao-group > header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ao-group table { margin: 0; }
.input-sm { padding: 4px 6px; min-height: 32px; width: 96px; font-size: .9rem; }
.wa-text { width: 100%; min-height: 220px; font: 13px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; resize: vertical; }
@media (max-width: 760px) {
  .doc-head { grid-template-columns: 1fr 1fr; }
  .doc-head .span2 { grid-column: 1 / -1; }
  .doc-new { margin-left: 0; width: 100%; }
  .input-sm { width: 72px; }
}

/* ---------- Печать документа A4 ---------- */
@page a4doc { size: A4 portrait; margin: 14mm 12mm; }
@media print {
  #print-area.a4 .a4doc { page: a4doc; width: auto; font: 11pt/1.4 Arial, Helvetica, sans-serif; color: #000; }
  .a4doc header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12mm; border-bottom: 1.5pt solid #000; padding-bottom: 3mm; margin-bottom: 5mm; }
  .a4doc h1 { font-size: 16pt; margin: 0 0 1mm; }
  .a4doc .a4-meta { text-align: right; font-size: 9pt; }
  .a4doc table { width: 100%; border-collapse: collapse; }
  .a4doc .a4-kv { margin-bottom: 5mm; }
  .a4doc .a4-kv th { text-align: left; width: 38mm; font-weight: 600; padding: 1mm 2mm 1mm 0; vertical-align: top; }
  .a4doc .a4-kv td { padding: 1mm 0; }
  .a4doc .a4-items th, .a4doc .a4-items td { border: .6pt solid #000; padding: 1.2mm 2mm; vertical-align: top; }
  .a4doc .a4-items th { background: #eee; font-size: 9.5pt; }
  .a4doc .a4-items td.num, .a4doc .a4-items td.r, .a4doc .a4-items th.num { text-align: right; white-space: nowrap; }
  .a4doc .a4-items tfoot td { font-weight: 700; }
  .a4doc .a4-items tr { break-inside: avoid; }
  .a4doc .a4-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; margin-top: 14mm; font-size: 10pt; }
}

/* =====================================================================
   OLAP-конструктор
   ===================================================================== */
.olap { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.olap-cfg { padding: 14px; display: grid; gap: 12px; position: sticky; top: 76px; }
.olap-preset { display: flex; gap: 6px; }
.olap-preset select { flex: 1; min-width: 0; }
.olap-fs { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.olap-fs legend { font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; padding: 0; }
.olap-fs .field { margin: 0; }
.olap-ms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 8px; }
.olap-ms .check { font-size: .9rem; min-height: 32px; }
.olap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.olap-chips .chip { align-items: center; padding: 3px 4px 3px 10px; font-size: .82rem; }
.chip-x { appearance: none; border: 0; background: var(--surface-3); color: var(--ink); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font: inherit; font-weight: 700; line-height: 1; }
.chip-x:hover { background: var(--line-strong); }
.olap-main { min-width: 0; }
.olap-main .period { margin-bottom: 10px; }
.olap-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.olap-bar #ol-info { margin-right: auto; }
.olap-bar .check { font-size: .9rem; }
.btn-excel { border-color: #1D6F42; color: #1D6F42; }
.btn-excel:hover { background: #1D6F42; color: #fff; border-color: #1D6F42; }
@media (prefers-color-scheme: dark) { .btn-excel { border-color: #5DBB86; color: #7FD4A3; } .btn-excel:hover { background: #2D8A57; color: #fff; } }
.olap-wrap { max-height: calc(100vh - 260px); overflow: auto; }
.olap-t { font-variant-numeric: tabular-nums; }
.olap-t thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }
.olap-t thead tr + tr th { top: 37px; }
.olap-t tbody th, .olap-t tfoot th, .olap-t thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 500; min-width: 160px; max-width: 320px; }
.olap-t thead th:first-child { z-index: 3; background: var(--surface-2); }
.olap-t tfoot th, .olap-t tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--line-strong); }
.olap-t td.tot, .olap-t th.tot { border-left: 2px solid var(--line-strong); font-weight: 600; }
.olap-t.heat tbody td[style*="--h"] { background: rgba(248, 110, 22, var(--h)); }
.olap-cfg .check { min-height: 30px; }
@media (prefers-color-scheme: dark) { .olap-t.heat tbody td[style*="--h"] { background: rgba(248, 110, 22, calc(var(--h) * .8)); } }
.olap-sort { appearance: none; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: 2px 0; text-align: inherit; width: 100%; }
.olap-sort:hover { text-decoration: underline; }
.olap-g th, .olap-g td { background: var(--surface-2) !important; font-weight: 700; }
.olap-tg { appearance: none; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; padding: 2px 0; display: inline-flex; gap: 6px; align-items: baseline; text-align: left; }
.olap-sub { padding-left: 28px !important; }
.olap-fv { max-height: 50vh; overflow: auto; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.olap-fv .check { justify-content: flex-start; }
.olap-fv .check .muted { margin-left: auto; }
@media (max-width: 1100px) {
  .olap { grid-template-columns: 1fr; }
  .olap-cfg { position: static; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-items: start; }
}
@media (max-width: 760px) {
  .olap-main { order: -1; }
  .olap-cfg { grid-template-columns: 1fr; }
  .olap-wrap { max-height: none; }
  .olap-t tbody th, .olap-t tfoot th, .olap-t thead th:first-child { min-width: 120px; }
}
.shell.terminal .kitchen-head { padding: 10px 14px 0; margin-bottom: 10px; }
.shell.terminal .kitchen-grid { padding: 0 14px 14px; }
@media (max-width: 600px) { .shell.terminal .kitchen-head { padding: 8px 10px 0; } .shell.terminal .kitchen-grid { padding: 0 10px 10px; } }

/* ---------- §20.3 Состояние принтеров ---------- */
.pg { display: grid; gap: 8px; margin-bottom: 8px; }
.pg-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px; }
.pg-tile { appearance: none; position: relative; min-height: 64px; border: 1px solid #1F6B2A; border-radius: 3px; background: #8EEA8E; color: #0E2A12;
  font: inherit; cursor: pointer; display: grid; grid-template-rows: auto 1fr auto; padding: 4px 8px; text-align: center; }
.pg-tile:hover { filter: brightness(1.05); }
.pg-tile:focus-visible { outline: 3px solid var(--focus, #1D4ED8); outline-offset: 2px; }
.pg-tile.slow { background: #F6E27A; border-color: #8A6D00; color: #2B2200; }
.pg-tile.offline { background: #F29C93; border-color: #8A1F14; color: #2E0904; }
.pg-tile.printing { opacity: .6; cursor: progress; }
.pg-ip { justify-self: end; font-size: .82rem; font-variant-numeric: tabular-nums; }
.pg-name { align-self: center; font-size: 1.05rem; font-weight: 600; display: grid; line-height: 1.2; }
.pg-name small { font-size: .75rem; font-weight: 400; opacity: .8; }
.pg-ms { justify-self: start; font-size: .82rem; font-variant-numeric: tabular-nums; }
.term-modal .pg-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 600px) { .pg-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- §20.2 Предпросмотр шаблона ленты ---------- */
.tape-wrap { display: grid; gap: 10px; align-content: start; }
.tape-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.tape-ctl .field { margin: 0; }
.tape { background: #fff; color: #111; border: 1px solid var(--line); box-shadow: var(--shadow-1); padding: 10px 8px 16px; justify-self: start;
  font: 12px/1.25 ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; white-space: pre; overflow-x: auto; max-width: 100%;
  -webkit-mask: linear-gradient(#000 calc(100% - 8px), transparent); }
.tape.w32 { width: calc(32ch + 16px); }
.tape.w48 { width: calc(48ch + 16px); }

/* ---------- §20.16 Подтверждение отмены / §20.13 Кому скидка ---------- */
.cx { display: grid; gap: 14px; }
.cx-what { margin: 0; font-weight: 600; }
.cx-reasons, .dd-reasons { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.cx-reasons legend, .dd-reasons legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.cx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cx-r, .chip-radio { position: relative; display: block; cursor: pointer; }
.cx-r input, .chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cx-r span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-2); font-weight: 600; font-size: .92rem; }
.cx-r input:checked + span, .chip-radio input:checked + span { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.cx-r input:focus-visible + span, .chip-radio input:focus-visible + span { outline: 3px solid var(--focus, #1D4ED8); outline-offset: 2px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-radio span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 600; font-size: .9rem; }
.cx-pin { display: grid; gap: 8px; justify-items: stretch; max-width: 320px; }
.cx-pin label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.cx-pin-in { text-align: center; letter-spacing: .4em; font-size: 1.4rem; }
.cx-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cx-pad .pk { min-height: 52px; font-size: 1.3rem; font-weight: 700; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); cursor: pointer; }
.cx-pad .pk:active { background: var(--surface-3); }
.cx .form-error:empty { display: none; }
.req { color: var(--danger); }
:root[data-term="classic"] .cx-r input:checked + span, :root[data-term="classic"] .chip-radio input:checked + span { background: #2BD47D; color: #04170C; border-color: #1FA463; }
:root[data-term="classic"] .cx-pad .pk { background: #1F6B45; color: #fff; border-color: #3A6499; border-radius: 2px; }
@media (min-width: 761px) { .cx-modal .cx { grid-template-columns: 1fr 300px; align-items: start; } .cx-modal .cx-what, .cx-modal .form-error { grid-column: 1 / -1; } }
@media (max-width: 480px) { .cx-grid { grid-template-columns: 1fr 1fr; } }
.k-item.k-cancel { background: #FDECEA; }
.k-item.k-cancel .k-name { color: #7A1D12; text-decoration-thickness: 2px; }
.k-x { margin-left: auto; background: #C62828; color: #fff; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 3px; font-size: .85rem; animation: kx 1s ease-in-out 3; }
@keyframes kx { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .k-x { animation: none; } }
:root[data-term="dark"] .k-item.k-cancel { background: #3A1512; }
:root[data-term="dark"] .k-item.k-cancel .k-name { color: #F6B4AB; }
.period-x { margin-left: auto; align-self: flex-end; display: flex; gap: 6px; }
.rep-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.rep-group { padding: 12px; }
.rep-group h3 { margin: 0 0 8px; font-size: 1rem; }
.row-alert td { background: color-mix(in srgb, var(--danger) 9%, transparent); }
.kpi-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.kpi-row .kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; min-width: 150px; }
.kpi-row .kpi span { color: var(--muted); font-size: .85rem; }
.kpi-row .kpi b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.modal.cx-modal { width: min(820px, calc(100vw - 24px)); }
.cx-modal .cx:not(:has(.cx-pin)) { grid-template-columns: 1fr; }
.modal.disc-modal { width: min(640px, calc(100vw - 24px)); }

/* ---------- §20.14 Отделы кассы (каналы) ---------- */
.ct-depts { display: flex; gap: 2px; background: var(--c-bar, #5E636B); padding: 0; overflow-x: auto; flex: none; }
.ct-dept { appearance: none; border: 0; flex: 1 1 0; min-width: 110px; min-height: 48px; background: var(--c-tile-2, #2A7D55); color: #fff; font: inherit; font-weight: 700; font-size: .95rem;
  text-transform: uppercase; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; position: relative; box-shadow: inset 0 -4px 0 var(--dc, transparent); }
.ct-dept[aria-selected="true"] { background: var(--c-lime, #2BD47D); color: var(--c-lime-ink, #04170C); }
.ct-dept:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.ct-dept .cb-n { position: static; }
.ct-dview { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 12px; }
.ct-dhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ct-dhead h2 { margin: 0; color: #fff; font-size: 1.2rem; }
.cb-new { appearance: none; border: 0; background: var(--c-lime, #2BD47D); color: var(--c-lime-ink, #04170C); font: inherit; font-weight: 800; min-height: 48px; padding: 0 18px; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; border-radius: 2px; text-transform: uppercase; }
.cb-new svg { width: 20px; height: 20px; }
.ct-dsub { margin: 10px 0 6px; color: #F2F3F5; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.ct-ords { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.ct-ord { appearance: none; border: 0; border-radius: 2px; background: var(--c-tile, #1F6B45); color: #fff; font: inherit; text-align: left; padding: 8px 10px; min-height: 92px;
  display: grid; grid-template-columns: 1fr auto; grid-auto-rows: min-content; gap: 2px 6px; cursor: pointer; }
.ct-ord:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.ct-ord-n { font-size: 1.15rem; }
.ct-ord-s { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ct-ord-t { grid-column: 1 / -1; font-size: .85rem; opacity: .9; }
.ct-ord-k { grid-column: 1 / -1; justify-self: start; font-size: .75rem; font-weight: 700; padding: 1px 6px; border-radius: 2px; background: rgba(0,0,0,.25); }
.ct-ord.ready .ct-ord-k { background: var(--c-lime, #2BD47D); color: var(--c-lime-ink, #04170C); }
.ct-ord-c { grid-column: 1 / -1; font-size: .78rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-ord.paid { background: #7D838C; color: #F4F5F7; min-height: 70px; }
.ct-dempty { color: #F2F3F5; margin: 4px 0 8px; }
.ch-grid .ch-btn { box-shadow: inset 0 -6px 0 var(--dc, transparent); min-height: 110px; font-size: 1.05rem; }
:root[data-term="dark"] .ct-dhead h2, :root[data-term="dark"] .ct-dsub, :root[data-term="dark"] .ct-dempty { color: var(--ink); }
/* §20.7 Смешанная */
.mix-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.mix-left { margin: 10px 0 0; font-weight: 700; color: var(--danger); }
.mix-left.ok { color: var(--ok, #1E7B34); }
.pay-m.mixed { background: var(--surface-2); }
:root[data-term="classic"] .pay-m.mixed { background: #5E636B; color: #fff; }
.modal.mix-modal { width: min(560px, calc(100vw - 24px)); }
@media (max-width: 480px) { .mix-grid { grid-template-columns: 1fr; } }
.ct-ords .ct-dempty { grid-column: 1 / -1; }

/* ---------- §20.10 Стоп-лист ---------- */
.modal.sl-modal { width: min(820px, calc(100vw - 24px)); }
.sl { display: grid; gap: 10px; }
.sl-top { display: grid; gap: 4px; position: sticky; top: 0; background: var(--surface); z-index: 1; padding-bottom: 4px; }
.sl-list { max-height: 60vh; overflow: auto; }
.sl-h { margin: 12px 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sl-ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 8px; background: var(--surface-2); border-radius: 4px; }
.sl-row.on { background: #FDECEA; }
.sl-row.on .sl-name b { text-decoration: line-through; color: #7A1D12; }
.sl-name { display: grid; min-width: 0; }
.sl-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-name small { color: var(--muted); font-size: .8rem; }
.sl-rem { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.sl-rem input { width: 72px; min-height: 44px; text-align: center; }
.sl-btn { appearance: none; min-width: 120px; min-height: 48px; border: 2px solid #C62828; border-radius: 3px; font: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); color: #B71C1C; text-transform: uppercase; font-size: .85rem; }
.sl-btn svg { width: 18px; height: 18px; }
.sl-btn.off { border-color: #1FA463; background: var(--c-lime, #2BD47D); color: var(--c-lime-ink, #04170C); }
.sl-btn:focus-visible { outline: 3px solid var(--focus, #1D4ED8); outline-offset: 2px; }
.sl-empty { color: var(--muted); padding: 6px 8px; }
.cm-rem { position: absolute; left: 6px; bottom: 6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: #fff; color: #0B5A32; font-style: normal; font-weight: 800; font-size: .78rem; display: grid; place-items: center; }
@media (prefers-color-scheme: dark) { .sl-row.on { background: #3A1512; } .sl-row.on .sl-name b { color: #F6B4AB; } }
@media (max-width: 520px) { .sl-row { grid-template-columns: 1fr auto; } .sl-rem { grid-column: 1; } .sl-btn { grid-row: 1 / span 2; grid-column: 2; } }

/* ---------- §20.5 Отчёты кассира ---------- */
.crep .page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.crep-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 12px; }
.crep-filters .field { margin: 0; min-width: 150px; }
.crep-day { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
.crep-day .btn-icon { font-size: 1.4rem; font-weight: 700; min-width: 44px; min-height: 44px; }
.crep-day input[type="datetime-local"] { min-width: 200px; }
.crep-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; align-items: start; }
.crep-out { padding: 12px; min-width: 0; }
.crep-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.crep-bar #cr-note { margin-right: auto; }
.crep-tape { margin: 0; background: #fff; color: #111; border: 1px solid var(--line); padding: 12px 14px; font: 13px/1.35 ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  white-space: pre; overflow-x: auto; max-width: calc(48ch + 30px); }
.crep-btns { display: grid; gap: 6px; position: sticky; top: 76px; }
.crep-btn { appearance: none; min-height: 52px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.crep-btn:hover { background: var(--surface-2); }
.crep-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.crep-btn:focus-visible { outline: 3px solid var(--focus, #1D4ED8); outline-offset: 2px; }
.crep-cards { display: grid; gap: 12px; }
.crep-title { margin: 0; font-size: 1.15rem; display: grid; }
.crep-title small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.crep-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.crep-card h3 { margin: 0 0 6px; font-size: 1rem; }
.kv-t th { text-align: left; font-weight: 500; }
.kv-t tr.tot th, .kv-t tr.tot td { font-weight: 800; border-top: 2px solid var(--line-strong); }
.crep-print { font: 11px/1.25 "Courier New", Courier, monospace; white-space: pre; margin: 0; }
@media (max-width: 900px) {
  .crep-body { grid-template-columns: 1fr; }
  .crep-btns { position: static; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); order: -1; }
}
@media (max-width: 480px) { .crep-day input[type="datetime-local"] { min-width: 0; width: 100%; } .crep-day .field { flex: 1 1 100%; } .crep-tape { font-size: 11px; } }

/* ---------- §22.3 Права должности ---------- */
.modal.perm-modal { width: min(1000px, calc(100vw - 24px)); }
.perm-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.perm-top .field { margin: 0; min-width: 240px; }
.perm-legend { margin: 0 0 10px; font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.perm-dot { width: 12px; height: 12px; border-radius: 3px; background: var(--danger); display: inline-block; }
.perm-groups { columns: 2 380px; column-gap: 16px; }
.perm-g { break-inside: avoid; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0 0 12px; min-width: 0; }
.perm-g legend { font-weight: 800; padding: 0 6px; display: flex; align-items: center; gap: 4px; }
.perm-g legend .btn { min-height: 28px; padding: 0 8px; font-size: .8rem; font-weight: 600; }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0; }
.perm-row .check { min-height: 36px; }
.perm-row .check span { display: grid; }
.perm-row.danger .check span { color: var(--danger); font-weight: 700; }
.perm-row.danger input[type=checkbox] { accent-color: var(--danger); }
.perm-hint { font-weight: 400; font-size: .76rem; color: var(--muted); }
.perm-val { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
:root[data-single] .multi-loc { display: none !important; }

/* ---------- §20.4 / §21 настройки ---------- */
.ch-sw { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.2); vertical-align: middle; }
.input-color { padding: 4px; height: 44px; width: 90px; }
.cp-wrap { max-height: 55vh; overflow: auto; margin-top: 8px; }
.set-2col { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: 16px; align-items: start; }
.hint-box.warn { background: color-mix(in srgb, #F6C343 22%, var(--surface)); border-color: #D9A400; }
.bk-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.tg-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--surface-2); border-radius: 6px; }
.tg-list li > span { margin-right: auto; }
.tg-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.tg-add .field { margin: 0; flex: 1 1 140px; }
.tg-sample { margin: 0; white-space: pre-wrap; background: var(--surface-2); padding: 12px; border-radius: 10px; font: 13px/1.45 ui-monospace, Consolas, monospace; }
.imp { display: grid; gap: 12px; max-width: 1000px; }
.imp-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.imp-steps li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: .9rem; }
.imp-steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: .8rem; }
.imp-steps li.cur { background: var(--ink); color: var(--surface); }
.imp-steps li.cur span { background: var(--brand); color: #141414; }
.imp-steps li.done span { background: #CBE8D2; color: #1E5A2B; }
.imp-body { padding: 16px; }
.imp-types, .imp-sheets { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.imp-types legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.imp-tpl { display: flex; flex-wrap: wrap; gap: 6px; }
.imp-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }
.imp-prev { max-height: 300px; overflow: auto; }
.imp-sum { display: flex; flex-wrap: wrap; gap: 10px; }
.imp-sum > div { flex: 1 1 140px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; }
.imp-sum b { font-size: 1.6rem; }
.imp-sum .ok b { color: var(--ok, #1E7B34); }
.imp-sum .bad b { color: var(--danger); }
.imp-done { text-align: center; padding: 20px; }
.imp-done svg { width: 48px; height: 48px; color: var(--ok, #1E7B34); }
@media (max-width: 900px) { .set-2col { grid-template-columns: 1fr; } }
.field.imp-types { flex-direction: row; flex-wrap: wrap; } .imp-types legend { width: 100%; }
/* Кухня: страница не прокручивается, прокручивается сетка заказов */
@media (min-width: 761px) {
  .shell.terminal:has(.kitchen-grid) { height: 100vh; height: 100dvh; overflow: hidden; }
  .shell.terminal .main:has(> .kitchen-grid), .shell.terminal .main:has(.kitchen-grid) { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .shell.terminal .kitchen-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; grid-auto-rows: max-content; }
}

/* ---------- §20.17 Отделы в левой колонке ---------- */
.ct-side { overflow-y: auto; }
.ct-side .ct-dept { appearance: none; flex: none; position: relative; width: 100%; min-width: 0; min-height: 72px; padding: 0 12px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 0; border-bottom: 1px solid rgba(255, 255, 255, .45); background: none; color: var(--c-ink, var(--ink)); font: inherit; font-weight: 800; font-size: 1.02rem;
  text-transform: none; letter-spacing: 0; text-align: left; cursor: pointer; box-shadow: none; }
.ct-side .ct-dept::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--dc, var(--c-tile, #1F6B45)); }
.ct-side .ct-dept[aria-pressed="true"] { background: var(--c-lime, var(--brand)); color: var(--c-lime-ink, #141414); }
.ct-side .ct-dept:focus-visible, .ct-side .ct-hall:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.ct-side .ct-dept .cb-n { position: static; flex: none; }
.ct-dept-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-subs { display: flex; flex-direction: column; background: rgba(0, 0, 0, .06); }
.ct-hall.sub { min-height: 52px; padding-left: 36px; font-weight: 600; font-size: .95rem; }
.ct-tables > .ct-dview { min-height: 0; }
@media (max-width: 899px) {
  .ct-tables { grid-template-columns: 132px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .ct-side { flex-direction: column !important; overflow-x: hidden; }
  .ct-side .ct-dept { min-height: 56px; padding: 0 6px 0 14px; font-size: .88rem; }
  .ct-hall.sub { min-height: 44px; padding-left: 20px; font-size: .82rem; }
}
.ct-side .ct-dept.open[aria-pressed="true"] { background: rgba(255, 255, 255, .32); color: var(--c-ink, var(--ink)); }
:root[data-term="dark"] .ct-side .ct-dept.open[aria-pressed="true"] { background: rgba(255, 255, 255, .1); }
.wt-chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.wt-chan { appearance: none; position: relative; min-height: 72px; border: 0; border-radius: 3px; background: var(--c-tile, #1F6B45); color: #fff; font: inherit; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; box-shadow: inset 6px 0 0 var(--dc, transparent); }
.wt-chan svg { width: 20px; height: 20px; }
.wt-chan:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.page-head .btn-excel { margin-left: auto; }
.pin-hint-link { color: #1D4E89; text-decoration: underline; font-weight: 700; margin-left: 4px; }


/* ---------- PIN показывается один раз ---------- */
.pin-once { text-align: center; padding: 8px 0 14px; }
.pin-once-who { margin: 0 0 6px; color: var(--muted); }
.pin-once-label { margin: 0; font-weight: 600; color: var(--ink-2); }
.pin-once-digits { display: flex; justify-content: center; gap: 8px; margin: 10px 0 12px; }
.pin-once-digits span { display: grid; place-items: center; width: 46px; height: 60px; border-radius: 10px; background: var(--surface-2); border: 2px solid var(--brand); font: 800 2.2rem/1 ui-monospace, Consolas, monospace; color: var(--ink); }
.pin-once-note { margin: 0; }
.modal.pin-once-modal { width: min(440px, calc(100vw - 24px)); }
@media (max-width: 380px) { .pin-once-digits span { width: 38px; height: 52px; font-size: 1.8rem; } }
/* сервер в сети */
.srv-urls { display: grid; gap: 6px; margin-top: 6px; }
.srv-url { display: flex; gap: 8px; align-items: center; }
.srv-url code { flex: 1; min-width: 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; font-size: 1rem; overflow-wrap: anywhere; }
.fs-plain { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; } .settings-form.is-ro .fs-plain { opacity: .85; } .hint-box.srv { align-items: flex-start; }
.pr-beep { display: grid; gap: 8px; }
.pr-beep-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.pr-beep-row .field { margin: 0; min-width: 120px; }
.pr-beep-on { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* ---------- §25 PWA: подсказка установки и обновление ---------- */
.pwa-banner { position: fixed; z-index: 1000; left: 8px; right: 8px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px;
  background: #1D1F23; color: #F2F1EE; border: 1px solid #34373D; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: .92rem; }
.pwa-banner.install { top: calc(8px + env(safe-area-inset-top)); }
.pwa-banner.top { top: calc(8px + env(safe-area-inset-top)); max-width: 420px; margin: 0 auto; }
.pwa-banner img { border-radius: 10px; flex: none; }
.pwa-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pwa-txt span { color: #B9B8B4; font-size: .85rem; }
.pwa-txt svg { vertical-align: -3px; }
.pwa-btn { appearance: none; border: 0; min-height: 44px; padding: 0 14px; border-radius: 10px; font: inherit; font-weight: 800; cursor: pointer; background: #2A2D33; color: #F2F1EE; flex: none; }
.pwa-btn.primary { background: #F86E16; color: #141414; }
.pwa-x { appearance: none; border: 0; background: none; color: #B9B8B4; width: 44px; height: 44px; font-size: 1.5rem; line-height: 1; cursor: pointer; flex: none; border-radius: 10px; }
.pwa-btn:focus-visible, .pwa-x:focus-visible { outline: 2px solid #F86E16; outline-offset: 2px; }

/* ---------- §25.4 QR и страница подключения ---------- */
.modal.qr-modal { width: min(460px, calc(100vw - 24px)); }
.qr-box { display: grid; justify-items: center; gap: 8px; text-align: center; }
.qr-img { width: min(320px, 76vw); background: #fff; padding: 6px; border-radius: 12px; }
.qr-img svg { display: block; width: 100%; height: auto; }
.qr-code { margin: 4px 0 0; font: 800 1.6rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; }
.qr-timer { margin: 0; font-weight: 700; color: var(--ink-2); }
.qr-modal.expired .qr-img { opacity: .25; }
.qr-modal.expired .qr-timer { color: var(--danger); }
.qr-steps { text-align: left; margin: 4px 0 0; padding-left: 20px; font-size: .92rem; }
.qr-url { margin: 0; overflow-wrap: anywhere; }
.enr { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; background: #0B0C0E; color: #F2F1EE; }
.enr-card { width: min(420px, 100%); background: #17181B; border: 1px solid #2A2C31; border-radius: 20px; padding: 22px 18px; display: grid; gap: 12px; }
.enr-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.enr-head img { border-radius: 12px; }
.enr .wordmark { color: #F2F1EE; }
.enr h1 { margin: 4px 0 0; font-size: 1.4rem; }
.enr-sub { margin: 0; color: #B9B8B4; }
.enr-warn { margin: 0; padding: 8px 10px; border-radius: 10px; background: #3A2412; color: #FFD2A8; }
.enr-field { display: grid; gap: 6px; }
.enr-field label { font-weight: 600; color: #D8D7D3; }
.enr-input { min-height: 52px; border-radius: 12px; border: 1px solid #3A3D44; background: #0F1012; color: #F2F1EE; font: inherit; font-size: 1.1rem; padding: 0 14px; }
.enr-input.code { font: 700 1.3rem ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
.enr-input:focus { outline: 2px solid #F86E16; outline-offset: 0; }
.enr-err { margin: 0; color: #FF8F80; font-weight: 600; min-height: 1.2em; }
.enr-err:empty { min-height: 0; }
.enr-go { appearance: none; border: 0; min-height: 56px; border-radius: 12px; background: #F86E16; color: #141414; font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; text-decoration: none; }
.enr-go[disabled] { opacity: .6; }
.enr-go:focus-visible, .enr-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.enr-link { color: #FFB27A; text-align: center; }
.enr-ok { width: 64px; height: 64px; border-radius: 50%; background: #2E7D45; color: #fff; font-size: 2rem; display: grid; place-items: center; justify-self: center; }
.enr-card.done { text-align: center; }
.url-row { display: flex; gap: 8px; } .url-row .input { flex: 1; min-width: 0; }

/* ---------- §27.1 Окно отмены: всегда видно причины, PIN и кнопки ---------- */
/* наведение не должно «съедать» цвет у сплошных кнопок (на сенсорных кассах :hover залипает после нажатия) */
.btn-danger-solid:hover, .btn-danger-solid:focus { background: #962B23; border-color: #962B23; color: #fff; }
@media (hover: none) { .btn-primary:hover { background: var(--brand); border-color: var(--brand); } .btn-danger-solid:hover { background: var(--danger); border-color: var(--danger); } }
:root[data-term="classic"] dialog.term-modal .btn-primary:hover { background: #3A6499; border-color: #3A6499; color: #fff; }
dialog.modal[open] { max-height: calc(100dvh - 16px); max-height: calc(100vh - 16px); }
@supports (height: 100dvh) { dialog.modal[open] { max-height: calc(100dvh - 16px); } }
dialog.modal[open] > .modal-head, dialog.modal[open] > .modal-foot { flex: none; }
dialog.modal[open] > .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.cx-err { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--danger-soft, #FBE4E1); color: var(--danger); font-weight: 700; }
.cx-err:empty { display: none; }
.cx-modal .cx { grid-template-areas: none; }
@media (min-width: 761px) { .cx-modal .cx-err { grid-column: 1 / -1; } }
.cx-r span { position: relative; padding-left: 30px; }
.cx-r span::before { content: ""; position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 2px solid currentColor; opacity: .7; }
.cx-r input:checked + span::before { background: currentColor; box-shadow: inset 0 0 0 3px var(--c-lime, var(--ink)); opacity: 1; }
.cx-r input { width: 100%; height: 100%; inset: 0; cursor: pointer; }
.cx-grid.need .cx-r span { border-color: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 35%, transparent); }
@media (max-height: 640px) {
  .cx-modal .modal-head { padding: 12px 16px 4px; }
  .cx-modal .modal-body { padding: 4px 16px 8px; }
  .cx-modal .modal-foot { padding: 8px 16px 10px; }
  .cx { gap: 8px; }
  .cx-r span { min-height: 44px; font-size: .88rem; }
  .cx-pad .pk { min-height: 42px; font-size: 1.15rem; }
  .cx-pin-in { min-height: 42px; }
}
.enr-bad { margin: 0; padding: 12px; border-radius: 12px; background: #3B1C19; color: #FFD0C8; line-height: 1.45; }
.enr-bad span { color: #F2B3A9; font-size: .9rem; }
.enr-form { display: grid; gap: 12px; }
.enr-spin { width: 40px; height: 40px; border-radius: 50%; border: 4px solid #3A3D44; border-top-color: #F86E16; animation: spin .8s linear infinite; justify-self: center; margin: 8px 0; }
.tm-users { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; } .tm-users li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }

/* ---------- §26.3 Неотправленные блюда и ошибка печати бегунка ---------- */
.unsent-list { margin: 8px 0; padding-left: 20px; display: grid; gap: 2px; }
.unsent-modal .modal-foot { flex-wrap: wrap; }
.kfail-host { position: fixed; z-index: 1100; left: 50%; transform: translateX(-50%); top: calc(8px + env(safe-area-inset-top)); width: min(640px, calc(100vw - 16px)); display: grid; gap: 6px; }
.kfail { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 12px; background: #C62828; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.35); border: 2px solid #8E1B1B; }
.kfail-ic { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #C62828; font-weight: 900; font-size: 1.3rem; display: grid; place-items: center; }
.kfail-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.kfail-t small { opacity: .9; font-size: .82rem; overflow-wrap: anywhere; }
.kfail-btn { appearance: none; flex: none; min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: #fff; color: #8E1B1B; font: inherit; font-weight: 800; cursor: pointer; }
.kfail-btn[disabled] { opacity: .7; }
.kfail-x { appearance: none; flex: none; width: 40px; height: 40px; border: 0; background: none; color: #fff; font-size: 1.5rem; cursor: pointer; border-radius: 8px; }
.kfail-btn:focus-visible, .kfail-x:focus-visible { outline: 3px solid #FFD54F; outline-offset: 2px; }
.kfail-inline { padding: 10px 12px; border-radius: 10px; background: #FDECEA; color: #8E1B1B; }
@media (max-width: 520px) { .kfail { flex-wrap: wrap; } .kfail-btn { width: 100%; order: 3; } }
.pct-grid .pct-100 { grid-column: 1 / -1; font-weight: 800; }

/* ---------- §27.6 Меню: фильтры и массовые действия ---------- */
.mb-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-bottom: 10px; }
.mb-filters .field { margin: 0; min-width: 150px; }
.mb-filters #mb-new { margin-left: auto; }
.mb-cats { position: relative; }
.mb-cats summary { list-style: none; cursor: pointer; min-width: 170px; display: flex; align-items: center; }
.mb-cats summary::-webkit-details-marker { display: none; }
.mb-cats-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 220px; max-height: 300px; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; box-shadow: var(--shadow-2); display: grid; gap: 2px; }
.mb-bar { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; margin-bottom: 8px; background: var(--ink); color: var(--surface); border-radius: 12px; }
.mb-bar b { margin-right: 8px; }
.mb-bar .btn { background: var(--surface); color: var(--ink); }
.mb-bar .btn-danger { color: var(--danger); }
.mb-t tr.row-sel td { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.mb-t td:first-child, .mb-t th:first-child { width: 40px; }
.mb-t input[type=checkbox] { width: 20px; height: 20px; }
.mb-price { border: 0; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; }
.olap-drill { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; } .olap-drill:hover { color: var(--brand-text, var(--brand)); }

/* ---------- §27.7 Подробный чек ---------- */
.modal.rv-modal { width: min(920px, calc(100vw - 24px)); }
.rv-head { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rv-head > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; }
.rv-head span { color: var(--muted); font-size: .8rem; }
.rv-st.paid { color: var(--ok, #1E7B34); } .rv-st.cancelled { color: var(--danger); }
.rv-cm { color: var(--brand-text, #A84A07); }
.rv-items tfoot .tot td { font-weight: 800; font-size: 1.05rem; }
.rv-pays { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rv-pays li { display: flex; gap: 10px; align-items: baseline; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.rv-pays li span { min-width: 120px; } .rv-pays small { color: var(--muted); margin-left: auto; }
.rv-tl { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line-strong); display: grid; gap: 8px; }
.rv-tl li { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding-left: 8px; }
.rv-tl li::before { content: ""; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--muted); }
.rv-tl time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.rv-tl li.ev-paid::before { border-color: var(--ok, #1E7B34); background: var(--ok, #1E7B34); }
.rv-tl li.ev-cancelled::before, .rv-tl li.ev-item_cancelled::before, .rv-tl li.ev-kitchen_print_error::before { border-color: var(--danger); background: var(--danger); }
.rv-tl li.ev-sent::before { border-color: var(--brand); }
.pr-man { display: grid; gap: 2px; margin-top: 4px; font-size: .8rem; color: var(--muted); } .pr-man input { width: 90px; }
.dc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; margin: 8px 0; } .dc-grid > div { display: grid; gap: 4px; } .dc-grid > div > span { color: var(--muted); font-size: .85rem; } .dc-grid b { font-size: 1.3rem; } .dc-grid small { color: var(--muted); } .pos { color: var(--ok, #1E7B34); } @media (max-width: 600px) { .dc-grid { grid-template-columns: 1fr; } } .pk-empty { visibility: hidden; }

/* ---------- §27.9 Руководства по ролям ---------- */
.guide-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.guide-intro { font-size: 1.05rem; color: var(--ink-2); }
.guide-sec { margin: 18px 0; }
.guide-sec h2 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 0 0 6px; }
.guide-n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #141414; display: grid; place-items: center; font-size: .95rem; }
.guide-sec ol { margin: 0; padding-left: 22px; display: grid; gap: 4px; line-height: 1.5; }
.guide-sec figure { margin: 10px 0 0; }
.guide-sec img { max-width: min(560px, 100%); height: auto; border: 1px solid var(--line); border-radius: 10px; }
.guide-sec figcaption { color: var(--muted); font-size: .85rem; }
.guide-card { border-left: 4px solid var(--brand); }
@media print {
  #print-area.guide-print .guide { page: a4doc; font: 11pt/1.45 Arial, sans-serif; color: #000; }
  #print-area.guide-print .guide-sec { break-inside: avoid; }
  #print-area.guide-print img { max-width: 120mm; border: 1px solid #999; }
  #print-area.guide-print .guide-n { background: #000; color: #fff; }
}
/* §56 демо-кафе: метка «ДЕМО» сверху по центру (не мешает нажатиям) */
.demo-badge { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 9999; pointer-events: none; display: flex; align-items: center; gap: 8px;
  padding: 3px 14px 4px; border-radius: 0 0 12px 12px; background: #FFC43D; color: #1A1200; font: 600 12px/18px system-ui, -apple-system, 'Segoe UI', sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.demo-badge b { font-size: 15px; letter-spacing: 1.5px; }
.demo-badge span { font-weight: 500; opacity: .8; }
@media (max-width: 600px) { .demo-badge span { display: none; } }
@media print { .demo-badge { display: none; } }
.demo-panel { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; border-left: 4px solid #FFC43D; }
.imp-bundle td b { font-weight: 600; }
