/* ---------- Шрифты (self-hosted) ---------- */
@font-face { font-family: "Golos Text"; font-weight: 400 700; font-display: swap; src: url("fonts/golos-text-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 400 700; font-display: swap; src: url("fonts/golos-text-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Golos Text"; font-weight: 400 700; font-display: swap; src: url("fonts/golos-text-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-weight: 400 700; font-display: swap; src: url("fonts/golos-text-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 700; font-display: swap; src: url("fonts/jetbrains-mono-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 700; font-display: swap; src: url("fonts/jetbrains-mono-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 700; font-display: swap; src: url("fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400 700; font-display: swap; src: url("fonts/jetbrains-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+20A0-20AB, U+20AD-20C0; }

/* ---------- Токены: «Рейка 2.0» — светлая (день) и тёмная (ночная смена) ---------- */
:root {
  /* сталь */
  --steel-950: #22272a;
  --steel-800: #353c40;
  --steel-600: #59626a;
  --steel-400: #9aa2a7;
  --steel-300: #b8bec2;
  --steel-100: #e3e7e9;
  /* термобумага */
  --paper: #ffffff;
  --paper-2: #f5f5f2;
  --paper-3: #ebebe6;
  --ink: #151515;
  --fade: #66665f;      /* 5.8:1 на белом */
  --ink-2: #353c40;     /* второстепенный, но плотный текст: примечания, подсказки, подписи */
  --rule: #d2d2cb;
  /* сигналы */
  --tomato: #d23a2e;    /* 4.7:1 с белым */
  --tomato-hover: #b9301f;
  --tomato-wash: #fdecea;
  --amber-ink: #8a5300;
  --amber-wash: #fbf5ea;
  --go: #2f6b45;
  --go-wash: #eef5f0;
  --on-signal: #ffffff; /* текст на томате и зелёном */
  /* шапка — графит в обеих темах */
  --shell-bg: #22272a;
  --shell-raise: #353c40;
  --shell-text: #b8bec2;
  --shell-strong: #ffffff;
  /* лист бумаги на стали: скругление, кромка, глубина */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --edge: rgba(34, 39, 42, .09);
  --shadow-sheet: 0 1px 2px rgba(34, 39, 42, .06), 0 6px 18px -8px rgba(34, 39, 42, .18);
  --shadow-pop: 0 2px 6px rgba(34, 39, 42, .08), 0 20px 44px -14px rgba(34, 39, 42, .38);
  --status-mute: 0%;    /* насколько приглушать цвета статусов (ночью — сильнее) */
  --status-ink: #151515; /* текст на строке цвета статуса */
  /* контролы внутри строки цвета статуса: светлые в обеих темах, чтобы читаться на пастели */
  --row-control: #ffffff;
  --row-line: rgba(21, 21, 21, .18);
  --row-warn: #8a5300;   /* «Не оплачен» на пастели */
  --row-danger: #c2352a; /* корзина удаления на пастели */

  --font: "Golos Text", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --t-xs: 12px; --t-sm: 13px; --t-md: 14px; --t-lg: 16px; --t-xl: 20px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.4;
  color: var(--ink);
  background: var(--steel-100);
  accent-color: var(--ink);
  color-scheme: light;
}
/* Ночная смена: воронёная сталь и графитовые листы, чернила — тёплая бумага.
   Цвета статусов Frontpad остаются узнаваемыми, но приглушены, чтобы не слепить в 3 часа ночи. */
:root[data-theme="dark"] {
  --steel-950: #0c0f11;
  --steel-800: #262c30;
  --steel-600: #8e989e;
  --steel-400: #59636a;
  --steel-300: #434c52;
  --steel-100: #121619;
  --paper: #1b2024;
  --paper-2: #222930;
  --paper-3: #2b333a;
  --ink: #ece8df;
  --fade: #a2a69f;      /* 6.9:1 на листе */
  --ink-2: #cdc9c0;
  --rule: #353e45;
  --tomato: #e5493c;    /* 4.6:1 с белым */
  --tomato-hover: #f05b4e;
  --tomato-wash: #3a1f1c;
  --amber-ink: #e2a84f;
  --amber-wash: #2f2617;
  --go: #6cc28e;
  --go-wash: #18291f;
  --on-signal: #ffffff;
  --shell-bg: #0c0f11;
  --shell-raise: #1f2529;
  --shell-text: #9aa3a9;
  --shell-strong: #f3f1ec;
  --edge: rgba(255, 255, 255, .06);
  --shadow-sheet: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 22px -10px rgba(0, 0, 0, .6);
  --shadow-pop: 0 2px 6px rgba(0, 0, 0, .45), 0 22px 48px -14px rgba(0, 0, 0, .75);
  --status-mute: 15%;
  --status-ink: #121518;
  --row-control: #e4dfd4; /* ночью — тёплая бумага, а не белый свет */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; min-width: 360px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input, textarea { caret-color: var(--tomato); }
* { scrollbar-width: thin; scrollbar-color: var(--steel-400) transparent; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.fade { color: var(--fade); }
kbd { font-family: var(--mono); font-size: var(--t-xs); line-height: 1; padding: 3px 5px; border: 1px solid currentColor; }

/* ---------- Верхнее меню (как во Frontpad: значок над подписью) ---------- */
.shell { flex: none; height: 54px; background: var(--shell-bg); color: var(--shell-strong); display: flex; align-items: stretch; padding: 0 var(--s3); }
.shell-nav { display: flex; }
.shell-link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0 var(--s4); color: var(--shell-text); font-size: var(--t-xs); font-weight: 500; transition: color .15s var(--ease), background .15s var(--ease); }
.shell-link svg { width: 20px; height: 20px; }
.shell-link:hover { color: var(--shell-strong); background: var(--shell-raise); }
.shell-link[aria-current="page"] { color: var(--shell-strong); background: var(--shell-raise); }
.shell-link[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--shell-strong); }
.shell-link.right { margin-left: auto; }
.count { position: absolute; top: 5px; right: 6px; font-family: var(--mono); font-size: var(--t-xs); min-width: 20px; padding: 1px 5px; text-align: center; color: #fff; }
.count.late { background: var(--tomato); }
.rail { flex: none; height: 8px; background: var(--steel-400); border-bottom: 2px solid var(--steel-600); }

/* ---------- Новый заказ: корзина | категории | товары ---------- */
.front { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px 130px minmax(0, 1fr); gap: var(--s2); padding: var(--s3); }

.bill { background: var(--paper); display: flex; flex-direction: column; min-height: 0; box-shadow: 0 1px 0 var(--steel-400); }
.edit-banner { background: var(--paper-3); padding: var(--s2) var(--s3); font-weight: 600; }
.tabs { display: flex; gap: 2px; padding: 6px 0 0 var(--s4); background: var(--steel-100); }
.tabs button { min-width: 96px; height: 32px; padding: 0 var(--s3); background: var(--steel-600); color: #fff; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s var(--ease); }
.tabs button:hover { background: var(--steel-800); }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tomato); }
.tab-body { flex: 1; min-height: 0; overflow: auto; }

/* Корзина-таблица */
.cart { width: 100%; border-collapse: collapse; }
.cart th { text-align: left; font-weight: 600; padding: 10px var(--s2); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.cart td { padding: 8px var(--s2); border-bottom: 1px dashed var(--rule); vertical-align: middle; }
.cart .c { text-align: center; }
.cart .r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cart .r .num, .cart tbody td.r:not(:last-child) { white-space: nowrap; }
.cart .r .cur { white-space: nowrap; font-family: var(--font); }
.cart th.r { font-family: var(--font); }
.cart .name { overflow-wrap: anywhere; }
.cart .note { display: block; font-size: var(--t-xs); color: var(--fade); }
.cart tr.auto td { color: var(--fade); }
.cart tr.added td { animation: ink-in .5s var(--ease); }
@keyframes ink-in { from { background: var(--paper-3); } to { background: transparent; } }
.cart tfoot td { border-bottom: 1px solid var(--rule); }
.cart tfoot tr.b td { font-weight: 700; }
.cart tfoot .applied { display: inline-flex; align-items: center; gap: 4px; }
.cart tfoot .applied button { width: 20px; height: 20px; display: grid; place-items: center; color: var(--fade); }
.cart tfoot .applied button:hover { background: var(--ink); color: var(--paper); }
.cart tfoot .applied svg { width: 13px; height: 13px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; }
.stepper button { width: 26px; height: 26px; display: grid; place-items: center; color: var(--ink); }
.stepper button:hover { background: var(--paper-3); }
.stepper svg { width: 18px; height: 18px; stroke-width: 2.2; }
.stepper input { width: 36px; height: 26px; border: 1px solid var(--rule); text-align: center; font-family: var(--mono); padding: 0; }
.empty { color: var(--fade); text-align: center; padding: var(--s6) var(--s4); margin: 0; }

/* Детали и Отметки: подпись слева, поле справа */
.form { width: 100%; border-collapse: collapse; margin-top: var(--s2); }
.form th { width: 92px; text-align: left; font-weight: 500; padding: 5px var(--s2) 5px var(--s4); vertical-align: middle; line-height: 1.2; }
.form th.top { vertical-align: top; padding-top: 10px; }
.form td { padding: 5px var(--s4) 5px var(--s2); }
.form tr.hl { background: var(--paper-2); }
.form input, .form select, .form textarea { width: 100%; height: 32px; border: 1px solid var(--rule); padding: 0 var(--s2); background: var(--paper); transition: border-color .15s var(--ease); }
.form textarea { height: auto; padding: 6px var(--s2); resize: vertical; }
.form input:hover, .form select:hover, .form textarea:hover { border-color: var(--steel-400); }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.form input.short { width: 64px; }
.form select.mid { width: 160px; }
.client-info { font-size: var(--t-xs); padding-top: 0 !important; color: var(--go); }
.tag-list { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tag { padding: 6px var(--s3); background: var(--paper-3); border: 1px solid transparent; transition: background .15s var(--ease); }
.tag:hover { border-color: var(--steel-400); }
.tag[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.invalid { border-color: var(--tomato) !important; background: var(--tomato-wash) !important; }

/* Низ корзины */
.bill-foot { flex: none; border-top: 1px dashed var(--steel-400); padding: var(--s2) var(--s3) var(--s3); }
.msgs { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.msgs .err { color: var(--tomato); }
.msgs .warn { color: var(--amber-ink); }
.to-pay { text-align: right; font-size: var(--t-lg); margin: var(--s2) 0 var(--s3); }
.to-pay b { font-size: var(--t-xl); }
.bill-actions { display: flex; align-items: center; gap: var(--s2); }
.spacer { flex: 1; }
.tool { height: 36px; min-width: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); transition: border-color .15s var(--ease), background .15s var(--ease); }
.tool:hover { border-color: var(--ink); }
.tool.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tool.score { font-size: var(--t-sm); }
.save { height: 36px; min-width: 120px; padding: 0 var(--s4); background: var(--tomato); color: var(--on-signal); font-weight: 700; transition: background .15s var(--ease), transform .1s var(--ease); }
.save:hover:not(:disabled) { background: var(--tomato-hover); }
.save:active:not(:disabled) { transform: scale(.98); }
.save:disabled { background: var(--steel-300); color: var(--ink-2); cursor: default; }

/* Категории */
.cats { display: flex; flex-direction: column; gap: 4px; overflow: auto; min-height: 0; }
.cat { min-height: 44px; padding: 6px var(--s2); text-align: center; background: var(--paper); font-size: var(--t-sm); font-weight: 500; line-height: 1.2; transition: background .15s var(--ease); }
.cat:hover { background: var(--paper-3); }
.cat[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Товары */
.goods { background: var(--paper); min-height: 0; overflow: auto; padding: var(--s2); }
.goods-top { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.search { flex: 0 1 320px; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s2); background: var(--paper-2); border: 1px solid transparent; color: var(--fade); }
.search:focus-within { border-color: var(--ink); color: var(--ink); }
.search svg { width: 16px; height: 16px; }
.search input { flex: 1; border: 0; outline: 0; background: none; height: 100%; min-width: 0; font-size: var(--t-sm); }
.link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--fade); font-size: var(--t-sm); }
.link:hover { color: var(--ink); }
.link svg { width: 15px; height: 15px; }
.goods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; }
.good { position: relative; min-height: 58px; padding: 6px; display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 4px; text-align: center; background: var(--paper-3); font-size: var(--t-xs); line-height: 1.2; transition: background .15s var(--ease); }
.good:hover { background: var(--steel-300); }
.good:active { transform: scale(.98); }
.good .price { font-family: var(--mono); font-weight: 700; font-size: var(--t-sm); }
.good { min-width: 0; }
.good > span:first-child { max-width: 100%; overflow-wrap: anywhere; } /* название без пробелов не вылезает на соседнюю плитку */
.good .price small { font-family: var(--font); font-weight: 400; }
.goods-empty { color: var(--fade); padding: var(--s4); }

/* ---------- Всплывающие списки (%, ⋯, Счёт) ---------- */
.pop { position: fixed; z-index: 30; background: var(--paper); border: 1px solid var(--steel-400); box-shadow: 0 12px 28px -8px rgba(34, 39, 42, .35); display: flex; max-height: 70vh; animation: pop-in .18s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } }
.pop .col-list { overflow: auto; min-width: 104px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; }
.pop .col-list:last-child { border-right: 0; }
.pop .item { padding: 7px var(--s3); text-align: center; white-space: nowrap; }
.pop .item:hover, .pop .item:focus-visible { background: var(--paper-2); }
.pop .item.selected { background: var(--ink); color: var(--paper); }
.pop .item.head { font-weight: 600; }
.pop .form-pop { padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); min-width: 230px; }
.pop .form-pop input { height: 32px; border: 1px solid var(--rule); padding: 0 var(--s2); font-family: var(--mono); }
.pop h3 { margin: 0; font-size: var(--t-xs); font-weight: 600; color: var(--fade); }
.btn { height: 32px; padding: 0 var(--s3); border: 1px solid var(--rule); background: var(--paper); font-weight: 500; }
.btn:hover { border-color: var(--ink); }
.btn.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.danger { background: var(--tomato); color: var(--on-signal); border-color: var(--tomato); }
.keys { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px var(--s3); font-size: var(--t-sm); }
.keys dt { text-align: right; }
.keys dd { margin: 0; }

/* Модальное окно (расчёт сдачи, очистка) — как во Frontpad */
.modal-back { position: fixed; inset: 0; background: rgba(34, 39, 42, .45); display: grid; place-items: center; z-index: 40; }
.modal { background: var(--paper); padding: var(--s4) var(--s5) var(--s5); min-width: 320px; animation: pop-in .18s var(--ease); }
.modal h2 { margin: 0 0 var(--s3); font-size: var(--t-lg); text-align: center; }
.modal p { text-align: center; margin: 0 0 var(--s3); }
.modal .big { width: 100%; height: 42px; font-family: var(--mono); font-size: var(--t-xl); text-align: center; border: 1px solid var(--ink); }
.modal .pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: var(--s3) 0; }
.modal .pad button { height: 40px; background: var(--paper-3); font-family: var(--mono); font-weight: 600; }
.modal .pad button:hover { background: var(--steel-300); }
.modal .pad .wide { grid-column: span 2; font-family: var(--font); font-weight: 500; }
.modal .change { text-align: center; font-family: var(--mono); min-height: 1.4em; }
.modal .buttons { display: flex; justify-content: center; gap: var(--s2); margin-top: var(--s3); }
.modal .buttons .save { min-width: 140px; }

/* ---------- Заказы: список, как во Frontpad ---------- */
.orders { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: var(--s3); gap: var(--s2); }
.orders-top { display: flex; align-items: center; gap: var(--s3); }
.summary { margin: 0; display: flex; background: var(--paper); }
.summary div { padding: 6px var(--s3); border-right: 1px solid var(--rule); }
.summary div:last-child { border-right: 0; }
.summary dt { display: inline; }
.summary dd { display: inline; margin: 0 0 0 4px; font-family: var(--mono); font-weight: 700; }
.summary .late dd { color: var(--tomato); }
.seg { display: inline-flex; border: 1px solid var(--steel-300); padding: 2px; gap: 2px; background: var(--paper); margin-left: auto; }
.seg button { padding: 4px 10px; color: var(--fade); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.seg svg { width: 16px; height: 16px; }

.list-wrap { flex: 1; min-height: 0; overflow: auto; }
.olist { width: 100%; border-collapse: separate; border-spacing: 0; }
.olist .c-items { width: 26%; } .olist .c-sum { width: 80px; } .olist .c-pct { width: 44px; } .olist .c-pay { width: 150px; }
.olist .c-point { width: 15%; } .olist .c-phone { width: 170px; }
.olist thead th { position: sticky; top: 0; z-index: 2; background: var(--paper); padding: 6px var(--s2); text-align: left; font-weight: 600; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.olist thead select { height: 28px; border: 1px solid var(--rule); background: var(--paper-2); font-weight: 400; max-width: 100%; }
.olist .r { text-align: right; }
.order-gap td { height: var(--s2); padding: 0; background: transparent; }
.order-head td { background: var(--st, var(--paper-3)); color: var(--st-text, var(--ink)); padding: 6px var(--s2); }
.order-head .when { font-family: var(--mono); font-weight: 700; font-size: var(--t-lg); margin-right: 6px; }
.order-head .when small { font-weight: 400; font-size: var(--t-sm); }
.order-head .mini { height: 26px; padding: 0 var(--s2); margin-left: 4px; background: var(--paper); color: var(--ink); border: 1px solid rgba(21, 21, 21, .2); font-size: var(--t-sm); }
.order-head .mini:hover { border-color: var(--ink); }
.order-head .timer-cell { white-space: nowrap; }
.order-head .status-cell { text-align: right; }
.order-head select { height: 28px; min-width: 190px; border: 1px solid rgba(21, 21, 21, .25); background: var(--paper); color: var(--ink); }
.order-body td { background: var(--tint, var(--paper)); padding: var(--s2); vertical-align: top; border-bottom: 1px solid rgba(21, 21, 21, .12); }
.order-body .items { list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); }
.order-body .items li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.order-body .items li span:not(:first-child) { text-align: right; font-family: var(--mono); white-space: nowrap; }
.order-body .items li span:first-child { overflow-wrap: anywhere; }
.order-body .show { color: var(--ink); text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 3px; }
.order-body .sum { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.order-body select { height: 28px; width: 100%; border: 1px solid rgba(21, 21, 21, .25); background: var(--paper); }
.order-body .addr { font-style: italic; }
.order-body .tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--t-xs); font-style: italic; }
.order-body .phone { font-family: var(--mono); white-space: nowrap; }
.order-body .hist { margin-top: 6px; font-size: var(--t-xs); }
.olist .empty-row td { background: var(--paper); text-align: center; color: var(--fade); padding: var(--s6); }

/* Таймер по нормативу статуса: серый → чёрный → красный */
.timer { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 var(--s2); font-family: var(--mono); font-size: var(--t-sm); background: var(--paper); color: var(--ink); border: 1px solid rgba(21, 21, 21, .15); }
.timer svg { width: 14px; height: 14px; }
.timer.warm { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.timer.late { background: var(--tomato); color: var(--on-signal); border-color: var(--tomato); font-weight: 700; }
.timer.none { background: transparent; border-color: transparent; }
.timer.pre { background: var(--paper-2); color: var(--ink-2); border-style: dashed; } /* предзаказ ещё не наступил */

/* ---------- Рейка (дополнительный вид) ---------- */
.board { flex: 1; min-height: 0; display: flex; gap: var(--s2); overflow-x: auto; }
.col { flex: 1 1 0; min-width: 170px; display: flex; flex-direction: column; min-height: 0; }
.col.is-empty { flex: 0 0 112px; min-width: 0; }
.col-head { display: flex; align-items: flex-end; gap: 6px; height: 40px; padding-bottom: 6px; font-weight: 600; line-height: 1.2; }
.col-head .cnt { font-family: var(--mono); font-weight: 400; font-size: var(--t-xs); color: var(--steel-600); }
.col-rail { height: 8px; background: var(--steel-400); border-bottom: 2px solid var(--steel-600); }
.col-body { flex: 1; min-height: 0; overflow: auto; padding-bottom: var(--s2); }
.stack { display: flex; flex-direction: column; gap: 12px; background: linear-gradient(var(--steel-400), var(--steel-400)) 50% 0 / 2px calc(100% - 28px) no-repeat; }
.col-empty { color: var(--steel-600); font-size: var(--t-sm); padding: var(--s2) 2px; margin: 0; }
.chit { flex: none; background: var(--paper); position: relative; padding: 16px 10px 18px; display: flex; flex-direction: column; gap: 6px; font-size: var(--t-sm); }
.chit::before { content: ""; position: absolute; top: 0; left: 50%; width: 30px; height: 7px; margin-left: -15px; background: var(--st, var(--steel-600)); box-shadow: inset 0 0 0 1px rgba(21, 21, 21, .25); }
.chit-top { display: flex; justify-content: space-between; align-items: baseline; }
.chit-no { font-family: var(--mono); font-weight: 700; font-size: var(--t-lg); }
.chit .go { min-height: 30px; padding: 4px var(--s2); text-align: left; font-size: var(--t-xs); font-weight: 600; background: var(--to, var(--ink)); color: var(--to-text, var(--paper)); border: 1px solid rgba(21, 21, 21, .2); }
.mark { display: inline-block; width: 10px; height: 10px; flex: none; background: var(--st, var(--steel-600)); box-shadow: inset 0 0 0 1px rgba(21, 21, 21, .25); margin-bottom: 3px; }

/* Перфорированная нижняя кромка у чеков на рейке */
.chit {
  -webkit-mask: radial-gradient(circle 4px at 50% 100%, transparent 96%, var(--ink)) 0 0 / 12px 100% repeat-x;
          mask: radial-gradient(circle 4px at 50% 100%, transparent 96%, var(--ink)) 0 0 / 12px 100% repeat-x;
}

.toast { position: fixed; bottom: var(--s5); left: 50%; transform: translateX(-50%); background: var(--steel-950); color: #fff; padding: 10px var(--s4); z-index: 50; animation: pop-in .2s var(--ease); }

/* ---------- Узкие экраны ---------- */
@media (max-width: 1100px) {
  .front { grid-template-columns: 360px 110px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .front { grid-template-columns: minmax(0, 1fr); overflow: auto; padding: var(--s2); }
  .bill { min-height: 70vh; }
  .cats { flex-direction: row; overflow-x: auto; }
  .cat { flex: none; min-width: 96px; }
  .goods { overflow: visible; }
  .shell-link { padding: 0 var(--s2); }
  .orders-top { flex-wrap: wrap; }
  .olist { min-width: 900px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.chit .go { display: inline-flex; align-items: center; gap: 4px; } .chit .go svg { width: 14px; height: 14px; } .chit select { height: 28px; border: 1px solid var(--rule); background: var(--paper); }

/* ---------- Справочники ---------- */
.dict-menu { position: fixed; z-index: 35; min-width: 240px; max-height: calc(100vh - 70px); overflow: auto; background: var(--steel-950); padding: 4px 0; display: flex; flex-direction: column; box-shadow: 0 12px 28px -8px rgba(34, 39, 42, .5); animation: pop-in .15s var(--ease); }
.dict-item { text-align: left; padding: 9px var(--s4); color: var(--steel-300); font-size: var(--t-sm); }
.dict-item:hover, .dict-item:focus-visible { background: var(--shell-raise); color: var(--shell-strong); outline: none; }
.dict-item.on { color: var(--shell-strong); font-weight: 600; }

.dict { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); }
.dict-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.dict-top h1 { margin: 0 var(--s2) 0 0; font-size: var(--t-xl); font-weight: 700; }
.dict-top select { height: 32px; border: 1px solid var(--rule); background: var(--paper); padding: 0 var(--s2); }
.dict-top .search { flex: 0 1 280px; height: 32px; background: var(--paper); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); cursor: pointer; }
.dict-note { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.dict-wrap { flex: 1; min-height: 0; overflow: auto; background: var(--paper); }
.dtable { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.dtable th { position: sticky; top: 0; z-index: 1; background: var(--paper); text-align: left; font-weight: 600; padding: 9px var(--s3); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.dtable td { padding: 8px var(--s3); border-bottom: 1px dashed var(--rule); vertical-align: middle; }
.dtable .r { text-align: right; }
.dtable .c { text-align: center; }
.dtable .n { width: 56px; color: var(--fade); }
.dtable tbody tr { cursor: pointer; }
.dtable tbody tr:hover td, .dtable tbody tr:focus-visible td { background: var(--paper-2); }
.dtable tbody tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.dtable .empty-row td { cursor: default; text-align: center; color: var(--fade); padding: var(--s6); background: var(--paper); }
.dtable .yes { display: inline-grid; place-items: center; }
.dtable .yes svg { width: 16px; height: 16px; stroke-width: 2.4; }
.swatch { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; box-shadow: inset 0 0 0 1px rgba(21, 21, 21, .25); }

/* Карточка записи (как всплывающее окно Frontpad) */
.modal.wide { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.modal.wide .dform-wrap { overflow: auto; margin: 0 calc(var(--s5) * -1); padding: 0 var(--s5); }
.dform { margin-top: 0; }
.dform th { width: 190px; padding-left: 0; }
.dform td { padding-right: 0; }
.dform .req { color: var(--tomato); margin-left: 2px; }
.dform input[type="checkbox"] { width: 18px; height: 18px; }
.dform input.short, .dform select.short { width: 140px; }
.dform input[type="date"] { width: 180px; }
.dform .ro { display: inline-block; padding: 6px 0; }
.dform .hint { font-size: var(--t-xs); color: var(--fade); margin-top: 3px; }
.ferr { color: var(--tomato); font-size: var(--t-xs); min-height: 0; }
.ferr:empty { display: none; }
.color-field { display: inline-flex; gap: var(--s2); align-items: center; }
.color-field input[type="color"] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--rule); background: var(--paper); }
.btn.danger-outline { color: var(--tomato); border-color: var(--tomato); }
.btn.danger-outline:hover { background: var(--tomato-wash); }
.btn svg { width: 16px; height: 16px; }
.btn { display: inline-flex; align-items: center; gap: 4px; }

/* Расписание курьеров */
.sched { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--s2); }
.sched-bar { display: flex; gap: var(--s2); align-items: center; }
.sched-grid { background: var(--paper); }
.sched-grid tbody tr { cursor: default; }
.sched-grid tbody tr:hover td { background: transparent; }
.sched-grid th.today, .sched-grid td.today { background: var(--paper-2); }
.shift { display: inline-flex; align-items: center; gap: 2px; }
.shift input { width: 86px; height: 28px; border: 1px solid var(--rule); font-family: var(--mono); font-size: var(--t-xs); padding: 0 4px; }

/* Товар в стоп-листе на экране заказа */
.good.stop { background: var(--paper-2); color: var(--fade); cursor: not-allowed; }
.good.stop:hover { background: var(--paper-2); }
.stop-label { font-size: var(--t-xs); font-weight: 600; color: var(--tomato); }

/* ---------- Склад ---------- */
.doc { flex: 1; min-height: 0; display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: var(--s3); }
.doc-head { background: var(--paper); padding: var(--s3) var(--s4); align-self: start; }
.doc-body { background: var(--paper); padding: var(--s3); min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--s2); }
.add-row { display: flex; gap: var(--s2); }
.doc-lines td { cursor: default; }
.doc-lines tbody tr:hover td { background: transparent; }
.doc-lines tfoot td { border-bottom: 0; padding-top: var(--s3); }
.qty-in { width: 96px; height: 30px; border: 1px solid var(--rule); padding: 0 var(--s2); text-align: right; background: var(--paper); }
.qty-in:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.unit { display: inline-block; min-width: 28px; margin-left: 6px; text-align: left; font-size: var(--t-xs); }
.icon-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; color: var(--fade); }
.icon-btn:hover { background: var(--paper-3); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.picker { width: 340px; }
.picker input[type="search"] { height: 32px; border: 1px solid var(--rule); padding: 0 var(--s2); font-family: var(--font); }
.pick-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; margin: 0 calc(var(--s3) * -1); }
.pick-list .pick { display: flex; justify-content: space-between; gap: var(--s3); text-align: left; padding: 7px var(--s3); }
.pick-list .pick:hover, .pick-list .pick:focus-visible { background: var(--paper-2); outline: none; }
.dtable tr.low td { background: color-mix(in srgb, var(--amber-ink) 10%, var(--paper)); }
.dtable tr.neg td { background: var(--tomato-wash); }
.dtable tr.neg td b { color: var(--tomato); }
.warn-text { color: var(--amber-ink); }
.recipe select { width: 100%; height: 30px; border: 1px solid var(--rule); background: var(--paper); }
.dict-top input[type="date"] { height: 32px; border: 1px solid var(--rule); background: var(--paper); padding: 0 6px; margin-left: 4px; }
.spacer { flex: 1; }
@media (max-width: 1000px) { .doc { grid-template-columns: minmax(0, 1fr); } }
.dtable td.r, .dtable .mono { white-space: nowrap; }
.doc { align-content: start; }
@media (max-width: 1000px) { .doc { overflow: auto; } .doc-body { overflow: visible; } }

/* ---------- Деньги ---------- */
.btn.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.period { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s1); }
.period input { height: 30px; border: 1px solid var(--rule); padding: 0 6px; margin-left: 4px; }
.period .buttons { display: flex; gap: var(--s2); }
.cash-head { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--s3); }
.shift-tag { background: var(--paper); padding: var(--s2) var(--s3); display: flex; align-items: center; gap: 6px; font-size: var(--t-sm); }
.cash-sum { background: var(--paper); border-collapse: collapse; font-size: var(--t-sm); }
.cash-sum th { text-align: left; padding: 6px var(--s3); font-weight: 700; }
.cash-sum td { padding: 6px var(--s2); white-space: nowrap; }
.cash-sum td.lbl { color: var(--fade); border-left: 1px solid var(--rule); padding-left: var(--s3); }
.cash-sum td.end { font-weight: 700; }
.cash-sum .kop { color: var(--steel-400); }
.dtable tr.static td { cursor: default; }
.dtable tr.static:hover td { background: transparent; }
.dtable td.note { font-size: var(--t-xs); font-style: italic; color: var(--ink-2); max-width: 520px; }
.op { display: inline-grid; place-items: center; }
.op svg { width: 18px; height: 18px; stroke-width: 2.4; }
.op.in { color: var(--go); }
.op.out { color: var(--amber-ink); }
.op.sale { font-size: var(--t-xs); color: var(--fade); }
.icon-btn.del:hover { color: var(--tomato); background: var(--tomato-wash); }
.tlink { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--steel-300); text-underline-offset: 3px; padding: 0; text-align: left; }
.tlink:hover { color: var(--ink); text-decoration-color: var(--ink); }
.tlink.warn { color: var(--amber-ink); text-decoration-color: currentColor; }
.linkish { text-decoration: underline; text-decoration-color: var(--steel-300); text-underline-offset: 3px; }
.paid { display: inline-flex; align-items: center; gap: 3px; color: var(--go); font-size: var(--t-xs); }
.paid svg { width: 14px; height: 14px; }
.dtable tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); padding-top: var(--s2); }
.dtable tr.subtotal td { background: var(--paper-2); font-weight: 600; }
.dtable td.b { font-weight: 700; }
.dtable td.rest { color: var(--amber-ink); }
.dform .inline { display: flex; align-items: center; gap: var(--s2); }
.dform .hint-row { padding: 0 0 var(--s2); color: var(--ink-2); }
.salary-who { background: var(--paper); padding: var(--s2) var(--s3); font-size: var(--t-md); }
.salary-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.salary-col { background: var(--paper); padding: var(--s3); overflow: auto; display: flex; flex-direction: column; gap: var(--s2); }
.salary-col .col-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--t-md); }
.salary-col .col-head > span:first-child { margin-right: auto; }
@media (max-width: 1000px) { .salary-cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Статистика ---------- */
.seg { display: inline-flex; border: 1px solid var(--rule); background: var(--paper); }
.seg button { height: 30px; padding: 0 var(--s3); font-size: var(--t-sm); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--paper-2); }
.seg button.on { background: var(--ink); color: var(--paper); }
.reports { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--s3); }
.rep-nav { background: var(--paper); overflow: auto; display: flex; flex-direction: column; padding: var(--s2) 0; }
.rep-group { font-weight: 700; font-size: var(--t-sm); padding: var(--s3) var(--s4) var(--s1); }
.rep-item { text-align: left; padding: 6px var(--s4) 6px var(--s5); font-size: var(--t-sm); }
.rep-item:hover:not(:disabled) { background: var(--paper-2); }
.rep-item.on { background: var(--ink); color: var(--paper); }
.rep-item:disabled { color: var(--steel-400); cursor: not-allowed; }
.rep-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: var(--s2); }
.rep-head { display: flex; align-items: center; gap: var(--s3); }
.rep-head h1 { margin: 0; font-size: var(--t-xl); }
.rep-filters { background: var(--paper); padding: var(--s3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); font-size: var(--t-sm); }
.rep-filters select, .rep-filters input[type="datetime-local"] { height: 30px; border: 1px solid var(--rule); background: var(--paper); padding: 0 6px; }
.rep-filters .check { display: inline-flex; align-items: center; gap: 6px; }
.rep-err { color: var(--tomato); font-size: var(--t-sm); }
.rep-err:empty { display: none; }
.rep-out { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rep-note { padding: var(--s2) var(--s3); }
.dtable.report tr.lv0 td { font-weight: 700; background: var(--paper-2); }
.dtable.report tr.lv2 td:first-child { padding-left: var(--s6); }
.dtable.report tr.strong td { font-weight: 700; }
.dtable.report tr.accent td { border-top: 2px solid var(--ink); }
.abc { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 8px; font-size: 11px; font-weight: 700; font-family: var(--font); }
.abc-A { background: var(--go); color: #fff; }
.abc-B { background: var(--amber-ink); color: #fff; }
.abc-C { background: var(--steel-300); color: var(--ink); }
.dtable.tsheet th, .dtable.tsheet td { padding: 4px 2px; }
.dtable.tsheet th:first-child, .dtable.tsheet td.who { padding-left: var(--s3); white-space: nowrap; min-width: 140px; }
.dtable.tsheet .wk { background: var(--paper-2); }
.ts-cell { width: 100%; min-width: 30px; height: 26px; font-family: var(--mono); font-size: 11px; color: var(--ink); }
.ts-cell:hover { background: var(--paper-3); }
.ts-cell.on { background: color-mix(in srgb, var(--go) 14%, var(--paper)); }
@media (max-width: 1000px) { .reports { grid-template-columns: minmax(0, 1fr); } }
@media print { .shell, .rail, .rep-nav, .rep-filters, .rep-head button { display: none !important; } .reports { display: block; } }

/* ---------- Сводка: палитра показателей (проверена валидатором dataviz) ---------- */
:root {
  --viz-revenue: #2a78d6;   /* выручка — синий */
  --viz-orders: #1baf7a;    /* заказы и товары — бирюзовый */
  --viz-avg: #6250d6;       /* средний чек — фиолетовый */
  --viz-clients: #e87ba4;   /* клиенты — розовый */
  --viz-purchases: #eb6834; /* закупки — оранжевый */
  --viz-costs: #eda100;     /* прочие расходы — жёлтый */
}
.stat-sum { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--s3); }
.tiles { display: grid; grid-template-columns: 170px repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); }
.tiles-title { background: var(--ink); color: var(--paper); padding: var(--s3) var(--s4); display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.tiles-title b { font-size: var(--t-xl); line-height: 1.15; }
.tiles-title span { font-size: var(--t-xs); color: var(--steel-300); }
.tile { --c: var(--ink); position: relative; background: var(--paper); padding: var(--s4) var(--s4) var(--s3); display: flex; flex-direction: column; gap: 4px;  overflow: hidden; }
.tile-l { font-size: var(--t-xs); color: var(--fade); }
.tile-v { font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-xs); font-weight: 600; }
.delta svg { width: 13px; height: 13px; stroke-width: 2.4; }
.delta.up { color: var(--go); }
.delta.down { color: var(--amber-ink); }
.delta.flat { color: var(--fade); font-weight: 500; }
.spark { width: 100%; height: 34px; margin-top: 4px; display: block; }
.spark-area { opacity: .12; }
.spark-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { stroke: var(--paper); stroke-width: 2; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.card { background: var(--paper); padding: var(--s3) var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.card.wide, .card-tools.wide { grid-column: 1 / -1; }
.card-tools { display: flex; justify-content: flex-end; }
.card header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.card h2 { margin: 0; font-size: var(--t-md); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.card .key { width: 10px; height: 10px; display: inline-block; }
.card .total { font-size: var(--t-lg); font-weight: 700; }
.card .empty { margin: var(--s4) 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart *, .spark * { stroke: none; }  /* общее правило иконок (обводка) графикам не нужно */
.chart .grid { stroke: var(--paper-3); stroke-width: 1; }
.chart .base { stroke: var(--steel-300); stroke-width: 1; }
.chart .axis { font-size: 10px; fill: var(--fade); font-family: var(--mono); }
.chart .peak { font-size: 11px; font-weight: 700; fill: var(--ink); font-family: var(--mono); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow .5s var(--ease) both; transition: opacity .15s var(--ease); }
.chart.hovering .bar { opacity: .4; }
.chart.hovering .bar.on { opacity: 1; }
@keyframes grow { from { transform: scaleY(0); } }
.viz-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink); color: var(--paper); padding: var(--s2) var(--s3); font-size: var(--t-xs); min-width: 150px; display: flex; flex-direction: column; gap: 3px; }
.viz-tip .head { font-weight: 700; margin-bottom: 2px; }
.viz-tip .row { display: flex; justify-content: space-between; gap: var(--s3); color: var(--steel-300); }
.viz-tip .row b { color: var(--paper); }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 22px 150px minmax(0, 1fr) 44px; align-items: center; gap: var(--s2); font-size: var(--t-sm); }
.hb-n { color: var(--fade); font-size: var(--t-xs); }
.hbar:nth-child(-n+3) .hb-n { color: var(--paper); background: var(--ink); text-align: center; font-weight: 700; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 12px; background: var(--paper-2); }
.hb-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; transform-origin: left; animation: growx .5s var(--ease) both; animation-delay: var(--d); }
@keyframes growx { from { transform: scaleX(0); } }
.hb-v { text-align: right; font-weight: 700; }
.donut-wrap { display: flex; align-items: center; gap: var(--s5); padding: var(--s1) 0; }
.donut-box { position: relative; width: 150px; height: 150px; flex: none; }
.donut { width: 100%; height: 100%; border-radius: 50%; -webkit-mask: radial-gradient(circle, transparent 58%, #000 59%); mask: radial-gradient(circle, transparent 58%, #000 59%); animation: spin-in .6s var(--ease) both; }
@keyframes spin-in { from { transform: rotate(-90deg); opacity: 0; } }
.donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-c b { font-size: 30px; line-height: 1; }
.donut-c span { font-size: var(--t-xs); color: var(--fade); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: var(--t-sm); min-width: 0; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.legend .sw { width: 12px; height: 12px; display: inline-block; }
@media (prefers-reduced-motion: reduce) { .chart .bar, .hb-fill, .donut { animation: none; } }
@media (max-width: 1000px) { .cards { grid-template-columns: minmax(0, 1fr); } .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tiles-title { grid-column: 1 / -1; } }

/* ---------- Настройки ---------- */
.dict-item .soon { margin-left: auto; font-size: 11px; color: var(--steel-400); }
.dict-item:disabled { color: var(--steel-400); cursor: not-allowed; display: flex; gap: var(--s2); }
.settings-wrap { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: minmax(0, 720px); gap: var(--s3); align-items: start; }
.settings-wrap.with-sample { grid-template-columns: minmax(0, 620px) minmax(300px, 1fr); }
.settings-card { background: var(--paper); padding: var(--s3) var(--s5) var(--s4); }
.settings-card h2 { margin: 0 0 var(--s2); font-size: var(--t-md); }
.settings-form tr.grp th { padding-top: var(--s4); font-size: var(--t-md); font-weight: 700; border-bottom: 2px solid var(--ink); }
.settings-form th { width: 280px; }
.sample { position: sticky; top: 0; }
.sample-paper { background: var(--paper-2); padding: var(--s4); display: flex; justify-content: center; }
.sample-frame { border: 0; background: #fff; height: 560px; box-shadow: 0 1px 0 var(--rule); }
.sample-frame.k58 { width: 210px; } .sample-frame.k80 { width: 300px; } .sample-frame.ka4 { width: 100%; }
@media (max-width: 1100px) { .settings-wrap.with-sample { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Вход и пользователи ---------- */
body.locked > :not(.login):not(svg) { display: none !important; }
.login { position: fixed; inset: 0; display: grid; place-items: center; background: var(--steel-950); }
.login-card { width: min(360px, calc(100vw - 32px)); background: var(--paper); padding: var(--s6) var(--s5) var(--s5); display: flex; flex-direction: column; gap: 6px; border-top: 6px solid var(--ink); }
.login-card h1 { margin: 0 0 var(--s3); font-size: var(--t-xl); }
.login-card label { font-size: var(--t-sm); color: var(--fade); margin-top: var(--s2); }
.login-card input { height: 40px; border: 1px solid var(--rule); padding: 0 var(--s3); font-size: var(--t-lg); background: var(--paper); }
.login-card input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.login-card .save { margin-top: var(--s4); height: 42px; }
.login-mark { height: 4px; width: 48px; background: var(--tomato); margin-bottom: var(--s3); }
.login-err { color: var(--tomato); font-size: var(--t-sm); margin: var(--s2) 0 0; min-height: 1em; }
.login-err:empty { display: none; }
/* Учётная запись у правого края шапки */
.shell-link.right:not([hidden]) ~ .shell-link.right { margin-left: 0; }
.who { display: flex; align-items: stretch; margin-left: var(--s2); padding-left: var(--s2); border-left: 1px solid var(--steel-800); }
.who-acct { display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3) 0 var(--s2); }
.who-ava { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--shell-raise); color: var(--shell-strong); font-size: var(--t-xs); font-weight: 600; letter-spacing: .02em; }
.who-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.who-text b { color: var(--shell-strong); font-size: var(--t-sm); font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text small { color: var(--steel-400); font-size: var(--t-xs); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .who-text { display: none; } .who-acct { padding-right: var(--s1); } }
.dtable tr.warn-row td { background: var(--tomato-wash); color: var(--ink-2); font-size: var(--t-xs); text-align: center; }
.settings-wrap.user-card { grid-template-columns: minmax(0, 980px); }
.perm-box { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--s5); margin-top: var(--s4); border-top: 2px solid var(--ink); padding-top: var(--s3); }
.perm-note { grid-column: 1 / -1; }
.perm-col h3 { margin: 0 0 var(--s2); font-size: var(--t-md); }
.perm-col.wide { columns: 2 260px; column-gap: var(--s5); }
.perm-col.wide h3 { column-span: all; }
.perm-group { break-inside: avoid; margin-bottom: var(--s3); }
.perm { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: var(--t-sm); cursor: pointer; }
.perm input { width: 16px; height: 16px; flex: none; }
.perm.g { font-weight: 700; }
.perm.c { padding-left: 24px; }

/* ---------- Карта и зоны доставки ---------- */
.zones { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s3); }
.zone-side { background: var(--paper); padding: var(--s3); overflow: auto; display: flex; flex-direction: column; gap: var(--s3); }
.zone-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.zone-list li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: var(--s2); padding: 6px 0; border-bottom: 1px dashed var(--rule); }
.zone-list .sw, .zone-tag i { width: 14px; height: 14px; display: inline-block; border: 1px solid var(--steel-400); }
.zone-edit { display: flex; flex-direction: column; gap: var(--s2); }
.zone-edit p { margin: 0; font-size: var(--t-sm); }
.zone-edit input, .zone-edit select { height: 32px; border: 1px solid var(--rule); padding: 0 var(--s2); background: var(--paper); }
.zone-edit .buttons { display: flex; gap: var(--s2); }
.zone-map { background: var(--paper); min-height: 420px; position: relative; }
.zone-map > .fade { padding: var(--s4); }
.zone-err { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); color: var(--ink-2); }
.zone-err b { color: var(--tomato); }
.zone-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); font-weight: 600; }
.zone-tag.warn { color: var(--amber-ink); font-weight: 500; }
@media (max-width: 900px) { .zones { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Сотрудник заказа (как во Frontpad: список в строке заказа) ---------- */
.emp-cell { padding-top: 4px; padding-bottom: 4px; }
.order-head .emp-sel { width: 100%; min-width: 0; max-width: 180px; height: 72px; border: 1px solid var(--rule); background: var(--paper); font-size: var(--t-xs); padding: 0; }
.order-head .emp-sel option { padding: 1px 6px; }
.order-head .emp-sel option:checked { background: var(--steel-300) linear-gradient(0deg, var(--steel-300), var(--steel-300)); color: var(--ink); font-weight: 600; }
.order-head .emp-sel option[value=""] { color: var(--fade); }
.order-head .emp-sel:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.chit-emp { display: flex; align-items: center; gap: 4px; font-size: var(--t-xs); }
.chit-emp svg { width: 12px; height: 12px; }

/* ---------- IP-телефония ---------- */
.shell-link.tel { position: relative; }
#btn-tel:not([hidden]) ~ #btn-keys { margin-left: 0; }
.tel-dot { position: absolute; top: 10px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--steel-600); box-shadow: 0 0 0 2px var(--steel-950); }
.shell-link.tel[data-state="on"] .tel-dot { background: #3fbf6f; }
.shell-link.tel[data-state="error"] .tel-dot { background: var(--tomato); }
.call-card { position: fixed; right: var(--s4); bottom: var(--s4); z-index: 60; width: 320px; background: var(--paper); border-top: 6px solid var(--ink); box-shadow: 0 18px 40px -12px rgba(34, 39, 42, .45); padding: var(--s3) var(--s4) var(--s4); display: flex; flex-direction: column; gap: 6px; animation: pop-in .18s var(--ease); }
.call-card header { display: flex; align-items: center; gap: var(--s2); }
.call-card header h2 { margin: 0; flex: 1; font-size: var(--t-lg); }
.call-card header > svg { color: var(--go); }
.call-card .cc-phone { margin: var(--s2) 0 0; font-size: 22px; font-weight: 700; }
.call-card .cc-name { margin: 0; font-size: var(--t-lg); font-weight: 600; }
.call-card .cc-info, .call-card .cc-state { margin: 0; font-size: var(--t-sm); color: var(--fade); }
.call-card .buttons { display: flex; gap: var(--s2); margin-top: var(--s2); }
.olist .phone { display: flex; align-items: center; gap: 6px; }
.call-btn { width: 24px; height: 24px; display: inline-grid; place-items: center; color: var(--go); border: 1px solid rgba(21, 21, 21, .2); background: var(--paper); flex: none; }
.call-btn:hover { border-color: var(--go); }
.call-btn svg { width: 14px; height: 14px; }
.settings-wrap.with-journal { grid-template-columns: minmax(0, 620px) minmax(0, 1fr); }
.settings-card.journal { overflow: auto; max-height: 100%; }
.tel-help p { margin: var(--s2) 0 0; }
@media (max-width: 1100px) { .settings-wrap.with-journal { grid-template-columns: minmax(0, 1fr); } }
.order-body select.unpaid { color: var(--amber-ink); font-weight: 600; }
.order-head .head-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 0; }
.order-head .mini.del-order { margin-left: auto; color: var(--tomato); width: 28px; padding: 0; display: inline-grid; place-items: center; }
.order-head .mini.del-order svg { width: 15px; height: 15px; }
.order-head .mini.del-order:hover { border-color: var(--tomato); background: var(--tomato-wash); }
.form-pop input.wide { width: 100%; height: 32px; border: 1px solid var(--rule); padding: 0 var(--s2); }

/* ---------- Статистика клиента (значок у телефона в списке заказов) ---------- */
.order-body .cs-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 6px; vertical-align: middle; color: var(--steel-600); border: 1px solid rgba(21, 21, 21, .18); background: var(--paper); }
.order-body .cs-btn svg { width: 15px; height: 15px; }
.order-body .cs-btn:hover { color: var(--ink); border-color: var(--ink); }
.modal.cstats { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.modal.cstats.cs-wide { width: min(940px, calc(100vw - 32px)); }
.cs-head { flex: none; display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5) var(--s3); }
.cs-ava { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--steel-950); color: #fff; font-weight: 600; font-size: var(--t-lg); }
.cs-ava svg { width: 24px; height: 24px; }
.cs-who { flex: 1; min-width: 0; }
.modal .cs-who h2 { margin: 0; text-align: left; font-size: var(--t-xl); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-who .mono { color: var(--fade); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-close { flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: var(--fade); align-self: flex-start; }
.cs-close:hover { color: var(--ink); background: var(--paper-2); }
.cs-close svg { width: 18px; height: 18px; }
.cs-tabs { flex: none; display: flex; gap: var(--s4); margin: 0 var(--s5); border-bottom: 1px solid var(--rule); }
.cs-tabs button { position: relative; padding: 8px 0; color: var(--fade); font-weight: 500; }
.cs-tabs button:hover { color: var(--ink); }
.cs-tabs button[aria-selected="true"] { color: var(--ink); }
.cs-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
.cs-pane { padding: var(--s4) var(--s5) var(--s5); overflow: auto; min-height: 260px; }
.modal .cs-empty { color: var(--fade); margin: var(--s6) 0; }
.cs-sub { margin: var(--s5) 0 var(--s2); font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.cs-sub.first { margin-top: 0; }
/* Покупки: строки карточки */
.cs-lines { border-top: 1px solid var(--paper-3); }
.cs-line { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: var(--s3); min-height: 38px; padding: 4px 0; border-bottom: 1px solid var(--paper-3); }
.cs-line > span { color: var(--fade); font-size: var(--t-sm); }
.cs-line > div { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; min-width: 0; }
.cs-sep { width: 1px; height: 14px; background: var(--rule); margin: 0 var(--s2); }
.cs-points { font-size: var(--t-lg); margin-right: var(--s2); }
.cs-points.pos { color: var(--go); }
.cs-acts { display: inline-flex; gap: 4px; }
.cs-act { width: 30px; height: 28px; display: grid; place-items: center; border: 1px solid var(--rule); background: var(--paper); color: var(--steel-600); }
.cs-act svg { width: 16px; height: 16px; }
.cs-act:hover { border-color: var(--ink); color: var(--ink); }
.cs-act.plus:hover { border-color: var(--go); color: var(--go); background: var(--go-wash); }
.cs-act.minus:hover { border-color: var(--tomato); color: var(--tomato); background: var(--tomato-wash); }
.cs-note { padding: 2px 8px; }
.cs-kpis { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--s4); border: 1px solid var(--rule); }
.cs-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px var(--s3); border-right: 1px solid var(--rule); min-width: 0; }
.cs-kpi:last-child { border-right: 0; }
.cs-kpi span { color: var(--fade); font-size: var(--t-xs); font-weight: 500; }
.cs-kpi b { font-family: var(--mono); font-size: var(--t-xl); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-kpi small { color: var(--fade); font-size: var(--t-xs); }
.cs-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 180px; }
.cs-bar { display: grid; grid-template-rows: auto 1fr auto; align-items: end; text-align: center; min-width: 0; }
.cs-bar .v { font-family: var(--mono); font-size: 10px; color: var(--fade); white-space: nowrap; overflow: hidden; }
.cs-bar i { display: block; align-self: end; background: var(--steel-300); transition: background .15s var(--ease); }
.cs-bar:hover i { background: var(--steel-600); }
.cs-bar.now i { background: var(--steel-950); }
.cs-bar .m { height: 34px; padding-top: 6px; border-top: 1px solid var(--rule); font-size: var(--t-xs); color: var(--fade); }
.cs-bar .m small { display: block; font-size: 10px; }
.cs-bar.now .m { color: var(--ink); font-weight: 600; }
/* Лицевой счёт: форма и история */
.cs-form { display: grid; gap: var(--s3); max-width: 420px; margin: 0 auto; }
.cs-form label { display: grid; gap: 4px; font-size: var(--t-sm); color: var(--fade); }
.cs-form input { height: 36px; padding: 0 10px; border: 1px solid var(--rule); color: var(--ink); font-size: var(--t-md); }
.cs-form input.mono { font-size: var(--t-xl); height: 44px; }
.cs-form input:focus { outline: none; border-color: var(--ink); }
.modal .cs-err { margin: 0; min-height: 1.2em; color: var(--tomato); font-size: var(--t-sm); }
.cs-form .buttons { margin-top: 0; }
.cs-hist, .cs-top { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.cs-hist th, .cs-top th { text-align: left; font-weight: 500; color: var(--fade); font-size: var(--t-xs); padding: 6px; border-bottom: 1px solid var(--rule); }
.cs-hist td, .cs-top td { padding: 7px 6px; border-bottom: 1px solid var(--paper-3); }
.cs-hist .r, .cs-top .r { text-align: right; }
.cs-hist td.mono:first-child { white-space: nowrap; }
.cs-hist td.pos { color: var(--go); }
.cs-hist td.neg { color: var(--tomato); }
.cs-hist tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--ink); }
/* Предпочтения */
.cs-top td:first-child { width: 50%; }
.cs-top .freq { display: flex; align-items: center; gap: var(--s2); white-space: nowrap; }
.cs-top .track { flex: 1; min-width: 60px; height: 6px; background: var(--paper-3); }
.cs-top .track i { display: block; height: 100%; background: var(--steel-600); }
.cs-top .freq .mono { font-size: var(--t-xs); color: var(--fade); min-width: 108px; }
.cs-usuals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.cs-usual { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; background: var(--paper-2); min-width: 0; }
.cs-usual span { color: var(--fade); font-size: var(--t-xs); font-weight: 500; flex: none; }
.cs-usual b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-usual small { margin-left: auto; font-family: var(--mono); color: var(--fade); }
/* Заказы клиента — каждый целиком */
.cs-olist { display: grid; gap: var(--s2); }

.cs-order > header { display: flex; align-items: center; gap: var(--s2); padding: 6px var(--s3); background: var(--paper-2); border-bottom: 1px solid var(--paper-3); }
.cs-order > header b { font-size: var(--t-md); }
.cs-st { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: var(--t-sm); }
.cs-st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st); box-shadow: inset 0 0 0 1px rgba(21, 21, 21, .15); }
.cs-copy { height: 26px; padding: 0 var(--s2); border: 1px solid var(--rule); background: var(--paper); font-size: var(--t-sm); }
.cs-copy:hover { border-color: var(--ink); }
.cs-obody { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(150px, .8fr) minmax(0, 1.2fr); gap: var(--s4); padding: var(--s2) var(--s3); font-size: var(--t-sm); }
.cs-items { list-style: none; margin: 0; padding: 0; }
.cs-items li { display: grid; grid-template-columns: 1fr 34px 64px; gap: 6px; padding: 1px 0; }
.cs-items li span:not(:first-child) { text-align: right; }
.cs-money { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s2); margin: 0; }
.cs-money dt { color: var(--fade); }
.cs-money dd { margin: 0; text-align: right; }
.cs-money dd.strong { font-weight: 700; }
.cs-money dd.unpaid { color: var(--amber-ink); font-weight: 600; }
.cs-where .cs-point { font-weight: 600; }
.cs-where .addr { font-style: italic; }
.cs-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cs-tags span { padding: 1px 6px; background: var(--paper-2); border: 1px solid var(--paper-3); font-size: var(--t-xs); }
@media (max-width: 700px) {
  .cs-kpis { grid-template-columns: repeat(2, 1fr); } .cs-kpi:nth-child(2) { border-right: 0; }
  .cs-usuals { grid-template-columns: 1fr; } .cs-line { grid-template-columns: 1fr; gap: 2px; }
  .cs-obody { grid-template-columns: 1fr; gap: var(--s2); }
}

/* «Показать ещё» в конце списка заказов (дальше подгружается само при прокрутке) */
.olist .list-more td { padding: var(--s4); text-align: center; background: transparent; }
/* «Период» в списке заказов: с … по … */
.period-pop { display: grid; gap: var(--s2); padding: var(--s3); min-width: 240px; }
.period-pop label { display: grid; gap: 4px; font-size: var(--t-sm); color: var(--fade); }
.period-pop input { height: 32px; padding: 0 8px; border: 1px solid var(--rule); color: var(--ink); font-family: var(--mono); font-size: var(--t-sm); }
.period-pop input:focus { outline: none; border-color: var(--ink); }
.period-pop .period-err { margin: 0; min-height: 1em; color: var(--tomato); font-size: var(--t-xs); }
.period-btns { display: flex; gap: var(--s2); }

/* ---------- «Настройки → Общие»: функции, часовой пояс, администрирование ---------- */
.settings-form .live:empty { display: none; }
.settings-form .live { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--t-sm); }
.settings-form .chip { padding: 2px 8px; border: 1px solid var(--rule); background: var(--paper-2); font-size: var(--t-xs); font-family: var(--mono); }
.feat { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.feat-state { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--fade); min-width: 96px; }
.feat-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--steel-300); }
.feat-state.on { color: var(--go); font-weight: 600; }
.feat-state.on::before { background: var(--go); }
.feat-state.soon { color: var(--steel-600); text-transform: lowercase; font-size: var(--t-xs); min-width: 0; padding: 1px 6px; border: 1px dashed var(--steel-300); }
.feat-state.soon::before { display: none; }
.feat input[type="date"] { height: 32px; padding: 0 8px; border: 1px solid var(--rule); font-family: var(--mono); }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); }
.tz-list { display: grid; grid-template-columns: auto auto auto; gap: 2px var(--s3); font-size: var(--t-sm); margin-right: var(--s2); }
.tz-list > div { display: contents; }
.tz-note { margin-top: 6px; padding: 6px 10px; background: var(--paper-2); color: var(--ink-2); font-size: var(--t-sm); }
.tz-table { border-collapse: collapse; margin: 0 auto var(--s2); }
.tz-table th { text-align: left; font-weight: 500; color: var(--fade); font-size: var(--t-xs); padding: 4px 8px; }
.tz-table td { padding: 4px 8px; }
.tz-table select { height: 32px; max-width: 320px; border: 1px solid var(--rule); }
.form-pop .parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 50vh; overflow: auto; }
/* Кнопки предзаказа на вкладке «Отметки» */
.prebill-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip-btn { height: 26px; padding: 0 10px; border: 1px solid var(--rule); background: var(--paper); font-size: var(--t-sm); font-family: var(--mono); }
.chip-btn:hover { border-color: var(--ink); }
/* Часы филиала в шапке — видны, когда часы компьютера в другом поясе */
.shell-clock { display: flex; align-items: center; gap: 6px; padding: 0 var(--s3); color: var(--steel-300); cursor: help; }
.shell-clock svg { width: 18px; height: 18px; }
.shell-clock span { display: flex; flex-direction: column; line-height: 1.15; }
.shell-clock b { color: var(--shell-strong); font-family: var(--mono); font-size: var(--t-md); font-weight: 600; }
.shell-clock small { font-size: var(--t-xs); }
.shell-clock.right { margin-left: auto; }
.shell-clock.right:not([hidden]) ~ .shell-link.right { margin-left: 0; }
/* «Цвет кнопки» категорий и товаров (палитра Frontpad) */
.cat.tinted { background: var(--btn); }
.cat.tinted:hover { background: color-mix(in srgb, var(--btn), var(--ink) 12%); }

.good.tinted { background: var(--btn); }
.good.tinted:hover { background: color-mix(in srgb, var(--btn), var(--ink) 12%); }
.dform .palette { display: flex; flex-wrap: wrap; gap: 6px; }
.dform .palette .dot { position: relative; width: 26px; height: 26px; border-radius: 50%; background: var(--dot); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(21, 21, 21, .15); transition: transform .12s var(--ease); }
.dform .palette .dot:hover { transform: scale(1.1); }
.dform .palette .dot:has(input:checked) { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.dform .palette .dot:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 4px; }
.dform .palette input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.dtable .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; box-shadow: inset 0 0 0 1px rgba(21, 21, 21, .15); }
/* Зарплата: калькулятор формулы в карточке сотрудника и расшифровка расчёта */
.formula-field .inline { display: flex; gap: var(--s2); }
.formula-field .inline input { flex: 1; min-width: 0; }
.formula-field .calc { margin-top: var(--s2); padding: var(--s3); background: var(--paper-2); border: 1px solid var(--paper-3); }
.formula-field .calc td { padding: 3px 6px 3px 0; font-size: var(--t-sm); }
.formula-field .calc td:first-child { color: var(--ink-2); padding-right: var(--s3); }
.formula-field .calc td:last-child { white-space: nowrap; }
.formula-field .calc input.short { width: 96px; }
.formula-field .calc-foot { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); }
.formula-field .calc-out { flex: 1; min-width: 0; padding: 6px 8px; background: var(--paper); border: 1px dashed var(--steel-300); font-family: var(--mono); font-size: var(--t-sm); overflow-wrap: anywhere; }
.formula-card { margin: 0 0 var(--s3); padding: var(--s3) var(--s4); background: var(--paper);  }
.formula-card.bad { border-left-color: var(--tomato); }
.formula-card .fc-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s2); }
.formula-card .fc-head span { font-size: var(--t-sm); color: var(--ink); font-weight: 600; }
.formula-card .fc-head code { font-family: var(--mono); font-size: var(--t-sm); color: var(--ink-2); }
.formula-card .fc-vars { display: grid; grid-template-columns: max-content max-content; gap: 3px var(--s4); margin: 0 0 var(--s2); }
.formula-card .fc-vars dt { color: var(--ink-2); font-size: var(--t-sm); }
.formula-card .fc-vars dt small { margin-left: 6px; color: var(--fade); }
.formula-card .fc-vars dd { margin: 0; text-align: right; font-weight: 600; }
.formula-card .fc-sum { font-size: var(--t-md); padding-top: var(--s2); border-top: 1px solid var(--paper-3); }
.formula-card .fc-sum b { color: var(--go); font-size: var(--t-lg); }
.formula-card .fc-err { margin: 0; color: var(--tomato); }
/* Переключатель в карточке справочника («От суммы / От персон») */
.dform .radio-group { display: inline-flex; border: 1px solid var(--rule); background: var(--paper); }
.dform .radio-group label { position: relative; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; cursor: pointer; white-space: nowrap; border-right: 1px solid var(--rule); color: var(--fade); font-weight: 500; }
.dform .radio-group label:last-child { border-right: 0; }
.dform .radio-group label:hover { color: var(--ink); background: var(--paper-2); }
.dform .radio-group label:has(input:checked) { background: var(--ink); color: var(--paper); }
.dform .radio-group label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.dform .radio-group input { position: absolute; opacity: 0; pointer-events: none; }
/* Один сотрудник на заказ — обычный выпадающий список */
.order-head .emp-sel.single { height: 28px; }

/* =====================================================================
   «Рейка 2.0» — тот же мир (сталь и термобумага), собранный как дорогой инструмент:
   листы бумаги на стали со скруглением, тонкой кромкой и мягкой глубиной; таблетки для выбора;
   строки цвета статуса с полоской пути заказа. Работает в обеих темах через токены выше.
   ===================================================================== */

/* Листы на стали */
.bill, .goods, .summary, .dict-wrap, .settings-card, .list-wrap, .stat-card, .tile, .rep-table, .salary-col, .cash-head {
  border-radius: var(--radius); box-shadow: var(--shadow-sheet), 0 0 0 1px var(--edge);
}
.bill, .goods, .dict-wrap, .settings-card, .list-wrap { overflow: hidden; }
.bill { overflow: hidden; }
.tab-body, .goods, .dict-wrap, .list-wrap { overflow: auto; }
.front { gap: var(--s3); padding: var(--s3) var(--s4) var(--s4); }
.orders { padding: var(--s3) var(--s4) var(--s4); }
.summary { overflow: hidden; }
.list-wrap { background: var(--paper); }

/* Шапка: графит, чуть больше воздуха, мягкая тень над сталью */
.shell { box-shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 6px 18px -12px rgba(0, 0, 0, .5); position: relative; z-index: 5; }
.shell-link { border-radius: var(--radius-sm); margin: 6px 1px; }
.shell-link[aria-current="page"]::after { bottom: -6px; }
.rail { display: none; } /* стальная рейка первой версии: глубину теперь даёт тень шапки */
.count { border-radius: var(--radius-pill); }

/* Переключатель темы */
.theme-btn svg.moon { display: none; }
:root[data-theme="dark"] .theme-btn svg.sun { display: none; }
:root[data-theme="dark"] .theme-btn svg.moon { display: block; }

/* Вкладки чека: сегменты-таблетки на подложке */
.tabs { gap: 4px; padding: var(--s2) var(--s3) 0; background: transparent; }
.tabs button { border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--paper-3); color: var(--fade); }
.tabs button:hover { background: var(--paper-2); color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 -1px 0 var(--edge), 1px 0 0 var(--edge), -1px 0 0 var(--edge); }
.bill .tabs { background: var(--paper-2); border-bottom: 1px solid var(--rule); }

/* Кнопки, поля, инструменты */
.btn, .tool, .save, .chip-btn, .cs-copy, .cs-act, .stepper button, .stepper input { border-radius: var(--radius-sm); }
.btn { transition: border-color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease); }
.btn:active, .tool:active { transform: scale(.98); }
.btn.dark { background: var(--ink); color: var(--paper); }
.save { box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 6px 14px -8px var(--tomato); }
.save:disabled { box-shadow: none; }
.form input, .form select, .form textarea, .dict-top select, .dict-top input[type="date"], .olist thead select, .search, .dform input, .dform select, .dform textarea,
.period-pop input, .cs-form input, .tz-table select, .feat input[type="date"], .stepper input, .settings-form input, .settings-form select, .settings-form textarea {
  border-radius: var(--radius-sm);
}
.search { background: var(--paper-2); border: 1px solid var(--rule); }
.form input, .form select, .form textarea { background: var(--paper); }
.form tr.hl { background: transparent; }
.form tr.hl th { color: var(--ink); }

/* Категории — таблетки; выбранная — инверсия чернилами; цвет кнопки виден точкой слева */
.cats { gap: 6px; }
.cat { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--edge); min-height: 42px; transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease); }
.cat:hover { background: var(--paper-2); }
.cat[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .45); }
.cat.tinted { background: var(--btn); color: var(--status-ink); }
.cat.tinted:hover { background: color-mix(in srgb, var(--btn), var(--ink) 10%); }
.cat.tinted[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: 0 0 0 3px var(--btn), 0 6px 14px -8px rgba(0, 0, 0, .45); }

/* Плитки товаров */
.goods-grid { gap: 6px; }
.good { border-radius: var(--radius-sm); transition: background .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease); }
.good:hover { background: var(--paper-2); box-shadow: 0 0 0 1px var(--steel-400); }
.good.tinted { color: var(--status-ink); }
.good.tinted:hover { background: color-mix(in srgb, var(--btn), var(--ink) 10%); }
.good:active { transform: scale(.97); }

/* Отметки, чипы, сегменты */
.tag { border-radius: var(--radius-pill); padding: 6px 14px; }
.chip, .chip-btn, .settings-form .chip { border-radius: var(--radius-pill); }
.seg { border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border-radius: 4px; }
.seg { padding: 2px; gap: 2px; }
.list-wrap { padding: 0 6px 6px; }

/* Окна, всплывающие списки, меню, тост */
.modal-back { background: rgba(12, 15, 17, .5); backdrop-filter: blur(2px); }
.modal { border-radius: 14px; box-shadow: var(--shadow-pop), 0 0 0 1px var(--edge); }
.pop { border-radius: var(--radius); border-color: var(--rule); box-shadow: var(--shadow-pop); overflow: hidden; }
.dict-menu, .settings-menu { border-radius: var(--radius); box-shadow: var(--shadow-pop); overflow: hidden; }
.dict-menu { background: var(--shell-bg); }
.dict-item { color: var(--shell-text); }
.toast { border-radius: var(--radius); background: var(--shell-bg); color: var(--shell-strong); box-shadow: var(--shadow-pop); }
.shell-clock { color: var(--shell-text); }
.viz-tip { border-radius: var(--radius-sm); }
.viz-tip .row { color: color-mix(in srgb, var(--paper), transparent 30%); }

/* Таблицы справочников и отчётов: мягкие строки */
.dtable tbody tr { transition: background .12s var(--ease); }
.dtable th:first-child, .dtable td:first-child { padding-left: var(--s4); }

/* ---------- «Заказы»: строки как во Frontpad, но собранные; полоска пути по статусам ---------- */
.olist { border-collapse: separate; border-spacing: 0; }
.olist thead th { background: var(--paper); border-bottom: 1px solid var(--rule); }
/* шапка и тело заказа — один лист с общим скруглением */
.order-head td { background: color-mix(in srgb, var(--st, var(--paper-3)), var(--steel-100) var(--status-mute)); color: var(--st-text, var(--status-ink)); }
.order-body td { background: color-mix(in srgb, var(--tint, var(--paper)), var(--steel-100) var(--status-mute)); color: var(--status-ink); border-bottom: 0; }
.order-head td:first-child { border-top-left-radius: var(--radius); }
.order-head td:last-child { border-top-right-radius: var(--radius); }
.order-body td:first-child { border-bottom-left-radius: var(--radius); }
.order-body td:last-child { border-bottom-right-radius: var(--radius); }
.order-gap td { height: 6px; }
.order-body .addr, .order-body .tags, .order-body .phone { color: var(--status-ink); }
.order-head .mini, .order-head select, .order-body select, .order-head .emp-sel, .order-body .cs-btn, .order-body .call-btn { border-radius: var(--radius-sm); }
/* контролы в цветной строке — светлые в обеих темах, чтобы читались на пастели */
.order-head .mini, .order-head select, .order-body select, .order-head .emp-sel, .order-body .cs-btn { background-color: var(--row-control); color: var(--status-ink); border-color: var(--row-line); }
.order-body select.unpaid { color: var(--row-warn); }
.order-head .mini.del-order { color: var(--row-danger); }
.order-head .timer { border-radius: var(--radius-pill); }
.order-head .timer:not(.late):not(.warm) { background: color-mix(in srgb, var(--row-control), transparent 15%); color: var(--status-ink); }
/* полоска пути: где заказ на своём маршруте (новый → … → выполнен) */
/* место под самый длинный путь (доставка, 7 шагов) — кнопки после полоски стоят в одну колонку */
.path { display: inline-flex; gap: 3px; vertical-align: middle; margin: 0 6px 0 2px; width: 130px; flex: none; --p: var(--status-ink); }
.path i { width: 14px; height: 6px; border-radius: 3px; background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--p), transparent 35%); transition: background .3s var(--ease); }
.path i.on { background: color-mix(in srgb, var(--p), transparent 35%); box-shadow: none; }
.path i.now { background: var(--p); box-shadow: none; width: 24px; }
.path.void i { background: transparent; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--p), transparent 50%); }
/* статус сменился — строка плавно перетекает из прежнего цвета в новый */
.order-head.changed td { animation: st-flow .7s var(--ease); }
.order-body.changed td { animation: tint-flow .7s var(--ease); }
@keyframes st-flow { from { background: var(--from-st); } }
@keyframes tint-flow { from { background: var(--from-tint); } }
.olist .list-more td { background: transparent; }
.order-body .show { color: var(--status-ink); text-decoration-color: color-mix(in srgb, currentColor, transparent 55%); }
.order-body .call-btn { background: var(--row-control); color: var(--status-ink); }
/* Ночью «Выполнен» (во Frontpad — почти белый) лежит графитовым листом, а не светит лампой */
:root[data-theme="dark"] .order-head[data-st="done"] td { background: var(--paper-3); color: var(--ink); }
:root[data-theme="dark"] .order-body[data-st="done"] td { background: var(--paper-2); color: var(--ink); }
:root[data-theme="dark"] .order-body[data-st="done"] :is(.addr, .tags, .phone, .show) { color: var(--ink); }
:root[data-theme="dark"] .order-head[data-st="done"] .path { --p: var(--ink); }
/* ночью контур будущих шагов плотнее — не ниже 3:1 к строке */
:root[data-theme="dark"] .path i { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--p), transparent 18%); }
:root[data-theme="dark"] .path i:is(.on, .now) { box-shadow: none; }
/* подпись «Сотрудник» в светлом поле строки — тёмная в обеих темах */
.order-head .emp-sel option[value=""] { color: color-mix(in srgb, var(--status-ink), transparent 32%); }
/* ночью контролы в строке — тёплая бумага, а не белый свет */

/* Сводка: плитки — листы; цвет показателя — точкой у подписи (без полосы поверх скруглённого листа) */
.tile { border-top: 0; }
.tile-l { display: inline-flex; align-items: center; gap: 6px; }
.tile-l::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.tiles-title { border-radius: var(--radius); }
.tiles-title span { color: color-mix(in srgb, var(--paper), transparent 35%); }
:root[data-theme="dark"] .tiles-title { background: var(--paper-3); color: var(--ink); box-shadow: 0 0 0 1px var(--edge); }
:root[data-theme="dark"] .tiles-title span { color: var(--fade); }

/* Выпадающие списки: своя стрелка в стиле иконок, цвет из темы. Свойства — с !important,
   потому что старые правила задают фон сокращённым background и иначе сбрасывают стрелку */
:root { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2359626a' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a2a69f' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }
.order-head, .order-body { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23353c40' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); } /* в цветной строке контролы светлые — стрелка тёмная */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none; padding-left: 8px; padding-right: 28px !important;
  background-image: var(--chev) !important; background-repeat: no-repeat !important;
  background-position: right 7px center !important; background-size: 16px !important;
}

/* «руб.» в сводке списка — шрифтом текста, цифры — моноширинные */
.summary dd .cur { font-family: var(--font); font-weight: 500; }

/* Поиск заказа в шапке */
.shell-search { align-self: center; display: flex; align-items: center; gap: 6px; height: 34px; margin-left: var(--s4); padding: 0 6px 0 10px; width: 260px; border-radius: var(--radius-sm); background: var(--shell-raise); color: var(--shell-text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: box-shadow .15s var(--ease), background .15s var(--ease); }
.shell-search:focus-within { box-shadow: inset 0 0 0 1px var(--shell-strong); background: color-mix(in srgb, var(--shell-raise), var(--shell-strong) 6%); }
.shell-search svg { width: 16px; height: 16px; }
.shell-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--shell-strong); font-size: var(--t-sm); }
.shell-search input::placeholder { color: var(--shell-text); }
.shell-search kbd { border: 0; padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, .08); color: var(--shell-text); font-size: 11px; }
.shell-search:focus-within kbd { display: none; }
@media (max-width: 1280px) { .shell-search { width: 190px; } .shell-search kbd { display: none; } }
.search-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper); font-size: var(--t-sm); }
.search-chip button { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--paper); }
.search-chip button:hover { background: color-mix(in srgb, var(--paper), transparent 80%); }
.search-chip svg { width: 14px; height: 14px; }

/* Рейка (доска) */
.chit { border-radius: var(--radius-sm); }

/* Тёмная тема: то, что держалось на «белом» */
:root[data-theme="dark"] .sample-frame { box-shadow: 0 0 0 1px var(--edge); }
:root[data-theme="dark"] .good { background: var(--paper-2); }
:root[data-theme="dark"] .good:hover { background: var(--paper-3); }
:root[data-theme="dark"] .good.tinted { background: color-mix(in srgb, var(--btn), var(--steel-100) 22%); }
:root[data-theme="dark"] .cat.tinted { background: color-mix(in srgb, var(--btn), var(--steel-100) 22%); }
:root[data-theme="dark"] .cat.tinted[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
:root[data-theme="dark"] .cs-bar.now i, :root[data-theme="dark"] .cs-ava { background: var(--ink); color: var(--paper); }
:root[data-theme="dark"] .modal-back { background: rgba(0, 0, 0, .6); }
:root[data-theme="dark"] input[type="date"], :root[data-theme="dark"] input[type="datetime-local"], :root[data-theme="dark"] input[type="time"] { color-scheme: dark; }

/* Без «полос сбоку»: заметки и карточки — полной рамкой и подложкой */
.cs-note { border-left: 0; border-radius: var(--radius-sm); background: var(--amber-wash); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber-ink), transparent 70%); }
.formula-card { border-left: 0; border-radius: var(--radius); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--go), transparent 55%), var(--shadow-sheet); }
.formula-card.bad { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tomato), transparent 45%), var(--shadow-sheet); }
.tz-note { border-left: 0; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--rule); }
.cs-order { border: 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--rule); }

/* Плавная смена темы — без вспышки и без анимации при загрузке */
:root.theme-anim, :root.theme-anim * { transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease) !important; }
@media (prefers-reduced-motion: reduce) {
  :root.theme-anim, :root.theme-anim * { transition: none !important; }
  .order-head.changed td, .order-body.changed td { animation: none; }
}

/* ===== Онлайн-касса (public/fiscal.js) ===== */
/* Значок кассы в шапке — как «Тел»: точка состояния */
.shell-link.kassa { position: relative; }
#btn-kassa:not([hidden]) ~ .shell-link.right { margin-left: 0; }
.shell-link.kassa[data-state="on"] .tel-dot { background: #3fbf6f; }
.shell-link.kassa[data-state="busy"] .tel-dot { background: #e2a84f; }
.shell-link.kassa[data-state="error"] .tel-dot { background: var(--tomato); }

/* Отметка чека в строке заказа: светлая, как остальные мини-кнопки, с точкой состояния */
.order-head .mini.fs-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: var(--t-xs); }
.fs-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--steel-600); flex: none; }
.fs-chip[data-fs="done"] i { background: #2f8a55; }
.fs-chip[data-fs="refund"] i { background: var(--steel-600); }
.fs-chip[data-fs="pending"] i, .fs-chip[data-fs="sent"] i { background: #c98a2b; animation: fs-pulse 1.2s var(--ease) infinite; }
.fs-chip[data-fs="check"] i { background: #c98a2b; }
.order-head .mini.fs-chip[data-fs="error"] { color: var(--row-danger); border-color: color-mix(in srgb, var(--row-danger), transparent 40%); }
.fs-chip[data-fs="error"] i { background: var(--row-danger); }
@keyframes fs-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .fs-chip i { animation: none !important; } }

/* Документ кассы — кассовая лента: термобумага, моноширинные цифры, пунктирные разделители */
.fr-list { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-start; max-height: 62vh; overflow: auto; padding: 2px; }
.fr-item { display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.fr-paper { position: relative; width: 280px; padding: var(--s4) var(--s4) var(--s5); background: #fbfaf6; color: #1d1d1b; border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  font-size: var(--t-sm); line-height: 1.35;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%; mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 12px 100%; }
.fr-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); padding-bottom: var(--s2); margin-bottom: var(--s2); border-bottom: 1px dashed #b9b6ad; }
.fr-state { font-size: var(--t-xs); padding: 1px 8px; border-radius: var(--radius-pill); background: #ecebe5; color: #4b4b46; white-space: nowrap; }
.fr-state.s-done { background: #e3f1e8; color: #23603c; }
.fr-state.s-error { background: #fbe3e0; color: #a4281d; }
.fr-state.s-check, .fr-state.s-pending, .fr-state.s-sent { background: #f8ecd6; color: #7a4a00; }
.fr-pos { padding: 3px 0; }
.fr-row { display: flex; justify-content: space-between; gap: var(--s3); }
.fr-row .mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fr-row.sub, .fr-vat { color: #5e5e58; font-size: var(--t-xs); }
.fr-row.total { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px dashed #b9b6ad; font-weight: 700; font-size: var(--t-md); }
.fr-foot { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px dashed #b9b6ad; font-size: var(--t-xs); color: #4b4b46; }
.fr-err { margin-top: var(--s2); padding: var(--s2); border-radius: var(--radius-sm); background: #fbe3e0; color: #a4281d; font-size: var(--t-xs); }
.fr-emu { margin-top: var(--s3); text-align: center; font-size: var(--t-xs); color: #8a5300; border: 1px dashed #d9b77f; border-radius: var(--radius-sm); padding: 3px; }

/* Панель «Онлайн-касса» из шапки */
.kassa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); min-width: min(640px, 80vw); }
.kassa-card { padding: var(--s4); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.kassa-card header { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.kassa-card .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--steel-600); }
.kassa-card .dot.on { background: #3fbf6f; } .kassa-card .dot.warn { background: #e2a84f; } .kassa-card .dot.off { background: var(--tomato); }
.kassa-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--s3); margin: 0 0 var(--s3); font-size: var(--t-sm); }
.kassa-dl dt { color: var(--fade); } .kassa-dl dd { margin: 0; }
.kassa-ops { display: flex; flex-wrap: wrap; gap: var(--s2); }
.kassa-card .link { margin-top: var(--s3); color: var(--tomato); text-decoration: underline; }

/* Настройки → Онлайн-касса: форма слева, кассы / журнал / сверка справа */
.settings-wrap.kassa-wrap { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); align-items: start; }
.kassa-side { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.kassa-side .settings-card.journal { max-height: none; }
.kassa-wrap .settings-form select { width: 100%; max-width: 340px; }
.kassa-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.kassa-top h2 { margin: 0; }
.segs { display: inline-flex; gap: 4px; }
.chip-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.kassa-steps { margin: var(--s2) 0; padding-left: 1.3em; display: grid; gap: var(--s2); max-width: 560px; }
.kassa-steps li { line-height: 1.45; }
@media (max-width: 1100px) { .settings-wrap.kassa-wrap { grid-template-columns: minmax(0, 1fr); } }
