/* Рабочее пространство бизнеса: мастер настройки, готовность к работе, База знаний.
   Токены — из app.css; формы — из auth.css. */

.is-app main { padding-block: 0; }
.wsp { display: flex; flex-direction: column; gap: 24px; }
.wsp__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.wsp__eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }
.wsp__eyebrow a { text-decoration: none; }
.wsp__title { margin: 0; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.wsp__lead { margin: 8px 0 0; color: var(--muted); max-width: 720px; line-height: 1.55; }
.wsp__h2 { margin: 0 0 12px; font-size: 18px; }
.wsp__card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; }
.wsp__grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 960px) { .wsp__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } }

.kb-link { display: inline-flex; align-items: center; min-height: 40px; font-weight: 700; font-size: 15px; color: var(--accent); text-decoration: none; }
.kb-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* выбор типов бизнеса: группы по сферам */
.types { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.types legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.types > div { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .types > div { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.types > div > div { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.types label { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; }
.types > div > div > label:first-child { font-weight: 700; color: var(--muted); font-size: 13px; min-height: 0; }
.types input { width: 20px; height: 20px; accent-color: var(--accent); }

/* готовность к работе */
.ready { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); }
.ready__ring {
  --p: 0; flex: none; width: 152px; height: 152px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0);
  display: flex; align-items: center; justify-content: center;
}
.ready__ring span { width: 118px; height: 118px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ready__text { flex: 1 1 320px; min-width: 0; }
.ready__next { margin-top: 16px; }
.ready__all { margin: 16px 0 0; font-weight: 700; color: var(--accent); }

.checklist__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.checklist__title { margin: 0; font-size: 20px; }
.checklist__toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong); cursor: pointer; font-size: 14px; font-weight: 600; }
.checklist__toggle::before { content: ""; width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--border-strong); }
.check-toggle:checked ~ .checklist__bar .checklist__toggle::before { background: var(--accent); border-color: var(--accent); }
.check-toggle:focus-visible ~ .checklist__bar .checklist__toggle { outline: 3px solid var(--focus); outline-offset: 2px; }
.check-toggle:checked ~ .checklist .check.is-done { display: none; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; align-items: center; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
@media (min-width: 880px) { .check { grid-template-columns: auto minmax(0, 1fr) 170px auto; } }
.check__mark { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.check__text { display: flex; flex-direction: column; gap: 2px; }
.check__text span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.check__status { font-size: 13px; font-weight: 700; color: var(--muted); }
.check__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; grid-column: 2 / -1; }
@media (min-width: 880px) { .check__actions { grid-column: auto; justify-content: flex-end; } }
.check.is-done .check__mark { background: var(--accent); color: var(--on-accent); }
.check.is-done .check__status { color: var(--accent); }
.check.is-todo { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check.is-todo .check__status { color: var(--warn-fg); }
.check.is-soon { opacity: 0.75; border-style: dashed; }

/* списки юрлиц и точек */
.rows { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; }
.rows li { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-top: 1px solid var(--border); }
.rows li:first-child { border-top: 0; }
.rows span { color: var(--text-2); font-size: 14px; }
.rows small { color: var(--muted); font-size: 13px; }
.rows__empty { color: var(--muted); }
.bind { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bind span:not([aria-hidden]) { padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

/* База знаний */
.kb-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.kb-card { display: flex; flex-direction: column; gap: 6px; height: 100%; color: var(--text); text-decoration: none; }
.kb-card:hover { border-color: var(--accent); color: var(--text); }
.kb-card span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.kb-article { max-width: 760px; display: flex; flex-direction: column; gap: 18px; }
.kb-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.kb-sec h2 { margin: 0 0 8px; font-size: 17px; }
.kb-sec p, .kb-sec li { line-height: 1.6; color: var(--text-2); }
.kb-sec ol, .kb-sec ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.kb-sec--warn { border-color: var(--danger-border); }
.kb-soon { margin: 0; color: var(--muted); }

/* скан вместо ручного ввода: зона перетаскивания */
.scan { margin-bottom: 18px; display: flex; flex-direction: column; gap: 10px; }
.scan__zone { display: flex; align-items: center; gap: 16px; padding: 22px 18px; border-radius: 18px; border: 2px dashed var(--accent); background: var(--accent-soft); cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.scan__zone:hover, .scan.is-over .scan__zone { border-style: solid; transform: scale(1.01); }
.scan.is-over .scan__zone { background: var(--surface); }
.scan:focus-within .scan__zone { outline: 3px solid var(--focus); outline-offset: 2px; }
.scan.is-busy .scan__zone { opacity: .6; cursor: progress; pointer-events: none; }
.scan__icon { flex: none; width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--accent); }
.scan__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.scan__text span { color: var(--text-2); font-size: 15px; line-height: 1.45; }
.scan__text small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.scan [hidden] { display: none !important; }

/* Идёт скан: превью документа, луч, процент и шаги (как в LawServices) */
.scanning { display: grid; grid-template-columns: 132px 1fr; gap: 20px; align-items: center; padding: 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); }
.scanning__preview { position: relative; height: 168px; border-radius: 14px; overflow: hidden; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; }
.scanning__preview img { width: 100%; height: 100%; object-fit: cover; }
.scanning__doc { height: 86%; width: auto; max-width: 90%; }
.scanning__sheet { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.scanning__ln { fill: var(--accent); opacity: .3; }
.scanning__beam { position: absolute; left: 0; right: 0; top: -48px; height: 48px;
  background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--accent) 35%, transparent) 82%, var(--accent) 100%);
  animation: scan-beam 2s ease-in-out infinite alternate; }
@keyframes scan-beam { from { top: -48px; } to { top: 100%; } }
.scanning__check { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: var(--on-accent); background: color-mix(in srgb, var(--accent) 82%, transparent); animation: scan-pop .3s ease; }
@keyframes scan-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.scan.is-done .scanning__beam, .scan.is-failed .scanning__beam { display: none; }
.scan.is-done .scanning__check { display: flex; }
.scanning__main { min-width: 0; }
.scanning__file { margin: 0 0 8px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.scanning__pct { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.scanning__pct strong { font-size: 32px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.scanning__pct span { color: var(--text-2); font-size: 14px; }
.scanning__track { height: 8px; margin: 10px 0 14px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.scanning__track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brand-gradient); transition: width .15s linear; }
.scanning__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.scanning__steps li { position: relative; padding-left: 28px; color: var(--muted); font-size: 14px; line-height: 20px; }
.scanning__steps li::before { content: ""; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--border); }
.scanning__steps li.is-active { color: var(--text); font-weight: 600; }
.scanning__steps li.is-active::before { border-color: var(--accent-soft); border-top-color: var(--accent); animation: scan-spin .9s linear infinite; }
.scanning__steps li.is-done { color: var(--text-2); }
.scanning__steps li.is-done::before { content: "✓"; border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 14px; text-align: center; }
@keyframes scan-spin { to { transform: rotate(360deg); } }
.scanning__hint { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.scanning__error { margin: 12px 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--danger-bg); color: var(--danger-fg); border: 1px solid var(--danger-border); font-weight: 600; line-height: 1.45; }
@media (max-width: 560px) {
  .scanning { grid-template-columns: 1fr; }
  .scanning__preview { height: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .scanning__beam { animation-duration: 6s; }
  .scanning__steps li.is-active::before { animation-duration: 3s; }
}
.scan-note { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-fg); font-weight: 600; line-height: 1.45; }
.field.is-scanned input, .field.is-scanned select { border-color: var(--warn-fg); box-shadow: 0 0 0 3px var(--warn-bg); }
.field.is-scanned label::after { content: " ✓"; color: var(--warn-fg); }

/* Меню */
.count { display: inline-block; min-width: 24px; padding: 1px 8px; margin-left: 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; text-align: center; vertical-align: middle; }
.menu__cat { margin: 18px 0 8px; font-size: 13px; letter-spacing: .02em; color: var(--muted); font-weight: 700; }
.menu__list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.menu__link { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; color: inherit; text-decoration: none; border: 1px solid transparent; }
.menu__link:hover, .menu__link:focus-visible { background: var(--surface-2); border-color: var(--border); }
.menu__item.is-off .menu__link { opacity: .55; }
.menu__thumb { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.menu__thumb--empty { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border: 1px dashed var(--border-strong); }
.menu__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu__body b { overflow-wrap: anywhere; }
.menu__body small { color: var(--muted); font-size: 13px; }
.menu__miss { color: var(--warn-fg); }
.menu__price { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.manual { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.manual summary { cursor: pointer; font-weight: 600; color: var(--accent-strong); padding: 6px 0; }
.manual[open] summary { margin-bottom: 10px; }

/* Проверка загрузки меню */
.import { display: flex; flex-direction: column; gap: 14px; }
.import__sum { margin: 0; font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; }
.import__table { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 14px; }
.import__table th { text-align: left; padding: 10px 8px; background: var(--surface-2); color: var(--text-2); font-weight: 600; white-space: nowrap; }
.import__table td { padding: 6px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.import__table input:not([type="checkbox"]) { width: 100%; min-width: 110px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; }
.import__table input[type="checkbox"] { width: 20px; height: 20px; margin-top: 7px; accent-color: var(--accent); }
.import__table .import__price { min-width: 90px; font-variant-numeric: tabular-nums; }
.import__table tr.has-issue td { background: var(--warn-bg); }
.import__issue { display: block; margin-top: 3px; color: var(--warn-fg); font-weight: 600; font-size: 12px; }
.import__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.import__actions .auth__btn { width: auto; padding-inline: 22px; }

/* Карточка позиции: как увидит гость */
.dish { border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface); max-width: 360px; }
.dish__photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface-2); }
.dish__photo--empty { display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.dish__body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.dish__body p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.dish__price { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }

/* Склад */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 16px; padding: 4px; border-radius: 14px; background: var(--surface-2); width: fit-content; max-width: 100%; }
.tabs__link { padding: 8px 14px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.tabs__link:hover { color: var(--text); }
.tabs__link[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.stock-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.stock-bar .wsp__h2 { margin: 0; }
.stock-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stock-actions .auth__btn, .stock-first { width: auto; }
.stock-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.stock-filter select, .stock-lines select { padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; max-width: 100%; }
.stock-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.stock-table th { text-align: left; padding: 10px 10px; background: var(--surface-2); color: var(--text-2); font-weight: 600; white-space: nowrap; }
.stock-table td { padding: 10px; border-top: 1px solid var(--border); vertical-align: top; }
.stock-table tfoot th, .stock-table tfoot td { background: none; border-top: 2px solid var(--border-strong); }
.stock-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stock-table tr.has-issue td { background: var(--warn-bg); }
.stock-table a { color: inherit; font-weight: 600; }
.stock-warn { color: var(--warn-fg); }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; vertical-align: middle; background: var(--surface-2); color: var(--text-2); }
.status--posted { background: var(--accent-soft); color: var(--accent-strong); }
.status--draft { background: var(--warn-bg); color: var(--warn-fg); }
.status--reversed { text-decoration: line-through; }
.wsp__title .status { font-size: 14px; }
.stock-doc { display: flex; flex-direction: column; gap: 14px; }
.stock-doc__head { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.stock-lines { min-width: 720px; }
.stock-lines select { min-width: 160px; width: 100%; }
.stock-add { width: auto; align-self: flex-start; }
.stock-errors { margin: 0; padding-left: 20px; }
.stock-packs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.stock-packs li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
:lang(hy) .wsp__card > .import__actions { margin-top: 18px; }
@media (max-width: 640px) {
  /* Строки документа на телефоне — карточками: все поля видны без прокрутки вбок */
  .table-wrap:has(.stock-lines) { overflow: visible; border: 0; }
  .stock-lines, .stock-lines tbody, .stock-lines tr, .stock-lines td { display: block; min-width: 0; width: 100%; }
  .stock-lines thead { display: none; }
  .stock-lines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 14px; }
  .stock-lines td { padding: 0; border: 0; }
  .stock-lines td:first-child { grid-column: 1 / -1; }
  .stock-lines td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .stock-lines input:not([type="checkbox"]), .stock-lines select { min-width: 0; width: 100%; }
}
.stock-upload { margin: 0 0 16px; }
.stock-import__doc { display: flex; flex-direction: column; gap: 12px; }
.stock-import__inc { font-size: 16px; }
.stock-import__wh { max-width: 420px; }
.stock-import__src { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.stock-import__ok { display: block; color: var(--accent-strong); font-size: 12px; font-weight: 600; margin-top: 2px; }
.stock-select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; width: 100%; }
.stock-consumption { margin-top: 22px; }
.stock-history { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.stock-history summary { cursor: pointer; padding: 6px 0; }
.stock-table--compact { min-width: 0; }

/* Касса в бэк-офисе */
.pos-reg { justify-content: space-between; flex-wrap: wrap; }
.pos-reg .auth__btn { width: auto; }
.pos-open { align-items: end; margin-bottom: 18px; }
.pos-open .field { margin: 0; min-width: 200px; }
.pos-open .auth__btn { width: auto; }
.pos-inline { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.pos-inline .field { margin: 0; flex: 1 1 160px; }
.pos-inline input:not([type="hidden"]) { min-height: 40px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.pos-inline .auth__btn { width: auto; }
.pos-pending .menu__list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.pos-report { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.pos-report div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pos-report dt { font-size: 13px; color: var(--muted); }
.pos-report dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.pos-pays { margin-top: 12px; }
.pos-reg__auto { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 0 14px 12px; font-size: 13px; color: var(--muted); }
.pos-reg__auto .auth__btn { width: auto; }

/* Стоп-лист */
.stop-where { align-items: end; margin-bottom: 18px; }
.stop-where .field { margin: 0; min-width: 220px; }
.stop-where .auth__btn { width: auto; }
.stop-rows { gap: 0; }
.stop-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.stop-row:last-child { border-bottom: 0; }
.stop-why { font-size: 13px; color: var(--danger-text); }
.stop-why--auto { color: var(--warn-fg); }

/* Инвентаризация */
.count-open { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; max-width: 640px; }
.count-open .field { margin: 0; }
.count-open .auth__btn { align-self: flex-start; width: auto; }
.count-open__kinds { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; border: 0; }
.count-open__kinds legend { padding: 0; margin-bottom: 6px; }
.count-open__kinds .field__help { flex-basis: 100%; margin: 2px 0 0; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 14px; }
.count-summary { margin-bottom: 8px; }
.count-summary__short dd { color: var(--danger-text); }
.count-summary__surplus dd { color: var(--accent-strong); }
.count-form { display: flex; flex-direction: column; gap: 12px; }
.count-form > .field__help { margin: 0; }
.count-filter { max-width: 420px; width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; }
.count-table { min-width: 640px; }
.count-table td { vertical-align: middle; }
.count-table__group th { background: none; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding-top: 16px; }
:lang(hy) .count-table__group th { text-transform: none; }
.count-table tr.is-short td:nth-last-child(-n+2), .stock-table tr.is-short td:nth-last-child(-n+2) { color: var(--danger-text); }
.count-table tr.is-surplus td:nth-last-child(-n+2), .stock-table tr.is-surplus td:nth-last-child(-n+2) { color: var(--accent-strong); }
.count-when { display: block; color: var(--muted); font-size: 12px; }
/* Блок ввода — постоянной ширины: иначе колонка «Факт» забирала всё свободное место таблицы и поле тянулось
   на 300 px, а список единиц разной ширины («л» / «шт» / «кг») сдвигал поля строк относительно друг друга. */
.count-table td:has(> .count-input) { width: 1%; white-space: nowrap; }
.count-input { display: grid; grid-template-columns: 120px 76px; gap: 6px; }
.count-input input { width: 100%; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; text-align: right; }
.count-input select { width: 100%; min-height: 40px; padding: 7px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.count-actions { position: sticky; bottom: 0; z-index: 2; padding: 10px 0; background: var(--surface); }
.count-actions .auth__btn { width: auto; }
.count-delete { margin-top: 10px; }
.count-delete .auth__btn { width: auto; }
.count-add .field { flex: 1 1 180px; }
@media (max-width: 640px) {
  /* Пересчёт с телефона: строка — карточка, поле факта во всю ширину, без прокрутки вбок */
  .table-wrap:has(.count-table) { overflow: visible; border: 0; }
  .count-table, .count-table tbody, .count-table tr, .count-table td, .count-table th { display: block; min-width: 0; width: 100%; }
  .count-table thead { display: none; }
  .count-table tbody[hidden], .count-table tr[hidden] { display: none; }
  .count-table tr[data-name] { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 14px; }
  .count-table td, .count-table td.num { padding: 0; border: 0; text-align: left; }
  .count-table td:first-child, .count-table td:nth-child(3) { grid-column: 1 / -1; }
  .count-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .count-table td:first-child::before { display: none; }
  .count-table__group th { padding: 12px 0 6px; }
  .count-table td:has(> .count-input) { grid-column: 1 / -1; width: 100%; }
  .count-input { grid-template-columns: minmax(0, 1fr) 84px; }
  .count-input input { min-height: 46px; font-size: 18px; }
}

/* ՀԴՄ, подключённая к кассе: код подключения, состояние коннектора, данные аппарата в чеке */
.hdm-pair { border-color: var(--accent); }
.hdm-pair__code { margin: 4px 0 0; font-size: clamp(28px, 7vw, 40px); font-weight: 700; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.hdm-pair__steps { display: grid; gap: 10px; margin: 12px 0; padding-left: 20px; }
.hdm-pair__cmd { margin: 8px 0 0; padding: 12px; overflow-x: auto; border-radius: var(--radius-s); background: var(--surface-2); font-size: 13px; line-height: 1.6; white-space: pre; }
.hdm-pair__cmd span { color: var(--warn-fg); }
.hdm-state { display: grid; gap: 4px; margin: 0 14px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s); font-size: 13px; }
.hdm-state small { color: var(--muted); }
.hdm-state .stock-warn { color: var(--warn-fg); }
.hdm-state.is-online { border-color: var(--accent); }
.hdm-state.is-online b::before { content: "● "; color: var(--accent); }
.hdm-state.is-offline { border-color: var(--warn-fg); background: var(--warn-bg); }
.hdm-state__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.hdm-state__actions .auth__btn, .hdm-reports .auth__btn { width: auto; }
.pos-reg__fiscal { margin: 0 14px 12px; }
.hdm-fiscal { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; }
.hdm-fiscal .pos-report { flex: 1 1 240px; }
.hdm-fiscal__qr svg { display: block; width: 132px; height: 132px; background: #fff; border-radius: var(--radius-s); }
.hdm-reports { gap: 8px; }

/* Запуск: обязательные пункты готовности (без них смена на кассе не открывается) */
.launch { margin: 0 0 20px; padding: 14px 16px; border: 1px solid var(--warn-fg); border-radius: var(--radius-m); background: var(--warn-bg); color: var(--warn-fg); }
.launch p { margin: 4px 0 8px; }
.launch ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.launch a { color: inherit; font-weight: 600; }
.launch.is-ready { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.check__req { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-fg); font-size: 12px; font-weight: 600; vertical-align: 1px; }

/* График смен и карта возможностей */
.sched-bar { flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.sched-bar .auth__btn { width: auto; }
.sched-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.sched-head .auth__btn { width: auto; }
.sched-grid th, .sched-grid td { vertical-align: top; min-width: 96px; }
.sched-grid thead a { color: inherit; }
.sched-avail { display: block; margin: 0 0 4px; padding: 2px 6px; border-radius: 6px; border: 1px dashed var(--accent); color: var(--accent-strong); font-size: 12px; font-variant-numeric: tabular-nums; }
.sched-shift { display: block; margin: 0 0 4px; font-size: 13px; }
.sched-shift > summary, .sched-shift > span { display: block; padding: 4px 8px; border-radius: 8px; cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; list-style: none; }
.sched-shift.is-draft > summary, .sched-shift.is-draft > span { background: var(--surface-2); border: 1px dashed var(--border-strong); }
.sched-shift.is-published > summary, .sched-shift.is-published > span { background: var(--accent-soft); color: var(--accent-strong); }
.sched-edit { display: grid; gap: 6px; padding: 8px 0; min-width: 180px; }
.sched-edit label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.sched-edit .auth__btn { width: auto; }
.need-table tr.is-short td { color: var(--danger-text); }
.check-line { display: flex; gap: 8px; align-items: center; min-height: 32px; }
/* Карта возможностей: сводная (люди × дни) и своя неделя карточками */
.sched-bar { justify-content: flex-start; }
.sched-bar__nav { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.avail-grid td { padding: 6px; }
.avail-grid .sched-avail, .avail-grid .avail-shift { white-space: nowrap; }
.avail-grid tbody th, .avail-grid thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.avail-shift.is-outside { background: var(--warn-bg); color: var(--warn-fg); box-shadow: inset 0 0 0 1px var(--warn-fg); }
.avail-grid th.is-today, .avail-grid td.is-today { background: var(--accent-soft); }
.avail-grid td.is-empty .avail-cell > summary { opacity: .7; }
.avail-cell > summary { display: grid; gap: 4px; min-height: 36px; padding: 4px; border-radius: 8px; cursor: pointer; list-style: none; }
.avail-cell > summary::-webkit-details-marker { display: none; }
.avail-cell > summary:hover { background: var(--surface-2); }
.avail-cell > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.avail-cell > summary .sched-avail { margin: 0; }
.avail-cell[open] > summary { background: var(--surface-2); }
.avail-none { color: var(--muted); }
.avail-shift { display: block; padding: 2px 6px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.avail-pop { display: grid; gap: 8px; padding: 8px 4px 4px; min-width: 200px; }
.avail-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 2px 2px 2px 10px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent-strong); font-weight: 600; font-variant-numeric: tabular-nums; justify-self: start; }
.avail-chip button { width: 28px; height: 28px; border: 0; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.avail-chip button:hover { background: var(--surface); }
.avail-chip button:focus-visible { outline: 3px solid var(--focus); }
.avail-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.avail-form .auth__btn { width: auto; }
.avail-times { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.avail-times input { width: 104px; min-height: 40px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text); font: inherit; font-variant-numeric: tabular-nums; }
.avail-times input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.avail-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.avail-day { display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); }
.avail-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.avail-day__title { margin: 0; font-size: 16px; text-transform: capitalize; }
.avail-day__title small { margin-left: 6px; color: var(--muted); font-weight: 400; }
.avail-day__none { margin: 0; color: var(--muted); font-size: 14px; }



/* ── Рабочее место как в Dodo IS: панель слева, страница справа (templates/org/base_org.html) ───────────────
   Спокойно для глаза: один нейтральный фон, белые карточки с мягкой тенью, выделение — заливкой, не рамками;
   акцент бренда только там, где действие или «где я сейчас». Цвета — токены app.css (светлая и тёмная темы). */
.is-app { background: var(--bg); }
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; align-items: start; }
.shell__toggle, .shell__bar, .shell__shade { display: none; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
        padding: 22px 16px 28px; background: var(--bg); scrollbar-width: thin; }
.side__brand { display: inline-flex; align-items: center; gap: 10px; padding: 2px 8px 10px; color: var(--text); font-weight: 800;
               font-size: 18px; letter-spacing: .01em; text-decoration: none; }
.side__brand .brand__mark { width: 32px; height: 32px; font-size: 16px; }

/* карточки человека и бизнеса: нажатие — их меню */
.side__card { background: var(--surface); border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04); }
.side__card > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 14px;
                        cursor: pointer; list-style: none; border-radius: 16px; }
.side__card > summary::-webkit-details-marker { display: none; }
.side__card > summary:hover { background: var(--surface-2); }
.side__card[data-single] > summary { cursor: default; }
.side__card[data-single] > summary:hover { background: transparent; }
.side__who { display: grid; min-width: 0; line-height: 1.3; }
.side__who b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__who small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: 17px;
                color: #fff; background: linear-gradient(135deg, #F2A541, #E2683C); }
.side__avatar--org { background: var(--brand-gradient); }
.side__menu { display: grid; gap: 2px; padding: 4px 8px 10px; border-top: 1px solid var(--border); }
.side__menu a, .side__menu-btn { display: flex; align-items: baseline; gap: 6px; width: 100%; min-height: 40px; padding: 9px 10px; border: 0;
                                 border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left;
                                 text-decoration: none; cursor: pointer; }
.side__menu a:hover, .side__menu-btn:hover { background: var(--surface-2); }
.side__menu-btn small { color: var(--muted); font-size: 12px; }
.side__menu-label { padding: 10px 10px 4px; font-size: 12px; color: var(--muted); }
.side__prefs { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
.side__prefs .lang-switch__btn { padding-inline: 8px; font-size: 13px; }

/* разделы: строки, группа раскрывается; «где я» — белая плашка, как в Dodo IS */
.side__nav { display: grid; gap: 2px; margin-top: 8px; }
.side__link { display: flex; align-items: center; gap: 6px; min-height: 42px; padding: 9px 14px; border-radius: 12px; color: var(--text-2);
              font-size: 15px; text-decoration: none; transition: background .15s ease, color .15s ease; }
.side__link:hover { background: var(--surface-2); color: var(--text); }
.side__link[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 700;
                                   box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.side__link--out { margin-top: 10px; color: var(--muted); }
.side__group { border-radius: 14px; }
.side__group[open] { background: var(--surface-2); padding-bottom: 6px; }
.side__group > summary { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 9px 14px;
                         border-radius: 12px; color: var(--text-2); font-size: 15px; cursor: pointer; list-style: none; }
.side__group > summary::-webkit-details-marker { display: none; }
.side__group > summary::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid currentColor;
                                border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .55;
                                transition: transform .2s ease; }
.side__group[open] > summary { color: var(--text); font-weight: 700; }
.side__group[open] > summary::after { transform: rotate(-135deg) translateX(-2px); }
.side__group > summary:hover { background: var(--surface-2); }
.side__group .side__link { margin-inline: 6px; padding-left: 14px; }

/* страница: просторно, крупный заголовок, карточки с мягкой тенью вместо жёстких рамок */
.shell__main { min-width: 0; padding: 30px clamp(16px, 3.2vw, 44px) 64px; margin: 10px 10px 10px 0; background: var(--surface-2);
               border-radius: 24px; min-height: calc(100vh - 20px); max-width: 1480px; }
.is-app .wsp__card { border-color: transparent; box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04); }
.is-app .wsp__title { font-size: clamp(28px, 3.2vw, 40px); letter-spacing: -0.02em; }
.is-app .auth__flash { margin: 0; }

/* тёмная тема: тени не видны — разделяем тоном */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .shell__main { background: #15181B; } }
:root[data-theme="dark"] .shell__main { background: #15181B; }

/* телефон и планшет: панель уезжает, открывается кнопкой «Меню» */
@media (max-width: 980px) {
  /* align-content: start — иначе на короткой странице лишняя высота экрана делится между шапкой и страницей (пустота сверху) */
  .shell { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .shell__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30;
                padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
  .shell__bar .side__brand { padding: 0; }
  .shell__menu-btn { min-height: 40px; padding: 8px 16px; border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 700;
                     box-shadow: 0 1px 2px rgba(16, 24, 40, .08); cursor: pointer; }
  .side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(320px, 86vw); height: 100vh; transform: translateX(-102%);
          transition: transform .22s ease; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
  .side__brand--top { display: none; }
  .shell__toggle:checked ~ .side { transform: none; }
  .shell__toggle:checked ~ .shell__shade { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .35); }
  .shell__main { margin: 0; border-radius: 0; min-height: auto; padding: 22px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { .side, .side__group > summary::after, .side__link { transition: none; } }
.sched-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.sched-legend .sched-avail, .sched-legend .sched-shift { display: inline-block; margin: 0; }
.sched-done { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border-radius: 999px; background: var(--accent-soft);
              color: var(--accent-strong); font-size: 13px; font-weight: 700; }

/* Ревизия: устройства, вслепую, сверка, история правок, итоги потерь */
.count-devices__list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0 0 12px; padding: 0; }
.count-device { display: grid; gap: 2px; min-width: 180px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.count-device small { color: var(--muted); font-size: 12px; }
.count-device__status { font-size: 13px; font-weight: 700; color: var(--warn-fg); }
.count-device.is-submitted .count-device__status { color: var(--accent-strong); }
.count-table tr.needs-recheck td { background: var(--warn-bg); }
.count-table tr.needs-recheck td:first-child { box-shadow: inset 4px 0 0 var(--warn-fg); }
.count-table tr.is-edited td:first-child label, .stock-table tr.is-edited td:first-child { text-decoration: underline dotted var(--accent); text-underline-offset: 4px; }
.count-table tr.is-edited .count-input input { border-color: var(--accent); background: var(--accent-soft); }
.count-history { margin-top: 4px; font-size: 12px; }
.count-history summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; }
.count-history ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; color: var(--text-2); }
.count-history time { color: var(--muted); font-variant-numeric: tabular-nums; }
.count-history small { color: var(--muted); }
.count-ok { color: var(--accent-strong); font-weight: 700; font-size: 13px; }
.loss-report div { position: relative; }
.loss-report dd small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.loss-report .is-bad dd { color: var(--danger-text); }
.loss-report .is-good dd { color: var(--accent-strong); }
.loss-report .is-total { background: var(--surface-2); }

/* ── Типичные закупки (стартовый набор сырья) ── */
.starter { display: grid; gap: 16px; }
.starter__note { margin: 0; color: var(--muted); font-size: 14px; }
.starter__group { margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface); min-width: 0; }
.starter__group legend { padding: 0 6px; }
.starter__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; margin: 0; padding: 0; list-style: none; }
.starter__row { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: var(--radius-s); cursor: pointer; }
.starter__row:hover { background: var(--accent-soft); }
.starter__row input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.starter__row b { display: block; font-weight: 600; }
.starter__row small { color: var(--muted); }
.starter__row.is-done { cursor: default; opacity: .6; }
.starter__row.is-done:hover { background: none; }
.starter__bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0; background: var(--bg); }
.starter-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 16px;
  border: 1px solid var(--accent-soft); border-radius: var(--radius-m); background: var(--accent-soft); }
.starter-cta p { margin: 0; }
.classifier-hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Настройки → Станции кухни */
.station-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.station { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 16px; }
.station__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.station__head .auth__btn { width: auto; }
.station__name { display: flex; flex-direction: column; min-width: 0; }
.station__name small { color: var(--muted); }
.station__devices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.station__items, .station__more { margin: 0; }
.station__more summary { color: var(--muted); font-size: 14px; cursor: pointer; }
.station__more form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.station__more .auth__btn, .station__form .auth__btn { width: auto; }
.station__form { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 10px; }
.station__choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; width: 100%; }
.station__cat { grid-column: 1 / -1; margin: 10px 0 2px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
:lang(hy) .station__cat { text-transform: none; }
.station__else { color: var(--muted); }
.station__unrouted { margin-top: 12px; }
.station-add { max-width: 520px; }
.kds-url { overflow-wrap: anywhere; }
.station__devices .hdm-state { margin: 0; }

/* Настройки → Сайт и онлайн-заказы */
.sf-set__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sf-set__head .hdm-state { margin: 0; }
.sf-set__cover { width: 240px; max-width: 100%; border-radius: 14px; }

