/* Админ-панель и личный кабинет. Использует токены из base.css. На телефоне — как приложение (внизу файла). */
body.app { font-size: 15px; line-height: 1.5; }
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }

/* Боковое меню */
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 22px 22px 18px; font-size: 17px; }
.side .who { margin: 0 14px 12px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-m); }
.side .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .who span { display: block; color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side nav { display: flex; flex-direction: column; padding: 4px 10px; gap: 2px; overflow-y: auto; }
.side nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--radius-s); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.side nav a:hover { background: var(--surface-2); color: var(--ink); }
.side nav a[aria-current="page"] { background: var(--cobalt-soft); color: var(--cobalt); }
.side nav .count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--cobalt); color: var(--on-cobalt); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.side nav .count:empty { display: none; }
.side .bottom { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.side .bottom button, .side .bottom a { width: 100%; justify-content: flex-start; }
.mobile-bar { display: none; }

/* Меню как в программе: заголовки разделов, иконки, раскрывающиеся группы */
.side nav { gap: 1px; padding: 2px 8px 8px; }
.side nav a, .side nav .nav-g { position: relative; display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 7px 12px; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14.5px; justify-content: flex-start; }
.side nav .nav-g { width: 100%; border: 0; background: none; font: inherit; font-weight: 500; font-size: 14.5px; cursor: pointer; text-align: left; }
.side nav .nav-g:hover { background: var(--surface-2); }
.side nav .nt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side nav .ni { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-2); }
.side nav .chev { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.side nav .nav-g[aria-expanded="true"] .chev { transform: rotate(180deg); }
.side nav a.sub { padding-left: 42px; min-height: 34px; font-size: 14px; color: var(--ink-2); }
.side nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.side nav a[aria-current="page"] .ni { color: var(--cobalt); }
.side nav a[aria-current="page"]::before, .side nav .nav-group.has-current > .nav-g::before {
  content: ""; position: absolute; left: 3px; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: 2px; background: var(--cobalt); }
.side nav .nav-group.has-current > .nav-g[aria-expanded="true"]::before { display: none; }
.side nav .nav-h { padding: 14px 12px 6px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.side nav .nav-sep { height: 1px; margin: 8px 4px; background: var(--line); }
.side nav .soon { flex: none; padding: 1px 7px; border-radius: 9px; background: var(--surface-2); color: var(--ink-3); font-size: 11px; font-weight: 500; }
.side nav a[aria-current="page"] .soon { background: var(--surface); }
.mode-sw { padding: 0 14px 10px; }
.mode-sw .seg { display: flex; width: 100%; }
.mode-sw .seg button { flex: 1; }
.open-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 14px 18px 18px; }
.open-card { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.open-card:hover { border-color: var(--cobalt); }
.open-card b { font-size: 15px; }
.open-card span { color: var(--ink-3); font-size: 13px; }
.soon-page { max-width: 560px; margin: 0 auto; }
.soon-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
  .side.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .mobile-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .mobile-bar b { font: 600 16px var(--display); }
}

/* Контент */
.main { padding: 32px 36px 64px; min-width: 0; }
.main:focus { outline: none; }
@media (max-width: 700px) { .main { padding: 20px 16px 48px; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--ink-3); margin-top: 6px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-3); text-decoration: none; font-size: 14px; margin-bottom: 8px; }
.back:hover { color: var(--ink); }

.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cobalt); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Плитки показателей */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
a.tile:hover { border-color: var(--ink-3); color: inherit; }
.tile span { display: block; color: var(--ink-3); font-size: 14px; }
.tile b { display: block; font: 600 28px/1.2 var(--display); margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile small { display: block; color: var(--ink-3); margin-top: 4px; font-size: 13px; }
.tile.warn b { color: var(--brass); }
.tile.bad b { color: var(--danger); }

/* Панели */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 17px; }
.panel-body { padding: 18px 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* Таблицы */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.t th { text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--surface-2); }
.t .num { text-align: right; white-space: nowrap; }
.t .muted, .muted { color: var(--ink-3); }
.t .nowrap { white-space: nowrap; }
.t small { display: block; color: var(--ink-3); font-size: 13px; }
.key { font: 500 13px var(--mono); letter-spacing: .02em; white-space: nowrap; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* Статус: точка и текст */
.st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 500; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.st.active { color: var(--ok); }
.st.expiring, .st.grace, .st.pending, .st.trial { color: var(--brass); }
.st.expired, .st.blocked, .st.revoked, .st.company_disabled, .st.rejected { color: var(--danger); }
.st.off, .st.cancelled { color: var(--ink-3); }
.prod { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--cobalt-soft); color: var(--cobalt); white-space: nowrap; }
.prod.Billiard { background: var(--brass-soft); color: var(--brass); }

/* Фильтры */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search], .filters input[type=date], .filters select {
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font: 400 15px var(--text);
}
.filters input[type=search] { min-width: 240px; flex: 1 1 240px; max-width: 380px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 9px 14px; font: 500 14px var(--text); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

/* Список «ключ — значение» */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Карточки лицензий (кабинет) */
.lic-list { display: grid; gap: 14px; }
.lic { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; }
.lic h3 { font-size: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lic .meta { color: var(--ink-3); margin-top: 6px; display: flex; gap: 6px 18px; flex-wrap: wrap; }
.lic .until { text-align: right; }
.lic .until b { display: block; font: 600 22px var(--display); }
.lic .until span { color: var(--ink-3); font-size: 14px; }
.lic .acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.lic .acts .st { white-space: normal; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.progress.warn i { background: var(--brass); }
.progress.bad i { background: var(--danger); }
@media (max-width: 640px) { .lic { grid-template-columns: minmax(0, 1fr); } .lic .until { text-align: left; } }

/* График (один ряд — без легенды, подсказка при наведении) */
.chart { position: relative; }
.chart svg { width: 100%; height: 240px; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font: 12px var(--text); }
.chart .bar { fill: var(--cobalt); }
.chart .bar.hl { fill: var(--cobalt-hover); }
.chart .hit { fill: transparent; cursor: default; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 6px; font-size: 13px; line-height: 1.4; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; display: none; z-index: 5; }
.tip b { font-weight: 600; }

/* Диалоги */
dialog.dlg { border: 0; border-radius: var(--radius-l); padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(10, 16, 30, .45); }
dialog.dlg.wide { width: min(760px, calc(100vw - 32px)); }
dialog.dlg::backdrop { background: rgba(15, 21, 34, .5); }
.dlg form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dlg header { padding: 20px 24px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dlg header h2 { font-size: 20px; }
.dlg header p { color: var(--ink-3); margin-top: 4px; }
.dlg .x { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 0 4px; }
.dlg .body { padding: 18px 24px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.dlg .body .full { grid-column: 1 / -1; }
.dlg footer { padding: 16px 24px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dlg .err { grid-column: 1 / -1; color: var(--danger); font-size: 14px; }
.dlg .err:empty { display: none; }
@media (max-width: 560px) { .dlg .body { grid-template-columns: 1fr; } }
.field .hint { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--cobalt); }
.secret { font: 600 20px var(--mono); padding: 14px 16px; background: var(--surface-2); border: 1px dashed var(--ink-3); border-radius: var(--radius-s); text-align: center; letter-spacing: .04em; user-select: all; overflow-wrap: anywhere; }

/* Уведомления */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: var(--radius-s); max-width: 380px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.err { background: var(--danger); color: #fff; }
.banner { padding: 14px 18px; border-radius: var(--radius-m); margin-bottom: 20px; border: 1px solid; display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--brass-soft); border-color: color-mix(in srgb, var(--brass) 40%, transparent); }
.banner.info { background: var(--cobalt-soft); border-color: color-mix(in srgb, var(--cobalt) 30%, transparent); }
.loading { padding: 48px; text-align: center; color: var(--ink-3); }

/* Вход */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--cobalt); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side { background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 32px 32px; }
:root[data-theme="dark"] .auth-side { background-color: #101317; }
.auth-side .logo { color: #fff; }
.auth-side h2 { font-size: clamp(28px, 3vw, 40px); max-width: 14em; }
.auth-side p { margin-top: 16px; opacity: .85; max-width: 30em; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-form form { width: min(400px, 100%); display: grid; gap: 16px; }
.auth-form h1 { font-size: 28px; }
.auth-form .sub { color: var(--ink-3); margin-top: 6px; }
.auth-form .btn { width: 100%; }
.auth-form .msg { color: var(--danger); min-height: 1.4em; font-size: 15px; }
.auth-form .foot-links { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-3); flex-wrap: wrap; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

.dlg .progress-text { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; margin: 0; }
.dlg .progress-text:empty { display: none; }
.field input[type=file] { padding: 9px 12px; }

/* Документы клуба (кабинет) */
.st.done { color: var(--ok); }
.st.open { color: var(--cobalt); }
.st.problem { color: var(--danger); }
.st.neutral { color: var(--ink-3); }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 10px; background: var(--brass); color: var(--surface); font: 600 12px var(--text); vertical-align: 1px; }
.nav-badge:empty { display: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chips button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 14px; font: 500 14px var(--text); cursor: pointer; min-height: 36px; }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chips button span { color: inherit; opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }
.docs { list-style: none; margin: 0; padding: 0; }
.docs li + li { border-top: 1px solid var(--line); }
.doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; width: 100%; padding: 14px 20px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.doc:hover { background: var(--surface-2); }
.doc .t1 { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.doc .t1 .kind { color: var(--ink-3); font-weight: 500; margin-right: 6px; }
.doc .t2 { color: var(--ink-3); font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.doc .amt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc .amt.minus { color: var(--danger); }
.doc .meta { text-align: right; font-size: 13px; white-space: nowrap; }
.wait { display: inline-block; font-size: 12px; font-weight: 600; color: var(--cobalt); background: var(--cobalt-soft); border-radius: 4px; padding: 1px 7px; margin-left: 8px; white-space: nowrap; }
.pending-box { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); }
.pending-box .panel-head { background: var(--brass-soft); border-radius: var(--radius-m) var(--radius-m) 0 0; }
.pend { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 14px 20px; }
.pend + .pend { border-top: 1px solid var(--line); }
.pend .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pend p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
@media (max-width: 640px) { .pend { grid-template-columns: 1fr; } .pend .acts { justify-content: stretch; } .pend .acts .btn { flex: 1; } .doc { padding: 12px 16px; } }
.doc-lines { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.doc-lines td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-lines td + td { padding-left: 12px; }
.doc-lines .num { text-align: right; white-space: nowrap; }
.doc-lines .struck td:first-child, .doc-lines .struck .num { text-decoration: line-through; color: var(--ink-3); }
.doc-lines small { display: block; color: var(--ink-3); font-size: 13px; }
.doc-sec { margin: 18px 0 6px; font: 600 14px var(--text); color: var(--ink-2); }
.doc-tot { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.doc-tot.strong { font-weight: 700; font-size: 17px; }
.doc-cmd { margin-top: 18px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--surface-2); font-size: 14px; }
.doc-cmd + .doc-cmd { margin-top: 8px; }
.sync-note { color: var(--ink-3); font-size: 14px; margin: -8px 0 16px; }
.tiles.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
@media (max-width: 640px) { .tiles.compact { grid-template-columns: 1fr 1fr; gap: 10px; } .tiles.compact .tile { padding: 12px 14px; } .tiles.compact .tile b { font-size: 22px; } }


/* ═════════ Телефон: кабинет как приложение ═════════ */
.tabbar { display: none; }
.mobile-logo { display: none; }
.install-hint { display: none; }
ol.how { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 8px; }

@media (max-width: 960px) {
  body.app { padding-bottom: calc(66px + var(--safe-b)); }
  .mobile-bar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); min-height: 56px; }
  .mobile-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side { padding-bottom: var(--safe-b); }
  .side-shade { position: fixed; inset: 0; z-index: 39; background: rgba(11, 23, 51, .45); }
  .side .bottom { padding-bottom: calc(14px + var(--safe-b)); }

  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b));
  }
  .tabbar a, .tabbar button {
    position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; min-height: 52px;
    color: var(--ink-3); text-decoration: none; background: none; border: 0; font: 500 11px/1.2 var(--text); cursor: pointer; border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--cobalt); }
  .tabbar a[aria-current="page"] svg { stroke-width: 2.2; }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brass); color: var(--surface); font: 600 11px/18px var(--text); font-style: normal; text-align: center; }
  .tab-badge:empty { display: none; }

  .toasts { left: 16px; right: 16px; bottom: calc(80px + var(--safe-b)); }
  .toast { max-width: none; }

  .install-hint {
    display: grid; grid-template-columns: 40px 1fr auto auto; gap: 10px; align-items: center;
    position: fixed; left: 12px; right: 12px; bottom: calc(76px + var(--safe-b)); z-index: 36;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 10px 10px 12px;
    box-shadow: 0 16px 40px -16px rgba(15, 30, 61, .4);
  }
  .install-hint img { width: 40px; height: 40px; }
  .install-hint b { display: block; font-size: 15px; }
  .install-hint span { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.3; }
  .install-hint .x { background: none; border: 0; font-size: 24px; color: var(--ink-3); width: 32px; height: 40px; cursor: pointer; }
}

@media (max-width: 700px) {
  .main { padding: 18px 14px 32px; }
  .page-head { margin-bottom: 18px; align-items: stretch; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile b { font-size: 21px; }
  .tile small { font-size: 12px; }
  .panel-head { padding: 14px 16px; }
  .panel-body { padding: 14px 16px; }
  .filters { gap: 8px; }
  .filters input[type=search] { min-width: 0; max-width: none; flex: 1 1 100%; }
  .filters input[type=date] { flex: 1 1 40%; }
  .seg { width: 100%; overflow-x: auto; }
  .seg button { flex: 1 0 auto; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; }
  .chips button { flex: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }

  /* Таблица → карточки: первая ячейка — заголовок, остальные «подпись — значение» */
  .table-wrap { overflow: visible; }
  table.t, .t tbody, .t tr, .t td { display: block; width: 100%; }
  .t thead { display: none; }
  .t tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .t tbody tr:last-child { border-bottom: 0; }
  .t td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .t td::before { content: attr(data-label); color: var(--ink-3); font-size: 13px; text-align: left; flex: none; max-width: 45%; }
  .t td[data-label=""]::before { content: none; }
  .t td:first-child { display: block; text-align: left; font-weight: 600; padding-bottom: 6px; }
  .t td:first-child::before { content: none; }
  .t td:first-child small { font-weight: 400; }
  .t td small { text-align: right; }
  .t td:first-child small { text-align: left; }
  .t td[data-label=""] { justify-content: flex-start; padding-top: 8px; }
  .t td[data-label=""] .btn { flex: 1 1 auto; }
  .t td.num { text-align: right; }
  .t tbody tr.click:active { background: var(--surface-2); }
  .t td .st { white-space: normal; text-align: right; }

  .lic { padding: 16px; gap: 12px; }
  .lic .acts .btn { flex: 1 1 auto; }
}

/* Окна на телефоне — снизу, на всю ширину */
@media (max-width: 560px) {
  dialog.dlg, dialog.dlg.wide {
    width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--radius-l) var(--radius-l) 0 0;
    max-height: 92vh; padding-bottom: var(--safe-b);
  }
  dialog.dlg[open] { animation: sheet-up .22s ease-out; }
  .dlg form { max-height: 92vh; }
  .dlg header { padding: 18px 18px 0; }
  .dlg .body { padding: 14px 18px; }
  .dlg footer { padding: 12px 18px 16px; }
  .dlg footer .btn { flex: 1 1 auto; }
  .field input, .field select, .field textarea { font-size: 16px; }   /* iPhone не увеличивает страницу при вводе */
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

@media (max-width: 860px) {
  .mobile-logo { display: flex; margin-bottom: 8px; }
  .auth-form { place-items: start center; padding: calc(28px + env(safe-area-inset-top, 0px)) 18px 32px; }
}

/* Открыт как приложение (с экрана телефона) — без кнопки «на главную» */
@media (display-mode: standalone) {
  .side .logo { pointer-events: none; }
}

/* ═════════ Кабинет: точки, склад, приход и накладная ═════════ */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sec-title { font-size: 19px; margin: 28px 0 14px; }
.small { font-size: 13px; }
.point-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 18px; }
.point-line b { font-weight: 600; }
.point-line select { min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: 500 15px var(--text); max-width: 100%; }

/* Программа на связи */
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.live.on { color: var(--ok); }
.live.on::before { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: live-pulse 2s infinite; }
.live.off { color: #A8650A; }
:root[data-theme="dark"] .live.off { color: #D9A441; }
.live.never { color: var(--ink-3); }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Карточки точек на «Обзоре» */
.points { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 22px; }
.point { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.point header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.point header > div { display: grid; gap: 6px; justify-items: start; }
.point h3 { font-size: 17px; }
.point dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 12px 0; border-block: 1px solid var(--line); }
.point dt { font-size: 12px; color: var(--ink-3); }
.point dd { margin: 2px 0 0; font: 600 17px var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.point .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.point p { margin: 0; }
.warn-line { color: var(--brass); font-size: 14px; font-weight: 500; }

/* Остатки */
.qty { font-variant-numeric: tabular-nums; font-weight: 600; }
.qty.low { color: var(--brass); }
.qty.zero { color: var(--danger); }
.debt { color: var(--brass); }

/* Отправлено из кабинета */
.cmds { list-style: none; margin: 0; padding: 0; }
.cmds li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); }
.cmds li:first-child { border-top: 0; }
.cmds li b { display: block; font-weight: 600; }
.cmds li small { display: block; color: var(--ink-3); font-size: 13px; }
.cmds .st { flex: none; }

/* Поле с подсказками */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; max-height: 300px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 18px 40px -18px rgba(15, 30, 61, .45); padding: 4px;
}
.combo-list .opt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.combo-list .opt span { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.combo-list .opt small { color: var(--ink-3); font-size: 12px; white-space: nowrap; flex: none; }
.combo-list .opt.on, .combo-list .opt:hover { background: var(--cobalt-soft); }
.combo-list .opt.new { color: var(--cobalt); font-weight: 600; border-top: 1px dashed var(--line); margin-top: 2px; }
.combo-list .none { padding: 10px; color: var(--ink-3); font-size: 14px; }

/* Документ: шапка, строки, итог */
.editor .ed-head { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.editor .ed-head .full { grid-column: 1 / -1; }
.editor .field input, .editor .field select { min-height: 44px; font-size: 15px; }
.editor .hint { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; min-height: 16px; }
.editor .seg.pay { width: 100%; }
.editor .seg.pay button { flex: 1 1 auto; min-height: 44px; }
.lines { --cols: minmax(0, 1fr) 110px 130px 130px 120px 40px; }
.lines.club, .lines.iv { --cols: minmax(0, 1fr) 110px 130px 120px 40px; }
.lines .lh { display: grid; grid-template-columns: var(--cols); gap: 10px; padding: 10px 20px; font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.lines .lh span:nth-child(n+2) { text-align: right; }
.line { display: grid; grid-template-columns: var(--cols); gap: 6px 10px; align-items: start; padding: 12px 20px 6px; border-bottom: 1px solid var(--line); }
.line .field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.line .field input { text-align: right; font-variant-numeric: tabular-nums; }
.line .field.pcell input { text-align: left; }
.line .sum { padding-top: 11px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.line .x { width: 40px; height: 44px; border: 0; background: none; color: var(--ink-3); font-size: 22px; cursor: pointer; border-radius: var(--radius-s); }
.line .x:hover { color: var(--danger); background: var(--surface-2); }
.line .newp { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--surface-2); border-radius: var(--radius-s); padding: 10px 12px; margin: 2px 0 8px; }
.line .newp .field label { position: static; width: auto; height: auto; clip: auto; font-size: 12px; margin-bottom: 4px; }
.line .newp .field input { text-align: left; }
.line.over .field:nth-child(2) input { border-color: var(--danger); }
.line.over .hint { color: var(--danger); }
.ed-foot {
  position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 16px; margin-top: 4px;
}
.ed-foot > div { display: grid; }
.ed-foot > div b { font: 600 22px var(--text); font-variant-numeric: tabular-nums; }
.ed-foot > div small { font-size: 13px; color: var(--ink-3); }
.ed-foot > div small.bad { color: var(--danger); font-weight: 600; }
.ed-foot .err { flex: 1 1 200px; margin: 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.ed-foot .err:empty { visibility: hidden; }
.ed-foot .btn { margin-left: auto; }

/* Ожидание программы */
.track { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 22px; }
.track .ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); position: relative; }
.track.waiting .ic::after { content: ""; width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--cobalt); border-radius: 50%; animation: spin 1s linear infinite; }
.track.done .ic { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.track.done .ic::after { content: ""; width: 18px; height: 10px; border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg) translate(2px, -2px); }
.track.failed .ic { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.track.failed .ic::after { content: "!"; color: var(--danger); font: 700 22px var(--text); }
.track b { font-size: 17px; }
.track p { margin: 6px 0 0; }
.track .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .editor .ed-head { grid-template-columns: 1fr; }
  .lines .lh { display: none; }
  .line { grid-template-columns: 1fr 1fr 40px; padding: 14px 16px 8px; }
  .line .field.pcell { grid-column: 1 / -1; }
  .line .field label { position: static; width: auto; height: auto; clip: auto; font-size: 12px; margin-bottom: 4px; color: var(--ink-3); }
  .line .x { grid-column: 3; grid-row: 1; justify-self: end; }
  .line .field.pcell { grid-row: 1; grid-column: 1 / 3; }
  .line .sum { grid-column: 1 / -1; text-align: right; padding-top: 0; }
  .line .sum::before { content: "Сумма  "; color: var(--ink-3); font-weight: 400; font-size: 13px; }
  .line .newp { grid-template-columns: 1fr 1fr; }
  .lines.rc:not(.club) .line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lines.rc:not(.club) .line .field.pcell { grid-column: 1 / 3; }
  .editor .ed-head > * { min-width: 0; }
  .editor .seg.pay { overflow: visible; }
  .editor .seg.pay button { flex: 1 1 0; white-space: normal; padding: 6px 8px; font-size: 14px; line-height: 1.2; }
  .ed-foot { position: static; }
  .ed-foot .btn { width: 100%; margin: 0; }
  .point dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .points { grid-template-columns: 1fr; }
  .cmds li { padding: 12px 16px; align-items: flex-start; flex-direction: column; gap: 6px; }
}

/* ═════════ Торговые агенты ═════════ */
.editor .newc { grid-column: 1 / -1; background: var(--surface-2); border-radius: var(--radius-s); padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.editor .newc b { color: var(--ink); }
.editor .newc-f { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.editor .newc-f label { font-size: 12px; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 22px; }
.agent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.agent.off { opacity: .65; }
.agent header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.agent h3 { font-size: 17px; }
.agent header small { color: var(--ink-3); font-size: 13px; }
.agent header .st { flex: none; }
.agent dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 12px 0; border-block: 1px solid var(--line); }
.agent dt { font-size: 12px; color: var(--ink-3); }
.agent dd { margin: 2px 0 0; font: 600 16px var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.agent dd small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.agent .acts { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .editor .newc-f { grid-template-columns: 1fr; }
  .agents { grid-template-columns: 1fr; }
  .row-acts { justify-content: stretch; width: 100%; }
  .row-acts .btn { flex: 1 1 auto; }
}

/* Журнал действий */
.t.journal td small.pre { white-space: pre-line; }

/* Веб-касса */
.pos-shift { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 16px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); font-size: 14px; color: var(--ink-2); }
.pos-shift b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 20px; align-items: start; margin-bottom: 20px; }
.pos .panel { margin-bottom: 0; }
.pos-check { position: sticky; top: 16px; }
.pos-search { display: flex; gap: 8px; }
.pos-search input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: 400 17px var(--text); }
.pos-search input:focus { outline: 2px solid var(--cobalt); outline-offset: -1px; }
.pos-search .btn { min-height: 48px; display: inline-flex; gap: 6px; align-items: center; }
.pos-search .btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.pos-note { font-size: 13px; margin: 8px 0 10px; }
.pos-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.pos-results .none { grid-column: 1 / -1; padding: 28px 10px; text-align: center; color: var(--ink-3); }
.pos-results button { position: relative; width: 100%; height: 100%; min-height: 86px; display: grid; grid-template-rows: auto 1fr auto; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.pos-results button:hover { border-color: var(--cobalt); }
.pos-results button:active { transform: scale(.985); }
.pos-results button.out { opacity: .55; }
.pos-results .nm { padding-right: 26px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pos-results small { color: var(--ink-3); font-size: 12px; }
.pos-results .pr { font-variant-numeric: tabular-nums; font-size: 16px; }
.pos-results .pr small { display: inline; margin-left: 4px; font-weight: 400; }
.pos-results .in { position: absolute; top: 6px; right: 6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--cobalt); color: #fff; font: 600 12px/24px var(--text); text-align: center; }
.pos-cart { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.pos-cart .none { padding: 26px 20px; text-align: center; color: var(--ink-3); }
.pos-cart li[data-i] { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.pos-cart li.flash { animation: pos-flash 1s ease-out; }
@keyframes pos-flash { from { background: var(--cobalt-soft); } to { background: transparent; } }
.pos-cart li.bad { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.pos-cart .nm b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.pos-cart .nm small { color: var(--ink-3); font-size: 13px; }
.pos-cart .iss { display: block; color: var(--danger); }
.pos-cart .qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.pos-cart .qty button { width: 34px; height: 36px; border: 0; background: var(--surface-2); color: var(--ink); font: 600 18px var(--text); cursor: pointer; }
.pos-cart .qty input { width: 56px; height: 36px; border: 0; text-align: center; background: var(--surface); color: var(--ink); font: 500 15px var(--text); }
.pos-cart .sm { min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.pos-cart .rm { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); font-size: 20px; cursor: pointer; }
.pos-cart .rm:hover { background: var(--surface-2); color: var(--danger); }
.pos-pay { display: grid; gap: 14px; }
.pos-pay .field { margin: 0; }
.pos-seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
.pos-seg button { padding: 10px 6px; }
.pos-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font: 500 14px var(--text); cursor: pointer; min-height: 34px; }
.chip:hover { border-color: var(--cobalt); color: var(--ink); }
.pos-sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pos-sum dt { color: var(--ink-3); }
.pos-sum dd { margin: 0; text-align: right; }
.pos-sum .big { font-size: 22px; font-weight: 700; color: var(--ink); }
.pos-sum dt[hidden], .pos-sum dd[hidden] { display: none; }
.pos-go { min-height: 54px; font-size: 17px; width: 100%; }
.pos-pay .err:empty { display: none; }
.pos-bar { display: none; }
.pos-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, #000 45%, transparent); }
.pos-box { width: min(420px, 100%); background: var(--surface); border-radius: var(--radius-m); padding: 28px 24px 22px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.pos-box .ic { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.pos-box.waiting .ic::after { content: ""; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--cobalt); border-radius: 50%; animation: spin 1s linear infinite; }
.pos-box.done .ic { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.pos-box.done .ic::after { content: ""; width: 24px; height: 13px; border-left: 4px solid var(--ok); border-bottom: 4px solid var(--ok); transform: rotate(-45deg) translate(2px, -3px); }
.pos-box.failed .ic { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.pos-box.failed .ic::after { content: "!"; color: var(--danger); font: 700 30px var(--text); }
.pos-box h2 { font-size: 20px; margin: 0 0 6px; }
.pos-box p { margin: 6px 0 0; color: var(--ink-2); }
.pos-box .big { font-size: 26px; font-weight: 700; color: var(--ink); }
.pos-box .change { font-size: 18px; color: var(--ink); margin-top: 14px; padding: 12px; border-radius: var(--radius-s); background: var(--surface-2); }
.pos-box .change b { font-size: 28px; display: block; }
.pos-box .acts { margin-top: 20px; display: grid; }
.pos-cam { position: relative; width: min(520px, 100%); background: #000; border-radius: var(--radius-m); overflow: hidden; display: grid; }
.pos-cam video { width: 100%; max-height: 70vh; object-fit: cover; display: block; }
.pos-cam .frame { position: absolute; left: 12%; right: 12%; top: 30%; height: 28%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 10px; pointer-events: none; }
.pos-cam p { margin: 0; padding: 12px; color: #fff; text-align: center; background: rgba(0, 0, 0, .7); }
.pos-cam .btn { border-radius: 0; min-height: 50px; }
@media (max-width: 1100px) {
  .pos { grid-template-columns: 1fr; }
  .pos-check { position: static; }
  .pos-cart { max-height: none; }
  .pos-bar:not([hidden]) {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; position: sticky; bottom: 0; z-index: 30;
    margin: 16px -16px 0; padding: 10px 16px; background: color-mix(in srgb, var(--surface) 96%, transparent); border-top: 1px solid var(--line);
  }
  .pos-bar small { display: block; color: var(--ink-3); font-size: 12px; }
  .pos-bar b { font-size: 20px; font-variant-numeric: tabular-nums; }
}
@media (max-width: 960px) { .pos-bar:not([hidden]) { bottom: calc(66px + var(--safe-b)); } }
@media (max-width: 560px) {
  .pos-results { grid-template-columns: 1fr 1fr; }
  .pos-search .btn span { display: none; }
  .pos-cart li[data-i] { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px 10px 16px; }
  .pos-cart .qty { grid-column: 1; justify-self: start; }
  .pos-cart .sm { grid-row: 1; grid-column: 2; }
  .pos-cart .rm { grid-row: 2; grid-column: 2; justify-self: end; }
}

/* Подтверждения: строки списка с новой строки */
.dlg .full p { white-space: pre-line; }

/* ── Программы, безопасность: текстовые блоки с инструкциями ── */
.prose ol, .prose ul { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.prose p { margin: 0 0 10px; }
.prose pre { margin: 8px 0 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); font: 500 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.prose code { font: 500 13px var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.t td .acts { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.t td .acts .btn { white-space: nowrap; }

/* Вход: вкладки «Личный кабинет / Облако» */
.auth-box { width: min(400px, 100%); display: grid; gap: 22px; }
.auth-box form { width: 100%; }
.auth-tabs { width: 100%; display: flex; }
.auth-tabs button { flex: 1; }
.auth-box .already { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.auth-box .already p:last-child { display: flex; flex-wrap: wrap; gap: 8px; }

/* Облако компании в админке */
.cl-meter { max-width: 260px; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.cl-meter i { display: block; height: 100%; background: var(--cobalt); }
.cl-meter.full i { background: var(--danger); }
.cl-badge { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 600; vertical-align: 1px; color: var(--cobalt); background: color-mix(in srgb, var(--cobalt) 12%, transparent); }
.cl-badge[hidden] { display: none; }
