:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e4e6eb;
  --text: #1c1f24;
  --muted: #6b7280;
  --accent: #e8590c;
  --accent-soft: #fff1e8;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fff6db;
  --nav: #17191d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text); background: var(--bg);
  display: grid; grid-template-columns: 188px 1fr; overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 10px; }
kbd { font: 11px/1 Consolas, monospace; padding: 2px 5px; border-radius: 4px; background: rgba(127,127,127,.18); opacity: .75; }
.muted { color: var(--muted); }
.r { text-align: right; }
.hidden, [hidden] { display: none !important; }

/* Навигация */
.nav { background: var(--nav); color: #cfd3da; display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 600; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.nav button { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; padding: 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.nav button:hover { background: rgba(255,255,255,.06); }
.nav button.active { background: rgba(255,255,255,.1); color: #fff; }
.nav button kbd { margin-left: auto; background: rgba(255,255,255,.1); }
.nav .ic { width: 20px; text-align: center; }
.nav-foot { margin-top: auto; padding: 10px; font-size: 12px; border-radius: 8px; background: rgba(255,255,255,.05); }
.nav-foot b { color: #fff; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--bad); }
.dot.on { background: #22c55e; }

main { overflow: hidden; height: 100vh; }
.view { display: none; height: 100%; overflow: auto; padding: 20px 24px; }
.view.active { display: block; }
#view-pos.active { display: block; padding: 0; overflow: hidden; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Кнопки и поля */
button.primary, button.ghost, button.danger, button.ok { border-radius: 8px; padding: 9px 14px; cursor: pointer; border: 1px solid transparent; font-weight: 600; }
button.primary { background: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(.95); }
button.primary:disabled { background: #d8dbe0; color: #8a909a; cursor: default; }
button.ghost { background: var(--panel); border-color: var(--line); }
button.ghost:hover { background: #f0f1f4; }
button.danger { background: var(--bad-soft); color: var(--bad); }
button.ok { background: var(--ok); color: #fff; }
button.small { padding: 5px 10px; font-size: 13px; }
button.big { width: 100%; padding: 16px; font-size: 18px; display: flex; justify-content: center; align-items: center; gap: 10px; }
button.icon { background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; color: var(--muted); font-size: 15px; }
button.icon:hover { background: #eef0f3; color: var(--text); }
input, select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=number] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }
.search { width: 100%; font-size: 16px; padding: 13px 14px; }
.search.sm { font-size: 14px; padding: 9px 12px; max-width: 360px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.seg { display: inline-flex; background: #e9ebef; border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.row-end { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.row-end input { flex: 1; }
.hint { color: var(--muted); margin: 0 0 10px; }
.note { background: var(--warn-soft); color: #6b4a07; padding: 12px 14px; border-radius: 8px; }

/* Таблицы */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 150px); }
.card .table-wrap { border: 0; border-radius: 0; }
.table-wrap.short { max-height: calc(100vh - 210px); }
.table { width: 100%; border-collapse: collapse; }
.table th { position: sticky; top: 0; background: #fafbfc; text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .02em; padding: 10px 12px; border-bottom: 1px solid var(--line); z-index: 1; }
.table td { padding: 9px 12px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; }
.table th.r, .table td.r { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.sel { background: var(--accent-soft); }
.table.compact td { padding: 7px 10px; }
.table td input { width: 90px; text-align: right; padding: 5px 8px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef0f3; color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }
.low { color: var(--bad); font-weight: 600; }

/* Касса */
.pos { display: grid; grid-template-columns: 1fr 400px; height: 100vh; }
.pos-left { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; overflow: hidden; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; cursor: pointer; font-weight: 500; }
.chips button.active { background: var(--text); border-color: var(--text); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; overflow: auto; align-content: start; padding-bottom: 20px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 92px; text-align: left; transition: border-color .1s, transform .05s; }
.tile:hover { border-color: var(--accent); }
.tile:active { transform: scale(.98); }
.tile.kb { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tile .t-name { font-weight: 600; line-height: 1.25; }
.tile .t-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; }
.tile .t-price { font-weight: 700; font-size: 15px; }
.tile .t-stock { font-size: 12px; color: var(--muted); }
.tile .t-stock.low { color: var(--bad); }

.pos-right { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; }
.cart { flex: 1; overflow: auto; padding: 0 10px; }
.cart-empty { color: var(--muted); text-align: center; padding: 40px 20px; }
.ci { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 8px; border-bottom: 1px solid #f0f1f4; }
.ci.flash { animation: flash .6s; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.ci .ci-name { font-weight: 600; }
.ci .ci-mark { font-size: 11px; color: var(--ok); }
.ci .ci-sum { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.ci .ci-ctrl { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.qty button { border: 0; background: #f4f5f7; width: 26px; height: 26px; cursor: pointer; font-weight: 700; }
.qty input { width: 44px; border: 0; border-radius: 0; text-align: center; padding: 3px; box-shadow: none !important; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.cart-foot .line { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-foot .total { color: var(--text); font-size: 24px; font-weight: 700; margin: 4px 0 6px; }
.discount-input { display: inline-flex; gap: 4px; }
.discount-input input { width: 90px; text-align: right; padding: 5px 8px; }
.discount-input select { padding: 5px 6px; }

/* Модалка */
.modal-bg { position: fixed; inset: 0; background: rgba(15,17,20,.45); display: grid; place-items: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
.modal-b { padding: 10px 20px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 20px; }
.form { display: grid; gap: 12px; max-width: 620px; }
.form label, .modal-b label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; color: #3a3f47; }
.form label.check, .modal-b label.check { flex-direction: row; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal-b .grid2 + .grid2, .modal-b label + .grid2, .modal-b .grid2 + label, .modal-b .grid3 { margin-top: 12px; }
.modal-b > label + label { margin-top: 12px; }

.pay-total { font-size: 34px; font-weight: 800; text-align: center; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-methods button { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 14px 6px; cursor: pointer; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pay-methods button span { font-size: 22px; }
.pay-methods button.active { border-color: var(--accent); background: var(--accent-soft); }
.cash-box { margin-top: 14px; }
.cash-box input { font-size: 22px; text-align: right; width: 100%; padding: 10px 12px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { flex: 1; border: 1px solid var(--line); background: #f7f8fa; border-radius: 8px; padding: 8px 4px; cursor: pointer; font-weight: 600; }
.change { margin-top: 12px; display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; padding: 12px 14px; background: var(--ok-soft); color: var(--ok); border-radius: 10px; }
.change.bad { background: var(--bad-soft); color: var(--bad); }
.age { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); color: #6b4a07; }

.done-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 34px; margin: 10px auto; }

/* Склад, продажи, смена */
.stock-grid, .sales-grid, .shift-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.sales-grid { grid-template-columns: 1fr 380px; }
.shift-grid { grid-template-columns: 420px 1fr; }
.dropdown { position: relative; }
.dropdown .dd { position: absolute; left: 0; right: 0; top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; z-index: 5; }
.dd div { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.dd div:hover, .dd div.kb { background: var(--accent-soft); }
#stockTable { margin-top: 12px; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #eceef1; font-variant-numeric: tabular-nums; }
.kv.big { font-size: 18px; font-weight: 700; border: 0; }
.items-list { margin: 10px 0; }

/* Отчёты */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k-l { color: var(--muted); font-size: 13px; }
.kpi .k-v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .k-s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rep-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .b:hover { opacity: 1; }
.bars-x { display: flex; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.bars-x span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }
.pay-split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 8px 0 10px; background: #eef0f3; }
.pay-split div { height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

/* Уведомления */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #1c1f24; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 380px; animation: tin .15s; }
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* Чек для печати */
#printArea { display: none; }
@media print {
  @page { margin: 0; }
  body { display: block; background: #fff; overflow: visible; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block; }
  .receipt { font: 12px/1.35 "Courier New", monospace; color: #000; padding: 2mm 3mm; }
  .receipt.w58 { width: 58mm; font-size: 11px; }
  .receipt.w80 { width: 80mm; }
  .receipt .c { text-align: center; }
  .receipt .row { display: flex; justify-content: space-between; gap: 6px; }
  .receipt hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
  .receipt .big { font-size: 15px; font-weight: 700; }
}

@media (max-width: 1100px) {
  body { grid-template-columns: 64px 1fr; }
  .nav .brand-name, .nav button kbd { display: none; }
  .nav button { font-size: 0; justify-content: center; }
  .nav .ic { font-size: 18px; }
  .nav-foot { display: none; }
  .pos { grid-template-columns: 1fr 360px; }
  .stock-grid, .sales-grid, .shift-grid, .rep-grid { grid-template-columns: 1fr; }
}

/* ===== Касса (отдельное приложение) ===== */
.kassa-body { display: block; }
.kassa { display: flex; flex-direction: column; height: 100vh; }
.topbar { height: 52px; flex: none; background: var(--nav); color: #cfd3da; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; gap: 12px; }
.topbar .brand { padding: 0; gap: 10px; }
.topbar .muted { color: #8b919c; font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar button.ghost { background: rgba(255,255,255,.08); border-color: transparent; color: #fff; }
.topbar button.ghost:hover { background: rgba(255,255,255,.15); }
.kassa .pos { height: calc(100vh - 52px); }
.net { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.08); }
.net::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: currentColor; }
.net.on { color: #4ade80; }
.net.warn { color: #fbbf24; }
.net.off { color: #f87171; }

/* ===== Экраны входа / подключения ===== */
.center-screen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; padding: 28px; }
.auth-card .big-logo { width: 56px; height: 56px; font-size: 28px; margin: 0 auto 4px; color: #fff; border-radius: 14px; }
.auth-card p { margin: 0; }
.code-input { text-align: center; font-size: 26px; letter-spacing: .12em; font-family: Consolas, monospace; }
.pair-code { font: 700 34px/1.2 Consolas, monospace; letter-spacing: .12em; text-align: center; padding: 16px; background: var(--accent-soft); color: var(--accent); border-radius: 10px; margin: 10px 0; user-select: all; }

/* ===== Бэк-офис ===== */
.nav .nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 6px; }
.nav .nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; padding: 8px 10px 4px; }
.table td.cb, .table th.cb { width: 34px; padding-right: 0; }
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--accent-soft); border-radius: 8px; margin-bottom: 10px; }
.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.cat-row input { flex: 1; border-color: transparent; background: transparent; }
.cat-row input:focus { border-color: var(--accent); background: #fff; }
.cat-row .n { color: var(--muted); font-size: 13px; min-width: 70px; text-align: right; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-3-1 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--text); }
.th-sort.on::after { content: ' ↓'; }
.th-sort.on.asc::after { content: ' ↑'; }
.abc { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 800; font-size: 13px; }
.abc-A { background: #dcfce7; color: #15803d; }
.abc-B { background: #fef3c7; color: #a16207; }
.abc-C { background: #fee2e2; color: #b91c1c; }
.abc-D { background: #e5e7eb; color: #4b5563; }
.abc-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.abc-card { border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.abc-card.active { box-shadow: 0 0 0 2px var(--text); }
.abc-card .t { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.abc-card .v { font-size: 20px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.abc-card .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.abc-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 6px 0 16px; }
.abc-bar div { height: 100%; }
.age-pill { display: inline-block; min-width: 44px; text-align: center; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.age-ok { background: var(--ok-soft); color: var(--ok); }
.age-mid { background: var(--warn-soft); color: var(--warn); }
.age-old { background: var(--bad-soft); color: var(--bad); }
.explain { color: var(--muted); font-size: 13px; margin: -4px 0 14px; max-width: 900px; }
.link { color: var(--accent); cursor: pointer; text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.list-plain { margin: 0; padding: 0; list-style: none; }
.list-plain li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eceef1; }
@media (max-width: 1100px) { .grid-2, .grid-3-1 { grid-template-columns: 1fr; } .abc-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) {
  .kassa .pos { grid-template-columns: 1fr; }
  body:not(.kassa-body) { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  body:not(.kassa-body) .nav { flex-direction: row; overflow-x: auto; padding: 6px; }
  body:not(.kassa-body) .nav .brand, body:not(.kassa-body) .nav .nav-title, body:not(.kassa-body) .nav .nav-sep, body:not(.kassa-body) .nav-foot { display: none; }
  body:not(.kassa-body) main { height: auto; }
  .view { padding: 14px 16px; }
}
@media (max-width: 1100px) { .nav .nav-title, .nav .nav-sep { display: none; } }
@media (max-width: 700px) {
  body:not(.kassa-body) { overflow: auto; height: auto; }
  body:not(.kassa-body) .view { height: auto; overflow: visible; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .table-wrap { max-height: none; }
}
a.btn-link { display: inline-flex; align-items: center; border-radius: 8px; padding: 9px 14px; font-weight: 600; text-decoration: none; color: var(--text); background: var(--panel); border: 1px solid var(--line); }
a.btn-link:hover { background: #f0f1f4; }

/* ===== Финансы ===== */
.fin-table { max-height: calc(100vh - 190px); }
.fin-table td:first-child, .fin-table th:first-child { position: sticky; left: 0; background: #fff; z-index: 2; }
.fin-table th:first-child { background: #fafbfc; z-index: 3; }
.fin-table td, .fin-table th { white-space: nowrap; }
.fin-table td.future, .fin-table th.future { opacity: .45; }
.fin-sec td { background: #f4f5f7 !important; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.fin-strong td { font-weight: 700; }
.fin-sub td { font-weight: 600; border-top: 1px solid var(--line); }
.fin-total td { font-weight: 800; background: var(--accent-soft) !important; font-size: 15px; }
.op-grid { display: grid; grid-template-columns: auto 150px 1fr 140px 170px 1fr auto; gap: 8px; align-items: center; }
.cat-row select { max-width: 230px; }
@media (max-width: 1100px) { .op-grid { grid-template-columns: 1fr 1fr; } }

/* ===== Клиент на кассе ===== */
.cust-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 18px 8px; padding: 8px 12px; border-radius: 9px; background: var(--accent-soft); color: #7a2e05; }
.cust-chip b { color: var(--text); }
.points-box { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #f4f5f7; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.points-box input { width: 110px; text-align: right; }
.phone-wrap { display: flex; align-items: stretch; }
.phone-prefix { display: grid; place-items: center; padding: 0 12px; font-size: 16px; font-weight: 600; background: #f4f5f7; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; }
.phone-wrap input { border-radius: 0 8px 8px 0; letter-spacing: .03em; }

/* Печать отчёта на А4 */
@media print {
  .report { font: 11px/1.35 Arial, sans-serif; color: #000; padding: 12mm; }
  .report h2 { font-size: 16px; margin: 0 0 6px; }
  .report table { width: 100%; border-collapse: collapse; margin: 8px 0; }
  .report th, .report td { border: 1px solid #999; padding: 3px 5px; text-align: left; }
  .report td:nth-child(n+3), .report th:nth-child(n+3) { text-align: right; }
  .report thead th { background: #eee; }
  .report tfoot td { font-weight: 700; }
  .report .small { color: #555; font-size: 10px; }
}

/* Сортировка по заголовку: ▼ лучшие, ▲ худшие, ↕ не выбрано */
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--text); background: #f0f1f4; }
.table th.sorted { color: var(--accent); background: var(--accent-soft); }
.sort-arr { font-size: 10px; margin-left: 2px; }
.sort-arr.idle { opacity: 0; }
.table th.sortable:hover .sort-arr.idle { opacity: .5; }

/* ===== Склад ===== */
.inline-field { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.inline-field select { min-width: 160px; }
.doc-sum { margin-top: 10px; padding: 10px 12px; background: #f7f8fa; border-radius: 8px; font-variant-numeric: tabular-nums; }
.doc-sum:empty { display: none; }
.plus { color: var(--ok); }
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.wh-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* Сворачиваемые группы меню */
.nav .nav-title { display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; border-radius: 6px; margin-top: 4px; }
.nav .nav-title:hover { color: #cfd3da; background: rgba(255,255,255,.04); }
.nav .nav-chev { font-size: 11px; transition: transform .15s; }
.nav .nav-title.closed .nav-chev { transform: rotate(-90deg); }
.nav button.nav-hidden { display: none; }
.nav { overflow-y: auto; }
@media (max-width: 1100px) { .nav button.nav-hidden { display: flex; } }

/* ===== Вход и пользователи ===== */
.auth-fields { display: flex; flex-direction: column; gap: 10px; }
.auth-card h1 { font-size: 22px; }
.nav-user { padding: 10px; margin-top: 8px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; line-height: 1.4; }
.nav-user .nu-name { color: #fff; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user .nu-sub { color: #8b919c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user .nu-actions { margin-top: 4px; color: #8b919c; }
.nav-user .link { color: #fdba8c; font-weight: 500; }
.nav .nav-foot { display: none; }
.link-box { display: flex; gap: 8px; margin: 10px 0; }
.link-box input { flex: 1; font-family: Consolas, monospace; font-size: 12px; }
@media (max-width: 1100px) { .nav-user .nu-sub, .nav-user .nu-actions .link:first-child { display: none; } .nav-user { font-size: 0; } .nav-user .nu-actions .link { font-size: 11px; } }

/* ===== Штрихкод и этикетки ===== */
.input-btn { display: flex; gap: 6px; }
.input-btn input { flex: 1; min-width: 0; }
.barcode-box { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.barcode-box:empty { display: none; }
.barcode-box svg { max-width: 220px; height: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px; background: #fff; }
.table td input.narrow { width: 70px; }
.label-preview { display: flex; justify-content: center; padding: 14px; background: #f4f5f7; border-radius: 10px; }
.label { background: #fff; color: #000; box-sizing: border-box; padding: 1.5mm 2mm; display: flex; flex-direction: column; align-items: center; justify-content: space-between; overflow: hidden; font-family: Arial, sans-serif; border: 1px dashed #bbb; }
.label .lb-name { font-size: 9pt; font-weight: 700; text-align: center; line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.label .lb-sku { font-size: 7pt; color: #333; }
.label .lb-price { font-size: 13pt; font-weight: 800; }
.label .lb-code { width: 100%; display: flex; justify-content: center; min-height: 0; flex: 1; align-items: flex-end; }
.label .lb-code svg { width: 100%; height: auto; max-height: 100%; }
.lb-40x30 .lb-name { font-size: 7pt; } .lb-40x30 .lb-price { font-size: 10pt; }
.lb-58x30 .lb-price { font-size: 11pt; }
@media print {
  .labels .label { border: 0; page-break-after: always; break-after: page; }
}
.cat-bar { width: 120px; height: 6px; border-radius: 3px; background: #eef0f3; overflow: hidden; flex: none; }
.cat-bar span { display: block; height: 100%; background: var(--accent); opacity: .7; }
.cat-none { background: var(--warn-soft); border-color: transparent; }

/* ===== Финансы: баланс и операции ===== */
.fin-top { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.bal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.bal-list { display: flex; flex-direction: column; }
.bal-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #eceef1; }
.bal-name { font-weight: 600; line-height: 1.3; }
.bal-name .badge { font-size: 11px; font-weight: 500; }
.bal-sum { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bal-act { display: flex; }
.bal-total { display: flex; justify-content: space-between; padding: 12px 0 0; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.op-fields { display: grid; grid-template-columns: 140px 1fr 130px 1fr; gap: 8px; align-items: center; }
.op-fields input[name="note"] { grid-column: 1 / 4; }
.op-fields.op-transfer { grid-template-columns: 140px 1fr auto 1fr 130px; }
.op-fields.op-transfer input[name="note"] { grid-column: 1 / 5; }
.op-arrow { font-size: 18px; color: var(--muted); }
.row-auto td { color: #4b5563; background: #fbfbfc; }
@media (max-width: 1100px) { .fin-top { grid-template-columns: 1fr; } .op-fields, .op-fields.op-transfer { grid-template-columns: 1fr 1fr; } .op-fields input[name="note"], .op-fields.op-transfer input[name="note"] { grid-column: 1 / -1; } .op-arrow { display: none; } }
.cat-row input.cat-grp { flex: 0 0 120px; color: var(--muted); }

/* ===== Аналитика денег: графики и помощник ===== */
.lc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 4px; }
.lc-legend button { border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); padding: 2px 0; }
.lc-legend button.off { color: var(--muted); text-decoration: line-through; opacity: .6; }
.lc-legend i, .lc-tip i, .lc-sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex: none; }
.lc-legend i.dash { background-image: linear-gradient(90deg, transparent 50%, var(--panel, #fff) 50%) !important; background-size: 6px 3px; }
.lc-sw { margin-right: 6px; vertical-align: middle; }
.lc-wrap { position: relative; }
.lc { width: 100%; height: auto; display: block; overflow: visible; }
.lc-grid { stroke: #eceef1; stroke-width: 1; }
.lc-zero { stroke: #c9ccd2; }
.lc-ytick { font-size: 11px; fill: var(--muted); text-anchor: end; font-variant-numeric: tabular-nums; }
.lc-xtick { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.lc-ref { stroke: #9aa0a8; stroke-width: 1; stroke-dasharray: 4 4; }
.lc-reflabel { font-size: 11px; fill: var(--muted); text-anchor: end; }
.lc-cross { stroke: #b5b9c0; stroke-width: 1; }
.lc-tip { position: absolute; top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: 8px 10px; font-size: 12px; min-width: 190px; pointer-events: none; z-index: 5; }
.lc-tip div { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.lc-tip span { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; padding-left: 10px; }
.lc-tip .lc-ev { color: var(--muted); }
.fa-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.fa-hero { margin-top: 12px; padding: 16px 18px; border-radius: 12px; background: var(--ok-soft); }
.fa-hero.zero { background: var(--warn-soft); }
.fa-hero-l { color: var(--muted); font-size: 13px; }
.fa-hero-v { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0; }
.fa-hero-s { font-size: 13px; color: #3a3f47; }
.fa-settings { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: flex-start; margin-top: 12px; }
.fa-settings details { flex: 1; min-width: 240px; }
.fa-settings summary, .fa-more summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.fa-accs { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.fa-why .kv b { font-variant-numeric: tabular-nums; }
.fa-more { margin-top: 12px; }
.pl-form { display: grid; grid-template-columns: auto 140px 1fr; gap: 8px; margin-bottom: 12px; }
.pl-form input[name="note"] { grid-column: 1 / 3; }
.pl-form select { grid-column: 3; grid-row: 2; }
.pl-form input[name="note"] { grid-row: 3; grid-column: 1 / 3; }
.pl-form button.primary { grid-row: 3; grid-column: 3; }
.pl-list { display: flex; flex-direction: column; }
.pl-row { display: grid; grid-template-columns: 96px 1fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed #eceef1; }
.pl-row.overdue { background: var(--bad-soft); border-radius: 6px; padding: 8px 6px; }
.pl-date { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 1100px) { .fa-grid { grid-template-columns: 1fr; } }

/* ---- период «с — по» и сводка продаж ---- */
.pp { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pp .seg { flex-wrap: wrap; max-width: 100%; }
.pp .seg button { white-space: nowrap; }
.pp-dates { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.pp-dates input { padding: 6px 8px; }
.ss-h { margin: 0 0 8px; font-size: 16px; }
.ss-h .muted { font-weight: 400; font-size: 13px; }
.up { color: #138a5e; font-weight: 600; }
.ss-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ss-totals .k-l { color: var(--muted); font-size: 12px; }
.ss-totals .k-v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ss-grid .ss-wide { grid-column: 1 / -1; }
.hb { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(80px, 140px) 1fr auto 40px; gap: 10px; align-items: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { background: #eef0f3; border-radius: 4px; height: 10px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: #2a78d6; border-radius: 4px; }
.hb-p { text-align: right; font-size: 12px; }
@media (max-width: 900px) { .ss-grid { grid-template-columns: 1fr; } }
/* ---- меню шире, группы в рамках ---- */
body.admin-body { grid-template-columns: 236px 1fr; }
.nav-group { display: flex; flex-direction: column; gap: 2px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 4px; margin-top: 8px; background: rgba(255,255,255,.025); }
.nav-group .nav-title { margin-top: 0 !important; color: #9aa1ad; font-weight: 600; }
.nav-group .nav-title.closed { color: #7b818c; }
@media (max-width: 1100px) { body.admin-body { grid-template-columns: 64px 1fr; } .nav-group { display: contents; } }

/* ---- аналитика: сценарии вывода ---- */
.fa-scen { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.fa-scen-t { font-weight: 700; font-size: 15px; }
.fa-buy { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 8px; }
.fa-buy label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .fa-buy { grid-template-columns: 1fr; } }

/* ---- сводка: колонка из двух карточек ---- */
.ss-col { display: flex; flex-direction: column; gap: 16px; }

/* ---- печать штрихкодов ---- */
.lb-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
.lb-side { position: sticky; top: 0; }
.lb-row { display: grid; grid-template-columns: 1fr 64px auto; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #eceef1; font-size: 13px; }
.lb-row input { padding: 4px 6px; }
.lb-n { overflow: hidden; text-overflow: ellipsis; }
#lbSel { max-height: 300px; overflow-y: auto; }
@media (max-width: 1000px) { .lb-layout { grid-template-columns: 1fr; } .lb-side { position: static; } }
/* ---- переключатель (ползунок) ---- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row .muted { font-size: 12px; font-weight: 400; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 24px; border-radius: 12px; background: #cfd3da; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
input.switch:checked { background: #1baf7a; }
input.switch:checked::after { left: 23px; }
.zone-seg button { white-space: nowrap; }
.pin-mask { font-family: ui-monospace, Consolas, monospace; cursor: pointer; letter-spacing: .15em; background: #f1f2f5; padding: 2px 8px; border-radius: 6px; }

/* ---- схема зала ---- */
.fl-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.fl-card { padding: 10px; }
.fl-canvas { position: relative; width: 100%; background-color: #f7f8fa; background-image: linear-gradient(#e6e8ec 1px, transparent 1px), linear-gradient(90deg, #e6e8ec 1px, transparent 1px); background-size: 4% 6.6667%; border-radius: 10px; touch-action: none; user-select: none; cursor: crosshair; overflow: hidden; }
.fl-t { position: absolute; box-sizing: border-box; background: #fff; border: 2px solid #9aa3b2; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: move; font-weight: 700; font-size: 14px; text-align: center; overflow: hidden; padding: 2px; }
.fl-t.round { border-radius: 50%; }
.fl-t small { font-weight: 400; color: var(--muted); font-size: 11px; }
.fl-t.sel { border-color: #2a78d6; box-shadow: 0 0 0 3px rgba(42,120,214,.2); }
.fl-rs { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-right: 3px solid #2a78d6; border-bottom: 3px solid #2a78d6; cursor: nwse-resize; }
.fl-ghost { position: absolute; border: 2px dashed #2a78d6; background: rgba(42,120,214,.08); border-radius: 10px; pointer-events: none; }
.fl-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); pointer-events: none; }
.fl-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
@media (max-width: 1000px) { .fl-layout { grid-template-columns: 1fr; } }
/* ---- касса: вкладки, лаунж, PIN ---- */
.ztabs { display: flex; gap: 4px; background: rgba(255,255,255,.08); border-radius: 10px; padding: 3px; }
.ztabs button { border: 0; background: none; color: #cfd3da; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.ztabs button.active { background: #fff; color: var(--text); }
.zt-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #eb6834; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.zt-n:empty { display: none; }
.lounge { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.lounge-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 15px; }
.lounge-head .muted { font-size: 13px; }
.lm-wrap { max-width: 1400px; width: 100%; }
.lm-canvas { position: relative; width: 100%; background: #f1f2f5; border-radius: 14px; }
.lm-t { position: absolute; box-sizing: border-box; border: 2px solid #c3c8d1; background: #fff; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 4px; overflow: hidden; font: inherit; color: var(--text); user-select: none; -webkit-user-select: none; touch-action: manipulation; transition: transform .08s; }
.lm-t:hover { border-color: #2a78d6; }
.lm-t:active, .lm-t.pressed { transform: scale(.97); }
.lm-t.round { border-radius: 50%; }
.lm-t b { font-size: 15px; }
.lm-t.busy { background: #fff4ec; border-color: #eb6834; }
.lm-sum { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.lm-sub { font-size: 12px; color: var(--muted); }
.lm-note { font-size: 12px; font-weight: 600; color: #b5531f; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.lm-other { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bill-bar { padding: 12px 14px; background: #fff4ec; border-bottom: 1px solid #f3d3bf; display: flex; flex-direction: column; gap: 8px; }
.bb-top { display: flex; align-items: center; gap: 8px; }
.bb-top b { flex: 1; font-size: 15px; }
.bill-bar input { width: 100%; box-sizing: border-box; }
.bill-pick { display: flex; flex-direction: column; gap: 8px; }
.bill-pick button { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px 14px; cursor: pointer; font: inherit; }
.bill-pick button:hover { border-color: #2a78d6; }
.pin-screen { position: fixed; inset: 0; z-index: 900; background: rgba(23,25,29,.92); display: flex; align-items: center; justify-content: center; }
.pin-card { background: #fff; border-radius: 18px; padding: 26px 28px; text-align: center; width: 300px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #9aa3b2; }
.pin-dots i.on { background: var(--text); border-color: var(--text); }
.pin-dots.bad i { border-color: var(--bad); background: var(--bad); animation: pinShake .3s; }
@keyframes pinShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button { height: 58px; border-radius: 12px; border: 1px solid var(--line); background: #f7f8fa; font-size: 22px; font-weight: 600; cursor: pointer; }
.pin-pad button:active { background: #e6e8ec; }
/* ---- касса: продажи за смену ---- */
.topbar .shift-close { background: #c0392b; color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 600; }
.topbar .shift-close:hover { background: #a93226; }
.hist-sum { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; color: var(--muted); }
.hist-sum b { color: var(--text); }
.hist-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.hist-bar .search { flex: 1; min-width: 180px; padding: 7px 10px; font-size: 14px; }
.hist-list { max-height: 55vh; overflow: auto; }
.hist-list tfoot td { border-top: 2px solid var(--line); }
.hist-check { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid #eef0f3; font-size: 13px; }
.hist-check .muted { font-size: 12px; margin-top: 2px; }
.hist-check.refund { opacity: .6; }
/* ---- картинки позиций ---- */
.tile.has-img { padding-top: 8px; }
.tile .t-img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #f1f2f5; pointer-events: none; }
.pimg { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.pimg-box { width: 120px; height: 90px; flex: none; border-radius: 8px; background: #f1f2f5; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted); font-size: 12px; }
.pimg-box img { width: 100%; height: 100%; object-fit: cover; }
.btn-file { display: inline-flex; align-items: center; cursor: pointer; }
.lm-row { display: inline-flex; align-items: center; gap: 10px; }
.lm-thumb { width: 44px; height: 33px; object-fit: cover; border-radius: 5px; background: #f1f2f5; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.lm-thumb.none { opacity: .35; }

/* ---- касса на планшете (iPad) ---- */
.kassa-body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.kassa-body input, .kassa-body textarea { -webkit-touch-callout: default; }
.kassa .topbar { padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
.kassa .pos, .kassa .lounge { padding-bottom: env(safe-area-inset-bottom); }
@media (max-width: 1100px) {
  .kassa .pos { grid-template-columns: 1fr 330px; }
  .topbar #kDevice, .topbar #kLast { display: none; }
  .topbar #kHist { font-size: 0; } .topbar #kHist::before { content: '📋 Продажи'; font-size: 13px; }
}
@media (pointer: coarse) {
  .tile { min-height: 104px; }
  .ci .qty button { min-width: 38px; min-height: 38px; }
  .chips button { padding: 9px 14px; }
}
/* ---- способы оплаты и интеграции ---- */
.pm-list, .int-list { display: flex; flex-direction: column; gap: 8px; }
.pm-row, .int-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.pm-row.off { opacity: .55; }
.pm-ord { display: flex; flex-direction: column; }
.pm-ord .icon { padding: 0 4px; font-size: 10px; line-height: 1.3; }
.pm-ic { font-size: 22px; width: 30px; text-align: center; }
.pm-name, .int-name { flex: 1; font-size: 13px; line-height: 1.35; }
.pm-icons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pm-icons button { width: 40px; height: 40px; font-size: 20px; border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; }
.pm-icons button.active { border-color: #2a78d6; box-shadow: 0 0 0 3px rgba(42,120,214,.2); }
.int-logo { width: 36px; height: 36px; border-radius: 9px; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.acc-pm { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
/* ---- касса: несколько чеков, режим, блокировка ---- */
.ck-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ck-tabs h2 { margin: 0 6px 0 0; }
.ck { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 5px 10px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.ck small { font-weight: 500; color: var(--muted); font-size: 11px; }
.ck.active { border-color: #2a78d6; background: #eef5fd; box-shadow: 0 0 0 2px rgba(42,120,214,.15); }
.ck-new { color: #2a78d6; border-style: dashed; justify-content: center; }
.cart-head { align-items: flex-start; gap: 8px; }
.zone-tag { margin-left: 8px; background: rgba(255,255,255,.12); color: #fff; border-radius: 7px; padding: 3px 9px; font-size: 13px; font-weight: 600; }
/* ---- касса: чек слева, меню справа ---- */
.kassa .pos { grid-template-columns: 400px 1fr; }
.kassa .pos-right { order: -1; border-left: 0; border-right: 1px solid var(--line); }
@media (max-width: 1100px) { .kassa .pos { grid-template-columns: 330px 1fr; } }
@media (max-width: 700px) { .kassa .pos { grid-template-columns: 1fr; } .kassa .pos-right { order: 0; border-right: 0; } }
.p-thumb { width: 32px; height: 24px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: 8px; background: #f1f2f5; }
/* ---- касса: полоса «Вышло обновление» ---- */
.upd-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #eef5fd; border-bottom: 1px solid #c9ddf6; font-size: 14px; flex: none; }
.upd-ic { width: 30px; height: 30px; border-radius: 50%; background: #2a78d6; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.upd-t { flex: 1; line-height: 1.35; }
.upd-notes { font-size: 12px; color: #3a3f47; }
.kassa .upd-bar:not([hidden]) ~ .pos { height: calc(100vh - 52px - 54px); }
/* ---- API-ключи ---- */
.api-key { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.api-key code { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 13px; word-break: break-all; user-select: all; }
.api-new { display: flex; gap: 8px; margin-top: 12px; }
.api-new input { flex: 1; }
.api-doc { font-size: 13px; line-height: 1.55; margin-top: 8px; }
.api-doc code { background: #f1f2f5; padding: 1px 5px; border-radius: 4px; }
.api-doc pre { background: #17191d; color: #e6e8ec; padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
/* ---- касса: смена не открыта ---- */
.no-shift { position: fixed; left: 0; right: 0; bottom: 0; top: 52px; z-index: 40; background: rgba(244,245,247,.94); display: flex; align-items: center; justify-content: center; }
.ns-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; text-align: center; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.08); }
.ns-ic { font-size: 40px; }
.ns-card h2 { margin: 6px 0 4px; }
.ns-card .big { width: 100%; margin-top: 10px; }
/* ---- подкатегории: маленькие значки рядом с категорией ---- */
.cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cat-main input { width: 100%; box-sizing: border-box; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 10px; }
.sub-chip { display: inline-flex; align-items: center; gap: 3px; background: #f1f2f5; border: 1px solid #e3e6ea; border-radius: 99px; padding: 1px 4px 1px 8px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.sub-chip i { font-style: normal; color: var(--muted); font-size: 11px; }
.sub-chip b { font-weight: 600; color: var(--muted); font-size: 11px; margin-left: 2px; }
.sub-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px; line-height: 1; padding: 0 3px; border-radius: 50%; }
.sub-chip button:hover { background: #e3e6ea; color: var(--bad); }
.sub-chip:hover { border-color: #c9ddf6; }
.sub-chip.sm { padding: 0 7px; font-size: 11px; vertical-align: middle; }
.sub-add { border: 1px dashed #c9cfd8; background: none; border-radius: 99px; padding: 1px 9px; font-size: 12px; color: #2a78d6; cursor: pointer; }
/* ---- поставка: прошлая цена закупа ---- */
.cost-hint { font-size: 11px; line-height: 1.25; margin-top: 3px; white-space: nowrap; text-align: right; }
.cost-hint .lc-up { color: #d0312d; font-weight: 600; }
.cost-hint .lc-down { color: #138a5e; font-weight: 600; }
.cost-hint .lc-same { color: var(--muted); }
/* ---- окна подтверждения в стиле сайта ---- */
.dlg-bg { position: fixed; inset: 0; z-index: 1000; background: rgba(15,17,20,.45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: dlgIn .12s ease-out; }
.dlg { background: #fff; border-radius: 14px; width: min(440px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 20px 20px 16px; }
.dlg-t { margin: 0 0 6px; font-size: 17px; line-height: 1.35; }
.dlg-text { color: #3a3f47; font-size: 14px; line-height: 1.5; margin-bottom: 4px; max-height: 50vh; overflow: auto; }
.dlg-in { width: 100%; box-sizing: border-box; margin-top: 8px; padding: 10px 12px; font-size: 15px; }
.dlg-f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
button.danger.solid { background: var(--bad); color: #fff; }
button.danger.solid:hover { filter: brightness(.95); }
@keyframes dlgIn { from { opacity: 0; } to { opacity: 1; } }
/* ---- данные на сервере, шаги импорта ---- */
.sto-disk { margin: 10px 0 14px; }
.sto-bar { display: flex; height: 12px; border-radius: 6px; background: #eef0f3; overflow: hidden; }
.sto-bar span.ours { background: #2a78d6; }
.sto-bar span.sys { background: #c3c8d1; }
.sto-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.sto-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: #eef0f3; border: 1px solid #d6dae0; margin-right: 5px; vertical-align: -1px; }
.sto-legend i.ours { background: #2a78d6; border-color: #2a78d6; }
.sto-legend i.sys { background: #c3c8d1; border-color: #c3c8d1; }
.sto-grid { gap: 24px; }
.sto-grid .kv { font-size: 13px; }
.imp-steps { display: grid; gap: 8px; padding: 12px 14px; background: #f7f8fa; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.imp-steps button { justify-self: start; }