/* ==========================================================================
   Касса кофейни — дизайн-система
   Цвета, отступы и размеры заданы токенами. Крупные элементы для сенсорных экранов,
   минимум анимаций (кассиру важна скорость).
   ========================================================================== */
:root {
  --bg: #eef2ef;
  --surface: #ffffff;
  --surface-2: #f6f8f7;
  --ink: #14302c;
  --ink-2: #3b524d;
  --muted: #5b6f6b;
  --line: #d9e1dc;
  --line-2: #e8eeea;
  --accent: #0e7c66;
  --accent-hover: #0b6955;
  --accent-ink: #ffffff;
  --accent-soft: #e2f3ee;
  --danger: #b3261e;
  --danger-soft: #fde8e6;
  --warn: #8a5a00;
  --warn-soft: #fff3d1;
  --info: #1f5f99;
  --info-soft: #e5f0fb;
  --ok: #17703a;
  --ok-soft: #e1f4e7;
  --sidebar: #14302c;
  --sidebar-ink: #d7e5e0;
  --sidebar-muted: #8fa9a1;
  --sidebar-active: #21463f;
  /* Графики (палитра проверена на различимость при нарушениях цветового зрения) */
  --series-1: #00a07a;
  --series-2: #eb6834;
  --series-3: #2a78d6;
  --grid: #e7ebe8;
  --axis: #c3cbc6;
  --r: 12px;
  --r-sm: 8px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 48, 44, .08), 0 1px 1px rgba(20, 48, 44, .04);
  --shadow-lg: 0 18px 50px rgba(20, 48, 44, .25);
  --tap: 44px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 .5em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { padding: 24px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; grid-auto-flow: column; gap: 10px; color: var(--muted); }

/* ---------- Иконки (SVG вставляет скрипт в [data-icon]) ---------- */
[data-icon] { display: inline-flex; width: 20px; height: 20px; flex: none; }
[data-icon] svg { width: 100%; height: 100%; }
.ico-sm[data-icon], .ico-sm [data-icon] { width: 16px; height: 16px; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: #c7d2cc; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--surface); border-color: #efc1bc; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-2); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 14px; border-radius: 7px; }
.btn-lg { min-height: 56px; padding: 0 22px; font-size: 17px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }
.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: 10px; background: transparent; color: inherit; position: relative; text-decoration: none; }
.icon-btn:hover { background: var(--line-2); }
.link-btn { border: 0; background: none; padding: 4px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.btn-group button { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 0 14px; min-height: 40px; font-weight: 600; color: var(--ink-2); }
.btn-group button:last-child { border-right: 0; }
.btn-group button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- Поля ввода ---------- */
.input, .select, .textarea { width: 100%; min-height: var(--tap); padding: 8px 12px; border: 1px solid #c9d4ce; border-radius: var(--r-sm); background: var(--surface); }
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 124, 102, .18); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(179, 38, 30, .12); }
.select-sm, .input-sm { min-height: 38px; padding: 4px 10px; }
.input-num { text-align: right; font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field-label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--danger); }
.req::after { content: " *"; color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 4px; }
.form-section > h3 { margin-bottom: 10px; }
.form-error { min-height: 1.3em; color: var(--danger); font-weight: 600; margin: 0; }
.form-error:empty { min-height: 0; }
.input-group { display: flex; gap: 6px; align-items: stretch; }
.input-group > .input, .input-group > .select { flex: 1; min-width: 0; }
.input-group > .select.unit { flex: 0 0 96px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------- Карточки, панели ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { font-size: 16px; }
.card-body { padding: 16px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); }
.panel-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; }

/* ---------- Значки статусов ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-dark { background: var(--ink); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; flex: none; }

/* ---------- Оболочка приложения ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--sidebar); color: var(--sidebar-ink); overflow: hidden; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; font-weight: 700; font-size: 16px; color: #fff; min-height: 60px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); font-size: 18px; flex: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: #2e5951 transparent; }
.nav-group { margin-top: 14px; }
.nav-group-title { padding: 0 10px 6px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--sidebar-muted); font-weight: 700; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--sidebar-ink); text-decoration: none; font-weight: 500; white-space: nowrap; text-align: left; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item[aria-current="page"] { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item .ico { opacity: .9; }
.nav-item .label { overflow: hidden; text-overflow: ellipsis; }
.nav-item .count { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 999px; background: #c3392f; color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.sidebar-foot { padding: 8px 10px 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.app.collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.app.collapsed .brand-name, .app.collapsed .nav-item .label, .app.collapsed .nav-group-title, .app.collapsed .nav-item .count { display: none; }
.app.collapsed .nav-item { justify-content: center; padding: 0; }
.app.collapsed .nav-group { margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 8px; }
.app.collapsed #collapseBtn [data-icon] { transform: scaleX(-1); }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 20px; background: rgba(238, 242, 239, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.page-title { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.alert-btn.has-critical .alert-count { background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
.alert-count { position: absolute; top: 4px; right: 3px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #c3392f; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 8px 0 4px; border: 1px solid transparent; border-radius: 999px; background: transparent; }
.user-btn:hover { background: var(--line-2); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; }
.user-name { font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 50; }
.menu-head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.menu-head span { color: var(--muted); font-size: 13px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--danger); }
.view { flex: 1; padding: 20px; outline: none; min-width: 0; }
/* Изменения других сотрудников и связь с сервером */
.live-bar { position: sticky; top: 60px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 12px 20px 0; padding: 8px 12px; border: 1px solid #b9d8f2; border-radius: var(--r-sm); background: var(--info-soft); color: var(--info); font-weight: 600; box-shadow: var(--shadow); }
.net-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 700; white-space: nowrap; }
.access-code { margin: 12px 0; padding: 14px 10px; border: 1px dashed var(--accent); border-radius: var(--r-sm); background: var(--accent-soft); color: var(--ink); font-size: 26px; font-weight: 700; letter-spacing: .08em; text-align: center; overflow-wrap: anywhere; user-select: all; }
.input-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; }
.net-pill::before { content: ""; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--danger); }
/* Язык интерфейса: кнопка в шапке и меню */
.lang-menu { position: relative; }
.lang-btn { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: inherit; font-weight: 700; font-size: 13px; }
.lang-btn:hover { background: var(--line-2); }
.lang-btn [data-icon] svg { width: 18px; height: 18px; display: block; }
.lang-menu .menu { min-width: 180px; }
.menu-item[aria-checked="true"] { font-weight: 700; }
.menu-item [data-icon] svg { width: 18px; height: 18px; display: block; }
.menu-spacer { display: inline-block; width: 18px; }
/* Переключатель языка на экранах входа */
.lang-switch { display: flex; justify-content: center; gap: 4px; padding: 3px; margin: -6px auto 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); width: max-content; max-width: 100%; }
.lang-switch button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; min-height: 34px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
/* Доступ с телефона: адреса и QR-коды */
.qr-list { display: grid; gap: 14px; margin-top: 10px; }
.qr-item { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-sm); line-height: 0; }
.qr svg { width: 168px; height: 168px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.preview-line { padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--surface-2); font-weight: 600; }
/* Выбор города с поиском */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; max-height: 260px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); }
.combo-list [role=option] { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.combo-list [role=option].active, .combo-list [role=option]:hover { background: var(--accent-soft); }
.combo-list [role=option][aria-selected="true"] { font-weight: 700; }
.combo-list .combo-empty { color: var(--muted); cursor: default; }
.view-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.scrim { position: fixed; inset: 0; background: rgba(20, 48, 44, .45); z-index: 25; }

/* ---------- Заголовок страницы, панель инструментов, вкладки ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-height: 40px; max-width: 100%; }
/* Выпадающий список не шире экрана, даже если в нём длинные пункты (казахский, английский) */
.select { max-width: 100%; text-overflow: ellipsis; }
.toolbar .search { flex: 1 1 220px; min-width: 180px; max-width: 360px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.tabs::-webkit-scrollbar { height: 6px; }
.tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.tabs-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs-row > .tabs { border-bottom: 0; margin-bottom: 0; min-width: 0; }
.tabs-row > .gap { padding-bottom: 6px; }
.tab { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.breadcrumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 8px; }
.breadcrumb:hover { color: var(--ink); }

/* ---------- Таблицы ---------- */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 700; text-transform: none; white-space: nowrap; z-index: 1; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table th .sort-ind { display: inline-block; width: 12px; margin-left: 4px; color: var(--accent); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: #fafcfb; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.muted-row td { color: var(--muted); }
.table tbody tr.row-danger { background: #fff8f7; }
.table tbody tr.row-warn { background: #fffcf2; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.table .actions { text-align: right; white-space: nowrap; }
.table .thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--line-2); display: block; }
.table .thumb-ph { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--line-2); font-size: 20px; }
.table .sub { display: block; color: var(--muted); font-size: 12.5px; }
.table .total-row td { font-weight: 700; border-top: 1px solid var(--line); background: var(--surface-2); }
.table td.indent { padding-left: 32px; color: var(--ink-2); }
details > summary { cursor: pointer; }
.table input.input { min-height: 38px; }
.table-compact th, .table-compact td { padding: 7px 10px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; color: var(--muted); flex-wrap: wrap; }
.pager .gap button { min-width: 40px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .empty-title { font-weight: 700; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

/* ---------- Показатели (KPI) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: block; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
a.kpi:hover { border-color: #b9c8c1; }
.kpi .kpi-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; }
.kpi .kpi-delta { font-size: 13px; margin-top: 2px; color: var(--muted); }
.kpi .up { color: var(--ok); }
.kpi .down { color: var(--danger); }
.kpi.kpi-warn { border-color: #f0d89a; background: #fffcf3; }
button.kpi { width: 100%; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
button.kpi:hover { border-color: #b9c8c1; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.hero-value { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }

/* ---------- Уведомления ---------- */
.alerts { display: grid; gap: 8px; }
.alert { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); }
.alert .alert-ico { width: 22px; height: 22px; margin-top: 1px; }
.alert-critical { border-color: #f2c0bb; background: #fff7f6; }
.alert-critical .alert-ico { color: var(--danger); }
.alert-warning { border-color: #f0d89a; background: #fffcf2; }
.alert-warning .alert-ico { color: var(--warn); }
.alert-info .alert-ico { color: var(--info); }
.alert-title { font-weight: 700; }
.alert-msg { color: var(--ink-2); font-size: 14px; }
.alert-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.notice { padding: 12px 14px; border-radius: var(--r-sm); background: var(--info-soft); color: #173f63; border: 1px solid #c9ddf1; }
.notice-warn { background: var(--warn-soft); color: #5c3d00; border-color: #f0d89a; }
.notice-danger { background: var(--danger-soft); color: #7a1b15; border-color: #f2c0bb; }
.notice-ok { background: var(--ok-soft); color: #0f4d27; border-color: #bfe3cb; }

/* ---------- Списки и описания ---------- */
pre.code { margin: 8px 0; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); font: 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
code { font: 13px ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.plain-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.table td.details-cell { min-width: 240px; max-width: 460px; font-size: 13px; }
.dl { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; }
.dl dd .sub { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; max-height: 280px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.timeline li { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--line-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.timeline li.done { background: var(--accent-soft); color: var(--accent); }
.timeline li.current { background: var(--ink); color: #fff; }
.timeline li.bad { background: var(--danger-soft); color: var(--danger); }

/* ---------- Модальные окна ---------- */
dialog.modal { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: var(--r-lg); color: var(--ink); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(20, 48, 44, .5); }
dialog.modal.modal-sm { width: min(420px, calc(100% - 24px)); }
dialog.modal.modal-lg { width: min(860px, calc(100% - 24px)); }
dialog.modal.modal-xl { width: min(1180px, calc(100% - 24px)); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { flex: 1; font-size: 18px; }
.modal-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.modal-foot .form-error { flex: 1 1 100%; }
.modal-foot .left { margin-right: auto; }

/* ---------- Всплывающие сообщения ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: grid; gap: 8px; max-width: min(420px, calc(100% - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast-error { background: #8f1d16; }
.toast-ok { background: #135e3a; }
.toast button { margin-left: auto; border: 0; background: none; color: #fff; opacity: .8; padding: 0 4px; font-size: 18px; line-height: 1; }

/* ---------- Индикатор загрузки ---------- */
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(20, 48, 44, .15); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
.btn-primary .spinner, .toast .spinner { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; padding: 40px; color: var(--muted); gap: 10px; }

/* ---------- Экран входа ---------- */
.auth { position: fixed; inset: 0; overflow-y: auto; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, #d7ebe4 0%, transparent 60%), var(--bg); z-index: 100; }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 26px; display: grid; gap: 16px; }
.auth-card.wide { width: min(720px, 100%); }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; color: #fff; }
.auth-brand h1 { font-size: 20px; }
.auth-brand p { margin: 0; color: var(--muted); }
.user-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 236px; overflow-y: auto; }
.user-tile { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 600; font-size: 14px; text-align: center; }
.user-tile .avatar { width: 40px; height: 40px; background: var(--accent); }
.user-tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent) inset; }
.user-tile-name { overflow-wrap: anywhere; }
.user-tile-role { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: -4px; }
/* «Начало работы» на главной */
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.gs-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); color: inherit; text-decoration: none; background: var(--surface); }
.gs-step:hover, .gs-step:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.gs-step > span:last-child { display: grid; gap: 2px; min-width: 0; }
.gs-ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.gs-ico svg { width: 20px; height: 20px; }
/* Мастер первого запуска */
.fr-shop { display: grid; grid-template-columns: 28px minmax(0, 1fr) 92px 44px; gap: 8px; align-items: center; margin-bottom: 8px; }
.fr-num { font-weight: 700; color: var(--muted); text-align: center; }
.fr-code { text-transform: uppercase; }
.inline-h { display: inline; margin: 0; font-size: 1.05rem; }
.form-section > .check { margin-bottom: 4px; }
@media (max-width: 480px) { .fr-shop { grid-template-columns: 22px minmax(0, 1fr) 70px 40px; gap: 6px; } }
.pin-display { display: flex; justify-content: center; gap: 10px; min-height: 22px; }
.pin-display i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-2); }
.pin-display i.on { background: var(--ink); border-color: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 58px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); font-size: 22px; font-weight: 600; }
.keypad button:active { background: var(--line-2); }
.keypad .kp-wide { font-size: 15px; }

/* ---------- Касса (POS) ---------- */
.app.pos-mode .view { padding: 0; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); height: calc(100dvh - 61px); min-height: 0; }
.pos-left { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pos-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px 8px; }
.pos-bar .search { flex: 1 1 220px; min-height: 48px; font-size: 16px; }
.shift-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.shift-pill.open { color: var(--ok); border-color: #bfe3cb; background: var(--ok-soft); }
.shift-pill.closed { color: var(--danger); border-color: #f2c0bb; background: var(--danger-soft); }
.pos-cats { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; }
.pos-cats::-webkit-scrollbar { display: none; }
.pos-cats .chip { min-height: 44px; padding: 0 18px; font-size: 15px; }
.pos-subcats { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 10px; }
.pos-grid { flex: 1; overflow-y: auto; padding: 4px 16px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.pcard { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 120px; padding: 12px; text-align: left; border: 1px solid var(--line); border-left: 6px solid var(--cat, var(--accent)); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); }
.pcard:active { transform: scale(.97); }
.pcard img { width: 100%; height: 76px; object-fit: cover; border-radius: 8px; background: var(--line-2); }
.pcard .pc-ico { font-size: 26px; line-height: 1; }
.pcard .pc-name { font-weight: 700; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.pcard .pc-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.pcard .pc-flag { position: absolute; top: 8px; right: 8px; }
.pcard.disabled { opacity: .5; }
.pcard.has-mods::after { content: "…"; position: absolute; right: 10px; bottom: 8px; color: var(--muted); font-weight: 700; }
.pos-cart { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.cart-head h2 { font-size: 17px; }
.cart-lines { flex: 1; overflow-y: auto; margin: 0; padding: 0 14px; list-style: none; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.cart-line .cl-name { font-weight: 700; }
.cart-line .cl-mods { color: var(--muted); font-size: 13px; }
.cart-line .cl-sum { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 20px; font-weight: 700; }
.qty output { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.cart-extra { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--line-2); }
.cart-extra .btn { flex: 1; }
.cart-totals { padding: 10px 14px 4px; display: grid; gap: 4px; }
.cart-totals .row { display: flex; justify-content: space-between; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cart-totals .row.total { color: var(--ink); font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.cart-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; padding: 10px 14px 14px; }
.cart-actions .btn { min-height: 60px; font-size: 18px; }
.cart-toggle { display: none; }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.pay-method { min-height: 60px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-weight: 700; font-size: 16px; }
.pay-method[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent) inset; }
.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-cash button { flex: 1 1 80px; min-height: 48px; }
.pay-due { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: var(--r); background: var(--ink); color: #fff; }
.pay-due strong { font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.change-due { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-radius: var(--r); background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.change-due strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.success-mark { display: grid; place-items: center; width: 72px; height: 72px; margin: 4px auto 0; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.success-mark [data-icon] { width: 40px; height: 40px; }
.mod-group { display: grid; gap: 8px; }
.mod-options { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-option { min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-weight: 600; }
.mod-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent) inset; }

/* ---------- Графики ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; max-width: 100%; overflow: visible; }
.chart .bar.on { opacity: .82; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .s1 { fill: var(--series-1); stroke: var(--series-1); }
.chart .s2 { fill: var(--series-2); stroke: var(--series-2); }
.chart .s3 { fill: var(--series-3); stroke: var(--series-3); }
.chart path.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart path.area { stroke: none; opacity: .1; }
.chart .bar { stroke: none; }
.chart .bar:hover, .chart .hit:hover + .bar { opacity: .82; }
.chart .hit { fill: transparent; stroke: none; cursor: crosshair; }
.chart .marker { stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .label-end { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; }
.chart-tip .tip-title { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; }
.chart-tip .tip-row strong { font-variant-numeric: tabular-nums; }
.chart-tip .key { width: 14px; height: 2px; border-radius: 1px; flex: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .key { width: 14px; height: 3px; border-radius: 2px; }
.legend .key.box { height: 10px; width: 10px; border-radius: 3px; }
.key.s1 { background: var(--series-1); } .key.s2 { background: var(--series-2); } .key.s3 { background: var(--series-3); }
.hbar { display: grid; grid-template-columns: minmax(90px, 1.4fr) minmax(0, 3fr) auto; gap: 10px; align-items: center; padding: 5px 0; }
.hbar .hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar svg { width: 100%; height: 14px; display: block; }
.hbar .track { fill: var(--line-2); }
.hbar .s1 { fill: var(--series-1); } .hbar .s2 { fill: var(--series-2); } .hbar .s3 { fill: var(--series-3); }
.hbar .hb-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hbar .hb-val .small { font-weight: 500; }
@media (max-width: 560px) {
  .hbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .hbar svg { grid-column: 1 / -1; grid-row: 2; }
  .hbar .hb-val { white-space: normal; text-align: right; }
}
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 24px; }

/* ---------- Фото и загрузка ---------- */
.photo-box { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-preview { width: 112px; height: 112px; border-radius: var(--r); object-fit: cover; border: 1px solid var(--line); background: var(--line-2); }
.photo-ph { display: grid; place-items: center; width: 112px; height: 112px; border-radius: var(--r); border: 1px dashed #b9c6bf; color: var(--muted); font-size: 13px; text-align: center; padding: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Матрица прав ---------- */
.perm-table td:first-child { min-width: 260px; }
.perm-table .group-row td { background: var(--surface-2); font-weight: 700; color: var(--ink-2); }

/* ---------- Чек для печати ---------- */
.print-area { display: none; }
.print-sheet { padding: 12mm; font: 12px/1.4 system-ui, sans-serif; color: #000; background: #fff; }
.print-sheet h2 { font-size: 16px; margin: 0 0 4px; }
.print-sheet table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.print-sheet th, .print-sheet td { border: 1px solid #000; padding: 4px 6px; text-align: left; }
.print-sheet td.blank { min-width: 25mm; }
.print-sheet .sign { margin-top: 12mm; }
.receipt { width: 76mm; margin: 0 auto; padding: 4mm; font: 12px/1.35 "Courier New", ui-monospace, monospace; color: #000; background: #fff; }
.receipt.w58 { width: 54mm; }
.receipt h3 { text-align: center; font-size: 14px; margin: 0 0 2mm; }
.receipt .c { text-align: center; }
.receipt .row { display: flex; justify-content: space-between; gap: 4px; }
.receipt .row span:last-child { white-space: nowrap; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; }
.receipt .big { font-size: 15px; font-weight: 700; }
.receipt .mods { padding-left: 3mm; font-size: 11px; }
.receipt .nf { margin-top: 2mm; text-align: center; font-size: 11px; }
.receipt-preview { background: #f2f2f2; padding: 12px; border-radius: var(--r); max-height: 60vh; overflow: auto; }
@media print {
  @page { margin: 0; }
  body.printing > *:not(.print-area) { display: none !important; }
  body.printing .print-area { display: block !important; }
  body.printing { background: #fff; }
  body.printing-report .view { padding: 0; }
  body.printing-report .sidebar, body.printing-report .topbar, body.printing-report .no-print { display: none !important; }
  body.printing-report .app { display: block; }
}

/* ---------- Адаптивность ---------- */
@media (max-width: 1279px) {
  .app { grid-template-columns: 72px minmax(0, 1fr); }
  .app .brand-name, .app .nav-item .label, .app .nav-group-title, .app .nav-item .count, #collapseBtn { display: none; }
  .app .nav-item { justify-content: center; padding: 0; }
  .app .nav-group { margin-top: 8px; border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 8px; }
  .col-8, .col-6, .col-4 { grid-column: span 12; }
  .col-3 { grid-column: span 6; }
}
@media (min-width: 1000px) and (max-width: 1279px) {
  .col-6 { grid-column: span 6; }
  .col-4 { grid-column: span 6; }
}
@media (max-width: 899px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .18s ease-out; }
  .app.nav-open .sidebar { transform: none; }
  .app .brand-name, .app .nav-item .label, .app .nav-group-title, .app .nav-item .count { display: revert; }
  .app .nav-item { justify-content: flex-start; padding: 0 10px; }
  .app .nav-group { border-top: 0; padding-top: 0; margin-top: 14px; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 8px 10px; gap: 6px; }
  .page-title { font-size: 17px; }
  .user-name { display: none; }
  .lang-btn { padding: 0 6px; }
  .view { padding: 14px 12px; }
  .live-bar { margin: 10px 12px 0; top: 56px; }
  .net-pill { padding: 0 8px; font-size: 12px; }
  /* Длинные надписи на кнопках (казахский, английский) переносятся, а не выходят за край экрана */
  .btn { white-space: normal; max-width: 100%; text-align: center; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .col-3 { grid-column: span 12; }
  .kpi .kpi-value { font-size: 22px; }
  dialog.modal, dialog.modal.modal-lg, dialog.modal.modal-xl { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; max-width: 100%; }
  .toolbar .search { max-width: none; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  /* Касса на телефоне и планшете вертикально: корзина — выезжающая панель */
  .pos { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 61px); }
  .pos-cart { position: fixed; left: 0; right: 0; bottom: 0; top: 64px; z-index: 40; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-lg); transform: translateY(105%); transition: transform .18s ease-out; }
  .pos.cart-open .pos-cart { transform: none; }
  .cart-toggle { display: flex; position: sticky; bottom: 0; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); gap: 10px; align-items: center; }
  .cart-toggle .btn { flex: 1; min-height: 54px; font-size: 17px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding-bottom: 8px; }
  .pcard { min-height: 104px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head .btn { flex: 1; }
  .hero-value { font-size: 34px; }
}
/* Невысокие экраны ноутбуков: меню помещается без прокрутки */
@media (min-width: 1280px) and (max-height: 980px) {
  .nav-item { min-height: 36px; }
  .nav-group { margin-top: 8px; }
  .nav-group-title { padding-bottom: 4px; }
  .brand { min-height: 52px; padding: 12px 18px 8px; }
  .sidebar-foot .nav-item { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: .01ms !important; } }

/* Telegram-бот: фото чека, распознанный текст, команда подключения канала, подсказка в строке прихода */
.tg-photo { display: block; max-width: 100%; max-height: 420px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; }
.tg-text { white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); margin: 6px 0 0; }
.tg-code { padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); user-select: all; word-break: break-all; }
.tg-hint { color: var(--accent); }
.tg-block .card-head { gap: 12px; flex-wrap: wrap; }
.tg-shop { width: auto; max-width: 280px; }
