/* ProfitTracker — оформление сайта для компьютера, слой поверх app.css (подключается последним).
   Идея: касса и чековая лента. Холодный светлый фон, тёмная «чернильная» панель, шафран — только там, где
   нужно действие или прибыль. Главная цифра дня — на «чеке» с рваным краем; всё остальное спокойное и плоское.
   Движение: только то, что отвечает на действие (нажатие, открытие, переключение) и один выезд заголовка
   при открытии страницы. Всё отключается при «уменьшить анимацию». */

/* ---------- Палитра и ритм (светлая схема); тёмная остаётся из tokens.css ---------- */
:root:not([data-theme="dark"]) {
  --c-bg: #edf0f6;
  --c-fill: #f4f6fb;
  --c-raised: #ffffff;
  --c-line: #e1e6ef;
  --c-text: #0e1a33;
  --c-muted: #55607a;
  --c-soft: #eaeef6;
  --c-side: #0c1530;
  --c-side-text: #c6cee2;
  --c-side-faint: #8f9ab6;
  --c-side-line: rgba(255, 255, 255, 0.08);
  --c-hero: #0e1a33;
  --paper-shadow: 0 1px 2px rgba(14, 26, 51, 0.05), 0 8px 24px -14px rgba(14, 26, 51, 0.16);
}
:root {
  --r-card: 16px;
  --r-ctl: 11px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --radius: var(--r-card);
}
body { font-feature-settings: "tnum" 1, "cv11" 1; letter-spacing: -0.003em; }

/* Крупные заголовки плотнее, цифры везде ровные */
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; }
.page-head .sub { font-size: 14px; }
.num, .kpi-value, .table td.num, .table td.right, b.num { font-variant-numeric: tabular-nums slashed-zero; }

/* ---------- Боковое меню: плоские чернила, спокойные пункты ---------- */
.sidebar {
  background: linear-gradient(180deg, #101c3c 0%, var(--side-bg) 38%, #0a1226 100%);
  border: 0;
  box-shadow: 0 18px 40px -22px rgba(8, 14, 32, 0.7);
}
.brand { font-weight: 800; letter-spacing: -0.03em; }
.brand-mark { background: linear-gradient(160deg, #ffc15a, #f2a33a); color: #1a1205; box-shadow: 0 6px 16px -6px rgba(242, 163, 58, 0.7); }
.nav-group { font-size: 12px; letter-spacing: 0.04em; text-transform: none; font-weight: 650; color: var(--side-faint); margin-top: 20px; }
.nav-group::after { opacity: 0.6; }
.nav-link { height: 40px; border-radius: 11px; font-weight: 560; transition: background 0.18s var(--ease-out), color 0.18s, transform 0.18s var(--ease-out); }
.nav-link:hover { background: rgba(255, 255, 255, 0.07); transform: translateX(2px); }
.nav-ico { background: transparent; width: 28px; height: 28px; }
.nav-link:hover .nav-ico { background: rgba(255, 255, 255, 0.08); transform: none; }
.nav-link.active { background: rgba(255, 255, 255, 0.1); box-shadow: none; color: #fff; }
.nav-link.active .nav-ico { background: var(--c-action); color: var(--c-on-action); box-shadow: 0 6px 14px -6px rgba(242, 163, 58, 0.8); }
.nav-more { font-weight: 560; }
/* Шафрановая «закладка» у активного пункта: её двигает polish.js (плавно переезжает при смене раздела) */
.nav-indicator { position: fixed; z-index: 71; left: 0; top: 0; width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--c-action); box-shadow: 0 0 14px rgba(242, 163, 58, 0.7); opacity: 0; transition: transform 0.32s var(--ease-spring), height 0.2s, opacity 0.2s; pointer-events: none; }
.nav-indicator.on { opacity: 1; }
.plan-card { border-radius: 13px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); }

/* ---------- Верхняя панель ---------- */
.topbar { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.8) blur(18px); border-bottom-color: color-mix(in srgb, var(--c-line) 80%, transparent); }
.search .input { border-radius: 12px; height: 42px; transition: box-shadow 0.2s var(--ease-out), border-color 0.2s, background 0.2s; }
.search .input:focus { border-color: var(--c-action); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-action) 18%, transparent); background: var(--surface); }
.search-results { border-radius: 14px; box-shadow: 0 24px 60px -24px rgba(14, 26, 51, 0.45); animation: pop 0.18s var(--ease-out); }
.pill-btn { border-radius: 12px; transition: background 0.15s, box-shadow 0.15s; }
.pill-btn:hover { background: var(--surface); box-shadow: var(--paper-shadow); }
.bell .nav-badge { animation: bell-pulse 2.6s ease-out 1; }
@keyframes bell-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-danger) 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: none; } }

/* ---------- Карточки: белые листы с тонкой кромкой ---------- */
.card { border-radius: var(--r-card); border: 1px solid var(--c-line); box-shadow: var(--paper-shadow); }
.card-head { padding: 18px 22px; border-bottom-color: color-mix(in srgb, var(--c-line) 70%, transparent); }
.card-head h2, .card-title { font-size: 16px; font-weight: 740; letter-spacing: -0.02em; }
.card.clickable, .item.clickable, .kpi.clickable { transition: transform 0.18s var(--ease-out), box-shadow 0.18s; }
.card.clickable:hover, .kpi.clickable:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -18px rgba(14, 26, 51, 0.4); }

/* ---------- Показатели: спокойные белые плитки, цвет — только в значке ---------- */
.kpi { padding: 20px 22px; border-radius: var(--r-card); gap: 10px; }
.kpi:hover { transform: none; box-shadow: var(--paper-shadow); }
.kpi[data-hue] { background: var(--surface); border-color: var(--c-line); }
.kpi[data-hue] .kpi-label .ico { background: color-mix(in srgb, var(--hue) 14%, var(--surface)); color: var(--hue); }
.kpi-label { font-size: 13px; font-weight: 640; }
.kpi-label .ico { border-radius: 10px; }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.kpi-value .cents { font-size: 0.62em; font-weight: 650; opacity: 0.55; letter-spacing: -0.01em; }
.kpi-cur { font-weight: 650; opacity: 0.6; }

/* Главная цифра дня — «чек»: тёмный лист с рваным нижним краем и пунктирными линиями показателей */
.kpi.primary {
  --tooth: 9px;
  background: radial-gradient(120% 80% at 100% 0%, rgba(242, 163, 58, 0.2), transparent 55%), linear-gradient(180deg, #14224a 0%, var(--c-hero) 100%);
  box-shadow: none; border: 0; padding-bottom: calc(22px + var(--tooth));
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / calc(var(--tooth) * 2) 100% repeat-x;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / calc(var(--tooth) * 2) 100% repeat-x;
}
.kpi.primary .kpi-value { font-size: 46px; letter-spacing: -0.05em; }
.kpi.primary .kpi-label { color: rgba(255, 255, 255, 0.78); }
.kpi.primary .kpi-label .ico { background: rgba(242, 163, 58, 0.22); color: #ffc15a; }
.kpi.primary .kpi-metrics { border-top: 1px dashed rgba(255, 255, 255, 0.22); padding-top: 14px; }
.kpi.primary .kpi-metrics b { font-size: 17px; font-weight: 740; }
.kpi.primary .kpi-metrics span { color: rgba(255, 255, 255, 0.62); }
.kpi.primary .kpi-spark { opacity: 0.95; }
.kpi.primary .kpi-spark path:not([fill="none"]) { opacity: 0.35; }

/* ---------- Кнопки ---------- */
.btn { border-radius: var(--r-ctl); height: 40px; font-weight: 640; transition: background 0.15s, border-color 0.15s, box-shadow 0.2s var(--ease-out), transform 0.12s var(--ease-out); }
.btn:hover { box-shadow: 0 1px 0 rgba(14, 26, 51, 0.04), 0 8px 18px -12px rgba(14, 26, 51, 0.35); }
.btn:active { transform: translateY(1px) scale(0.985); box-shadow: none; }
.btn-primary { background: linear-gradient(180deg, #ffb94a, var(--c-action)); color: #1a1205; border: 0; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 10px 22px -12px rgba(242, 163, 58, 0.9); }
.btn-primary:hover { background: linear-gradient(180deg, #ffc15a, #f5ab43); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 14px 28px -14px rgba(242, 163, 58, 1); }
:root[data-theme="dark"] .btn-primary { color: #1a1205; }
.btn-lg { height: 52px; border-radius: 14px; }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; color: var(--text); animation: spin 0.7s linear infinite; }
.btn-primary.busy::after { color: #1a1205; }

/* ---------- Переключатель периодов ---------- */
.seg { background: color-mix(in srgb, var(--c-line) 70%, var(--c-bg)); border-radius: 13px; padding: 4px; }
.seg button { border-radius: 10px; transition: background 0.2s var(--ease-out), color 0.2s, box-shadow 0.2s; }
.seg button.active { background: var(--surface); box-shadow: 0 1px 2px rgba(14, 26, 51, 0.1), 0 6px 14px -8px rgba(14, 26, 51, 0.3); }

/* ---------- Таблицы: воздух, ровные цифры, мягкая подсветка строки ---------- */
.table th { background: color-mix(in srgb, var(--c-fill) 85%, var(--surface)); font-size: 12.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--muted); }
.table td { padding: 13px 16px; border-bottom-color: color-mix(in srgb, var(--c-line) 65%, transparent); }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--c-action) 6%, var(--surface)); }
.table tbody tr.selected, .table tbody tr[aria-selected="true"] { background: color-mix(in srgb, var(--c-action) 12%, var(--surface)); box-shadow: inset 3px 0 0 var(--c-action); }

/* ---------- Значки, поля ---------- */
.badge { height: 24px; padding: 0 10px; border-radius: 12px; font-weight: 680; }
.input, .select, textarea.input { border-radius: var(--r-ctl); border-color: var(--c-line); background: var(--surface); transition: border-color 0.15s, box-shadow 0.2s var(--ease-out); }
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--c-line) 50%, var(--c-muted)); }
.input:focus, .select:focus { border-color: var(--c-action); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-action) 18%, transparent); outline: none; }

/* ---------- Окна и панели: пружинное открытие, размытый фон ---------- */
.overlay { background: rgba(8, 14, 32, 0.5); backdrop-filter: blur(5px) saturate(1.2); }
.modal { border-radius: 22px; animation: modal-in 0.28s var(--ease-spring); box-shadow: 0 40px 90px -30px rgba(8, 14, 32, 0.6); }
.drawer { animation: drawer-in 0.32s var(--ease-out); box-shadow: -30px 0 80px -30px rgba(8, 14, 32, 0.5); }
@keyframes modal-in { from { transform: translateY(14px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(48px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.toast { border-radius: 14px; animation: toast-in 0.3s var(--ease-spring); box-shadow: 0 18px 40px -18px rgba(8, 14, 32, 0.6); }
@keyframes toast-in { from { transform: translateY(14px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Пустые состояния, загрузка ---------- */
.empty .ico { width: 56px; height: 56px; padding: 15px; border-radius: 18px; background: var(--c-soft); color: var(--c-muted); }
.skeleton { border-radius: 14px; }

/* ---------- Заголовок страницы выезжает один раз при открытии; всё остальное остаётся на месте ---------- */
.page { animation: none; }
.page > .page-head { animation: head-in 0.42s var(--ease-out) both; }
@keyframes head-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page > .grid-kpi > .card { animation: tile-in 0.45s var(--ease-out) both; }
.page > .grid-kpi > .card:nth-child(2) { animation-delay: 0.05s; }
.page > .grid-kpi > .card:nth-child(3) { animation-delay: 0.1s; }
.page > .grid-kpi > .card:nth-child(4) { animation-delay: 0.15s; }
@keyframes tile-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Прогресс и полосы: растут при появлении ---------- */
.progress i, .bar-item .fill, .rk-bar, .cust-bar-fill, .flow-fill { transform-origin: left center; animation: grow-x 0.7s var(--ease-out) both; }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Касса: добавленная строка чека коротко подсвечивается ---------- */
.cart-line, .cl2 { animation: line-flash 0.7s var(--ease-out); }
@keyframes line-flash { from { background: color-mix(in srgb, var(--c-action) 22%, transparent); } to { background: transparent; } }
.tile2 { transition: transform 0.15s var(--ease-out), box-shadow 0.2s, border-color 0.15s; }
.tile2:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(14, 26, 51, 0.4); }
.tile2:active { transform: scale(0.98); }

/* ---------- Уважаем «уменьшить анимацию» ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .nav-link:hover { transform: none; }
}

/* Обучение: четыре шага по порядку (это действительно последовательность): текущий подсвечен и с кнопкой */
.onboarding { padding: 22px 24px; display: grid; gap: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--c-action) 7%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--c-action) 30%, var(--c-line)); }
.onb-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.onb-head h2 { font-size: 20px; font-weight: 780; letter-spacing: -0.03em; }
.onb-head .sub { color: var(--muted); margin-top: 2px; }
.onb-progress { width: min(260px, 36%); height: 8px; border-radius: 4px; }
.onb-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.onb-step { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 12px; align-content: start; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--c-line); transition: border-color 0.2s, box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out); }
.onb-step .btn { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }
.onb-mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 760; background: var(--c-soft); color: var(--c-muted); }
.onb-text { display: grid; gap: 2px; min-width: 0; }
.onb-text b { font-weight: 720; letter-spacing: -0.01em; }
.onb-text .muted { font-size: 13px; }
.onb-step.current { border-color: var(--c-action); box-shadow: 0 14px 30px -18px rgba(242, 163, 58, 0.9); transform: translateY(-2px); }
.onb-step.current .onb-mark { background: var(--c-action); color: #1a1205; animation: onb-pulse 2.2s ease-out 2; }
.onb-step.done .onb-mark { background: var(--c-success); color: var(--c-on-signal); }
.onb-step.done { background: color-mix(in srgb, var(--c-success) 7%, var(--surface)); }
@keyframes onb-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-action) 55%, transparent); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: none; } }
@media (max-width: 1100px) { .onb-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .onb-head { flex-direction: column; align-items: stretch; gap: 12px; } .onb-progress { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .onb-step.current { transform: none; } }

/* ---------- Новый товар: три понятных блока и живой предпросмотр ---------- */
.modal.xl { width: min(1080px, 100%); }
.toolbar-sub { display: flex; align-items: center; gap: 10px; padding: 0 20px 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 13px; border-radius: 15px; border: 1px solid var(--c-line); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.12s var(--ease-out); }
.chip:hover { border-color: var(--c-action); background: color-mix(in srgb, var(--c-action) 8%, var(--surface)); }
.chip:active { transform: scale(0.97); }
.chip.on { background: var(--c-action); border-color: transparent; color: #1a1205; }
.np { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.np-form { display: grid; gap: 16px; min-width: 0; }
.np-section { display: grid; gap: 14px; padding: 18px 20px; border: 1px solid var(--c-line); border-radius: 16px; background: var(--surface); }
.np-head h3 { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; }
.np-head p { font-size: 13px; margin-top: 2px; }
.np-examples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.np-profit { min-height: 22px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.np-profit.good { color: var(--c-success); }
.np-profit.bad { color: var(--c-danger); }
.np-more { border: 1px dashed var(--c-line); border-radius: 16px; background: color-mix(in srgb, var(--c-fill) 60%, transparent); }
.np-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; cursor: pointer; font-weight: 650; list-style: none; }
.np-more > summary::-webkit-details-marker { display: none; }
.np-more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 7px; background: var(--c-soft); font-weight: 800; }
.np-more[open] > summary::before { content: "–"; }
.np-more > summary { justify-content: flex-start; }
.np-more > summary .muted { margin-left: auto; font-weight: 500; }
.np-more-body { display: grid; gap: 16px; padding: 4px 20px 20px; }
.np-side { position: sticky; top: 0; }
.np-preview { display: grid; gap: 14px; padding: 18px; border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--c-action) 8%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--c-action) 26%, var(--c-line)); }
.np-tile { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--paper-shadow); border-left: 4px solid var(--c-success); }
.np-thumb { grid-row: span 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--c-soft); color: var(--c-muted); }
.np-tile-text { display: grid; min-width: 0; }
.np-tile-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-tile .badge { justify-self: start; }
.np-cap { font-size: 12.5px; text-align: center; }
.np-stats { display: grid; gap: 8px; margin: 0; }
.np-stats > div { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px dashed var(--c-line); }
.np-stats dt { color: var(--muted); font-size: 13px; }
.np-stats dd { margin: 0; }
.np-stats .pos { color: var(--c-success); }
.np-stats .neg { color: var(--c-danger); }
@media (max-width: 900px) { .np { grid-template-columns: 1fr; } .np-side { position: static; order: -1; } }
.modal.xl .overlay-body { overflow-x: hidden; }
.np, .np-form, .np-section, .np-side, .np-more-body { min-width: 0; max-width: 100%; }
.np-section .form-grid { min-width: 0; }
.np-section .seg { max-width: 100%; }
.np-stats dt { white-space: nowrap; }
.np-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .np-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Общие доводки: главная плитка равномерно заполняет высоту, счётчики в переключателях не слипаются */
.grid-kpi > .kpi.primary { justify-content: space-between; }
.grid-kpi > .kpi.primary .kpi-value { margin-block: auto; }
.chip-count { margin-left: 6px; padding: 0 6px; border-radius: 8px; background: color-mix(in srgb, var(--c-line) 80%, transparent); opacity: 1; }
.seg button.active .chip-count { background: color-mix(in srgb, var(--c-action) 22%, transparent); }

/* Пустые состояния: значок в мягком «ореоле», чуть покачивается (один раз при появлении) */
.empty { display: grid; justify-items: center; gap: 8px; padding: 36px 20px; text-align: center; }
.empty .ico { position: relative; width: 64px; height: 64px; padding: 18px; border-radius: 22px; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c-action) 22%, var(--c-soft)), var(--c-soft)); color: color-mix(in srgb, var(--c-action) 70%, var(--c-text)); box-shadow: 0 0 0 8px color-mix(in srgb, var(--c-action) 8%, transparent); animation: empty-float 0.9s var(--ease-spring) both; }
.empty h3 { font-size: 17px; font-weight: 750; letter-spacing: -0.02em; }
.empty p { color: var(--muted); max-width: 44ch; }
@keyframes empty-float { from { transform: translateY(10px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Оплата в кассе: «к оплате» на чеке, способы оплаты, быстрые суммы ---------- */
.pay-total { --tooth: 8px; position: relative; display: grid; gap: 4px; justify-items: center; padding: 22px 20px calc(24px + var(--tooth)); border: 0; border-radius: 16px 16px 0 0; color: #fff; background: radial-gradient(120% 90% at 100% 0%, rgba(242, 163, 58, 0.22), transparent 55%), linear-gradient(180deg, #14224a, var(--c-hero)); -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / calc(var(--tooth) * 2) 100% repeat-x; mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / calc(var(--tooth) * 2) 100% repeat-x; }
.pay-total-label { font-size: 12.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }
.pay-total-value { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; animation: amount-in 0.5s var(--ease-spring) both; }
@keyframes amount-in { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.pay-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--c-line) 70%, var(--c-bg)); }
.pay-method { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-weight: 680; cursor: pointer; transition: background 0.2s var(--ease-out), color 0.2s, box-shadow 0.2s, transform 0.12s; }
.pay-method:hover { color: var(--text); }
.pay-method:active { transform: scale(0.97); }
.pay-method.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(14, 26, 51, 0.12), 0 8px 16px -10px rgba(14, 26, 51, 0.4); }
.pay-method.active .ico { color: var(--c-action); }
.pay-row { border-radius: 14px; }
.pay-row .input { font-size: 22px; font-weight: 760; text-align: right; height: 48px; }
.pay-quick .chip { height: 34px; padding: 0 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-quick .chip.active { background: var(--c-action); border-color: transparent; color: #1a1205; }

/* ---------- «Готово»: чек выезжает из принтера, галочка и сумма появляются следом ---------- */
.modal .success { position: relative; display: grid; gap: 6px; justify-items: center; width: min(320px, 100%); margin: 6px auto 12px; padding: 26px 22px 40px; text-align: center; background: var(--surface); border: 0; border-radius: 4px 4px 0 0; box-shadow: var(--paper-shadow); -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 16px 100% repeat-x; mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 16px 100% repeat-x; animation: receipt-print 0.75s var(--ease-out) both; }
.modal .success .kpi-value { font-size: 34px; border-top: 1px dashed var(--c-line); border-bottom: 1px dashed var(--c-line); padding: 12px 0; width: 100%; animation: amount-in 0.5s var(--ease-spring) 0.45s both; }
.modal .success .success-check { animation: check-pop 0.5s var(--ease-spring) 0.35s both, check-ring 1s ease-out 0.55s 1; }
@keyframes receipt-print { from { clip-path: inset(0 0 100% 0); transform: translateY(-14px); } to { clip-path: inset(0 0 0 0); transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal .success { clip-path: none; transform: none; } }
.overlay-body:has(> .success) { background: color-mix(in srgb, var(--c-line) 55%, var(--c-bg)); padding-top: 22px; }
.modal .success { box-shadow: 0 18px 30px -20px rgba(14, 26, 51, 0.5); }

/* ---------- Таблицы: первые строки появляются каскадом; сообщения показывают, сколько им осталось ---------- */
.table tbody tr { animation: row-in 0.32s var(--ease-out) both; }
.table tbody tr:nth-child(2) { animation-delay: 0.02s; } .table tbody tr:nth-child(3) { animation-delay: 0.04s; }
.table tbody tr:nth-child(4) { animation-delay: 0.06s; } .table tbody tr:nth-child(5) { animation-delay: 0.08s; }
.table tbody tr:nth-child(6) { animation-delay: 0.1s; } .table tbody tr:nth-child(7) { animation-delay: 0.12s; }
.table tbody tr:nth-child(8) { animation-delay: 0.14s; } .table tbody tr:nth-child(n+9) { animation-delay: 0.16s; }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.toast { position: relative; overflow: hidden; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: currentColor; opacity: 0.35; transform-origin: left; animation: toast-timer 3.2s linear both; }
.toast.err::after { animation-duration: 6s; }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .toast::after { display: none; } }

/* ---------- Вход: холодный фон, тёмная панель с примером чека, спокойная карточка ---------- */
:root:not([data-theme="dark"]) .lg { --lg-bg: #edf0f6; --lg-line: #e1e6ef; --lg-field: #f4f6fb; --lg-text: #0e1a33; --lg-muted: #55607a; --lg-shadow: 0 30px 70px -28px rgba(14, 26, 51, 0.45), 0 1px 3px rgba(14, 26, 51, 0.06); }
:root .lg-hero { background: radial-gradient(700px 440px at 92% -6%, rgba(242, 163, 58, 0.34), transparent 62%), linear-gradient(160deg, #0b1530 0%, #101f48 60%, #14275c 100%); }
:root .lg-hero::before { display: none; }
:root .lg-title { font-size: clamp(32px, 4.4vw, 54px); font-weight: 820; letter-spacing: -0.04em; }
:root .lg-card { border-radius: 24px; padding: 32px 30px 26px; }
:root .lg-card h1 { font-size: 26px; letter-spacing: -0.035em; }
:root .lg-card .auth-tabs { background: color-mix(in srgb, var(--lg-line) 70%, var(--lg-bg)); }
:root .lg-deco { display: none !important; }
.lg-receipt { position: absolute !important; right: clamp(24px, 5vw, 72px); bottom: 44px; width: 270px; padding: 18px 18px 30px; color: #0e1a33; background: #fff; border-radius: 6px 6px 0 0; font-size: 13.5px; display: grid; gap: 7px; transform: rotate(2.5deg); box-shadow: 0 30px 50px -24px rgba(0, 0, 0, 0.65); -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 16px 100% repeat-x; mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 16px 100% repeat-x; animation: receipt-print 1s var(--ease-out) 0.25s both, receipt-sway 7s ease-in-out 1.4s infinite alternate; }
.rc-head { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed #c9d1e0; color: #55607a; font-size: 12.5px; }
.rc-head b { color: #0e1a33; }
.rc-line { display: flex; align-items: baseline; gap: 6px; }
.rc-dots { flex: 1; border-bottom: 1px dotted #aab3c8; transform: translateY(-3px); }
.rc-sum, .rc-profit { display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; border-top: 1px dashed #c9d1e0; }
.rc-sum b { font-size: 17px; }
.rc-profit { border: 0; padding-top: 0; color: #0b7a53; }
.rc-profit b { font-size: 20px; font-weight: 800; }
@keyframes receipt-sway { from { transform: rotate(2.5deg) translateY(0); } to { transform: rotate(1deg) translateY(-8px); } }
@media (max-width: 1180px) { .lg-receipt { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .lg-receipt { animation: none; clip-path: none; } }

/* ---------- Карточка товара: сводка вверху и те же понятные блоки, что в «Новом товаре» ---------- */
.drawer .overlay-body { gap: 14px; background: color-mix(in srgb, var(--c-fill) 70%, var(--surface)); }
.pd-summary { display: grid; gap: 12px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--c-line); box-shadow: var(--paper-shadow); }
.pd-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.pd-fact { display: grid; gap: 2px; padding-left: 12px; border-left: 3px solid var(--c-line); }
.pd-fact b { font-size: 18px; font-weight: 780; letter-spacing: -0.02em; }
.pd-fact.good { border-left-color: var(--c-success); } .pd-fact.good b { color: var(--c-success); }
.pd-fact.bad { border-left-color: var(--c-danger); } .pd-fact.bad b { color: var(--c-danger); }

/* «Что требует внимания» на главной */
.item.attn { text-decoration: none; color: inherit; transition: background 0.15s, transform 0.15s var(--ease-out); border-radius: 12px; }
.item.attn:hover { background: var(--c-soft); transform: translateX(2px); text-decoration: none; }
.attn-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--c-soft); color: var(--c-muted); }
.item.attn.warn .attn-ico { background: var(--warn-weak); color: var(--warn); }
.item.attn.bad .attn-ico { background: var(--bad-weak); color: var(--bad); }
.np-preview { grid-template-columns: minmax(0, 1fr); }
.np-stats dt { white-space: normal; }
.np-stats > div { display: flex !important; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.np-stats dt, .np-stats dd { flex: 0 1 auto; width: auto; min-width: 0; margin: 0; text-align: left; }
.np-stats dd b { display: inline; width: auto; }

/* Пустые состояния: «иллюстрация» из мягких пятен и точек вокруг значка (без картинок: ничего не грузится) */
.empty { position: relative; isolation: isolate; }
.empty::before { content: ""; position: absolute; z-index: -1; top: 14px; left: 50%; width: 190px; height: 120px; transform: translateX(-50%); background: radial-gradient(60px 40px at 22% 40%, color-mix(in srgb, var(--c-action) 16%, transparent), transparent 70%), radial-gradient(60px 40px at 78% 40%, color-mix(in srgb, var(--c-action) 14%, transparent), transparent 70%), radial-gradient(3px 3px at 8% 20%, color-mix(in srgb, var(--c-action) 60%, transparent), transparent 3px), radial-gradient(3px 3px at 92% 25%, color-mix(in srgb, var(--c-muted) 45%, transparent), transparent 3px), radial-gradient(4px 4px at 85% 85%, color-mix(in srgb, var(--c-action) 45%, transparent), transparent 4px), radial-gradient(3px 3px at 14% 80%, color-mix(in srgb, var(--c-muted) 40%, transparent), transparent 3px); animation: empty-float 1s var(--ease-spring) both; }

/* Сетка показателей без дыр: у сетки с главным «чеком» четыре колонки, а хвост последнего ряда растягивается на свободное место */
@media (min-width: 1101px) {
  .grid-kpi:has(> .kpi.primary:first-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-kpi > .kpi.primary:first-child:nth-last-child(-n+3) { grid-row: auto; }
  .grid-kpi > .kpi.primary:first-child:is(:nth-last-child(4), :nth-last-child(8), :nth-last-child(12)) ~ .kpi:last-child { grid-column: span 2; }
  .grid-kpi > .kpi.primary:first-child:is(:nth-last-child(6), :nth-last-child(10)) ~ .kpi:last-child { grid-column: 1 / -1; }
  .grid-kpi > .kpi.primary:first-child:is(:nth-last-child(7), :nth-last-child(11)) ~ .kpi:nth-last-child(-n+2) { grid-column: span 2; }
}

/* Значок внутри кнопки пустого состояния — обычного размера, а не плиткой; вкладки со значком; пароль с «Показать» внутри поля */
.empty .btn .ico { position: static; width: 16px; height: 16px; padding: 0; border-radius: 0; background: none; box-shadow: none; animation: none; color: inherit; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button .ico { margin-left: 0; }
.pw-row { position: relative; display: block; }
.pw-row .input { width: 100%; padding-right: 92px; }
.pw-row .pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); height: 32px; }

/* Поля ввода: граница не слабее 3:1 к фону карточки (раньше около 1,3:1, пустое поле почти не было видно) */
.input, .select, textarea.input { border-color: color-mix(in srgb, var(--c-muted) 70%, var(--surface)); }
.input:hover, .select:hover { border-color: var(--c-muted); }
.field-hint { color: var(--muted); }

/* «Избранное» в боковом меню: плитки 2×2 со значком и названием; открепить — звёздочка при наведении */
.fav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px 2px 8px; }
.fav-cell { position: relative; min-width: 0; }
.fav-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-height: 66px; padding: 10px 10px 9px; border-radius: 14px; text-decoration: none; color: var(--side-text); background: color-mix(in srgb, var(--c-on-hero) 7%, transparent); border: 1px solid color-mix(in srgb, var(--c-on-hero) 11%, transparent); transition: background 0.18s, border-color 0.18s, transform 0.18s var(--ease-out); }
.fav-tile:hover { background: color-mix(in srgb, var(--c-on-hero) 13%, transparent); transform: translateY(-1px); }
.fav-tile .nav-ico { width: 28px; height: 28px; }
.fav-tile.active { color: var(--c-on-hero); background: color-mix(in srgb, var(--c-action) 24%, transparent); border-color: color-mix(in srgb, var(--c-action) 60%, transparent); }
.fav-name { font-size: 12.5px; font-weight: 650; line-height: 1.15; overflow-wrap: anywhere; }
.fav-tile .nav-badge { position: absolute; top: 8px; right: 30px; }
.fav-x { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--c-action); cursor: pointer; opacity: 0; transition: opacity 0.15s, background 0.15s; }
.fav-x .ico { fill: currentColor; }
.fav-cell:hover .fav-x, .fav-cell:focus-within .fav-x { opacity: 1; }
.fav-x:hover { background: color-mix(in srgb, var(--c-on-hero) 14%, transparent); }
@media (hover: none) { .fav-x { opacity: 0.8; } }

/* ---------- Движение товаров ---------- */
.mv-custom { align-items: center; gap: 8px; }
.mv-custom[hidden] { display: none; }
.mv-up { color: var(--c-success); font-weight: 650; }
.mv-down { color: var(--c-danger); font-weight: 650; }
.mv-zero { color: var(--c-muted); opacity: 0.55; }
.mv-name { display: grid; gap: 1px; min-width: 220px; }
.mv-name .muted { font-size: 12.5px; }
.mv-closing { font-size: 15px; }
.table tbody tr:has(.mv-closing) td:last-child { background: color-mix(in srgb, var(--c-action) 7%, transparent); }
.table tbody tr:has(.mv-name) { cursor: pointer; }

/* итоговая «лента»: остаток на конец крупно, рядом итоги по видам движения через пунктир */
.mv-tape { display: grid; grid-template-columns: minmax(220px, 1.3fr) repeat(auto-fit, minmax(118px, 1fr)); border: 1px solid var(--c-line); border-radius: 22px; background: var(--surface); overflow: hidden; }
.mv-tape-main { display: grid; gap: 3px; align-content: center; padding: 16px 20px; background: color-mix(in srgb, var(--c-action) 8%, var(--surface)); }
.mv-tape-main > span { color: var(--c-muted); font-size: 13px; font-weight: 600; }
.mv-tape-main b { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.mv-tape-main small { color: var(--c-muted); }
.mv-cell { display: grid; gap: 2px; align-content: center; padding: 14px 16px; border-left: 2px dashed var(--c-line); }
.mv-cell > span { font-size: 12.5px; font-weight: 600; }
.mv-cell b { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.mv-cell.good b { color: var(--c-success); }
.mv-cell.bad b { color: var(--c-danger); }
.mv-cell small { font-size: 12px; }

/* лента операций товара */
.mv-product { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 16px; background: var(--surface); }
.mv-product .right { text-align: right; display: grid; gap: 1px; }
.mv-product .right b { font-size: 20px; }
.mv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mv-stat { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--c-soft); }
.mv-stat b { font-size: 20px; font-weight: 700; }
.mv-stat.up b { color: var(--c-success); }
.mv-stat.down b { color: var(--c-danger); }
.mv-feed { display: grid; gap: 14px; }
.mv-day > header { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 4px; border-bottom: 2px dashed var(--c-line); }
.mv-op { display: grid; grid-template-columns: 56px minmax(0, 1fr) 70px 110px; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--c-line); }
.mv-op:last-child { border-bottom: 0; }
.mv-what { display: grid; gap: 1px; min-width: 0; }
.mv-what b { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mv-what .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-op .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-muted); display: inline-block; flex: none; }
.mv-op .dot.good { background: var(--c-success); }
.mv-op .dot.bad { background: var(--c-danger); }
.mv-op > .num { text-align: right; font-size: 16px; }
.mv-after { text-align: right; display: grid; justify-items: end; }
.mv-after small { font-size: 11.5px; }
@media (max-width: 900px) { .mv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mv-op { grid-template-columns: 48px minmax(0, 1fr) 56px 80px; } }

/* Аудит склада */
.au-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.au-title h2, .au-title h3 { margin: 0; }
.au-list { display: grid; gap: 8px; }
.au-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 16px; width: 100%; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 16px; background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.au-row:hover { border-color: var(--c-action); }
.au-row.draft { border-style: dashed; }
.au-num { font-weight: 700; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.au-main { display: grid; gap: 8px; min-width: 0; }
.au-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.au-side { display: flex; align-items: center; gap: 10px; text-align: right; }
.au-side > b, .au-side > small { display: block; }
.au-side b.good { color: var(--c-success); }
.au-side b.bad { color: var(--c-danger); }
.au-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--c-soft); }
.au-bar.thin { height: 6px; }
.au-bar i { display: block; min-width: 0; }
.au-bar i.ok { background: var(--c-success); }
.au-bar i.bad { background: var(--c-danger); }
.au-bar i.warn { background: var(--c-warning); }
.au-bar i.rest { background: var(--c-line); }
.au-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--c-muted); }
.au-legend .dot, .au-acc .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--c-line); }
.au-legend .dot.ok { background: var(--c-success); }
.au-legend .dot.bad { background: var(--c-danger); }
.au-legend .dot.warn { background: var(--c-warning); }
.au-sum { display: grid; gap: 12px; margin-bottom: 14px; }
.au-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.au-stat { display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--c-soft); }
.au-stat span { font-size: 12.5px; color: var(--c-muted); }
.au-stat b { font-size: 19px; font-weight: 700; }
.au-stat.good b { color: var(--c-success); }
.au-stat.bad b { color: var(--c-danger); }
.au-prod { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--c-line); }
.au-pname { display: grid; gap: 1px; min-width: 0; }
.au-pname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-exp { font-size: 12.5px; }
.au-ctl { display: flex; align-items: center; gap: 6px; }
.au-qty { width: 84px; text-align: center; }
.au-step, .au-check { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--c-line); background: var(--surface); color: inherit; cursor: pointer; }
.au-step:hover, .au-check:hover { border-color: var(--c-action); }
.au-diff { min-width: 52px; text-align: right; font-weight: 650; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.au-diff.up { color: var(--c-success); }
.au-diff.down { color: var(--c-danger); }
.au-progress { display: grid; gap: 8px; margin-bottom: 10px; }
.au-counts { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.au-days { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-bottom: 20px; }
.au-day { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 6px; }
.au-day i { display: block; width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; background: var(--c-line); }
.au-day i.up { background: var(--c-success); }
.au-day i.down { background: var(--c-danger); }
.au-day span { position: absolute; bottom: -20px; font-size: 11px; color: var(--c-muted); white-space: nowrap; }
.au-acc { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
@media (max-width: 700px) { .au-row { grid-template-columns: 1fr auto; } .au-num { display: none; } }

/* Отчёты: наличные, сотрудники, залежавшийся товар */
.ri-cash { gap: 14px; }
.ri-net { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--c-soft); }
.ri-net b { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.ri-net.good { background: color-mix(in srgb, var(--c-success) 10%, var(--surface)); }
.ri-net.good b { color: var(--c-success); }
.ri-net.bad { background: color-mix(in srgb, var(--c-danger) 10%, var(--surface)); }
.ri-net.bad b { color: var(--c-danger); }
.ri-flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ri-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 2px 6px; font-weight: 600; }
.ri-head b.good, .num.good { color: var(--c-success); }
.ri-head b.bad, .num.bad, td .bad { color: var(--c-danger); }
td .good { color: var(--c-success); }
.ri-list { display: grid; border: 1px solid var(--c-line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.ri-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--c-line); }
.ri-row:last-child { border-bottom: 0; }
.ri-label { font-size: 13.5px; color: var(--c-muted); }
.ri-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--c-soft); }
.ri-ico.good { color: var(--c-success); background: color-mix(in srgb, var(--c-success) 14%, var(--surface)); }
.ri-ico.bad { color: var(--c-danger); background: color-mix(in srgb, var(--c-danger) 14%, var(--surface)); }
.ri-ico.warn { color: var(--c-warning); background: color-mix(in srgb, var(--c-warning) 16%, var(--surface)); }
.ri-ico.info { color: var(--c-action); background: color-mix(in srgb, var(--c-action) 14%, var(--surface)); }
.ri-mix { display: flex; width: 150px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--c-soft); }
.ri-mix i { display: block; min-width: 3px; }
.ri-mix i.ok { background: var(--c-success); }
.ri-mix i.info { background: var(--c-action); }
.ri-mix i.warn { background: var(--c-warning); }
.ri-who { display: grid; gap: 1px; }
.ri-stuck { display: grid; }
.ri-stuck-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 11px 2px; border-bottom: 1px solid var(--c-line); }
.ri-stuck-row:last-child { border-bottom: 0; }
.ri-stuck-row > div:first-child { display: grid; gap: 1px; min-width: 0; }
.ri-stuck-sum { display: grid; text-align: right; }
@media (max-width: 900px) { .ri-flows { grid-template-columns: 1fr; } }
.donut-legend .row { gap: 14px; }
.donut-legend .row > span { min-width: 0; }
.donut-legend .row b { white-space: nowrap; }
.ri-donut { flex-direction: column; align-items: stretch; gap: 14px; }
.ri-donut > svg, .ri-donut > .donut { align-self: center; }
.ri-mix { width: 110px; }

/* Ссылка-кнопка на чек в ленте движения товара */
.link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--c-action) 9%, transparent); color: var(--c-action); font: inherit; font-weight: 600; cursor: pointer; }
.link-btn:hover { background: color-mix(in srgb, var(--c-action) 16%, transparent); }

/* Просмотр чека */
.rc { display: grid; gap: 14px; }
.rc-hero { position: relative; display: grid; gap: 4px; padding: 16px 18px 20px; border-radius: 20px; background: linear-gradient(180deg, color-mix(in srgb, var(--c-action) 9%, var(--surface)), var(--surface)); border: 1px solid var(--c-line); }
.rc-hero::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; border-bottom: 2px dashed var(--c-line); }
.rc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.rc-total { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--c-soft); font-size: 12.5px; font-weight: 600; }
.rc-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rc-tile { display: grid; gap: 3px; padding: 11px 13px; border-radius: 14px; border: 1px solid var(--c-line); background: var(--surface); }
.rc-tile span { font-size: 12px; }
.rc-tile b { font-size: 17px; font-weight: 700; }
.rc-tile.warn b { color: var(--c-warning); }
.rc-section { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: -6px; }
.rc-lines { border: 1px solid var(--c-line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.rc-line { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--c-line); }
.rc-line:last-child { border-bottom: 0; }
.rc-line.gone { opacity: 0.55; }
.rc-what { display: grid; gap: 1px; min-width: 0; }
.rc-what b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-what small { font-size: 12.5px; }
.rc-sums { display: grid; gap: 6px; padding: 12px 4px 0; border-top: 2px dashed var(--c-line); }
.rc-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rc-sum.big { font-size: 22px; font-weight: 700; }
.rc-sum.big b { font-size: 26px; letter-spacing: -0.02em; }
.rc-sum .good { color: var(--c-success); }
.rc-sum .bad { color: var(--c-danger); }

/* Меню поверх окон и боковых панелей (overlay = 60) */
.menu { z-index: 90; }

/* Окно чека: четыре кнопки в одну строку */
.modal:has(.rc) { width: min(600px, 100%); }

/* Оборудование */
.eq-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.eq-tile { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: 16px; background: var(--surface); }
.eq-tile > div { display: grid; gap: 1px; min-width: 0; }
.eq-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--c-soft); }
.eq-tile.ok .eq-ico { background: color-mix(in srgb, var(--c-success) 14%, var(--surface)); color: var(--c-success); }

/* Печать чека окном браузера: виден только блок #print-root */
#print-root { display: none; }
@media print {
  @page { margin: 0; }
  body:has(> #print-root) > *:not(#print-root) { display: none !important; }
  html, body { background: #fff !important; }
  #print-root { display: block; margin: 0 auto; padding: 3mm; color: #000; background: #fff; font: 12px/1.35 "Courier New", monospace; }
  #print-root.w58 { width: 58mm; }
  #print-root.w72 { width: 72mm; }
  #print-root.w80 { width: 80mm; }
  .pr-shop { text-align: center; font-weight: 700; font-size: 14px; }
  .pr-meta { text-align: center; font-size: 11px; }
  .pr-rule { border-top: 1px dashed #000; margin: 5px 0; }
  .pr-line { display: flex; justify-content: space-between; gap: 8px; }
  .pr-name { word-break: break-word; }
  .pr-total { font-weight: 700; font-size: 14px; }
  .pr-thanks { text-align: center; margin-top: 8px; }
}

/* Весы с наклейками */
.sc-digits { display: flex; flex-wrap: wrap; gap: 4px; }
.sc-d { display: inline-grid; place-items: center; width: 26px; height: 34px; border-radius: 8px; font: 700 15px/1 var(--font-mono, ui-monospace, monospace); background: var(--c-soft); color: var(--c-muted); }
.sc-d.p { background: color-mix(in srgb, var(--c-muted) 18%, var(--surface)); color: var(--c-text, inherit); }
.sc-d.c { background: color-mix(in srgb, var(--c-action) 16%, var(--surface)); color: var(--c-action); }
.sc-d.w { background: color-mix(in srgb, var(--c-success) 16%, var(--surface)); color: var(--c-success); }
.sc-d.k { background: transparent; color: var(--c-muted); border: 1px dashed var(--c-line); }
.sc-format { display: grid; gap: 8px; padding: 14px 16px; border: 1px dashed var(--c-line); border-radius: 16px; background: var(--c-soft); }
.sc-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-muted); }
.sc-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; }
.sc-pick { display: grid; gap: 6px; width: 100%; padding: 11px 13px; border: 1px solid var(--c-line); border-radius: 14px; background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: inherit; }
.sc-pick:hover, .sc-pick.on { border-color: var(--c-action); background: color-mix(in srgb, var(--c-action) 6%, var(--surface)); }
.sc-preview { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--c-soft); }

/* Что заказать */
.ro-list { display: grid; border: 1px solid var(--c-line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.ro-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--c-line); }
.ro-row:last-child { border-bottom: 0; }
.ro-row.off { opacity: 0.5; }
.ro-name { display: grid; gap: 1px; min-width: 0; }
.ro-ctl { display: flex; align-items: center; gap: 8px; }
.ro-qty { width: 96px; text-align: right; }

/* Экран покупателя: окно без меню, крупно */
body.cd-mode .sidebar, body.cd-mode .topbar, body.cd-mode .tabbar, body.cd-mode .page-actions { display: none !important; }
body.cd-mode .app { display: block; }
body.cd-mode .main { margin: 0; padding: 0; max-width: none; }

/* Настройки: разделы слева, содержимое справа */
.set-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.set-nav { display: grid; gap: 4px; padding: 10px; position: sticky; top: 76px; }
.set-nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.set-nav-item:hover { background: var(--c-soft); }
.set-nav-item.on { background: color-mix(in srgb, var(--c-action) 12%, var(--surface)); color: var(--c-action); }
.set-profile { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.set-ava { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: color-mix(in srgb, var(--c-action) 16%, var(--surface)); color: var(--c-action); font-size: 20px; font-weight: 700; }
.set-prof-text { display: grid; gap: 2px; min-width: 0; }
.set-prof-text b { font-size: 18px; }
.set-link { text-decoration: none; color: inherit; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.th-card { display: grid; gap: 8px; padding: 8px; border: 2px solid var(--c-line); border-radius: 16px; background: var(--surface); font: inherit; color: inherit; cursor: pointer; text-align: left; }
.th-card.on { border-color: var(--c-action); }
.th-prev { display: grid; grid-template-columns: 28% 1fr; grid-template-rows: 1fr 1fr; gap: 5px; height: 84px; padding: 6px; border-radius: 10px; background: #eceff5; }
.th-prev i { border-radius: 5px; background: #fff; }
.th-prev i:first-child { grid-row: 1 / 3; }
.th-prev.dark { background: #0b1120; }
.th-prev.dark i { background: #1c2740; }
.th-prev.auto { background: linear-gradient(90deg, #eceff5 50%, #0b1120 50%); }
@media (max-width: 900px) { .set-layout { grid-template-columns: 1fr; } .set-nav { position: static; grid-auto-flow: column; overflow-x: auto; } .set-nav-item { white-space: nowrap; width: auto; } }

/* Товары из Excel: шаги */
.xl-step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; align-items: start; }
.xl-n { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--c-action) 14%, var(--surface)); color: var(--c-action); font-size: 20px; font-weight: 700; }

/* Подписка: сетка тарифов */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; align-items: stretch; }
.pl-card { position: relative; display: grid; align-content: start; gap: 12px; padding: 18px; }
.pl-card h3 { margin: 0; font-size: 20px; }
.pl-card.mine { border: 2px solid var(--c-success); }
.pl-card.hit { border: 2px solid var(--c-action); }
.pl-hit { position: absolute; top: -11px; left: 16px; padding: 2px 12px; border-radius: 999px; background: var(--c-action); color: #fff; font-size: 12px; font-weight: 700; }
.pl-price b { font-size: 30px; letter-spacing: -0.02em; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; }
.pl-feats li { display: flex; gap: 8px; align-items: flex-start; }
.pl-feats li svg { flex: none; margin-top: 2px; color: var(--c-success); }
.pl-foot { display: grid; gap: 10px; margin-top: auto; }

/* Касса на сенсорном экране: цифровая клавиатура оплаты, крупные кнопки */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.np-key { height: 52px; border: 1px solid var(--c-line); border-radius: 16px; background: var(--surface); color: var(--c-text); font: inherit; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; touch-action: manipulation; transition: transform 0.1s, background 0.15s; }
.np-key:active { transform: scale(0.94); background: color-mix(in srgb, var(--c-action) 18%, var(--surface)); }
.np-back { color: var(--muted); }
.np-clear { grid-column: 1 / -1; height: 44px; font-size: 14px; font-weight: 650; color: var(--muted); }
.pay-change-row { background: color-mix(in srgb, var(--c-success) 10%, var(--surface-2)); border-color: transparent; }
.pay-change-row .num { font-size: 30px; font-weight: 800; }
.pay-quick .chip { height: 48px; padding: 0 20px; font-size: 17px; }
.pay-method { height: 52px; }
.pay-btn { min-height: 64px; }
.qty button { min-width: 40px; min-height: 40px; }

/* Экран покупателя: последняя позиция крупно, итог внизу, анимации */
.cd { --cd-a: var(--c-action); --cd-b: var(--c-brand); --cd-on: var(--c-on-brand); position: relative; min-height: 100vh; display: flex; background: var(--c-bg); overflow: hidden; }
.cd-main { flex: 1; min-width: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 18px; padding: 28px 48px 32px; }
.cd[data-view="idle"] .cd-main, .cd[data-view="paid"] .cd-main, .cd[data-view="pay"] .cd-main { grid-template-rows: 1fr; }
.cd-center { grid-row: 1 / -1; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; }
.cd-shop { color: var(--muted); font-size: 22px; font-weight: 600; }
.cd-shop.big { color: var(--c-text); font-size: 52px; font-weight: 800; letter-spacing: -0.03em; animation: cd-rise 0.8s var(--ease-spring) both; }
.cd-hello { font-size: 28px; color: var(--muted); animation: cd-rise 0.8s var(--ease-spring) 0.15s both; }
.cd-orb { position: relative; width: 120px; height: 120px; margin-bottom: 8px; }
.cd-orb i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--cd-a); opacity: 0; animation: cd-ring 3.6s ease-out infinite; }
.cd-orb i:nth-child(2) { animation-delay: 1.2s; }
.cd-orb i:nth-child(3) { animation-delay: 2.4s; }
.cd-orb::after { content: ""; position: absolute; inset: 38px; border-radius: 50%; background: var(--cd-a); animation: cd-beat 3.6s ease-in-out infinite; }
.cd-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 26px; }
.cd-count { color: var(--muted); font-size: 20px; }
.cd-stage { display: grid; align-content: center; justify-items: center; gap: 28px; }
.cd-hero { display: grid; justify-items: center; gap: 8px; text-align: center; animation: cd-pop 0.55s var(--ease-spring) both; }
.cd-hero-name { font-size: 54px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; max-width: 90%; overflow-wrap: anywhere; }
.cd-hero-qty { font-size: 26px; color: var(--muted); }
.cd-hero-sum { font-size: 104px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; color: var(--cd-a); }
.cd-rest { display: grid; gap: 4px; width: min(640px, 90%); font-size: 24px; color: var(--muted); }
.cd-rest-line { display: flex; justify-content: space-between; gap: 16px; animation: cd-rise 0.5s var(--ease-out) both; }
.cd-rest-line:nth-child(2) { opacity: 0.8; } .cd-rest-line:nth-child(3) { opacity: 0.6; } .cd-rest-line:nth-child(4) { opacity: 0.4; }
.cd-foot { display: grid; gap: 6px; padding: 20px 32px; border-radius: 28px; background: var(--cd-b); color: var(--cd-on); animation: cd-rise 0.6s var(--ease-spring) both; }
.cd-disc { font-size: 20px; text-align: right; opacity: 0.85; }
.cd-sum { display: flex; justify-content: space-between; align-items: baseline; font-size: 30px; font-weight: 600; }
.cd-sum b { font-size: 76px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.cd-sum b.bump { animation: cd-bump 0.5s var(--ease-spring); }
.cd-pay-label { font-size: 28px; color: var(--muted); }
.cd-pay .cd-total { font-size: 140px; animation: none; }
.cd-pay-row { display: flex; justify-content: space-between; gap: 48px; min-width: 520px; font-size: 38px; color: var(--muted); animation: cd-rise 0.45s var(--ease-spring) both; }
.cd-pay-row b { color: var(--c-text); font-size: 54px; }
.cd-pay-change b { color: var(--c-success); font-size: 72px; }
.cd-total { font-size: 96px; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; animation: cd-pop 0.6s var(--ease-spring) 0.5s both; }
.cd-thanks { font-size: 44px; font-weight: 800; animation: cd-rise 0.6s var(--ease-spring) 0.3s both; }
.cd-change { font-size: 36px; color: var(--muted); animation: cd-rise 0.6s var(--ease-spring) 0.7s both; }
.cd-change b { color: var(--c-success); font-size: 52px; }
.cd-check { width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center; background: var(--c-success); color: #fff; animation: check-pop 0.6s var(--ease-spring) both, check-ring 1.4s ease-out 0.4s 1; }
.cd-check .ico { width: 72px; height: 72px; stroke-width: 2.8; }
.cd-check .ico path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: check-draw 0.5s ease-out 0.45s forwards; }
@keyframes cd-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes cd-pop { from { opacity: 0; transform: scale(0.82) translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes cd-bump { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes cd-ring { 0% { transform: scale(0.35); opacity: 0.7; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes cd-beat { 0%, 100% { transform: scale(0.85); } 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .cd *, .cd { animation: none !important; } .cd-check .ico path { stroke-dashoffset: 0; } }

.cd[data-accent="blue"] { --cd-a: #3b82f6; --cd-b: #1e3a8a; --cd-on: #fff; }
.cd[data-accent="green"] { --cd-a: #10b981; --cd-b: #064e3b; --cd-on: #fff; }
.cd[data-accent="violet"] { --cd-a: #8b5cf6; --cd-b: #3b1d7a; --cd-on: #fff; }
.cd-note { max-width: 900px; padding: 14px 28px; border-radius: 999px; background: color-mix(in srgb, var(--cd-a) 16%, transparent); color: var(--c-text); font-size: 30px; font-weight: 650; animation: cd-rise 0.8s var(--ease-spring) 0.3s both; }
.acc-row { display: flex; gap: 10px; }
.acc-sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; background: var(--c-action); cursor: pointer; box-shadow: 0 0 0 1px var(--c-line); }
.acc-sw[data-accent="blue"] { background: #3b82f6; } .acc-sw[data-accent="green"] { background: #10b981; } .acc-sw[data-accent="violet"] { background: #8b5cf6; }
.acc-sw.on { border-color: var(--surface); box-shadow: 0 0 0 3px var(--c-text); }

/* Режим кассира: на невысоком экране помещается больше товаров */
body.focus-pos .pos-freq { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 12px; }
body.focus-pos .pos-freq > * { flex: none; }
body.focus-pos .pos-grid[data-density="2"] .tile-media { aspect-ratio: 16 / 7; }
body.focus-pos .pos-grid[data-density="3"] { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.dp-note { width: min(380px, 55%); flex: none; }

/* Экран покупателя пополам: слева реклама со сменой картинок, справа чек */
.cd-ad { position: relative; flex: 0 0 44%; overflow: hidden; background: var(--cd-b); }
.cd-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.cd-slide.on { opacity: 1; }
.cd-slide-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.cd-slide.on .cd-slide-img { animation: cd-zoom 12s ease-out both; }
.cd-slide.plain { background: linear-gradient(160deg, var(--cd-b), color-mix(in srgb, var(--cd-a) 60%, var(--cd-b))); }
.cd-slide-cap { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 4px; padding: 90px 36px 34px; background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent); color: #fff; }
.cd-slide.plain .cd-slide-cap { top: 0; align-content: center; background: none; text-align: center; }
.cd-slide-cap b { font-size: 46px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.cd-slide-cap span { font-size: 40px; font-weight: 700; color: color-mix(in srgb, var(--cd-a) 70%, #fff); }
.cd-slide.on .cd-slide-cap { animation: cd-rise 0.9s var(--ease-spring) 0.5s both; }
.cd[data-split="on"] .cd-main { padding: 24px 32px 28px; }
.cd[data-split="on"] .cd-shop.big { font-size: 40px; }
.cd[data-split="on"] .cd-hero-name { font-size: 40px; }
.cd[data-split="on"] .cd-hero-sum { font-size: 76px; }
.cd[data-split="on"] .cd-sum b { font-size: 58px; }
.cd[data-split="on"] .cd-sum { font-size: 24px; }
.cd[data-split="on"] .cd-total { font-size: 76px; }
.cd[data-split="on"] .cd-pay .cd-total { font-size: 96px; }
.cd[data-split="on"] .cd-pay-row { min-width: 0; width: 100%; gap: 24px; font-size: 28px; }
.cd[data-split="on"] .cd-pay-row b { font-size: 40px; }
.cd[data-split="on"] .cd-pay-change b { font-size: 52px; }
.cd[data-split="on"] .cd-note { font-size: 24px; }
@keyframes cd-zoom { from { transform: scale(1); } to { transform: scale(1.12); } }
@media (max-width: 900px) { .cd-ad { flex-basis: 0; display: none; } }

.promo-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.promo-thumb { position: relative; width: 120px; height: 80px; border-radius: 12px; overflow: hidden; border: 1px solid var(--c-line); }
.promo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; }
.promo-thumb button .ico { width: 14px; height: 14px; }
.promo-pick { display: grid; max-height: 50vh; overflow: auto; border: 1px solid var(--c-line); border-radius: 14px; }
.promo-pick-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--c-line); cursor: pointer; }
.promo-pick-row:last-child { border-bottom: 0; }

.pos-together { background: color-mix(in srgb, var(--c-success) 8%, var(--surface)); }
.cd-rate { display: grid; justify-items: center; gap: 14px; margin-top: 8px; animation: cd-rise 0.6s var(--ease-spring) 1s both; }
.cd-rate-q { font-size: 28px; color: var(--muted); }
.cd-faces { display: flex; gap: 22px; }
.cd-face { display: grid; justify-items: center; gap: 6px; min-width: 150px; padding: 18px 20px 14px; border: 2px solid var(--c-line); border-radius: 26px; background: var(--surface); color: var(--c-text); font: inherit; font-size: 20px; font-weight: 650; cursor: pointer; touch-action: manipulation; transition: transform 0.15s var(--ease-spring), border-color 0.2s; }
.cd-face:active { transform: scale(0.94); }
.cd-face:hover { border-color: var(--cd-a); }
.cd-face-ico { font-size: 64px; line-height: 1; }
.cd-rate-done { margin-top: 8px; font-size: 32px; font-weight: 750; color: var(--c-success); animation: cd-pop 0.5s var(--ease-spring) both; }
.cd[data-split="on"] .cd-face { min-width: 110px; padding: 14px 12px 10px; font-size: 16px; }
.cd[data-split="on"] .cd-face-ico { font-size: 48px; }
.cd[data-split="on"] .cd-faces { gap: 12px; }
.ri-rates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ri-rate { display: grid; justify-items: center; gap: 2px; padding: 14px 8px; border-radius: 16px; background: var(--c-soft); }
.ri-rate b { font-size: 26px; }
.ri-rate-face { font-size: 32px; line-height: 1; }
.ri-rate.good b { color: var(--c-success); }
.ri-rate.bad b { color: var(--c-danger, #d14343); }
.cd-after { display: flex; align-items: center; justify-content: center; gap: 36px; flex-wrap: wrap; }
.cd-qr { display: grid; justify-items: center; gap: 8px; animation: cd-pop 0.6s var(--ease-spring) both; }
.cd-qr-svg { width: 170px; height: 170px; border-radius: 14px; box-shadow: 0 0 0 1px var(--c-line); }
.cd-qr-text { display: grid; text-align: center; font-size: 18px; font-weight: 650; }
.cd-qr-text small { color: var(--muted); font-size: 14px; font-weight: 400; }
.cd[data-split="on"] .cd-qr-svg { width: 130px; height: 130px; }
.cd-paid-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: stretch; }
.cd-paid-split .cd-center { grid-row: auto; }
.cd-qr-panel { display: grid; place-content: center; justify-items: center; gap: 18px; padding: 32px; border-radius: 32px; background: var(--cd-b); color: var(--cd-on); animation: cd-pop 0.6s var(--ease-spring) 0.4s both; }
.cd-qr-panel .cd-qr-svg { width: min(340px, 100%); height: auto; aspect-ratio: 1; border-radius: 18px; box-shadow: none; }
.cd-qr-wait { width: min(340px, 100%); aspect-ratio: 1; border-radius: 18px; background: rgba(255, 255, 255, 0.14); animation: cd-beat 1.6s ease-in-out infinite; }
.cd-qr-panel .cd-qr-text { font-size: 24px; }
.cd-qr-panel .cd-qr-text small { color: inherit; opacity: 0.75; font-size: 17px; }
.cd[data-split="on"] .cd-paid-split { grid-template-columns: 1fr 230px; gap: 16px; }
.cd[data-split="on"] .cd-qr-panel { padding: 16px; border-radius: 24px; }
.cd[data-split="on"] .cd-qr-panel .cd-qr-text { font-size: 17px; }
.cd[data-split="on"] .cd-qr-panel .cd-qr-text small { font-size: 13px; }

/* Интернет-магазин → Внешний вид: выбор шаблона и цвета */
.look-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; --lk: #168a5b; }
.look-tiles[data-accent="blue"] { --lk: #2563d9; } .look-tiles[data-accent="orange"] { --lk: #d8682a; } .look-tiles[data-accent="violet"] { --lk: #7c3aed; } .look-tiles[data-accent="ink"] { --lk: #14213d; }
.look-tile { display: grid; gap: 6px; padding: 12px; text-align: left; border: 2px solid var(--c-line); border-radius: 18px; background: var(--surface); color: var(--c-text); font: inherit; cursor: pointer; transition: border-color 0.2s, transform 0.12s; }
.look-tile:active { transform: scale(0.98); }
.look-tile.on { border-color: var(--lk); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lk) 18%, transparent); }
.look-prev { display: grid; gap: 5px; height: 96px; padding: 8px; border-radius: 12px; background: var(--c-soft); }
.look-prev i { display: block; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--c-line); }
.lp-market { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.lp-market i:nth-child(odd) { background: color-mix(in srgb, var(--lk) 22%, var(--surface)); }
.lp-list { grid-template-rows: repeat(4, 1fr); }
.lp-list i:nth-child(odd) { background: color-mix(in srgb, var(--lk) 22%, var(--surface)); }
.lp-list i { border-radius: 4px; }
.lp-magazine { grid-template-columns: 1fr; grid-template-rows: 2fr 1fr; }
.lp-magazine i:nth-child(1) { background: color-mix(in srgb, var(--lk) 22%, var(--surface)); }
.lp-magazine i:nth-child(n+3) { display: none; }
.look-sw { display: flex; gap: 10px; }
.look-dot { width: 34px; height: 34px; border: 3px solid transparent; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px var(--c-line); }
.look-dot.on { box-shadow: 0 0 0 3px var(--c-text); border-color: var(--surface); }
.ld-green { background: #168a5b; } .ld-blue { background: #2563d9; } .ld-orange { background: #d8682a; } .ld-violet { background: #7c3aed; } .ld-ink { background: #14213d; }

/* Лояльность: сводка, список программ, форма программы */
.lo-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--c-line); border-radius: 16px; overflow: hidden; }
.lo-kpi { display: grid; gap: 4px; padding: 12px 14px; border-right: 1px solid var(--c-line); }
.lo-kpi:last-child { border-right: 0; }
.lo-kpi b { font-size: 20px; }
.lo-prog { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lo-levels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lo-lvl { padding: 3px 10px; border-radius: 999px; background: var(--c-soft); font-size: 13px; }
.lo-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.lo-kind { display: grid; gap: 4px; padding: 12px 14px; text-align: left; border: 1.5px solid var(--c-line); border-radius: 14px; background: var(--surface); color: var(--c-text); font: inherit; cursor: pointer; }
.lo-kind.on { border-color: var(--c-action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-action) 18%, transparent); }
.lo-level { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.lo-level.lo-head { font-size: 13px; color: var(--muted); }
.lo-check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: 14px; cursor: pointer; }
.lo-check small { display: block; }
.lo-example { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c-action) 14%, var(--c-bg)); font-size: 14px; }
.lo-pay { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--c-action) 10%, var(--surface-2)); }
.lo-pay-head { display: flex; align-items: center; gap: 10px; }
.lo-pay-head .ico { width: 22px; height: 22px; color: var(--c-action); }
.lo-pay-info { font-size: 13px; }
.cd-points { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px; background: color-mix(in srgb, var(--cd-a) 16%, transparent); font-size: 22px; font-weight: 650; animation: cd-rise 0.6s var(--ease-spring) 0.8s both; }
.cd-points .ico { width: 24px; height: 24px; color: var(--cd-a); }
.lo-card { display: grid; gap: 10px; }
.lo-member { display: flex; align-items: center; gap: 12px; }
.lo-balance { display: grid; justify-items: end; }
.lo-balance b { font-size: 26px; }
.lo-next { display: grid; gap: 6px; }
.lo-track { height: 8px; border-radius: 999px; background: var(--c-line); overflow: hidden; }
.lo-fill { display: block; height: 100%; border-radius: 999px; background: var(--c-action); }
.lo-hist { font-size: 14px; }
.cart-note.on { border-style: solid; }
.pay-note { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rc-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c-warning, #c2570c) 12%, var(--surface-2)); font-size: 14px; }

/* Касса: больше места товарам. Полоски подсказок и категории — в одну прокручиваемую строку, заголовок компактнее */
.pos-root > .page-head { margin-bottom: 0; }
.pos-root > .page-head .sub { display: none; }
.pos-root .pos-freq { flex-wrap: nowrap; overflow-x: auto; padding: 6px 12px; border-radius: 14px; scrollbar-width: none; }
.pos-root .pos-freq::-webkit-scrollbar { display: none; }
.pos-root .pos-freq > * { flex: none; }
.pos-root .pos-cats { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
.pos-root .pos-cats .chip { flex: none; }

/* вкладки чеков в панели чека */
.held-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px 4px; scrollbar-width: none; }
.held-tabs::-webkit-scrollbar { display: none; }
.held-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--c-line); border-radius: 10px; background: var(--surface); color: var(--c-text); font: inherit; font-size: 13px; cursor: pointer; }
.held-tab.on { border-color: var(--c-action); background: color-mix(in srgb, var(--c-action) 14%, var(--surface)); font-weight: 650; cursor: default; }
.held-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-warning, #c2570c); }
.held-dot.now { background: var(--c-success, #15803d); }

/* строки со стрелками: листаются колесом мыши и стрелками по краям */
.hs { position: relative; min-width: 0; width: 100%; max-width: 100%; overflow: hidden; border-radius: 14px; }
.pos-left, .pos-bar { min-width: 0; }
.hs:has(> :not(.hs-arrow)[hidden]) { display: none; }
.hs-arrow { position: absolute; top: 0; bottom: 0; z-index: 2; display: grid; place-items: center; width: 34px; padding: 0; border: 0; cursor: pointer; color: var(--c-text); }
.hs-arrow[hidden] { display: none; }
.hs-arrow.left { left: 0; border-radius: 14px 0 0 14px; background: linear-gradient(90deg, var(--surface) 55%, transparent); justify-items: start; padding-left: 6px; }
.hs-arrow.right { right: 0; border-radius: 0 14px 14px 0; background: linear-gradient(270deg, var(--surface) 55%, transparent); justify-items: end; padding-right: 6px; }
.hs-arrow .ico { width: 18px; height: 18px; }

/* «С этим берут» рядом со скидкой на чек */
.cart-together { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 14px; background: color-mix(in srgb, var(--c-success) 8%, var(--surface)); }
.cart-together[hidden] { display: none; }
.cart-together .pos-freq-label { font-size: 11.5px; }
.cart-together .pos-freq-chip { height: 30px; font-size: 13px; }

/* Касса: «Список с кодами» — горизонтальная карточка с фото слева, штрихкодом и остатком (удобно искать по коду) */
.tile-code2 { display: none; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-grid[data-density="4"] { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pos-grid[data-density="4"] .tile2 { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; grid-template-rows: auto auto auto auto; column-gap: 12px; row-gap: 3px; align-items: center; padding: 10px 12px; border-left-width: 6px; }
.pos-grid[data-density="4"] .tile-media { grid-column: 1; grid-row: 1 / -1; align-self: center; width: 78px; height: 78px; aspect-ratio: 1; border-radius: 14px; }
.pos-grid[data-density="4"] .tile-info { display: contents; }
.pos-grid[data-density="4"] .tile-name { grid-column: 2; grid-row: 1; min-height: 0; font-size: 15px; -webkit-line-clamp: 2; padding-right: 30px; }
.pos-grid[data-density="4"] .tile-code2 { display: block; grid-column: 2; grid-row: 2; }
.pos-grid[data-density="4"] .tile-variant { grid-column: 2; grid-row: 3; font-size: 12px; }
.pos-grid[data-density="4"] .tile-stock { position: static; grid-column: 2; grid-row: 4; justify-self: start; align-self: end; }
.pos-grid[data-density="4"] .tile-foot { display: contents; }
.pos-grid[data-density="4"] .tile-foot b { grid-column: 2; grid-row: 4; justify-self: end; align-self: end; font-size: 17px; white-space: nowrap; }
.pos-grid[data-density="4"] .tile-add { grid-column: 3; grid-row: 2 / 5; align-self: end; width: 40px; height: 40px; }
.pos-grid[data-density="4"] .tile-star { right: 8px; top: 8px; width: 26px; height: 26px; box-shadow: none; }
.pos-grid[data-density="4"] .tile-picked { left: 18px; top: 18px; }
.pos-grid[data-density="4"] .tile-media .ava-xl { width: 46px; height: 46px; font-size: 22px; }
.pos-sort { white-space: nowrap; }

/* Окно оплаты: цифры — компактной панелью рядом с окном, а не большой клавиатурой внутри него */
.pay-recv { display: inline-flex; align-items: center; gap: 8px; }
.pay-pad-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--surface); color: var(--muted); cursor: pointer; }
.pay-pad-btn:hover { color: var(--c-text); border-color: var(--c-action); }
.np-pop { position: fixed; z-index: 400; width: 252px; padding: 12px; border-radius: 20px; background: var(--surface); box-shadow: 0 24px 60px -18px rgba(14, 26, 51, 0.5), 0 0 0 1px var(--c-line); }
.np-pop-head { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 2px 10px; }
.np-shown { font-size: 20px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-pop-x { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); cursor: pointer; }
.np-pop-keys { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 46px); gap: 8px; }
.np-k { border: 1px solid var(--c-line); border-radius: 12px; background: var(--surface-2); color: var(--c-text); font: inherit; font-size: 19px; font-weight: 650; cursor: pointer; touch-action: manipulation; transition: transform 0.08s, background 0.12s; }
.np-k:active { transform: scale(0.94); background: color-mix(in srgb, var(--c-action) 20%, var(--surface)); }
.np-gray { color: var(--muted); }
.np-ok { grid-column: 4; grid-row: 3 / 5; display: grid; place-items: center; border-color: transparent; background: var(--c-action); color: var(--c-on-action); }
.np-ok .ico { width: 22px; height: 22px; }

/* История продаж: примечание кассира под названием товара */
.cell-note { display: flex; align-items: center; gap: 4px; margin-top: 2px; max-width: 260px; font-size: 12px; color: var(--c-action); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-note .ico { width: 12px; height: 12px; flex: none; }

/* Порядок категорий: список с перетаскиванием */
.co-list { display: grid; gap: 8px; }
.co-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--c-line); border-radius: 14px; background: var(--surface); cursor: grab; position: relative; }
.co-row.dragging { opacity: 0.45; }
.co-row.drop-before::before, .co-row.drop-after::after { content: ""; position: absolute; left: 8px; right: 8px; height: 3px; border-radius: 3px; background: var(--c-action); }
.co-row.drop-before::before { top: -6px; }
.co-row.drop-after::after { bottom: -6px; }
.co-grip { color: var(--faint); font-size: 18px; line-height: 1; user-select: none; }
.co-num { width: 22px; color: var(--muted); text-align: right; }
.co-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--c-text); cursor: pointer; }
.co-btn:hover:not(:disabled) { background: var(--surface-2); }
.co-btn:disabled { opacity: 0.3; cursor: default; }
.co-btn.up .ico { transform: rotate(180deg); }
.co-btn .ico { width: 16px; height: 16px; }

/* Долги: кнопка «не напоминать» у клиента */
.co-btn.muted-off { color: var(--faint); background: var(--surface-2); }
.co-btn.muted-off .ico { opacity: 0.55; }

/* Новый долг */
.md-pick { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 1.5px dashed var(--c-line); border-radius: 16px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.md-pick:hover { border-color: var(--c-action); }
.md-pick small { display: block; }
.md-plus { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); }
.md-who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: 16px; background: var(--surface); }
.md-amount { font-size: 26px; font-weight: 800; height: 56px; }

/* ссылки под кнопкой входа: «Регистрация» и «Забыли пароль?» в одну строку */
.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Касса: узкая панель чека — шапка и вкладки не сжимаются, список товаров получает больше места */
.cart-head, .held-tabs, .cart-groups { flex: none; }
.held-tab { flex: none; }
.cart-groups { padding: 6px 16px; }
.pos-root .cart-pay { padding: 10px 14px 12px; gap: 8px; }
.pos-root .cart-together { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 5px 8px; gap: 6px; }
.pos-root .cart-together::-webkit-scrollbar { display: none; }
.pos-root .cart-together > * { flex: none; }
.pos-root .cart-together .pos-freq-chip { height: 28px; padding: 0 10px; }
.pos-root .cart-sums { grid-template-columns: auto 1fr auto; align-items: stretch; gap: 6px; }
.pos-root .cart-sub { padding: 6px 10px; }
.pos-root .cart-sub b { font-size: 16px; }
.pos-root .cart-disc { min-height: 40px; padding: 0 8px; font-size: 13px; }
.pos-root .cart-disc.cart-note { padding: 0 10px; }
.pos-root .cart-sums .cart-note { font-size: 0; gap: 0; }
.pos-root .cart-sums .cart-note .ico { width: 18px; height: 18px; }
.pos-root .pay-btn { padding: 10px 16px; min-height: 56px; }
@media (max-width: 520px) { .pos-root .cart-sums { grid-template-columns: auto 1fr auto; } }

/* Режим кассира: плашка «в чеке» не растягивается поверх названия; строки чека ниже */
body.focus-pos .pos-grid[data-density="4"] .tile-picked { left: 18px; right: auto; top: 18px; }
.tile-picked { width: max-content; max-width: calc(100% - 20px); }
.cl-main { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 0; }
.cl-main .name { flex: 1 0 100%; }
.cl-main > .muted { font-size: 12.5px; }
.cart-line { padding-block: 8px; row-gap: 4px; }
body.focus-pos .cart-line { padding: 9px 16px; }

/* Экран покупателя: показан весь чек. Остальные позиции — прокручиваемым списком, новые внизу виднее */
.cd-stage { min-height: 0; grid-template-rows: auto minmax(0, 1fr); align-content: start; gap: 18px; }
.cd-rest { align-self: stretch; justify-self: center; overflow-y: auto; min-height: 0; padding-right: 6px; scrollbar-width: thin; }
.cd-rest-line:nth-child(n) { opacity: 1; }
.cd-stage.many { gap: 10px; }
.cd-stage.many .cd-hero-name { font-size: 36px; }
.cd-stage.many .cd-hero-qty { font-size: 20px; }
.cd-stage.many .cd-hero-sum { font-size: 64px; }
.cd-stage.many .cd-rest { font-size: 21px; }
.cd-main { min-height: 0; }
body.focus-pos .cart-line { padding: 7px 14px; row-gap: 3px; }
body.focus-pos .cart-line .qty button { width: 34px; height: 34px; }
body.focus-pos .cart-line .qty input { width: 46px; height: 34px; }
body.focus-pos .cl-ctrl .input { height: 34px; width: 104px; }
body.focus-pos .cart-line .line-thumb { width: 34px; height: 34px; }
@media (max-height: 960px) { body.focus-pos .kbd-keys { display: none; } }
body.focus-pos .pos-root .pay-btn { min-height: 54px; }

/* Касса: компактные строки чека. Сверху — название и остаток, справа сумма и «− 1 +»; цена, скидка и «Убрать» только у выбранной строки */
.cart-line.cl2 { grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; cursor: pointer; }
.cart-line.cl2 .cl-sum { display: grid; justify-items: end; gap: 6px; }
.cart-line.cl2 .cl-sum > b { font-size: 16px; }
.cart-line.cl2 .qty button { width: 32px; height: 32px; }
.cart-line.cl2 .qty input { width: 42px; height: 32px; }
.cart-line.cl2.sel { background: color-mix(in srgb, var(--c-brand) 7%, var(--surface)); box-shadow: inset 3px 0 0 var(--c-brand); }
.cart-line.cl2 .cl-ctrl { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; padding-top: 2px; }
.cart-line.cl2 .cl-ctrl .cl-del { margin-right: auto; color: var(--c-danger, #c0392b); }
.cart-line.cl2 .cl-ctrl .input { width: 104px; height: 34px; }
.cl-ctrl .cl-pct { gap: 6px; }
body.focus-pos .cart-line.cl2 .qty button { width: 34px; height: 34px; }
body.focus-pos .cart-line.cl2 .qty input { width: 44px; height: 34px; }

/* Оптовая подсказка на карточке товара */
.tile-opt { font-size: 12px; font-weight: 650; color: var(--c-success, #1b7f4b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Отложенные чеки: кнопка со счётчиком в шапке чека */
.held-btn { gap: 6px; }
.held-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--c-brand); color: var(--c-on-brand, #fff); font-size: 12px; line-height: 18px; text-align: center; }

/* «К оплате»: сумма слева, кнопка действия справа */
.pay-btn { justify-content: space-between; }
.pay-btn-due { display: grid; gap: 0; }
.pay-btn-label { font-size: 12.5px; opacity: 0.85; font-weight: 650; }
.pay-btn-due .pay-btn-sum { font-size: 26px; line-height: 1.1; }
.pay-btn .pay-btn-go { padding: 9px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.22); font-size: 15px; gap: 6px; }
.cart-line.cl2 .qty button { min-width: 30px; min-height: 30px; width: 30px; height: 30px; }
.cart-line.cl2 .qty input { width: 40px; height: 30px; }
body.focus-pos .cart-line.cl2 .qty button { min-width: 30px; min-height: 30px; width: 30px; height: 30px; }
body.focus-pos .cart-line.cl2 .qty input { width: 40px; height: 30px; }
.cart-line.cl2 .cl-sum { gap: 4px; }
.cart-line.cl2 .cl-sum > b { line-height: 1.2; }
body.focus-pos .cart-line.cl2, .cart-line.cl2 { padding: 6px 14px; }
.cl-ctrl .cl-pct { gap: 6px; }
.pos-grid[data-density="4"] .tile2 { grid-template-rows: auto auto auto auto auto; }
.pos-grid[data-density="4"] .tile-opt { grid-column: 2 / -1; grid-row: 5; }

/* Связь: постоянная отметка «онлайн» в верхней панели; без связи или с очередью — заметная плашка */
.net-pill.online { border-color: transparent; background: transparent; color: var(--muted); font-weight: 600; cursor: default; }
.net-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-success, #1b9e5a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-success, #1b9e5a) 22%, transparent); }
.net-pill.online .t { font-size: 13px; }

/* Компьютер: меню сворачивается в узкую полосу с иконками (кнопка «гамбургер» в верхней панели) */
.rail-toggle { display: none; }
@media (min-width: 901px) {
  .rail-toggle { display: inline-flex; flex: none; margin-right: 6px; }
  .app { transition: grid-template-columns 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
  body.nav-rail { --sidebar: 96px; }
  body.nav-rail .sidebar { padding: 14px 8px; align-items: center; overflow-x: hidden; }
  body.nav-rail .brand { font-size: 0; gap: 0; padding: 2px 0 10px; justify-content: center; }
  body.nav-rail .nav-group { font-size: 0; margin: 10px 4px 6px; width: 100%; }
  body.nav-rail .nav-row { width: 100%; justify-content: center; }
  body.nav-rail .nav-link { justify-content: center; padding: 0; width: 100%; max-width: 52px; height: 44px; }
  body.nav-rail .nav-text, body.nav-rail .pin-btn, body.nav-rail .sidebar-legal, body.nav-rail .plan-text { display: none; }
  body.nav-rail .nav-link .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; padding: 0 4px; font-size: 10.5px; line-height: 16px; }
  body.nav-rail .fav-grid { grid-template-columns: 1fr; width: 100%; }
  body.nav-rail .fav-name { display: none; }
  body.nav-rail .fav-tile { justify-content: center; }
  body.nav-rail .nav-more { justify-content: center; padding: 0; }
  body.nav-rail .nav-more span { display: none; }
  body.nav-rail .sidebar-foot { width: 100%; }
  body.nav-rail .plan-card { justify-content: center; padding: 8px 0; }
}

/* Шапка: одна высота (44px) и три группы — магазин и поиск слева, связь и время, кнопки и профиль справа */
.topbar { gap: 10px; }
.topbar > * { flex: none; }
.topbar .grow { flex: 1 1 0; min-width: 0; }
.topbar .search { flex: 1 1 300px; max-width: 480px; min-width: 150px; height: 44px; }
.top-id { display: flex; align-items: center; gap: 10px; height: 44px; max-width: 290px; padding: 0 10px 0 5px; border: 0; border-radius: 13px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.top-id:hover { background: var(--surface-2); }
.top-id-mark { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--g-action, var(--c-action)); color: var(--c-on-action); font-weight: 800; }
.top-id-text { display: grid; min-width: 0; line-height: 1.25; }
.top-id-text b { font-size: 15px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-id-text span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-id .ico { color: var(--muted); flex: none; }
.top-status { display: flex; align-items: center; height: 44px; padding: 0 4px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.top-status .net-pill { height: 34px; border: 0; background: transparent; }
.top-status .net-pill.off, .top-status .net-pill.warn { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.top-clock { display: grid; justify-items: end; padding: 0 10px; line-height: 1.15; border-left: 1px solid var(--border); }
.top-clock-t { display: flex; align-items: baseline; gap: 3px; }
.top-clock-t b { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.top-clock-t small { font-size: 11px; color: var(--muted); font-weight: 650; }
.top-date { font-size: 11.5px; color: var(--muted); text-transform: capitalize; }
.top-status > .net-pill:only-child, .top-status > .top-clock:first-child { border-left: 0; }
.top-actions { display: flex; align-items: center; gap: 1px; height: 44px; padding: 0 4px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.top-actions .btn { height: 36px; min-width: 38px; padding: 0 8px; justify-content: center; }
.top-actions .npad-label { display: none; }
.lang-btn { font-weight: 800; letter-spacing: 0.02em; }
.topbar > .pill-btn { height: 44px; border-radius: 13px; }
@media (max-width: 1700px) { .top-date { display: none; } }
@media (max-width: 1560px) { .top-id-text span { display: none; } }
@media (max-width: 1440px) { .top-clock { display: none; } }
@media (max-width: 1300px) { .top-id-text, .top-id .ico { display: none; } .top-id { padding: 0 4px; } .topbar .net-pill.online .t, .topbar .profile-name { display: none; } }
@media (max-width: 900px) { .top-id, .top-status .top-clock, .top-actions .lang-btn { display: none; } }

/* Окно «Мои магазины» */
.ms-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.ms-card.here { border-color: var(--c-brand); box-shadow: 0 0 0 1px var(--c-brand); }
.ms-head { display: flex; align-items: center; gap: 12px; grid-column: 1; min-width: 0; }
.ms-head b { font-size: 16px; }
.ms-figs { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 28px; flex-wrap: wrap; }
.ms-fig { display: grid; gap: 1px; }
.ms-fig b { font-size: 16px; }
.ms-here { grid-column: 2; grid-row: 1; padding: 6px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c-brand) 14%, transparent); color: var(--brand-text); font-weight: 750; font-size: 13px; }
.ms-card > .btn { grid-column: 2; grid-row: 1; }
.ms-add-locked { opacity: 0.8; }
.ms-upsell { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.ms-upsell p { margin: 4px 0 0; }
.currency-btn { font-weight: 800; letter-spacing: 0.02em; }
@media (max-width: 1500px) { .shops-btn .t { display: none; } }

/* ===== Ваши точки: плитки с недельным графиком ===== */
.pt-lead { margin: 0 0 4px; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pt-tile { display: grid; gap: 4px; align-content: start; text-align: left; padding: 14px 14px 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: transform 0.15s var(--ease-out), box-shadow 0.15s, border-color 0.15s; }
.pt-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--c-action); }
.pt-tile.here { background: linear-gradient(160deg, var(--side-bg), color-mix(in srgb, var(--side-bg) 82%, var(--c-action))); border-color: transparent; color: var(--c-on-hero); cursor: default; }
.pt-tile.here:hover { transform: none; box-shadow: none; }
.pt-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--g-action, var(--c-action)); color: var(--c-on-action); font-weight: 800; }
.pt-name { font-weight: 750; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.pt-here { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--c-action); color: var(--c-on-action); font-size: 11.5px; font-weight: 800; }
.pt-role { font-size: 12.5px; color: var(--muted); }
.pt-tile.here .pt-role, .pt-tile.here .pt-cap, .pt-tile.here .pt-month { color: color-mix(in srgb, var(--c-on-hero) 72%, transparent); }
.pt-sum { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-top: 6px; }
.pt-cap, .pt-month { font-size: 12.5px; color: var(--muted); }
.pt-bars { display: flex; align-items: flex-end; gap: 4px; height: 34px; margin: 8px 0 4px; }
.pt-bars i { flex: 1; border-radius: 3px; background: color-mix(in srgb, var(--c-action) 28%, transparent); min-height: 3px; }
.pt-bars i.today { background: var(--c-action); }
.pt-tile.here .pt-bars i { background: color-mix(in srgb, var(--c-on-hero) 26%, transparent); }
.pt-tile.here .pt-bars i.today { background: var(--c-action); }
.pt-new { place-content: center; justify-items: center; text-align: center; border-style: dashed; background: transparent; min-height: 150px; }
.pt-new.locked { opacity: 0.75; }
.pt-plus { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--c-action) 18%, transparent); color: var(--brand-text); }
.pt-offer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c-action) 10%, var(--surface)); font-size: 14px; }

/* ===== Визитка магазина: поля и макет чека ===== */
.card-edit { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 22px; align-items: start; }
.vz-side { display: grid; gap: 8px; }
.vz-cap { font-size: 12.5px; }
.vz-paper { padding: 16px 14px 18px; background: #fffdf8; color: #1b1b1b; border-radius: 4px; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.35); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; line-height: 1.5; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), 95% 100%, 90% calc(100% - 8px), 85% 100%, 80% calc(100% - 8px), 75% 100%, 70% calc(100% - 8px), 65% 100%, 60% calc(100% - 8px), 55% 100%, 50% calc(100% - 8px), 45% 100%, 40% calc(100% - 8px), 35% 100%, 30% calc(100% - 8px), 25% 100%, 20% calc(100% - 8px), 15% 100%, 10% calc(100% - 8px), 5% 100%, 0 calc(100% - 8px)); }
.vz-paper .muted { color: #777; }
.vz-title { text-align: center; font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }
.vz-line { text-align: center; color: #555; overflow-wrap: anywhere; }
.vz-rule { border-top: 1px dashed #999; margin: 8px 0; }
.vz-row { display: flex; justify-content: space-between; gap: 8px; }
.vz-total { font-size: 13px; font-weight: 800; }
.vz-thanks { text-align: center; margin-top: 10px; color: #555; }
@media (max-width: 760px) { .card-edit { grid-template-columns: 1fr; } .vz-side { order: -1; } }

/* ===== Левое меню: время и связь внизу ===== */
.side-status { display: grid; gap: 2px; padding: 9px 12px; border-radius: 14px; background: color-mix(in srgb, var(--c-on-hero) 6%, transparent); color: var(--c-on-hero); }
.side-time { display: flex; align-items: baseline; gap: 4px; }
.side-time b { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.side-time small { font-size: 12px; opacity: 0.6; font-weight: 650; }
.side-sub { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--side-text); text-transform: capitalize; }
.side-sub .side-net { text-transform: none; font-weight: 650; }
.side-sub .side-date { opacity: 0.75; margin-left: auto; }
.side-status.off .net-dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
body.nav-rail .side-status { padding: 8px 0; justify-items: center; }
body.nav-rail .side-time small, body.nav-rail .side-sub .side-net, body.nav-rail .side-sub .side-date { display: none; }
body.nav-rail .side-time b { font-size: 14px; }

/* ===== Шапка: тревожная плашка связи и быстрая панель ===== */
.topbar .net-pill.online { display: none; }
.panel-btn { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }
.topbar .bell { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); }

/* Меню: блоки «Торговля / Склад / Деньги / Магазин» сворачиваются; справа число разделов и стрелка */
.nav-sec-head { display: flex; align-items: center; gap: 8px; width: calc(100% - 20px); border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; padding: 4px 0; border-radius: 8px; }
.nav-sec-head:hover { color: var(--c-on-hero); }
.nav-sec-head::after { order: 2; }
.nav-sec-head .nav-sec-count { order: 3; font-size: 11px; font-weight: 650; opacity: 0.7; font-variant-numeric: tabular-nums; }
.nav-sec-head .ico { order: 4; transition: transform 0.15s; }
.nav-sec-head[aria-expanded="true"] .ico { transform: rotate(90deg); }
.nav-sec-head:focus-visible { outline: 2px solid var(--c-action); outline-offset: 2px; }
.nav-sec[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .nav-sec-head .ico { transition: none; } }
@media (min-width: 901px) {
  body.nav-rail .nav-sec { display: block; }
  body.nav-rail .nav-sec[hidden] { display: block; }
  body.nav-rail .nav-sec-head { font-size: 0; justify-content: center; padding: 0; }
  body.nav-rail .nav-sec-head .nav-sec-count, body.nav-rail .nav-sec-head .ico { display: none; }
}

/* Вкладки «Все клиенты / Должники» над двумя страницами одного раздела */
.client-tabs { align-self: flex-start; }
.client-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 9px; color: inherit; text-decoration: none; font-weight: 600; }
.client-tabs a.active { background: var(--surface); box-shadow: var(--shadow-1, 0 1px 3px rgb(0 0 0 / 0.12)); }
.topbar .journal-btn { height: 44px; width: 44px; }

.nav-sec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-danger) 25%, transparent); margin-left: 2px; }

/* Продажи: показатели одной полосой, панель над таблицей — два осмысленных ряда */
@media (min-width: 901px) {
  .grid-kpi.kpi-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-kpi.kpi-strip > .kpi.primary { grid-row: auto; grid-column: auto; }
  .grid-kpi.kpi-strip > .kpi { grid-column: auto !important; }
}
.toolbar.toolbar-2 { flex-direction: column; align-items: stretch; gap: 10px; }
.toolbar-2 .toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar-2 .toolbar-row .spacer { flex: 1; }

/* Приход: период и поиск в одной строке */
.filter-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.filter-line > .chips { flex: none; }
.filter-line > .search-inline-lg { flex: 1 1 260px; min-width: 220px; }
@media (min-width: 901px) {
  .grid-kpi.kpi-strip:has(> :nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .grid-kpi.kpi-strip:has(> :nth-child(5)) .kpi-value { font-size: clamp(22px, 2vw, 30px); }
}
.toolbar-2 .search-inline { flex: 1 1 300px; max-width: 520px; }
.toolbar-2 .search-inline input { width: 100%; }
@media (min-width: 901px) {
  .page .grid-kpi.kpi-strip:has(> .kpi:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .page .grid-kpi.kpi-strip > .kpi.primary:first-child { grid-row: auto; grid-column: auto; }
}

/* Карточка товара: вкладки «Основное / Склад / Дополнительно», кнопка «Сохранить» всегда у нижнего края */
.pd-tabs { align-self: stretch; display: flex; flex: none; min-height: 44px; }
.pd-tabs button { flex: 1; }
.pd-panel[hidden] { display: none; }
.pd-savebar { position: sticky; bottom: -1px; z-index: 2; flex: none; margin: 0 -4px; padding: 12px 4px; border-top: 1px solid var(--border); background: rgb(247 249 252); }
:root[data-theme="dark"] .pd-savebar { background: var(--surface-2, #1b2233); }
.pd-savebar[hidden] { display: none; }

/* Дополнительные штрихкоды внутри блока «Что это за товар» */
.pd-codes { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); display: grid; gap: 8px; }
.pd-codes-title { font-weight: 650; font-size: 13.5px; }
.pd-codes textarea { width: 100%; resize: vertical; }

/* Новый товар: строка штрихкода — значок, поле и «Создать код» в одну линию */
.bc-block { display: grid; gap: 8px; }
.bc-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border: 1px solid var(--border-strong, var(--border)); border-radius: 14px; background: var(--surface); }
.bc-row:focus-within { outline: 2px solid var(--c-action); outline-offset: 1px; }
.bc-row .bc-ico { display: grid; place-items: center; color: var(--muted); flex: none; }
.bc-row input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; box-shadow: none; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.bc-row .btn { flex: none; }
.bc-note { font-size: 13px; }
.bc-note.ok { color: var(--c-success, #1b7f4b); }

/* Клиенты и должники: раскрывающиеся строки, полоска оплаты, три вида списка */
.meter { display: inline-block; width: 96px; height: 6px; border-radius: 99px; background: var(--surface-3, #e6e9f0); overflow: hidden; vertical-align: middle; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--c-success, #1b9e5a); }
.meter.slim { width: 100%; height: 5px; }
.paid-cell { display: grid; gap: 4px; min-width: 110px; }
.hero-meter { display: grid; gap: 6px; margin-top: 10px; }
.hero-meter .meter { background: color-mix(in srgb, #fff 22%, transparent); }
.hero-meter small { opacity: 0.85; }
.exp-th, .exp-cell { width: 36px; padding-right: 0 !important; }
.exp-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.exp-btn:hover { background: var(--surface-2); color: var(--text); }
.exp-btn .ico { transition: transform 0.15s; }
.exp-btn[aria-expanded="true"] .ico { transform: rotate(90deg); }
tr.is-open { background: color-mix(in srgb, var(--c-action) 5%, transparent); }
tr.detail-row > td { padding: 0 !important; background: var(--surface-2); }
.detail-box { padding: 12px 16px 14px 52px; }
.debt-detail { display: grid; gap: 8px; }
.debt-detail-row { display: grid; grid-template-columns: minmax(140px, 1.2fr) minmax(80px, 1fr) minmax(110px, auto); align-items: center; gap: 14px; }
.debt-detail-row .dd-what { display: grid; font-weight: 600; }
.debt-detail-row .dd-sum { display: grid; text-align: right; }
.debt-detail .link { justify-self: start; background: none; border: 0; padding: 0; cursor: pointer; }
.debt-modes { flex: none; }
@media (prefers-reduced-motion: reduce) { .exp-btn .ico { transition: none; } }

/* Отчёты: вкладки, таблица «Закрытие смены» без обрезки, вкладки «Топ-10» не налезают на заголовок */
.report-tabs { align-self: flex-start; flex: none; }
.report-pane[hidden] { display: none; }
.report-pane .table-wrap, .report-pane .card:has(> .table) { overflow-x: auto; }
.card-head { flex-wrap: wrap; gap: 8px 12px; }
.card-head .seg { max-width: 100%; }
.card-head .seg { overflow-x: auto; scrollbar-width: none; }
.card-head .seg button { padding-inline: 10px; white-space: nowrap; }
.card-head .seg::-webkit-scrollbar { display: none; }

/* Отчёты → Продажи: полоса долей категорий и список под ней */
.cat-box { display: grid; gap: 14px; }
.cat-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.cat-bar > i { min-width: 4px; }
.cat-list { display: grid; gap: 2px; }
.cat-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 44px minmax(90px, auto) minmax(120px, auto); align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px dashed var(--border); }
.cat-row:last-child { border-bottom: 0; }
.cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cat-row small { text-align: right; }
.cat-pct { text-align: right; font-variant-numeric: tabular-nums; }
.ri-more { margin-top: 10px; }
@media (max-width: 700px) { .cat-row { grid-template-columns: 14px minmax(0, 1fr) 44px minmax(80px, auto); } .cat-row small { display: none; } }

/* Наличные за период: две дорожки потока вместо плиток со значками — длина полосы это сумма */
.cf { display: grid; gap: 18px; }
.cf-net { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.cf-net > div { display: grid; gap: 2px; }
.cf-net b { font-size: clamp(28px, 3vw, 38px); line-height: 1.1; letter-spacing: -0.02em; }
.cf-net.good b { color: var(--c-success); }
.cf-net.bad b { color: var(--c-danger); }
.cf-formula { font-size: 13px; }
.cf-lanes { display: grid; gap: 20px; }
.cf-lane { display: grid; gap: 8px; }
.cf-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 650; }
.cf-rail { height: 16px; border-radius: 99px; background: var(--surface-3, #e6e9f0); overflow: hidden; }
.cf-track { display: flex; height: 100%; gap: 2px; border-radius: 99px; overflow: hidden; transition: width 0.5s var(--ease-out, ease); }
.cf-track > i { min-width: 3px; }
.cf-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted); }
.cf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cf-legend b { color: var(--text); font-weight: 650; }
.cf-legend .zero { opacity: 0.55; }
.cf-empty { padding: 6px 0; }
@media (prefers-reduced-motion: reduce) { .cf-track { transition: none; } }

/* Отчёты: «Итоги периода» полосой из четырёх фактов, переключатель Дни/Недели/Месяцы не растягивается на всю ширину */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.fact { display: grid; gap: 4px; padding: 6px 18px; border-left: 1px solid var(--border); min-width: 0; }
.fact:first-child { border-left: 0; padding-left: 0; }
.fact > b { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.fact > span { font-size: 13px; }
@media (max-width: 900px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; } .fact:nth-child(odd) { border-left: 0; padding-left: 0; } }
.report-pane .stack > .seg { align-self: flex-start; }

/* Отчёты: показатели всегда по четыре в ряд (цепочка прибыли читается слева направо) */
@media (min-width: 1101px) {
  .page .grid-kpi.kpi-strip.report-kpis, .page .grid-kpi.kpi-strip.report-kpis:has(> .kpi:nth-child(5)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) { .page .grid-kpi.kpi-strip.report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Раскрытые строки на телефоне: строка-карточка, подробности под ней на всю ширину */
@media (max-width: 700px) {
  .exp-cell { display: block; width: auto; padding: 4px 0 0 !important; }
  .exp-th { display: none; }
  tr.detail-row { display: block; margin: -4px 0 12px; border-radius: 0 0 14px 14px; background: var(--surface-2); }
  tr.detail-row > td { display: block; width: 100%; box-sizing: border-box; }
  .detail-box { padding: 10px 14px 14px; }
  .debt-detail-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .debt-detail-row .dd-bar { grid-column: 1 / -1; order: 3; }
}

/* Отчёты: вкладки «Топ-10» помещаются целиком, карточки в паре не растягиваются друг по другу */
.card-head .seg button { font-size: 13.5px; padding-inline: 8px; }
.report-pane .grid-main { align-items: start; }
.card-head .seg button { font-size: 13px; padding-inline: 6px; }

/* Закрытие смены: дата не на всю ширину, между датой и таблицей воздух */
.shift-card .card-body { display: grid; gap: 16px; }
.shift-card .field { max-width: 240px; }

/* Возвраты: список по дням, карточки возвратов, мастер оформления (три шага) */
.rt-days { display: grid; gap: 22px; }
.rt-day { display: grid; gap: 10px; }
.rt-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 4px; }
.rt-cards { display: grid; gap: 10px; }
.rt-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 18px; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--c-danger); border-radius: 14px; background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.rt-card:hover { border-color: color-mix(in srgb, var(--c-danger) 40%, var(--border)); box-shadow: 0 6px 18px -12px rgb(0 0 0 / 0.3); }
.rt-card:focus-visible { outline: 2px solid var(--c-action); outline-offset: 2px; }
.rt-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: color-mix(in srgb, var(--c-danger) 12%, var(--surface)); color: var(--c-danger); }
.rt-main { display: grid; gap: 3px; min-width: 0; }
.rt-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rt-reason { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--surface-3); font-size: 12.5px; font-weight: 600; }
.rt-reason.big { padding: 8px 14px; font-size: 15px; border-radius: 12px; }
.rt-sub { font-size: 13px; }
.rt-lines { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-sum { display: grid; text-align: right; gap: 2px; }
.rt-sum b { font-size: 17px; }
.neg { color: var(--c-danger); }
.rt-why { display: grid; gap: 10px; }
.rt-why-row { display: grid; grid-template-columns: minmax(140px, 240px) minmax(0, 1fr) 32px; align-items: center; gap: 14px; }
.rt-why-row b { text-align: right; }
.rt-hero { display: grid; gap: 6px; padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--c-danger) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-danger) 25%, var(--border)); justify-items: start; }
.rt-hero b { font-size: 30px; letter-spacing: -0.02em; }
.rt-facts { display: grid; gap: 10px; margin: 14px 0; }
.rt-facts > div { display: flex; justify-content: space-between; gap: 12px; }
.rt-line-sum { display: grid; text-align: right; }
.rf-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 16px; padding: 0; }
.rf-steps li { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 13.5px; color: var(--muted); }
.rf-steps li + li::before { content: ""; flex: 0 0 18px; height: 2px; background: var(--border); margin-right: 2px; }
.rf-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); font-size: 12px; font-weight: 700; }
.rf-steps li.on { color: var(--text); font-weight: 650; }
.rf-steps li.on .rf-dot { background: var(--c-action); color: var(--c-on-action); }
.rf-steps li.done .rf-dot { background: var(--c-success); color: #fff; }
.rf { display: grid; gap: 14px; }
.rf-search { max-width: none; }
.rf-list { display: grid; gap: 10px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.rf-receipt { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.rf-receipt:hover { border-color: var(--c-action); }
.rf-r-top { display: flex; justify-content: space-between; gap: 12px; }
.rf-r-names { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.rf-label { font-weight: 650; font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.rf-lines { display: grid; gap: 8px; }
.rf-line { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.rf-line.static { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.rf-line.on { border-color: var(--c-action); background: color-mix(in srgb, var(--c-action) 7%, var(--surface)); }
.rf-tick { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-strong, var(--border)); color: var(--c-on-action); }
.rf-line.on .rf-tick { background: var(--c-action); border-color: var(--c-action); }
.rf-l-name { display: grid; gap: 2px; min-width: 0; }
.rf-reasons { margin: 2px 0; }
.rf-foot { display: flex; align-items: center; gap: 10px; width: 100%; }
.rf-foot .grow { flex: 1; }
.rf-sum { display: grid; }
.rf-sum b { font-size: 20px; }
.rf-done { display: grid; gap: 14px; }
.rf-done-top { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: color-mix(in srgb, var(--c-success) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-success) 30%, var(--border)); }
.rf-done-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--c-success); color: #fff; }
.rf-done-sum { font-size: 30px; letter-spacing: -0.02em; color: var(--c-danger); }
@media (max-width: 700px) {
  .rt-card { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .rt-card > .ico { display: none; }
  .rt-why-row { grid-template-columns: minmax(0, 1fr) 80px 28px; }
  .rf-steps li span:last-child { display: none; }
  .rf-steps li.on span:last-child { display: inline; }
}

.rf-search { display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; background: var(--surface); }
.rf-search:focus-within { outline: 2px solid var(--c-action); outline-offset: 1px; }
.rf-search .input { flex: 1; border: 0; outline: 0; box-shadow: none; background: transparent; }
.rf-search .ico { flex: none; color: var(--muted); }

/* Частичный возврат: выбор количества под отмеченной позицией */
.rf-item { display: grid; gap: 6px; }
.rf-item .rf-line.on { border-bottom-left-radius: 12px; }
.rf-qty { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 4px 14px 2px 52px; font-size: 13.5px; }
.rf-qty[hidden], .rf-note[hidden] { display: none; }
.rf-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-strong, var(--border)); border-radius: 10px; overflow: hidden; background: var(--surface); }
.rf-stepper button { width: 34px; height: 34px; border: 0; background: var(--surface-2); font-size: 18px; cursor: pointer; color: inherit; }
.rf-stepper button:hover { background: var(--surface-3); }
.rf-stepper .input { width: 64px; height: 34px; text-align: center; border: 0; border-radius: 0; box-shadow: none; padding: 0 6px; }
.rf-note { padding: 0 14px 0 52px; }

/* Возврат: количество и «Всё» в строке позиции (переопределяет прежнюю раскладку строки-кнопки) */
.rf-line:not(.static) { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 8px 14px 8px 8px; cursor: default; }
.rf-line:not(.static) .rf-pick { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px; border: 0; border-radius: 10px; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 48px; }
.rf-line:not(.static) .rf-pick:hover { background: color-mix(in srgb, var(--c-action) 6%, transparent); }
.rf-ctl { display: inline-flex; align-items: center; gap: 8px; }
.rf-amount { min-width: 84px; text-align: right; }
.rf-line .rf-note { grid-column: 1 / -1; padding: 0 6px 4px 54px; }
.rf-all { height: 40px; padding: 0 14px; border: 1px solid var(--border-strong, var(--border)); border-radius: 10px; background: var(--surface); font: inherit; font-weight: 650; color: inherit; cursor: pointer; }
.rf-all:hover { border-color: var(--c-action); }
.rf-all.on { background: color-mix(in srgb, var(--c-action) 14%, var(--surface)); border-color: var(--c-action); }
.rf-stepper button { width: 40px; height: 40px; }
.rf-stepper .input { width: 68px; height: 40px; font-size: 16px; font-weight: 650; }
.rf-stepper[hidden] { display: none; }
.rf-item, .rf-qty { display: contents; }
@media (max-width: 700px) {
  .rf-line:not(.static) { grid-template-columns: minmax(0, 1fr) auto; }
  .rf-line:not(.static) .rf-ctl { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; padding-left: 50px; }
}

.rf-stepper.dim { opacity: 0.6; }

/* Онлайн-магазин → Заказы: список по дням, карточка заказа со следующим шагом, шкала времени */
.od-days { display: grid; gap: 22px; }
.od-day { display: grid; gap: 10px; }
.od-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 4px; }
.od-cards { display: grid; gap: 10px; }
.od-card { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto 18px; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--c-action); border-radius: 14px; background: var(--surface); cursor: pointer; }
.od-card:hover { box-shadow: 0 6px 18px -12px rgb(0 0 0 / 0.3); }
.od-card:focus-visible { outline: 2px solid var(--c-action); outline-offset: 2px; }
.od-card.st-new { border-left-color: var(--c-warning); }
.od-card.st-done { border-left-color: var(--c-success); }
.od-card.st-cancelled { border-left-color: var(--c-danger); opacity: 0.8; }
.od-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--surface-3); color: var(--muted); }
.st-new .od-ico { background: color-mix(in srgb, var(--c-warning) 16%, var(--surface)); color: var(--c-warning); }
.st-done .od-ico { background: color-mix(in srgb, var(--c-success) 14%, var(--surface)); color: var(--c-success); }
.st-cancelled .od-ico { background: color-mix(in srgb, var(--c-danger) 12%, var(--surface)); color: var(--c-danger); }
.st-preparing .od-ico, .st-ready .od-ico, .st-shipping .od-ico { background: color-mix(in srgb, var(--c-action) 14%, var(--surface)); color: var(--c-action); }
.od-main { display: grid; gap: 3px; min-width: 0; }
.od-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.od-who { font-size: 14px; }
.od-meta { display: flex; gap: 12px; align-items: center; min-width: 0; font-size: 13px; color: var(--muted); }
.od-way { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.od-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-sum { display: grid; text-align: right; gap: 2px; }
.od-sum b { font-size: 17px; }
.od-nostep { width: 0; }
.od-more { display: flex; justify-content: center; padding: 6px 0; }
.od-buyer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.od-blocked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.od-why { margin-top: 4px; font-size: 13px; padding: 4px 10px; border-radius: 8px; background: var(--surface-3); display: inline-block; }
.tl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.tl-step { display: grid; gap: 4px; justify-items: start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tl-step .tl-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--muted); }
.tl-step.done .tl-dot { background: var(--c-success); color: #fff; }
.tl-step.now { border-color: var(--c-action); background: color-mix(in srgb, var(--c-action) 6%, var(--surface)); }
.tl-step.now .tl-dot { background: var(--c-action); color: var(--c-on-action); }
.tl-step.off { opacity: 0.45; }
.tl-step.cancelled { border-color: var(--c-danger); background: color-mix(in srgb, var(--c-danger) 7%, var(--surface)); }
.tl-step.cancelled .tl-dot { background: var(--c-danger); color: #fff; }
@media (max-width: 800px) {
  .od-card { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .od-card > .btn { grid-column: 2 / -1; justify-self: start; }
  .od-card > .ico { display: none; }
  .tl { grid-auto-flow: row; }
}
.stages { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.stage { padding: 12px 14px; }

/* Онлайн-магазин → Баннеры и скидки */
.sc-section { display: grid; gap: 16px; padding: 18px 20px; }
.sc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.sc-head h2 { margin: 0 0 4px; font-size: 18px; }
.sc-head p { margin: 0; max-width: 70ch; font-size: 13.5px; }
.sc-count { display: grid; gap: 6px; min-width: 130px; text-align: right; }
.sc-count b { font-size: 24px; }
.sc-fit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sc-tile { margin: 0; display: grid; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.sc-pic { position: relative; aspect-ratio: 2 / 1; background: var(--surface-3); display: grid; place-items: center; }
.sc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-num { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgb(15 23 42 / 0.78); color: #fff; font-size: 13px; font-weight: 700; }
.sc-first { position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 99px; background: var(--c-action); color: var(--c-on-action); font-size: 12px; font-weight: 700; }
.sc-first-inline { position: static; display: inline-block; margin-left: 8px; }
.sc-tools { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: inherit; cursor: pointer; }
.icon-btn:hover:not(:disabled) { border-color: var(--c-action); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn.danger { color: var(--c-danger); }
.icon-btn.danger:hover { border-color: var(--c-danger); background: color-mix(in srgb, var(--c-danger) 8%, var(--surface)); }
.icon-btn .up { transform: rotate(180deg); }
.sc-add { cursor: pointer; place-items: center; align-content: center; gap: 4px; min-height: 160px; border-style: dashed; color: var(--muted); text-align: center; padding: 16px; }
.sc-add:hover { border-color: var(--c-action); color: var(--text); }
.sc-add b { color: var(--text); }
.sc-rows { display: grid; gap: 10px; }
.sc-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto auto 34px; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--c-danger) 30%, var(--border)); border-radius: 14px; background: color-mix(in srgb, var(--c-danger) 4%, var(--surface)); }
.sc-row.off { border-color: var(--border); background: var(--surface); }
.sc-idx { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); font-weight: 700; font-size: 13px; }
.sc-name { display: grid; gap: 2px; min-width: 0; }
.sc-name > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-prices { display: flex; align-items: baseline; gap: 10px; }
.sc-prices b { font-size: 17px; }
.sc-order { display: inline-flex; gap: 6px; }
.sc-addrow { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 1px dashed var(--border-strong, var(--border)); border-radius: 14px; background: transparent; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.sc-addrow:hover { border-color: var(--c-action); color: var(--text); }
.sc-product { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.sc-product-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--c-danger) 12%, var(--surface)); color: var(--c-danger); }
.sc-chips { margin: 0; }
.sc-preview { padding: 14px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--c-danger) 28%, var(--border)); background: color-mix(in srgb, var(--c-danger) 6%, var(--surface)); display: grid; gap: 6px; }
.sc-cap { font-size: 12.5px; font-weight: 650; }
.sc-pv { display: grid; gap: 4px; }
.sc-pv-old { display: flex; align-items: center; gap: 10px; }
.sc-pv-new { font-size: 30px; letter-spacing: -0.02em; color: var(--c-danger); }
.sc-pv-save { font-size: 13.5px; color: var(--c-danger); font-weight: 600; }
.sc-note { font-size: 13px; }
.sc-pick { display: grid; gap: 6px; max-height: 50vh; overflow-y: auto; }
.sc-pick-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sc-pick-row:hover:not(.off) { border-color: var(--c-action); }
.sc-pick-row.off { opacity: 0.55; cursor: default; }
@media (max-width: 800px) {
  .sc-head { flex-direction: column; }
  .sc-count { text-align: left; }
  .sc-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .sc-row > .sc-prices, .sc-row > .btn, .sc-row > .sc-order { grid-column: 2 / -1; }
}
.sc-add { position: relative; }
.sc-add input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.sc-first-inline { justify-self: start; margin: 2px 0 0; }

/* Онлайн-магазин → Telegram и Настройки */
.bt-connect { padding: 20px; border-radius: 18px; background: linear-gradient(135deg, color-mix(in srgb, #2aabee 9%, var(--surface)), var(--surface)); }
.bt-hero { display: flex; gap: 18px; align-items: flex-start; }
.bt-info { flex: 1; min-width: 0; display: grid; gap: 8px; }
.bt-info h2, .bt-hero h2 { margin: 0; font-size: 22px; }
.bt-info p, .bt-hero p { margin: 0; font-size: 14px; }
.bt-logo { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 16px; background: #2aabee; color: #fff; }
.bt-hero.off .bt-logo { background: var(--surface-3); color: var(--muted); }
.bt-state { display: inline-flex; width: fit-content; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: color-mix(in srgb, var(--c-success) 14%, var(--surface)); color: var(--c-success); }
.bt-state.off { background: var(--surface-3); color: var(--muted); }
.bt-link { display: inline-block; width: fit-content; max-width: 100%; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.bt-qrbox { display: grid; gap: 6px; justify-items: center; flex: none; }
.bt-qr { width: 150px; height: 150px; border-radius: 12px; border: 1px solid var(--border); image-rendering: pixelated; }
.bt-form { margin-top: 16px; max-width: 520px; }
.bt-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bt-done { padding: 18px 20px; display: grid; gap: 12px; }
.bt-done h3, .bt-howto h3 { margin: 0; font-size: 16px; }
.bt-done ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bt-done li { display: flex; gap: 12px; align-items: flex-start; }
.bt-done li > div { display: grid; gap: 2px; }
.bt-tick { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--c-success) 16%, var(--surface)); color: var(--c-success); flex: none; }
.bt-shopurl { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.bt-action { display: flex; align-items: center; gap: 14px; padding: 14px 16px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--border); }
.bt-action:hover { border-color: var(--c-action); }
.bt-action .grow { display: grid; gap: 2px; }
.bt-act-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--surface-3); }
.bt-replace { padding: 14px 16px; border: 1px dashed var(--border); border-radius: 14px; }
.bt-replace[hidden] { display: none; }
.bt-off { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--c-danger) 30%, var(--border)); background: color-mix(in srgb, var(--c-danger) 4%, var(--surface)); }
.bt-off > div { display: grid; gap: 2px; }
.bt-off b { color: var(--c-danger); }
.bt-howto { padding: 18px 20px; display: grid; gap: 12px; }
.bt-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bt-steps li { display: flex; gap: 12px; align-items: flex-start; }
.bt-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--c-action); color: var(--c-on-action); font-weight: 700; font-size: 13px; flex: none; }
.st-card { display: grid; gap: 16px; padding: 18px 20px; }
.st-head { display: flex; align-items: center; gap: 10px; }
.st-head h3 { margin: 0; font-size: 16px; }
.st-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); color: var(--muted); }
.st-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.st-switch:has(input:checked) { border-color: color-mix(in srgb, var(--c-action) 55%, var(--border)); background: color-mix(in srgb, var(--c-action) 6%, var(--surface)); }
.st-switch:has(input:focus-visible) { outline: 2px solid var(--c-action); outline-offset: 2px; }
.st-text { display: grid; gap: 2px; }
.st-switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.st-track { flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background 0.15s; }
.st-track i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); transition: transform 0.15s; }
.st-switch input:checked ~ .st-track { background: var(--c-action); }
.st-switch input:checked ~ .st-track i { transform: translateX(18px); }
.st-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.st-url { font-size: 14px; }
.st-label { font-weight: 650; font-size: 13.5px; }
.st-place { display: grid; gap: 10px; padding: 12px 14px; border: 1px dashed var(--border-strong, var(--border)); border-radius: 12px; }
.st-where { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.st-manual summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.st-manual .form-grid { margin-top: 10px; }
.st-lead { margin: 0; font-size: 13.5px; }
.st-save { position: sticky; bottom: 0; z-index: 2; padding: 12px 0; background: linear-gradient(to top, var(--bg, #f3f5fa) 70%, transparent); }
@media (prefers-reduced-motion: reduce) { .st-track, .st-track i { transition: none; } }
@media (max-width: 800px) { .bt-hero { flex-wrap: wrap; } .bt-cols { grid-template-columns: 1fr; } }
.st-save { position: static; padding: 4px 0 8px; background: none; }

/* Статистика магазина: показатели одной полосой, переключатель метрик и факты под графиком */
@media (min-width: 1101px) { .page .grid-kpi.kpi-strip.st-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.st-metrics { align-self: flex-start; margin-bottom: 8px; }
.st-how { margin-top: 4px; }
.facts .fact small { font-size: 12px; line-height: 1.4; }
.facts .fact { align-content: start; }

/* Онлайн-магазин → Заказы: период и порядок сверху, показатели, статусы одной строкой */
.od-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.od-bar select { min-width: 230px; }
@media (min-width: 1101px) { .page .grid-kpi.kpi-strip.od-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.od-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.od-search { flex: 1 1 320px; max-width: 560px; }
.od-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: thin; }
.od-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.od-chip:hover { border-color: var(--c-action); }
.od-chip.active { background: var(--c-action); border-color: var(--c-action); color: var(--c-on-action); }
.od-chip .od-n { min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text); font-size: 12.5px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.od-chip.active .od-n { background: rgb(255 255 255 / 0.28); color: inherit; }
.od-chip.warn:not(.active) .od-n { background: color-mix(in srgb, var(--c-warning) 24%, var(--surface)); }
.od-chip.bad:not(.active) .od-n { background: color-mix(in srgb, var(--c-danger) 16%, var(--surface)); }
.od-chip.good:not(.active) .od-n { background: color-mix(in srgb, var(--c-success) 16%, var(--surface)); }
.od-chip.zero:not(.active) { opacity: 0.6; }
.shop-todo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 10px 16px 14px; }
.shop-todo-chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px; border: 1px dashed var(--border-strong, var(--border)); border-radius: 99px; background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.shop-todo-chip:hover { border-color: var(--c-action); }
.shop-todo-chip b { color: var(--c-action); font-weight: 650; }
.od-bar select { width: auto; flex: none; }
.od-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; background: var(--surface); height: 44px; }
.od-search:focus-within { outline: 2px solid var(--c-action); outline-offset: 1px; }
.od-search .ico { flex: none; color: var(--muted); }
.od-search .input { flex: 1; border: 0; outline: 0; box-shadow: none; background: transparent; height: 100%; padding: 0; }
.od-kpis .kpi { min-height: 0; }
.page .od-kpis > .kpi.primary { grid-row: auto; grid-column: auto; }
.shop-todo { padding-top: 0; }

/* Настройки магазина: две компактные колонки, карта с кругом радиуса, ползунок радиуса */
.st-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.st-card { gap: 12px; padding: 16px 18px; }
.st-switch { padding: 10px 12px; }
.st-prefix { display: flex; align-items: center; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; background: var(--surface); overflow: hidden; }
.st-prefix > span { padding: 0 0 0 12px; white-space: nowrap; font-size: 14px; }
.st-prefix .input { flex: 1; border: 0; box-shadow: none; background: transparent; min-width: 0; }
.st-lab { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 600; font-size: 13.5px; }
.st-count { font-size: 12px; font-weight: 500; }
.st-badge { padding: 2px 10px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 12.5px; font-weight: 700; }
.st-badge.on { background: color-mix(in srgb, var(--c-action) 18%, var(--surface)); color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--c-action); height: 28px; }
.mm { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); background: repeating-linear-gradient(0deg, transparent 0 39px, color-mix(in srgb, var(--border) 70%, transparent) 39px 40px), repeating-linear-gradient(90deg, transparent 0 39px, color-mix(in srgb, var(--border) 70%, transparent) 39px 40px), var(--surface-2); cursor: crosshair; touch-action: none; user-select: none; }
.mm-tiles { position: absolute; inset: 0; }
.mm-tile { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.mm-pin { position: absolute; width: 34px; height: 34px; margin: -34px 0 0 -17px; display: grid; place-items: center; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c-action); color: var(--c-on-action); box-shadow: 0 3px 10px rgb(0 0 0 / 0.35); pointer-events: none; }
.mm-pin .ico { transform: rotate(45deg); }
.mm-ring { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--c-action); background: color-mix(in srgb, var(--c-action) 14%, transparent); pointer-events: none; }
.mm-ring[hidden], .mm-pin[hidden] { display: none; }
.mm-zoom { position: absolute; top: 10px; left: 10px; display: grid; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); }
.mm-btn { width: 36px; height: 36px; border: 0; background: #fff; color: #111; font-size: 20px; line-height: 1; cursor: pointer; }
.mm-btn + .mm-btn { border-top: 1px solid #ddd; }
.mm-btn:disabled { opacity: 0.4; cursor: default; }
.mm-credit { position: absolute; right: 6px; bottom: 4px; padding: 1px 6px; border-radius: 6px; background: rgb(255 255 255 / 0.8); color: #333; font-size: 11px; pointer-events: none; }
@media (max-width: 1000px) { .st-cols { grid-template-columns: 1fr; } }

/* Онлайн-магазин: карточка с кнопками-окнами, статистика с четырьмя цветными графиками */
.shop-bar-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; }
.shop-logo { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--c-action); color: var(--c-on-action); flex: none; }
.shop-id { display: grid; gap: 3px; min-width: 0; flex: 1 1 220px; }
.shop-id .shop-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13.5px; }
.shop-id .shop-state { width: fit-content; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.shop-part { min-height: 120px; }
.ss-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.ss-range { font-size: 13.5px; }
.ss-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ss-tile { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.ss-tile > div { display: grid; gap: 2px; min-width: 0; }
.ss-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; flex: none; }
.ss-label { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.ss-value { font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; }
.tone-violet { --tc: #7c3aed; } .tone-orange { --tc: #ea580c; } .tone-green { --tc: #16a34a; } .tone-blue { --tc: #2563eb; }
.ss-ico, .sb-ico { background: color-mix(in srgb, var(--tc) 14%, var(--surface)); color: var(--tc); }
.ss-value, .sb-total { color: var(--tc); }
.ss-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sb-card { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.sb-head { display: flex; align-items: center; gap: 10px; }
.sb-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; }
.sb-total { margin-left: auto; font-size: 20px; font-weight: 750; }
.sb-plot { display: flex; align-items: stretch; gap: 6px; height: 190px; }
.sb-col { flex: 1; min-width: 0; display: grid; grid-template-rows: 18px 1fr 18px; justify-items: center; gap: 4px; }
.sb-num { font-size: 12px; font-weight: 700; color: var(--tc); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sb-bar { width: 100%; max-width: 46px; border-radius: 9px; background: var(--surface-2); display: flex; align-items: flex-end; overflow: hidden; }
.sb-fill { display: block; width: 100%; border-radius: 9px; background: color-mix(in srgb, var(--tc) 38%, var(--surface)); }
.sb-col.now .sb-fill { background: var(--tc); }
.sb-day { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sb-col.now .sb-day { color: var(--text); font-weight: 700; }
.ss-foot { margin: 0; font-size: 13px; }
@media (max-width: 1000px) { .ss-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ss-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .ss-tiles { grid-template-columns: 1fr; } .shop-actions { margin-left: 0; } }
.sb-plot { height: 150px; }
.shop-bar { padding: 0; gap: 0; }
.shop-id .shop-link { flex: none; padding: 0; background: none; border-radius: 0; font-size: 13.5px; }
.shop-actions { flex: 0 1 auto; }
.shop-todo { padding: 0 18px 14px; }
.shop-bar-top { gap: 12px 16px; }
.shop-actions { flex: 1 1 100%; margin-left: 0; }
.shop-id { flex: 1 1 0; }

.st-sample { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.st-sample:empty { display: none; }
label + .st-lead, .st-card .field[hidden], .stack[hidden] { }

/* Категории: цветные точки, полоса долей склада, таблица, выбор цвета */
.tone-blue { --cg: #2563eb; }
.tone-red { --cg: #dc2626; }
.tone-orange { --cg: #d97706; }
.tone-green { --cg: #16a34a; }
.tone-purple { --cg: #7c3aed; }
.tone-pink { --cg: #db2777; }
.tone-cyan { --cg: #0891b2; }
.tone-gray, .tone-none { --cg: #64748b; }
.cg-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cg, #64748b); }
.cg-name { display: inline-flex; align-items: center; gap: 10px; }
.cg-share { display: grid; gap: 12px; padding: 16px 18px; }
.cg-share-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cg-strip { display: flex; gap: 3px; height: 16px; }
.cg-seg { flex: 1 1 0; min-width: 4px; padding: 0; border: 0; border-radius: 5px; background: var(--cg); cursor: pointer; transition: filter 0.15s, transform 0.15s; }
.cg-seg:hover, .cg-seg:focus-visible { filter: brightness(1.12); transform: scaleY(1.25); }
.cg-seg.tone-none { background: repeating-linear-gradient(135deg, var(--cg) 0 4px, color-mix(in srgb, var(--cg) 55%, var(--surface)) 4px 8px); }
.cg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cg-key { display: inline-flex; align-items: center; gap: 7px; padding: 2px 4px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; border-radius: 6px; }
.cg-key:hover { background: var(--surface-2); }
.cg-more { align-self: center; font-size: 13px; }
.cg-table .table tbody tr { cursor: pointer; }
.cg-share-bar { display: block; width: 110px; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cg-share-bar i { display: block; height: 100%; border-radius: 99px; background: var(--cg); }
.cg-loose { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--surface); }
.cg-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.cg-swatch { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 2px solid transparent; border-radius: 11px; background: var(--cg); color: #fff; cursor: pointer; }
.cg-swatch[aria-checked="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.cg-swatch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Цели: карточки периодов, полоса выполнения, подсказки суммы, полоса целей в «Обзоре» */
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.gl-card { display: grid; gap: 12px; padding: 18px 20px; }
.gl-head { display: flex; align-items: center; gap: 12px; }
.gl-head b { display: block; font-size: 16px; }
.gl-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--tc, #2563eb) 16%, var(--surface)); color: var(--tc, #2563eb); }
.gl-ico.tone-orange { --tc: #ea580c; } .gl-ico.tone-blue { --tc: #2563eb; } .gl-ico.tone-green { --tc: #16a34a; } .gl-ico.tone-violet { --tc: #7c3aed; } .gl-ico.tone-pink { --tc: #db2777; }
.gl-fact { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.gl-fact b { font-size: 28px; letter-spacing: -0.6px; }
.gl-bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.gl-fill { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width 0.4s var(--ease-out); }
.gl-fill.pace-done, .gl-fill.pace-on_track { background: var(--good); }
.gl-fill.pace-close { background: var(--warn); }
.gl-fill.pace-behind { background: var(--bad); }
.gl-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-meta b { font-size: 15px; }
.gl-facts { list-style: none; display: grid; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; margin: 0; }
.gl-facts:empty { display: none; }
.gl-facts li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.gl-facts li span { color: var(--muted); }
.gl-empty { display: grid; gap: 10px; justify-items: start; padding: 6px 0 2px; }
.gl-empty p { margin: 0; font-size: 14px; }
.gl-card.locked { opacity: 0.85; }
.gl-foot { font-size: 13px; }
.gl-sug { display: grid; gap: 8px; margin-top: 12px; }
.gl-sug-title { font-size: 12.5px; font-weight: 600; }
.gl-opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.gl-opt:hover { border-color: var(--brand); background: var(--brand-weak); }
.gl-strip { display: grid; gap: 10px; padding: 14px 18px; cursor: pointer; }
.gl-strip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.gl-strip.empty { display: flex; align-items: center; gap: 12px; cursor: default; }
.gl-strip-head { display: flex; justify-content: space-between; align-items: baseline; }
.gl-strip-rows { display: grid; gap: 8px; }
.gl-row { display: grid; grid-template-columns: 76px 1fr 44px; align-items: center; gap: 12px; font-size: 13.5px; }
.gl-row b { text-align: right; }
.gl-ico .ico { width: 20px; height: 20px; }
.gl-strip.empty b, .gl-strip.empty small { display: block; }

/* ИИ-помощник на «Обзоре» */
.ai-card { display: grid; gap: 12px; padding: 14px 18px; }
.ai-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-head b { flex: 1; min-width: 0; }
.ai-chips { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2, color-mix(in srgb, var(--text) 8%, transparent)); }
.ai-chip { padding: 4px 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ai-chip.on { background: var(--surface, #fff); color: var(--text); box-shadow: 0 1px 3px color-mix(in srgb, var(--text) 18%, transparent); }
.ai-body { display: grid; gap: 10px; justify-items: start; }
.ai-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.45; }
.ai-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.ai-wait { display: flex; align-items: center; gap: 10px; }

/* Раздел «ИИ»: «Внимание» и утренняя сводка */
.ai-page { max-width: 860px; }
.at-title { margin: 6px 0 0; font-size: 18px; }
.at-card { display: grid; gap: 10px; padding: 14px 18px; border-left: 4px solid transparent; }
.at-card.sev-high { border-left-color: var(--bad, #d64545); }
.at-card.sev-medium { border-left-color: var(--warn, #e0952b); }
.at-head { display: flex; align-items: flex-start; gap: 12px; }
.at-head h2 { margin: 0; font-size: 16px; }
.at-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.at-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line, color-mix(in srgb, var(--text) 10%, transparent)); }
.at-list li:first-child { border-top: 0; }
.at-extra { color: var(--muted); white-space: nowrap; }
.at-debt { align-items: flex-start !important; }
.at-debt .at-main { display: grid; gap: 2px; min-width: 0; }
.at-text { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.at-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.at-foot { display: flex; justify-content: flex-end; }
.at-morning { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.at-morning input { width: 20px; height: 20px; accent-color: var(--brand, #f2a33a); }
.at-morning .grow { display: grid; gap: 2px; }

/* Чат «Спросить свой бизнес» */
.ac-card { display: grid; gap: 10px; padding: 14px 18px; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip { padding: 6px 12px; border: 1px solid var(--line, color-mix(in srgb, var(--text) 14%, transparent)); border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ac-chip:hover { background: color-mix(in srgb, var(--brand, #f2a33a) 12%, transparent); }
.ac-thread { display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.ac-thread:empty { display: none; }
.ac-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; }
.ac-msg.me { justify-self: end; background: color-mix(in srgb, var(--brand, #f2a33a) 22%, transparent); }
.ac-msg.ai { justify-self: start; background: var(--surface-2, color-mix(in srgb, var(--text) 7%, transparent)); }
.ac-msg.wait { color: var(--muted); }
.ac-msg.bad { color: var(--bad, #d64545); }
.ac-row { display: flex; gap: 8px; }
.ac-input { flex: 1; min-width: 0; }

/* Подготовка акции */
.pr-card { display: grid; gap: 12px; padding: 14px 18px; }
.pr-controls { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pr-label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pr-margin { width: 110px; }
.pr-list { display: grid; }
.pr-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line, color-mix(in srgb, var(--text) 10%, transparent)); cursor: pointer; }
.pr-row:first-child { border-top: 0; }
.pr-row input { width: 18px; height: 18px; accent-color: var(--brand, #f2a33a); }
.pr-price { white-space: nowrap; }
.pr-price s { color: var(--muted); }
.pr-price em { color: var(--good, #1f9d55); font-style: normal; font-weight: 700; }
.pr-out { display: grid; gap: 10px; }
.pr-result { display: grid; gap: 8px; }
.pr-text { width: 100%; resize: vertical; }
.pr-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pr-row .grow { display: grid; gap: 2px; min-width: 0; }
.pr-text { min-height: 170px; }
.pr-card .ai-head small { margin-left: auto; text-align: right; }


/* Накладная по фото */
.iv-card { display: grid; gap: 12px; padding: 14px 18px; }
.iv-out { display: grid; gap: 10px; justify-items: start; }
.iv-wrap { width: 100%; overflow-x: auto; }
.iv-table td { vertical-align: top; }
.iv-table .iv-num { width: 110px; }
.iv-table .select { min-width: 220px; }
.iv-flag td:first-child { box-shadow: inset 3px 0 0 var(--warn, #e0952b); }
.iv-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.iv-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }


/* Умный импорт из Excel */
.im-out { display: grid; gap: 10px; justify-items: start; width: 100%; }
.im-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; width: 100%; }
.im-field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.im-errors { margin: 0; padding-left: 18px; color: var(--bad, #d64545); font-size: 13px; }
.im-out .badge { margin-left: 8px; }


/* Страница «ИИ»: вкладки, плитки инструментов, сетка «Внимания» */
.ai-page { max-width: 1180px; }
.ai-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2, color-mix(in srgb, var(--text) 7%, transparent)); width: fit-content; }
.ai-tab { padding: 8px 18px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.ai-tab.on { background: var(--surface, #fff); color: var(--text); box-shadow: 0 1px 4px color-mix(in srgb, var(--text) 16%, transparent); }
.ai-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ai-kpi { display: grid; gap: 2px; padding: 14px 18px; border-radius: 18px; background: var(--surface, #fff); box-shadow: var(--shadow-card, 0 1px 3px color-mix(in srgb, var(--text) 10%, transparent)); border-top: 4px solid color-mix(in srgb, var(--muted) 40%, transparent); }
.ai-kpi b { font-size: 28px; line-height: 1; }
.ai-kpi small { color: var(--muted); }
.ai-kpi.bad { border-top-color: var(--bad, #d64545); }
.ai-kpi.bad b { color: var(--bad, #d64545); }
.ai-kpi.warn { border-top-color: var(--warn, #e0952b); }
.ai-kpi.warn b { color: var(--warn, #c27a14); }
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; align-items: start; }
.at-card { border-left: 0 !important; }
.at-head { align-items: center; }
.at-titles { flex: 1; min-width: 0; display: grid; gap: 2px; }
.at-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--muted) 16%, transparent); color: var(--muted); }
.at-ico.sev-high { background: color-mix(in srgb, var(--bad, #d64545) 15%, transparent); color: var(--bad, #d64545); }
.at-ico.sev-medium { background: color-mix(in srgb, var(--warn, #e0952b) 17%, transparent); color: var(--warn, #c27a14); }
.ai-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ai-tile { display: grid; gap: 6px; justify-items: start; padding: 20px; text-align: left; border: 0; border-radius: 22px; background: var(--surface, #fff); color: var(--text); font: inherit; box-shadow: var(--shadow-card, 0 1px 3px color-mix(in srgb, var(--text) 10%, transparent)); cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.ai-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px color-mix(in srgb, var(--text) 14%, transparent); }
.ai-tile b { font-size: 16px; }
.ai-tile-ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; margin-bottom: 6px; }
.ai-tile-ico .ico { width: 24px; height: 24px; }
.ai-tile-ico.tone-orange { background: color-mix(in srgb, #f2a33a 18%, transparent); color: #c27a14; }
.ai-tile-ico.tone-green { background: color-mix(in srgb, #1f9d55 15%, transparent); color: #1f9d55; }
.ai-tile-ico.tone-blue { background: color-mix(in srgb, #2563eb 14%, transparent); color: #2563eb; }
.ai-head { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center; }
.ai-head > .gl-ico { grid-row: 1 / 3; }
.ai-head > b { grid-column: 2; grid-row: 1; }
.ai-head > small { grid-column: 2; grid-row: 2; text-align: left !important; margin-left: 0 !important; }
.ai-head > .ai-chips { grid-column: 3; grid-row: 1 / 3; }
.iv-card textarea, .ac-card textarea { width: 100%; min-height: 96px; resize: vertical; }
@media (max-width: 900px) { .at-grid { grid-template-columns: 1fr; } .ai-kpis { grid-template-columns: 1fr; } }
.ai-tile { align-content: start; min-height: 150px; }


/* Помощник по системе */
.hp-out { display: grid; gap: 10px; }
.hp-answer { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--brand, #f2a33a) 14%, transparent); display: grid; gap: 6px; }
.hp-answer p { margin: 0; line-height: 1.5; }
.hp-articles { display: grid; gap: 8px; }
.hp-article { padding: 10px 14px; border-radius: 14px; background: var(--surface-2, color-mix(in srgb, var(--text) 5%, transparent)); }
.hp-article summary { cursor: pointer; font-weight: 700; }
.hp-article p { margin: 8px 0 0; line-height: 1.5; color: var(--muted); }


/* Чат с разговорами */
.cv-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.cv-side { display: grid; gap: 10px; align-content: start; padding-right: 12px; border-right: 1px solid var(--line, color-mix(in srgb, var(--text) 10%, transparent)); }
.cv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 420px; overflow-y: auto; }
.cv-list li { display: flex; align-items: center; gap: 2px; border-radius: 10px; }
.cv-list li.on { background: color-mix(in srgb, var(--brand, #f2a33a) 16%, transparent); }
.cv-open { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 7px 10px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.cv-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-del { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; opacity: 0; }
.cv-list li:hover .cv-del, .cv-list li.on .cv-del { opacity: 1; }
.cv-del:hover { color: var(--bad, #d64545); }
.cv-empty { margin: 0; font-size: 13px; }
.cv-main { display: grid; gap: 10px; min-width: 0; }
.cv-thread { max-height: 460px; }
.cv-mode { justify-self: end; }
@media (max-width: 900px) { .cv-body { grid-template-columns: 1fr; } .cv-side { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line, color-mix(in srgb, var(--text) 10%, transparent)); padding-bottom: 10px; } .cv-list { max-height: 160px; } }

/* ИИ → Сегодня: дела по деньгам */
.td-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.td-sum { display: grid; grid-auto-flow: column; align-items: baseline; gap: 4px 10px; }
.td-sum b { font-size: 34px; line-height: 1; }
.td-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.td-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); border-radius: 999px; background: var(--surface, #fff); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.td-chip b { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.td-chip.on { background: var(--text); color: var(--surface, #fff); border-color: var(--text); }
.td-chip.on b { background: color-mix(in srgb, var(--surface, #fff) 25%, transparent); }
.td-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 16px; align-items: start; }
.td-card { --role: #3b6df0; display: grid; gap: 12px; padding: 16px 18px; border-top: 4px solid var(--role); }
.td-card.tone-orange { --role: #e0952b; }
.td-card.tone-green { --role: #2e9d5c; }
.td-card.tone-violet { --role: #7c5ce0; }
.td-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.td-role { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--role); background: color-mix(in srgb, var(--role) 13%, transparent); }
.td-role.tone-orange { --role: #b8741a; }
.td-role.tone-green { --role: #23804a; }
.td-role.tone-violet { --role: #6240c8; }
.td-role.tone-blue { --role: #2c58d0; }
.td-titles h2 { margin: 0; font-size: 16px; }
.td-impact { display: grid; justify-items: end; gap: 2px; text-align: right; }
.td-impact b { font-size: 20px; line-height: 1.1; }
.td-text { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px; background: color-mix(in srgb, var(--text) 5%, transparent); white-space: pre-wrap; }
.td-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 4px; border-top: 1px dashed color-mix(in srgb, var(--text) 14%, transparent); }
.td-actions, .td-mark { display: flex; flex-wrap: wrap; gap: 8px; }
.td-results { display: grid; gap: 12px; padding: 16px 18px; }
.td-res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.td-res { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.td-res b { font-size: 24px; line-height: 1; }
.td-empty-res { margin: 0; }
@media (max-width: 700px) { .td-list { grid-template-columns: 1fr; } .td-head { grid-template-columns: auto minmax(0, 1fr); } .td-impact { grid-column: 1 / -1; justify-items: start; text-align: left; } }

/* Персонажи ИИ-команды */
.tm-av { display: inline-block; flex: none; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 10%, transparent); }
.tm-av svg { display: block; width: 100%; height: 100%; }
.tm-busy .tm-dots circle { animation: tm-blink 1.2s infinite both; }
.tm-busy .tm-dots circle:nth-child(2) { animation-delay: .2s; }
.tm-busy .tm-dots circle:nth-child(3) { animation-delay: .4s; }
@keyframes tm-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tm-busy .tm-dots circle { animation: none; } }
.td-head { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.td-who { font-weight: 700; color: var(--role); }
.td-who.tone-orange { color: #b8741a; }
.td-who.tone-green { color: #23804a; }
.td-who.tone-violet { color: #6240c8; }
.td-who.tone-blue { color: #2c58d0; }
.td-chip { padding-left: 6px; }
.td-chip:first-child { padding-left: 14px; }

/* Маркетолог */
.mk { display: grid; gap: 14px; padding: 16px 18px; border-top: 4px solid #7c5ce0; }
.mk-head { grid-template-columns: auto minmax(0, 1fr) auto; }
.mk-settings { display: grid; grid-template-columns: minmax(200px, 1fr) auto auto; align-items: end; gap: 10px 16px; }
.mk-settings small { grid-column: 1 / -1; }
.mk-field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.mk-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding-bottom: 8px; }
.mk-draft { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.mk-draft-head { display: flex; align-items: center; gap: 10px; }
.mk-kind { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #6240c8; background: color-mix(in srgb, #7c5ce0 14%, transparent); }
.mk-text { width: 100%; min-height: 130px; resize: vertical; font: inherit; line-height: 1.5; }
.mk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-empty { margin: 0; }
.mk-st.mk-published { color: #23804a; font-weight: 700; }
.mk-st.mk-skipped { color: var(--muted); }
@media (max-width: 700px) { .mk-settings { grid-template-columns: 1fr; } }

/* Маркетолог: картинка поста */
.mk-settings { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.mk-draft-img { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mk-visual { display: grid; gap: 10px; }
.mk-preview { position: relative; border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--text) 8%, transparent); min-height: 180px; display: grid; place-items: center; }
.mk-img { display: block; width: 100%; height: auto; }
.mk-img-9x16 { max-height: 520px; width: auto; max-width: 100%; }
.mk-img-wait { position: absolute; inset: 0; display: grid; place-items: center; }
.mk-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); display: grid; place-items: center; cursor: pointer; color: #fff; }
.mk-swatch svg { filter: drop-shadow(0 0 2px rgba(0, 0, 0, .8)); }
.mk-swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface, #fff) inset; }
.mk-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-side { display: grid; gap: 10px; min-width: 0; }
.mk-side .mk-draft-head { flex-wrap: wrap; }
@media (max-width: 800px) { .mk-draft-img { grid-template-columns: 1fr; } }
.mk-swatch.sw-sun { background: #ffc43d; }
.mk-swatch.sw-ocean { background: #185fa9; }
.mk-swatch.sw-mint { background: #d2eee0; }
.mk-swatch.sw-night { background: #111827; }
.mk-swatch.sw-paper { background: #faf5ec; }
.mk-swatch.sw-berry { background: #5e34c4; }

/* Маркетолог: расписание и логотип */
.mk-times { grid-column: 1 / -1; display: grid; gap: 6px; }
.mk-times-label { font-size: 13px; font-weight: 600; }
.mk-hours { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-hours .td-chip { padding: 5px 12px; font-size: 13px; }
.mk-logo { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.mk-logo-box { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); }
.mk-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mk-logo-text { display: grid; gap: 2px; flex: 1 1 220px; }

/* Маркетолог: правка с ИИ */
.mk-ai { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #7c5ce0 8%, transparent); }
.mk-ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-ai-chips .td-chip { padding: 4px 12px; font-size: 13px; }
.mk-ai-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }

/* ИИ-офис: магазин изнутри (размеры в cqw: проценты ширины сцены) */
.of { position: relative; width: 100%; max-width: 1040px; margin-inline: auto; container-type: inline-size; aspect-ratio: 1586 / 992; border-radius: 22px; overflow: hidden; background: #241b2f; box-shadow: var(--shadow-card, 0 1px 6px color-mix(in srgb, var(--text) 14%, transparent)); }
.of-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.of-img { display: block; user-select: none; -webkit-user-drag: none; }
.of-person { position: absolute; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; transform: translateX(-50%); font: inherit; }
.of-person .of-img { animation: of-bob 3.6s ease-in-out infinite alternate; transition: filter .2s; }
.of-person:hover .of-img { filter: brightness(1.06); }
.of-person.on .of-img { filter: drop-shadow(0 0 .7cqw rgba(255, 214, 102, .95)); }
.of-person:focus-visible { outline: 3px solid #ffd666; outline-offset: 2px; border-radius: 12px; }
.of-seat { overflow: hidden; height: 9.84cqw; top: 18.85cqw; }
.of-seat .of-img { height: 15.9cqw; width: auto; }
.of-manager { left: 16.7cqw; }
.of-sales { left: 48.2cqw; }
.of-sales .of-img { animation-delay: -1.2s; }
.of-finance { left: 76.6cqw; }
.of-finance .of-img { animation-delay: -2.1s; }
.of-stand { top: 42.6cqw; left: 20.2cqw; }
.of-stand .of-img { height: 17cqw; width: auto; }
.of-guest { position: absolute; height: 14.2cqw; width: auto; top: 45.4cqw; transform: translateX(-50%); animation: of-bob 3.2s ease-in-out infinite alternate; }
.of-guest-1 { left: 53.6cqw; }
.of-guest-2 { left: 62.1cqw; animation-delay: -1s; }
.of-guest-3 { left: 71.9cqw; animation-delay: -2s; }
.of-walker { position: absolute; height: 14cqw; width: auto; top: 47.2cqw; left: 0; opacity: 0; pointer-events: none; animation: of-walk 28s linear infinite; }
.of-bubble { position: absolute; transform: translateX(-50%); max-width: 22cqw; padding: .55cqw 1.1cqw; border-radius: 1.3cqw; background: #fff; color: #2b2433; font-size: clamp(10px, 1.1cqw, 15px); font-weight: 700; line-height: 1.25; text-align: center; box-shadow: 0 .3cqw .9cqw rgba(0, 0, 0, .22); pointer-events: none; animation: of-pop .5s ease-out both; }
.of-bubble::after { content: ""; position: absolute; left: 50%; bottom: -.7cqw; width: 1.2cqw; height: 1.2cqw; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 0 0 .3cqw 0; }
.of-b-manager { left: 17cqw; top: 15.4cqw; }
.of-b-sales { left: 52.2cqw; top: 15.4cqw; }
.of-b-finance { left: 81.3cqw; top: 15.4cqw; }
.of-b-warehouse { left: 22.5cqw; top: 38cqw; }
.of-b-till { left: 87.5cqw; top: 38.8cqw; }
.of-badge { position: absolute; transform: translateX(-50%); display: flex; align-items: center; gap: .5cqw; padding: .3cqw 1.1cqw .3cqw .5cqw; border-radius: 999px; background: #fff; color: #2b2433; font-size: clamp(10px, 1.05cqw, 14px); font-weight: 800; box-shadow: 0 .3cqw .8cqw rgba(0, 0, 0, .25); pointer-events: none; }
.of-badge img { height: 2.4cqw; width: auto; display: block; }
.of-badge-stock { left: 30cqw; top: 57.4cqw; }
.of-badge-coins { left: 89.3cqw; top: 30.6cqw; }
.of-badge-till { left: 83cqw; top: 58.2cqw; }
@keyframes of-bob { from { transform: translateY(0); } to { transform: translateY(-.35cqw); } }
@keyframes of-pop { from { opacity: 0; transform: translateX(-50%) translateY(.6cqw) scale(.94); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes of-walk { 0%, 58% { transform: translateX(34cqw); opacity: 0; } 61% { opacity: 1; } 97% { opacity: 1; } 100% { transform: translateX(96cqw); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .of-person .of-img, .of-guest, .of-bubble { animation: none; } .of-walker { display: none; } }

/* «Сегодня»: страница в две колонки — сцена и правая колонка с командой и лентой */
.td-hero { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: stretch; }
.td-hero-scene .of { max-width: none; }
.td-rail { position: relative; min-height: 0; }
.rl-in { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; }
.rl-sum, .rl-team, .rl-feed { padding: 14px 16px; border-radius: 20px; }
.rl-sum { display: grid; gap: 6px; background: linear-gradient(135deg, #2f2640, #4a3a6b); color: #fff; }
.rl-sum .muted { color: rgba(255, 255, 255, .72); }
.rl-big { display: flex; align-items: baseline; gap: 10px; }
.rl-big b { font-size: 46px; line-height: 1; }
.rl-big span { font-weight: 700; }
.rl-done { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #ffd98a; }
.rl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rl-reset { border: 0; background: none; color: var(--brand, #c2670a); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.rl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 14px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.rl-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.rl-row.on { background: color-mix(in srgb, #f2a33a 16%, transparent); border-color: #f2a33a; }
.rl-row-text { display: grid; min-width: 0; }
.rl-row-text b { font-size: 15px; }
.rl-row-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-chip { min-width: 26px; padding: 2px 8px; border-radius: 999px; text-align: center; font-weight: 800; font-size: 13px; color: #fff; background: #7c5ce0; }
.rl-manager { background: #2c58d0; }
.rl-warehouse { background: #d98a1f; }
.rl-finance { background: #23804a; }
.rl-sales { background: #7c5ce0; }
.rl-ok { color: #23a06b; display: grid; place-items: center; }
.rl-feed { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.rl-feed-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.rl-ev { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 8px 2px; border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent); font-size: 14px; }
.rl-ev:first-child { border-top: 0; }
.rl-ev-text { display: grid; gap: 2px; }
.rl-empty { padding: 12px 2px; font-size: 14px; }
.td-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 6px; }
.td-bar h2 { margin: 0; font-size: 22px; }
.td-lower { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .td-hero, .td-lower { grid-template-columns: 1fr; } .rl-in { position: static; } .rl-feed-list { max-height: 360px; } }

/* «Сегодня»: левая колонка (сцена, дела, маркетолог) и правая (сводка, команда, лента, итоги) */
.td-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.td-main, .td-side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.td-main .td-list { grid-template-columns: 1fr; }
.td-side .rl-in { position: static; display: grid; grid-template-rows: none; gap: 14px; }
.td-side .td-rail { position: static; }
.td-side .rl-feed-list { max-height: 420px; }
.td-side .rl-feed { display: block; }
.td-hero-scene .of, .td-main .of { max-width: none; }
@media (max-width: 1100px) { .td-grid { grid-template-columns: 1fr; } }

/* ИИ: верхняя строка (вкладки + режим), компактные итоги, шапка маркетолога */
.ai-toprow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.mk-head-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.td-side .td-res-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.td-side .td-res { padding: 10px 10px; }
.td-side .td-res b { font-size: 20px; }
.td-side .td-res small { font-size: 11px; line-height: 1.25; }

/* «ИИ» использует всю ширину страницы: справа не остаётся пустого места */
.ai-page { max-width: 1760px; width: 100%; }

/* ИИ-офис: движение сотрудников, продавец за прилавком, значки-реакции */
.of-clerk { position: absolute; height: 11cqw; width: auto; left: 85.8cqw; top: 40.6cqw; transform: translateX(-50%); pointer-events: none; }
.of-person.away .of-img { visibility: hidden; }
.of-wk { position: absolute; height: 16cqw; transform: translateX(-50%); pointer-events: none; transition: opacity .25s; }
.of-wk.fade { opacity: 0; }
.of-fig { height: 100%; background-repeat: no-repeat; background-size: 400% 100%; animation: of-step .52s step-end infinite; }
.of-fig[hidden], .of-pose[hidden] { display: none; }
.of-pose { display: block; height: 100%; width: auto; }
.of-pose.flip { transform: scaleX(-1); }
.of-fig-manager-l, .of-fig-manager-r { aspect-ratio: 0.56; }
.of-fig-warehouse-l, .of-fig-warehouse-r { aspect-ratio: 0.56; }
.of-fig-finance-l, .of-fig-finance-r { aspect-ratio: 0.635; }
.of-fig-sales-l, .of-fig-sales-r { aspect-ratio: 0.6; }
.of-fig-manager-l { background-image: url(/img/office/walk-manager-l.webp); }
.of-fig-manager-r { background-image: url(/img/office/walk-manager-r.webp); }
.of-fig-warehouse-l { background-image: url(/img/office/walk-warehouse-l.webp); }
.of-fig-warehouse-r { background-image: url(/img/office/walk-warehouse-r.webp); }
.of-fig-finance-l { background-image: url(/img/office/walk-finance-l.webp); }
.of-fig-finance-r { background-image: url(/img/office/walk-finance-r.webp); }
.of-fig-sales-l { background-image: url(/img/office/walk-sales-l.webp); }
.of-fig-sales-r { background-image: url(/img/office/walk-sales-r.webp); }
.of-fx { position: absolute; width: 3.6cqw; height: auto; transform: translateX(-50%); pointer-events: none; animation: of-pop .45s ease-out both; }
.of-b-focus { z-index: 3; }
@keyframes of-step { 0% { background-position: 0% 0; } 25% { background-position: 33.333% 0; } 50% { background-position: 66.667% 0; } 75% { background-position: 100% 0; } }
@media (prefers-reduced-motion: reduce) { .of-fig { animation: none; } .of-wk { transition: none; } }

/* ИИ: страницы ролей (Склад, Финансы, Продажи) */
.rp-page { max-width: 1180px; }
.rp-head { display: flex; align-items: center; gap: 14px; }
.rp-head h2 { margin: 0; font-size: 20px; }
.rp-two { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.rp-score { padding: 18px 20px; display: grid; align-content: start; gap: 8px; }
.rp-score-n { font-size: 44px; line-height: 1; font-weight: 800; color: var(--c-action); }
.rp-score-n.off { color: var(--muted); }
.rp-score-n small { font-size: 16px; font-weight: 600; color: var(--muted); }
.rp-score-why { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.rp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rp-stat { padding: 14px 16px; border: 1px solid var(--c-line); border-radius: var(--r-card); background: var(--surface); display: grid; gap: 3px; align-content: start; }
.rp-stat b { font-size: 22px; }
.rp-block { padding: 16px 18px; display: grid; gap: 10px; }
.rp-bh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rp-list { list-style: none; margin: 0; padding: 0; display: grid; }
.rp-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--c-line); }
.rp-row:first-child { border-top: 0; }
.rp-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.rp-extra { font-weight: 700; white-space: nowrap; }
.rp-foot { display: flex; gap: 8px; }
.rp-scroll { overflow-x: auto; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rp-table th, .rp-table td { padding: 9px 12px; text-align: right; border-top: 1px solid var(--c-line); white-space: nowrap; }
.rp-table th:first-child, .rp-table thead th { text-align: left; color: var(--muted); font-weight: 700; }
.rp-table thead th { border-top: 0; text-align: right; }
.rp-table thead th:first-child { text-align: left; }
.rp-chart { width: 100%; height: auto; max-height: 220px; }
.rp-bar { fill: color-mix(in srgb, var(--c-action) 38%, var(--surface)); }
.rp-bar.now { fill: var(--c-action); }
.rp-lbl { fill: var(--muted); font-size: 11px; }
@media (max-width: 1000px) { .rp-two { grid-template-columns: 1fr; } }
.rp-bar { display: flex; justify-content: flex-end; }

/* ИИ-офис: название магазина на вывеске над крышей */
.of-sign { position: absolute; left: 27.8cqw; top: 2.9cqw; width: 43cqw; height: 7.2cqw; display: grid; place-items: center; padding: 0 1.2cqw; pointer-events: none; }
.of-sign span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 3.3cqw; letter-spacing: 0.06em; color: #ffe9a8; text-shadow: 0 0 0.6cqw rgba(255, 196, 77, 0.9), 0 0 1.8cqw rgba(255, 150, 40, 0.7); }

/* ИИ: пороги тревоги и окно «Как это работает» */
.ts-card { padding: 16px 18px; display: grid; gap: 12px; max-width: 760px; }
.ts-head { display: grid; gap: 2px; }
.ts-grid { display: grid; gap: 12px; }
.ts-grid .input { max-width: 140px; }
.ts-foot { display: flex; gap: 8px; }
.hw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hw-row { display: flex; gap: 12px; align-items: flex-start; }
.hw-row p { margin: 2px 0 0; }
.hw-note { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-ctl); background: color-mix(in srgb, var(--c-action) 8%, var(--surface)); }

/* ИИ: торговый зал (точка «в сети») и фильтр ленты по сотрудникам */
.rp-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-line); flex: none; }
.rp-dot.on { background: var(--c-success, #1b7f4b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-success, #1b7f4b) 22%, transparent); }
.rl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.rl-chip-btn { border: 1px solid var(--c-line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.rl-chip-btn.on { background: color-mix(in srgb, var(--c-action) 14%, var(--surface)); border-color: var(--c-action); color: var(--c-action); font-weight: 700; }

/* ---------- Аудит ПК: число и валюта в карточке показателя всегда помещаются ---------- */
/* Размер подгоняется под ширину самой карточки (cqw), а не только под число цифр: крупная сумма в узкой
   карточке уменьшается, а не обрезается. Корзины s/m/l/xl приходят из moneyValue() по длине числа. */
.page .kpi { container-type: inline-size; }
.page .kpi .kpi-value { max-width: 100%; font-size: min(30px, 15.9cqw); }
.page .kpi .kpi-value[data-size="m"] { font-size: min(27px, 13.3cqw); }
.page .kpi .kpi-value[data-size="l"] { font-size: min(24px, 11.5cqw); }
.page .kpi .kpi-value[data-size="xl"] { font-size: min(21px, 9.5cqw); }
.page .kpi.primary .kpi-value { font-size: min(46px, 15.9cqw); }
.page .kpi.primary .kpi-value[data-size="m"] { font-size: min(40px, 13.3cqw); }
.page .kpi.primary .kpi-value[data-size="l"] { font-size: min(34px, 11.5cqw); }
.page .kpi.primary .kpi-value[data-size="xl"] { font-size: min(28px, 9.5cqw); }

/* ---------- Касса: поиск — широкая основная строка, вид и порядок — отдельной строкой под ним ---------- */
.pos-bar .pos-searchrow { flex-direction: column; align-items: stretch; gap: 8px; }
.pos-bar .pos-searchrow .search-inline-lg { width: 100%; flex: none; }
.pos-bar .pos-searchrow .search-inline-lg .input { min-width: 0; }
.pos-bar .pos-tools { width: 100%; flex: none; flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
.pos-bar .pos-tools .pos-sort { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Вход: чек — часть колонки, а не поверх неё ---------- */
/* Раньше чек был прибит к нижнему краю и накладывался на преимущества, когда окно ниже или уже. Теперь он
   идёт последним в потоке колонки: текст сверху, чек под ним, перекрытия не бывает; в низком окне чек скрыт. */
.lg-hero { display: flex; flex-direction: column; min-height: 0; }
.lg-hero .lg-receipt { position: relative !important; right: auto; bottom: auto; align-self: flex-end; margin-top: clamp(16px, 3vh, 36px); margin-right: clamp(0px, 2vw, 40px); flex: none; }
@media (max-height: 1010px) { .lg-receipt { display: none !important; } }
/* имена .rc-line / .rc-sum общие с экраном чека продажи: у примера на странице входа свои строки */
.lg-receipt .rc-line { display: flex; grid-template-columns: none; align-items: baseline; gap: 6px; padding: 0; border: 0; }
.lg-receipt .rc-sum { gap: 10px; }
.pl-price small, .pl-foot .pl-avg { display: block; font-weight: 500; }
.pl-price small, .pl-foot .pl-avg { display: block; font-weight: 500; }

/* ---------- Опасные действия: свёрнутый блок отдельно от обычных кнопок ---------- */
.danger-zone { padding: 0; border: 1px dashed color-mix(in srgb, var(--c-danger) 45%, var(--c-line)); border-radius: 14px; background: color-mix(in srgb, var(--c-danger) 4%, var(--surface)); }
.danger-zone > summary { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 650; color: var(--c-danger); cursor: pointer; list-style: none; border-radius: 14px; }
.danger-zone > summary::-webkit-details-marker { display: none; }
.danger-zone > summary:focus-visible { outline: 2px solid var(--c-danger); outline-offset: 2px; }
.danger-zone > :not(summary) { margin: 0 16px 12px; }
.danger-zone .item { padding: 8px 0; }
.danger-inline { margin-top: 10px; }

/* ---------- Компактные показатели: списки и таблицы выше сгиба ---------- */
.page .grid-kpi.kpi-strip .kpi { padding: 14px 18px; gap: 6px; }
.page .grid-kpi.kpi-strip .kpi .kpi-foot { min-height: 0; }
.page .grid-kpi.kpi-strip > .kpi.primary .kpi-value { font-size: min(34px, 14cqw); }
.exp-sum { align-items: stretch; }
.exp-sum > .kpi.primary { grid-column: auto; padding: 16px 20px; }
.exp-sum > .kpi.primary .kpi-value { font-size: min(34px, 14cqw); }
.exp-sum .donut-wrap { gap: 16px; }

/* ---------- v1.208: правки по аудиту ПК-версии ---------- */
/* Выбранный вариант переключателя: часть страниц помечает его классом .on или aria-pressed, а не .active */
.seg button.on, .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(14, 26, 51, 0.1), 0 6px 14px -8px rgba(14, 26, 51, 0.3); }
.seg button.on .chip-count, .seg button[aria-pressed="true"] .chip-count { background: color-mix(in srgb, var(--c-action) 22%, transparent); }

/* Постраничная панель: выбор «строк на странице» не растягивается на всю ширину */
.pager { flex-wrap: wrap; row-gap: 8px; }
.pager > span { white-space: nowrap; }
.pager .select { width: auto; flex: none; height: 34px; min-width: 76px; }

/* Свечение пустого состояния — ровно за значком (анимация появления сбрасывала сдвиг по центру) */
.empty::before { left: calc(50% - 95px); transform: none; }

/* Полоса «Поставьте цель» на обзоре: своё имя класса, чтобы не наследовать оформление пустых состояний */
.gl-strip.gl-strip-blank { display: flex; align-items: center; gap: 12px; cursor: default; }
.gl-strip.gl-strip-blank b, .gl-strip.gl-strip-blank small { display: block; }

/* Полосы прокрутки: тонкие, в цвет интерфейса; место под полосу страницы зарезервировано — шапка не прыгает */
html { scrollbar-gutter: stable; }
html, .table-wrap, .modal-body, .drawer-body, .qr-side, .card-body, .list-plain { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--c-muted) 45%, transparent) transparent; }
.sidebar { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--side-text) 28%, transparent) transparent; }

/* Одиночный показатель не растягивается на всю страницу */
@media (min-width: 900px) { .grid-kpi:not(.kpi-strip):has(> .kpi:only-child) { grid-template-columns: minmax(260px, 420px); } }

/* Цвет суммы на тёмной главной карточке: читаемый зелёный и красный */
.kpi.primary .kpi-value.good { color: color-mix(in srgb, var(--c-success) 55%, #fff); }
.kpi.primary .kpi-value.bad { color: color-mix(in srgb, var(--c-danger) 45%, #fff); }

/* Подпись в центре кольца помещается внутри него */
.donut-small { font-size: 7px; letter-spacing: 0.03em; }

/* Чипы периода со значком: зазор между значком и текстом */
.chips .chip { display: inline-flex; align-items: center; gap: 6px; }

/* Диапазон дат в карточке (смены кассы): поля обычной ширины, а не на всю карточку */
.card-body .row > .input[type="date"] { flex: 0 1 190px; min-width: 150px; }

/* Метка рядом с названием в ячейке таблицы */
.cell-title + .badge { margin-left: 8px; }

/* Флажки без своего оформления — в цвет действий */
input[type="checkbox"], input[type="radio"] { accent-color: var(--c-action); }
/* ИИ-страницы ролей: время последнего обновления и явная ошибка */
.rp-bar { align-items: center; gap: 12px; }
.rp-bar > small { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; }
.rp-stale { color: var(--c-danger); font-weight: 600; }

/* Заголовки таблиц: кнопка сортировки с видимым фокусом */
.table th .th-sort { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; border-radius: 6px; }
.table th.right .th-sort { flex-direction: row-reverse; }
.table th .th-sort:hover { color: var(--text); }
.table th .th-sort:focus-visible { outline: 2px solid var(--c-action); outline-offset: 2px; }

/* ---------- Подписка: плашка, расход лимитов, пакеты, доверие ---------- */
.sub-banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-color: color-mix(in srgb, var(--c-success) 40%, var(--c-line)); }
.sub-banner.soon { border-color: color-mix(in srgb, var(--c-warning) 55%, var(--c-line)); background: color-mix(in srgb, var(--c-warning) 7%, var(--surface)); }
.sub-banner .gl-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--c-soft); }
.sub-usage { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sub-use { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--c-line); border-radius: 14px; background: var(--surface); }
.sub-use b { font-size: 20px; }
.sub-use.over { border-color: var(--c-danger); }
.sub-use small { color: var(--c-danger); font-weight: 600; }
.pl-from { font-size: 12.5px; margin: 2px 0 -2px; }
.pl-mine { position: absolute; top: -11px; left: 16px; padding: 2px 10px; border-radius: 999px; background: var(--c-success); color: #fff; font-size: 12px; font-weight: 700; }
.pl-card.pkg .pl-foot { margin-top: auto; }
.sub-trust { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px; font-size: 13px; color: var(--c-muted); }
.sub-methods { display: flex; gap: 6px; flex-wrap: wrap; }

/* Подписка: выбор срока — крупные понятные кнопки, пять ступеней в ряд на широком экране */
.term-head { display: grid; gap: 10px; margin-bottom: 14px; }
.term-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.term-btn { display: grid; gap: 2px; min-width: 104px; padding: 10px 16px; text-align: left; border: 1.5px solid var(--c-line); border-radius: 14px; background: var(--surface); font: inherit; color: inherit; cursor: pointer; }
.term-btn b { font-size: 16px; }
.term-btn small { color: var(--c-muted); font-size: 12px; }
.term-btn.on { border-color: var(--c-action); background: color-mix(in srgb, var(--c-action) 10%, var(--surface)); }
.term-btn.on small { color: var(--c-action); font-weight: 650; }
.term-btn:focus-visible { outline: 2px solid var(--c-action); outline-offset: 2px; }
.term-summary { margin: 0; color: var(--c-muted); font-size: 13.5px; }
.pl-total { display: grid; gap: 1px; }
.pl-total b { font-size: 22px; letter-spacing: -0.02em; }
@media (min-width: 1300px) { .pl-grid:has(> .pl-card:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* карточки тарифов: блок оплаты и кнопка всегда у нижнего края, в одном ряду */
.pl-grid > .pl-card { display: flex; flex-direction: column; }
.pl-grid > .pl-card > .pl-foot { margin-top: auto; padding-top: 6px; }

/* Подписка, нижняя часть: промокод и приглашения слева, подарок справа, одна строка про оплату */
.sub-extras { display: grid; gap: 14px; align-items: start; }
.sub-extras.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
@media (max-width: 1000px) { .sub-extras.two { grid-template-columns: minmax(0, 1fr); } }
.gift-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.gift-tile { display: grid; justify-items: start; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--c-line); border-radius: 14px; background: var(--surface); font: inherit; color: inherit; cursor: pointer; text-align: left; transition: border-color 0.15s, transform 0.15s; }
.gift-tile:hover { border-color: var(--c-action); transform: translateY(-1px); }
.gift-tile:focus-visible { outline: 2px solid var(--c-action); outline-offset: 2px; }
.gift-tile .ico { color: var(--c-action); }
.gift-tile b { font-size: 16px; }
.gift-tile span { color: var(--c-muted); font-size: 13px; }
.gift-note { margin: 12px 0; font-size: 13px; }
.gift-codes { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--c-line); }
.sub-trust small { display: block; margin-top: 4px; }

/* Движение товаров: суммы по единицам — по строке на единицу, без переносов и нулей */
.mv-vals { display: grid; gap: 1px; }
.mv-vals b { white-space: nowrap; line-height: 1.15; }
.mv-cell .mv-vals b { font-size: 18px; }
.mv-tape-main .mv-vals b { font-size: 28px; }
.mv-vals b i { font-style: normal; font-size: 0.6em; font-weight: 650; opacity: 0.7; letter-spacing: 0; }
.mv-cell { min-width: 0; }

/* ---------- «Скидочные товары»: название — на всю ширину строки, действия — второй строкой ---------- */
/* В окне шириной ~700 px шесть колонок в одну линию сжимали название до «Бумаж…»; метка «Первый на витрине»
   в узкой колонке переносилась и становилась кругом. Теперь: 1-я строка — номер и полное название,
   2-я — цены и скидка слева, кнопки справа. */
@media (min-width: 801px) {
  .sc-row { grid-template-columns: 30px minmax(0, 1fr) auto auto auto; grid-template-rows: auto auto; row-gap: 8px; column-gap: 12px; }
  .sc-row > .sc-idx { grid-row: 1 / 3; align-self: start; }
  .sc-row > .sc-name { grid-column: 2 / -1; grid-row: 1; }
  .sc-row > .sc-prices, .sc-row > span:nth-child(3) { grid-column: 2; grid-row: 2; }
  .sc-row > .btn { grid-column: 3; grid-row: 2; }
  .sc-row > .sc-order { grid-column: 4; grid-row: 2; }
  .sc-row > .icon-btn.danger { grid-column: 5; grid-row: 2; }
}
.sc-name > b { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.3; }
.sc-name .sc-first-inline { display: inline-flex; align-items: center; width: fit-content; margin: 2px 0 0; padding: 2px 10px; border-radius: 99px; white-space: nowrap; line-height: 1.4; }
.sc-prices { flex-wrap: wrap; }
.sc-row { border-color: color-mix(in srgb, var(--c-danger) 22%, var(--border)); background: color-mix(in srgb, var(--c-danger) 2.5%, var(--surface)); }

/* ── Товары: аватар в первой колонке (эмодзи по названию, иначе буква) ── */
.pc-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pc-name > div { min-width: 0; }
.pc-av { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; font-size: 15px; font-weight: 750; color: var(--c-brand-text, #14213d); background: color-mix(in srgb, var(--c-action, #f2a33a) 18%, var(--c-fill, #fff)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-action, #f2a33a) 26%, transparent); }
.pc-av.glyph { font-size: 20px; font-weight: 400; line-height: 1; background: color-mix(in srgb, var(--c-muted, #55607a) 10%, var(--c-fill, #fff)); box-shadow: none; }

/* ── Обзор: карточка «ИИ-помощники» (команда на главной) ── */
.overview-team { height: auto; }
.overview-team .card-body { padding: 14px 20px 18px; }
.overview-people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.overview-person { text-align: center; min-width: 0; }
.overview-portrait { width: 88px; height: 88px; margin: 0 auto 8px; overflow: hidden; border-radius: 50%; background: var(--surface-2); }
.overview-portrait img { display: block; width: 100%; height: auto; }
.overview-person-manager .overview-portrait { background: color-mix(in srgb, var(--brand) 13%, var(--surface)); }
.overview-person-warehouse .overview-portrait { background: color-mix(in srgb, var(--warn) 17%, var(--surface)); }
.overview-person-finance .overview-portrait { background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.overview-person-sales .overview-portrait { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.overview-person b { display: block; font-size: 14px; }
.overview-person small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.overview-team-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.overview-team-foot .muted { font-size: 12px; margin-top: 3px; }
@media (max-width: 700px) {
  .overview-people { gap: 8px; }
  .overview-portrait { width: 60px; height: 60px; }
  .overview-person small { font-size: 10.5px; }
}

/* ── Касса v2: больше места товарам. Поиск и инструменты — одна строка, лента «Часто» тоньше, карточки плотнее ── */
.pos-bar .pos-searchrow { flex-direction: row; align-items: center; gap: 10px; }
.pos-bar .pos-searchrow .search-inline-lg { flex: 1; width: auto; min-width: 0; }
.pos-bar .pos-tools { width: auto; flex: none; flex-wrap: nowrap; justify-content: flex-end; }
.pos-bar .pos-tools .pos-sort { max-width: 190px; }
.pos-root .pos-left { gap: 10px; }
.pos-root .pos-bar { gap: 8px; padding: 10px; }
.pos-root .pos-freq { padding: 4px 10px; }
.pos-grid[data-density="4"] { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.pos-grid[data-density="4"] .tile2 { grid-template-columns: 62px minmax(0, 1fr) auto; padding: 8px 10px; column-gap: 10px; row-gap: 2px; border-left-width: 5px; }
.pos-grid[data-density="4"] .tile-media { width: 62px; height: 62px; border-radius: 12px; }
.pos-grid[data-density="4"] .tile-name { font-size: 14.5px; line-height: 1.2; }
.pos-grid[data-density="4"] .tile-foot b { font-size: 16px; }
.pos-grid[data-density="4"] .tile-add { width: 36px; height: 36px; }
.pos-grid[data-density="4"] .tile-picked { left: 14px; top: 14px; }
.pos-grid .tile2.picked { border-color: var(--c-action); background: color-mix(in srgb, var(--c-action) 9%, var(--surface)); box-shadow: 0 0 0 1px var(--c-action), var(--shadow-sm); }
@media (max-width: 1000px) {
  .pos-bar .pos-searchrow { flex-direction: column; align-items: stretch; }
  .pos-bar .pos-tools { flex-wrap: wrap; width: 100%; }
}
.tile-media.tile-glyph { font-size: 30px; line-height: 1; background: color-mix(in srgb, var(--c-action) 12%, var(--surface-2)); }
.pos-grid[data-density="4"] .tile-media.tile-glyph { font-size: 28px; }

/* Касса: счётчик новых заказов на кнопке «Заказы» */
.orders-count { margin-left: 6px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--c-action); color: var(--c-on-action); font-size: 12px; font-weight: 800; }
.orders-count[hidden] { display: none; }
.cl-opt { font-size: 12px; font-weight: 650; color: var(--good, #15803d); }

/* ── Касса: «Заказ» рядом с «К оплате» и окно оформления заказа ── */
.pos-root .pay-actions { display: flex; gap: 8px; align-items: stretch; }
.pos-root .pay-actions > .pay-btn { flex: 1; min-width: 0; }
.order-btn { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--brand); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: transform 0.12s, background 0.12s; }
.order-btn .ico { width: 20px; height: 20px; }
.order-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.order-btn:active:not(:disabled) { transform: scale(0.96); }
.order-btn:disabled { opacity: 0.5; cursor: default; }
.order-customer { display: flex; gap: 8px; align-items: stretch; }
.order-customer .pay-row { flex: 1; }
.order-when { display: flex; flex-direction: column; gap: 10px; }
.order-when-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.order-when-fields .input { max-width: 190px; }
.od-pickup { color: var(--warn); font-weight: 650; font-size: 12.5px; }

/* ── Касса: панель смены ── */
.shift-panel { gap: 10px; }
.shift-state { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.shift-state i { width: 9px; height: 9px; border-radius: 50%; background: var(--good, #16a34a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good, #16a34a) 20%, transparent); }
.shift-due { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.shift-due b { font-size: 24px; letter-spacing: -0.02em; }
.shift-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.shift-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.shift-more { display: flex; justify-content: flex-end; }
.orders-count.late { background: var(--bad, #dc2626); color: #fff; }

/* ── Меню слева: значки окрашены по группе (быстрее находить раздел), активный пункт — по-прежнему шафрановый ── */
.nav-link[data-sec] .nav-ico { background: color-mix(in srgb, currentColor 14%, transparent); }
.nav-link[data-sec="home"] .nav-ico { color: #8db8ff; }
.nav-link[data-sec="trade"] .nav-ico { color: #ffc56b; }
.nav-link[data-sec="stock"] .nav-ico { color: #6fe3a1; }
.nav-link[data-sec="money"] .nav-ico { color: #c7a8ff; }
.nav-link[data-sec="manage"] .nav-ico { color: #6fe1d6; }
.nav-link[data-sec].active .nav-ico { background: var(--c-action); color: var(--c-on-action); }
.nav-link[data-sec]:hover .nav-ico { background: color-mix(in srgb, currentColor 22%, transparent); }
.nav-link[data-sec].active:hover .nav-ico { background: var(--c-action); }

/* ── Шапка: инструменты одной группой, профиль «пилюлей» с именем и ролью ── */
.topbar .top-tools { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 16px; background: color-mix(in srgb, var(--text) 5%, var(--surface)); box-shadow: inset 0 0 0 1px var(--border); }
.topbar .top-tools .btn-icon { position: relative; width: 38px; height: 38px; border-radius: 12px; color: var(--muted); transition: background 0.15s, color 0.15s, transform 0.15s; }
.topbar .top-tools .btn-icon:hover { background: var(--surface); color: var(--text); box-shadow: var(--paper-shadow); }
.topbar .top-tools .btn-icon:active { transform: scale(0.94); }
.topbar .top-tools .btn-icon .ico { width: 20px; height: 20px; }
.topbar .top-tools .bell.has-unread { color: var(--c-action, #f2a33a); }
.topbar .top-tools .bell.has-unread .ico { animation: bell-ring 1.4s ease 0.3s 1; transform-origin: 50% 8%; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.topbar .top-tools .nav-badge { position: absolute; top: 2px; right: 0; }
.topbar .profile-btn { height: 46px; gap: 10px; padding: 0 12px 0 5px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--paper-shadow); }
.topbar .profile-btn:hover { background: var(--surface); box-shadow: 0 6px 18px -8px rgba(15, 27, 51, 0.35); }
.topbar .profile-btn .avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--g-action, linear-gradient(135deg, #f7b84f, #f2a33a)); color: var(--c-on-action, #14213d); font-weight: 800; font-size: 16px; }
.topbar .profile-btn .pf-text { display: grid; text-align: left; line-height: 1.2; min-width: 0; }
.topbar .profile-btn .pf-text b { font-size: 14px; font-weight: 750; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .profile-btn .pf-text small { font-size: 12px; color: var(--muted); }
.topbar .profile-btn > .ico { color: var(--muted); }
@media (max-width: 1200px) { .topbar .profile-btn .pf-text { display: none; } .topbar .profile-btn { padding: 0 8px 0 5px; } }
@media (max-width: 700px) { .topbar .profile-btn > .ico { display: none; } }
@media (prefers-reduced-motion: reduce) { .topbar .top-tools .bell.has-unread .ico { animation: none; } }

/* ── Уведомления: значок по типу сообщения, звук ── */
.notif-ico { position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: color-mix(in srgb, var(--tone, var(--muted)) 15%, var(--surface)); color: var(--tone, var(--muted)); }
.notif-ico .ico { width: 21px; height: 21px; }
.notif-ico.tone-blue { --tone: #2563eb; } .notif-ico.tone-amber { --tone: #d97706; } .notif-ico.tone-red { --tone: #dc2626; }
.notif-ico.tone-violet { --tone: #7c3aed; } .notif-ico.tone-teal { --tone: #0e7490; } .notif-ico.tone-gray { --tone: #55607a; }
.notif-ico.unread::after { content: ""; position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--c-action, #f2a33a); box-shadow: 0 0 0 2px var(--surface); }
.notif-sound { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.notif-sound input { accent-color: var(--c-action, #f2a33a); width: 16px; height: 16px; }

/* ── Оплата переводом: банки (настройки и окно оплаты) ── */
.bank-list, .pay-banks { display: flex; flex-wrap: wrap; gap: 8px; }
.bank-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.bank-chip .ico { color: var(--brand); }
.bank-chip b { font-size: 14px; }
.bank-chip button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.bank-chip button:hover { background: color-mix(in srgb, var(--bad, #dc2626) 12%, transparent); color: var(--bad, #dc2626); }
.bank-add { gap: 10px; align-items: center; }
.bank-add .input { max-width: 280px; }
.pay-bank { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.pay-bank .pay-row-label { font-weight: 650; }

/* ── Отчёт «Как заплатили» и обязательный банк в окне оплаты ── */
.pay-line { display: flex; flex-direction: column; gap: 6px; }
.pay-line .top { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.pay-track { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 16%, transparent); overflow: hidden; }
.pay-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pay-fill.cash { background: #16a34a; } .pay-fill.transfer { background: #2563eb; } .pay-fill.debt { background: #d97706; }
.pay-fill.bank { background: #6b9bff; } .pay-fill.none { background: #9aa4b8; }
.pay-banks-rep { display: flex; flex-direction: column; gap: 12px; margin: 2px 0 4px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #2563eb 6%, var(--surface)); }
.pay-sub { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--muted); font-size: 13px; }
.pay-bank .req { color: var(--bad, #dc2626); }
.pay-bank.need { border-color: var(--bad, #dc2626); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad, #dc2626) 15%, transparent); }

/* ── Расходы: полноценный раздел (показатели, категории, список по дням, форма, статистика) ── */
.exp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; margin-right: 8px; }
.exp-filter { display: flex; flex-direction: column; gap: 12px; }
.exp-search { display: flex; gap: 10px; align-items: center; }
.exp-search .search-inline { flex: 1; }
.exp-kpis { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); padding: 0; overflow: hidden; }
.exp-stat { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-left: 1px solid var(--border); min-width: 0; }
.exp-stat:first-child { border-left: 0; }
.exp-stat small { font-size: 12.5px; color: var(--muted); font-weight: 650; }
.exp-stat b { font-size: 20px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.exp-stat.big b { font-size: 34px; color: var(--bad, #dc2626); letter-spacing: -0.02em; }
.exp-stat.big small { text-transform: uppercase; letter-spacing: 0.05em; }
.exp-stat .muted { font-size: 12.5px; }
.exp-bars { display: flex; flex-direction: column; gap: 14px; }
.exp-bar .top { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.exp-bar .top > span:first-child { display: inline-flex; align-items: center; min-width: 0; }
.exp-track { height: 9px; margin-top: 6px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); overflow: hidden; }
.exp-bar-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.exp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.exp-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.12s; }
.exp-chip .exp-dot { margin-right: 6px; }
.exp-chip em { font-style: normal; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent); font-size: 12px; }
.exp-chip:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.exp-chip:active { transform: scale(0.97); }
.exp-chip.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); color: var(--brand); }
.exp-chip.manage, .exp-chip.add { border-style: dashed; color: var(--muted); }
.exp-chips.tight .exp-chip { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.exp-day > header { display: flex; align-items: baseline; gap: 10px; padding: 12px 20px; background: color-mix(in srgb, var(--text) 3.5%, var(--surface)); border-bottom: 1px solid var(--border); font-size: 14px; }
.exp-day + .exp-day > header { border-top: 1px solid var(--border); }
.exp-day > header .muted { font-size: 13px; }
.exp-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 20px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background 0.12s; }
.exp-row:last-child { border-bottom: 0; }
.exp-row:hover { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.exp-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; }
.exp-ico .ico { width: 22px; height: 22px; }
.exp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.exp-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15.5px; }
.exp-tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, currentColor 11%, transparent); font-size: 12.5px; font-weight: 700; }
.exp-tag .exp-dot { margin-right: 6px; background: currentColor; }
.exp-tag.solid { background: color-mix(in srgb, currentColor 10%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); gap: 6px; padding: 5px 12px; font-size: 13.5px; }
.exp-tag.solid:not(:first-child) { color: var(--text); background: var(--surface-2); box-shadow: none; }
.exp-sum { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.exp-sum b { font-size: 17px; color: var(--bad, #dc2626); }
.exp-sum small { font-size: 12px; }
.exp-more { display: flex; justify-content: center; }
.exp-foot { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.exp-amount { padding: 16px 18px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--bad, #dc2626) 30%, var(--border)); background: color-mix(in srgb, var(--bad, #dc2626) 8%, var(--surface)); }
.exp-amount small { display: block; font-size: 13px; color: var(--muted); font-weight: 650; }
.exp-amount b { font-size: 32px; color: var(--bad, #dc2626); letter-spacing: -0.02em; }
.exp-view-name { margin: 0; font-size: 20px; }
.exp-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.exp-note { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.exp-amount-box { padding: 14px 18px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--bad, #dc2626) 30%, var(--border)); background: color-mix(in srgb, var(--bad, #dc2626) 7%, var(--surface)); }
.exp-amount-box small { color: var(--muted); font-weight: 650; }
.exp-amount-box .row { align-items: baseline; gap: 10px; }
.exp-amount-input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; height: auto !important; font-size: 34px !important; font-weight: 800; color: var(--bad, #dc2626); letter-spacing: -0.02em; width: 100%; }
.exp-hints { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.exp-hint { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.exp-hint:hover { background: var(--surface-2); }
.exp-cat-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.exp-cat-row.hidden { opacity: 0.6; }
.exp-cat-row small { display: block; }
.exp-hidden-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.exp-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.exp-swatches button { width: 34px; height: 34px; border: 3px solid transparent; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 2px var(--surface); }
.exp-swatches button.on { border-color: var(--text); }
.exp-icons { display: flex; flex-wrap: wrap; gap: 8px; }
.exp-icons button { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); cursor: pointer; }
.exp-icons button.on { border-width: 2px; background: var(--surface); }
.exp-icons .ico { width: 22px; height: 22px; }
.exp-stat-seg { flex-wrap: wrap; }
.exp-custom { gap: 10px; align-items: center; }
.exp-stats-kpi { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.exp-stats-kpi .exp-stat { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.exp-stats-kpi .exp-stat.big { grid-row: span 2; background: color-mix(in srgb, var(--bad, #dc2626) 7%, var(--surface)); border-color: color-mix(in srgb, var(--bad, #dc2626) 24%, var(--border)); }
.exp-chg { align-self: flex-start; margin-top: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 700; }
.exp-chg.up { color: var(--bad, #dc2626); } .exp-chg.down { color: var(--good, #16a34a); } .exp-chg.flat { color: var(--muted); }
.exp-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; }
.exp-week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.exp-week-col small { font-size: 11.5px; white-space: nowrap; }
.exp-week-plot { width: 100%; height: 120px; display: flex; align-items: flex-end; }
.exp-week-bar { display: block; width: 100%; border-radius: 10px 10px 4px 4px; background: var(--bad, #dc2626); min-height: 0; }
@media (max-width: 1100px) { .exp-kpis { grid-template-columns: repeat(2, 1fr); } .exp-stat { border-left: 0; border-top: 1px solid var(--border); } .exp-stats-kpi { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .exp-kpis { grid-template-columns: 1fr; } .exp-search { flex-direction: column; align-items: stretch; } .exp-row { padding: 12px 14px; } .exp-day > header { padding: 10px 14px; flex-wrap: wrap; } }

.exp-auto { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 11%, var(--surface)); color: var(--brand); font-size: 12px; font-weight: 700; }
.exp-clip { display: inline-grid; place-items: center; color: var(--muted); }
.exp-receipt { display: block; max-width: 100%; max-height: 280px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--border); cursor: zoom-in; object-fit: contain; background: var(--surface); }
.exp-photo { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.exp-photo-name { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }

/* ── Расходы (v2): шапка-итог, два столбца, список по дням, правая колонка ── */
.xp-page { gap: 16px; }
.xp-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.xp-filter { display: flex; }
.xp-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; padding: 26px 28px; border-radius: 26px; color: #fff; background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c-action, #f2a33a) 26%, transparent), transparent 55%), linear-gradient(150deg, #213a6b 0%, #14213d 100%); box-shadow: var(--paper-shadow); }
.xp-hero-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.xp-hero-main > small { font-size: 13.5px; color: rgba(255, 255, 255, 0.75); }
.xp-hero-sum { font-size: clamp(36px, 3.6vw, 54px); line-height: 1.02; font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.xp-hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.xp-pill { padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.13); font-size: 13px; font-weight: 650; white-space: nowrap; }
.xp-pill.up { background: rgba(255, 140, 140, 0.22); color: #ffd2cf; }
.xp-pill.down { background: rgba(120, 230, 170, 0.2); color: #b8f5cf; }
.xp-hero-side { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; min-width: 0; }
.xp-days { display: flex; align-items: flex-end; gap: 4px; height: 96px; }
.xp-days i { flex: 1; min-width: 3px; border-radius: 4px 4px 2px 2px; background: rgba(255, 255, 255, 0.16); }
.xp-days i.on { background: var(--c-action, #f2a33a); }
.xp-days-cap { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: rgba(255, 255, 255, 0.65); }
.xp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.xp-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.xp-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; position: sticky; top: 12px; }
.xp-bar { display: flex; gap: 10px; align-items: center; }
.xp-search { position: relative; flex: 1; min-width: 0; display: block; }
.xp-search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.xp-search .input { width: 100%; height: 44px; padding-left: 40px; border-radius: 14px; }
.xp-bar select { width: auto; min-width: 190px; height: 44px; border-radius: 14px; }
.xp-day { display: flex; flex-direction: column; gap: 8px; }
.xp-day > header { display: flex; align-items: center; gap: 12px; padding: 4px 4px 0; }
.xp-date { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--paper-shadow); line-height: 1.05; }
.xp-date b { font-size: 17px; }
.xp-date small { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.xp-date-name { font-weight: 700; text-transform: capitalize; }
.xp-date-sum { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--bad, #dc2626) 10%, var(--surface)); color: var(--bad, #dc2626); font-size: 14px; }
.xp-rows { display: flex; flex-direction: column; gap: 8px; }
.xp-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px 12px 14px; border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--paper-shadow); transition: transform 0.12s, box-shadow 0.15s; }
.xp-row:hover { box-shadow: 0 8px 20px -10px rgba(15, 27, 51, 0.35); transform: translateY(-1px); }
.xp-row:active { transform: scale(0.995); }
.xp-row .exp-sum b { font-size: 16.5px; color: var(--text); }
.xp-row .exp-sum small { display: grid; place-items: center; color: var(--faint); }
.xp-cat { display: inline-flex; align-items: center; font-weight: 650; }
.xp-donut { display: grid; place-items: center; }
.xp-legend { display: flex; flex-direction: column; gap: 2px; }
.xp-leg { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 8px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.xp-leg:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.xp-leg:disabled { cursor: default; }
.xp-leg .exp-dot { margin: 0; }
.xp-leg-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-leg small { grid-column: 2 / -1; margin-top: -2px; font-size: 12px; }
.xp-rep { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; font-size: 14px; }
.xp-rep-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.xp-rep-empty { margin: 0; font-size: 13.5px; }
@media (max-width: 1100px) { .xp-grid { grid-template-columns: 1fr; } .xp-side { position: static; } .xp-hero { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .xp-hero { padding: 20px; } .xp-bar { flex-direction: column; align-items: stretch; } .xp-bar select { width: 100%; } }

.xp-top { display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; }
.xp-top > small { font-size: 12.5px; color: rgba(255, 255, 255, 0.7); font-weight: 650; }
.xp-top-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.1); font-size: 14px; }
.xp-top-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ── Уведомления: разобранный текст бота (шапка, секции, строки «подпись — значение», рейтинг) ── */
.notif-body .nf { white-space: normal; display: flex; flex-direction: column; gap: 14px; max-width: 720px; line-height: 1.45; }
.nf-title { display: flex; align-items: center; gap: 10px; }
.nf-title h4 { margin: 0; font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.nf-emoji { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--surface-2, color-mix(in srgb, var(--border) 45%, var(--surface))); font-size: 15px; line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.nf-emoji.big { width: 34px; height: 34px; border-radius: 11px; font-size: 18px; background: color-mix(in srgb, var(--c-action, #f2a33a) 20%, var(--surface)); }
.nf-sec { display: flex; flex-direction: column; gap: 6px; }
.nf-sec-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.01em; }
.nf-sec-h .nf-emoji { width: 22px; height: 22px; border-radius: 7px; font-size: 12px; }
.nf-rows, .nf-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.nf-row, .nf-rank { display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.nf-row + .nf-row, .nf-rank + .nf-rank { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.nf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nf-label { color: var(--text); font-size: 14px; }
.nf-sub { color: var(--muted); font-size: 12.5px; }
.nf-val { flex: none; max-width: 62%; text-align: right; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum", "lnum"; overflow-wrap: anywhere; }
.nf-val.neg { color: var(--bad); }
.nf-row.key { padding: 12px 14px; background: color-mix(in srgb, var(--c-action, #f2a33a) 9%, var(--surface)); }
.nf-row.key .nf-label { font-weight: 650; }
.nf-row.key .nf-val { font-size: 17px; letter-spacing: -0.01em; }
.nf-n { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2, color-mix(in srgb, var(--border) 45%, var(--surface))); color: var(--muted); font-size: 12.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.nf-n.n1 { background: #f6c24a; color: #5a3c00; } .nf-n.n2 { background: #cfd6e4; color: #343c4f; } .nf-n.n3 { background: #e5b48a; color: #5a3416; }
.nf-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.nf-meta { flex: none; max-width: 48%; text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.nf-text, .nf-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 14px; }
.nf-note { color: var(--muted); font-size: 12.5px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--border) 28%, var(--surface)); }
.nf-note .nf-emoji, .nf-text .nf-emoji { width: 22px; height: 22px; font-size: 12px; }
@media (max-width: 700px) { .nf-val { max-width: 55%; } .nf-meta { max-width: 40%; } }

.nf-title { flex-wrap: wrap; }
.nf-chip { padding: 3px 10px; border-radius: 999px; background: var(--surface-2, color-mix(in srgb, var(--border) 45%, var(--surface))); color: var(--muted); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.nf-rows > .nf-text { padding: 9px 14px; }
.nf-rows > .nf-text + .nf-text { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }


/* ── Сотрудники: табель, график, рейтинг, расчётный листок ── */
.chip.on { background: var(--c-brand); border-color: transparent; color: var(--c-on-brand); }
.pday-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pday { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.pday.ok { background: var(--good-weak); color: var(--good); }
.pday.bad { background: var(--bad-weak); color: var(--bad); }
.pslip { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.pslip-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; font-size: 14px; }
.pslip-line + .pslip-line { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.pslip-line b { font-variant-numeric: tabular-nums; }
.pslip-line.neg b { color: var(--bad); }
.pslip-line.total { background: var(--surface-2); font-weight: 650; }
.pslip-line.key { background: color-mix(in srgb, var(--c-action, #f2a33a) 12%, var(--surface)); font-size: 16px; }
/* табель */
.tsh-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tsh-choices-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.tsh-choice { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--muted); font: inherit; font-weight: 650; font-size: 13.5px; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s; }
.tsh-choice:hover:not(:disabled) { border-color: var(--brand); color: var(--text); }
.tsh-choice:active:not(:disabled) { transform: scale(0.97); }
.tsh-choice:disabled { opacity: 0.45; cursor: not-allowed; }
.tsh-choice.tsh-present.on { background: var(--good); border-color: transparent; color: #fff; }
.tsh-choice.tsh-absent.on { background: var(--bad); border-color: transparent; color: #fff; }
.tsh-choice.tsh-off.on { background: #5b6478; border-color: transparent; color: #fff; }
.tsh-hint { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
.tsh-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.tsh-key { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.tsh-key i { width: 14px; height: 14px; border-radius: 5px; border: 1.5px dashed var(--border-strong); }
.tsh-key.tsh-auto i { background: var(--good-weak); border: 1px solid var(--good-weak); }
.tsh-key .ico { width: 15px; height: 15px; }
.tsh-key.tsh-present .ico { color: var(--good); } .tsh-key.tsh-absent .ico { color: var(--bad); } .tsh-key.tsh-off .ico { color: #5b6478; }
.tsh-today-date { font-size: 20px; font-weight: 750; letter-spacing: -0.01em; }
.tsh-today { display: flex; flex-direction: column; margin-top: 8px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.tsh-today-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); }
.tsh-today-row + .tsh-today-row { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.tsh-state.tsh-present { color: var(--good); } .tsh-state.tsh-absent { color: var(--bad); }
.tsh-scroll { overflow-x: auto; }
.tsh-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 880px; }
.tsh-grid th, .tsh-grid td { padding: 4px 2px; text-align: center; }
.tsh-grid thead th { position: sticky; top: 0; background: var(--surface); font-weight: 600; font-size: 12px; color: var(--muted); padding-top: 10px; }
.tsh-grid .tsh-name { position: sticky; left: 0; z-index: 1; min-width: 190px; text-align: left; padding: 6px 14px; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.tsh-day b { display: block; font-size: 13px; color: var(--text); }
.tsh-day small { font-size: 11px; }
.tsh-day.today { background: color-mix(in srgb, var(--c-action, #f2a33a) 14%, var(--surface)); border-radius: 10px 10px 0 0; }
.tsh-day.weekend small { color: var(--bad); }
.tsh-sum { min-width: 64px; padding: 6px 12px !important; white-space: nowrap; }
.tsh-miss { color: var(--bad); font-weight: 650; }
.tsh-cell { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1.5px dashed var(--border-strong); border-radius: 10px; background: transparent; color: var(--faint); cursor: pointer; transition: transform 0.1s, background 0.15s, border-color 0.15s; }
.tsh-cell:not(:disabled):hover { transform: translateY(-1px); border-color: var(--brand); }
.tsh-cell:disabled { cursor: default; }
.tsh-cell .ico { width: 16px; height: 16px; }
.tsh-cell.future { opacity: 0.6; }
.tsh-cell.tsh-present { border: 1px solid transparent; background: var(--good-weak); color: var(--good); }
.tsh-cell.tsh-present.manual { background: var(--good); color: #fff; }
.tsh-cell.tsh-absent { border: 1px solid transparent; background: var(--bad-weak); color: var(--bad); }
.tsh-cell.tsh-absent.manual { background: var(--bad); color: #fff; }
.tsh-cell.tsh-off { border: 1px solid transparent; background: color-mix(in srgb, #5b6478 14%, var(--surface)); color: #5b6478; }
.tsh-cell.tsh-off.manual { background: #5b6478; color: #fff; }
.tsh-cell.today { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-action, #f2a33a) 60%, transparent); }
.tsh-note { position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c-action, #f2a33a); }
/* график */
.stfsch-person { display: flex; align-items: center; gap: 10px; }
.stfsch-cell { display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; min-width: 118px; min-height: 36px; padding: 0 8px; border: 1.5px dashed var(--border-strong); border-radius: 10px; background: transparent; color: var(--faint); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; font-variant-numeric: tabular-nums; }
.stfsch-cell:disabled { cursor: default; }
.stfsch-cell:not(:disabled):hover { border-color: var(--brand); color: var(--text); }
.stfsch-cell.has { border: 1px solid transparent; background: color-mix(in srgb, var(--c-brand, #213a6b) 12%, var(--surface)); color: var(--text); }
.stfsch-cell.off { border-style: solid; border-color: transparent; background: color-mix(in srgb, #5b6478 12%, var(--surface)); color: #5b6478; }
.stfsch-cell.past { opacity: 0.55; }
.stfsch-cell .ico { width: 14px; height: 14px; }
.stfsch-grid { min-width: 840px; }
/* рейтинг */
.rnk-list { display: flex; flex-direction: column; gap: 8px; }
.rnk-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.rnk-place { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 38px; height: 32px; padding: 0 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.rnk-place .ico { width: 14px; height: 14px; }
.rnk-top.rnk-1 .rnk-place { background: #f6c24a; color: #5a3c00; }
.rnk-top.rnk-2 .rnk-place { background: #cfd6e4; color: #343c4f; }
.rnk-top.rnk-3 .rnk-place { background: #e5b48a; color: #5a3416; }
.rnk-sum { font-size: 16px; white-space: nowrap; }
.rnk-plan { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.rnk-plan .pay-meter { flex: 1; max-width: 240px; }
.rnk-done { color: var(--good); font-weight: 650; }
.rnk-signals { display: flex; flex-direction: column; gap: 8px; }
.rnk-signal { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.rnk-signal.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: var(--warn-weak); }
.rnk-signal-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.rnk-signal.warn .rnk-signal-ico { background: color-mix(in srgb, var(--warn) 20%, var(--surface)); color: var(--warn); }
@media (max-width: 700px) { .tsh-choices { grid-template-columns: 1fr; } .tsh-legend { margin-left: 0; } }

/* Блок «Услуги» в боковом меню: свой цвет значков */
.nav-link[data-sec="svc"] .nav-ico { color: #ff9fb8; }
.nav-link[data-sec].active .nav-ico { color: var(--c-on-action); }

/* Упаковки одного товара: строки редактора в карточке и выбор единицы в строке чека */
.pk-row { padding: 12px; border: 1px solid var(--c-border, rgba(0, 0, 0, 0.12)); border-radius: 10px; display: grid; gap: 10px; }
.pk-new { display: grid; gap: 10px; padding-top: 4px; }
.cart-line .cl-units { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.cart-line .cl-units button { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--c-border, rgba(0, 0, 0, 0.18)); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.cart-line .cl-units button.on { background: var(--c-action, #1f2a5c); color: var(--c-on-action, #fff); border-color: transparent; }

/* Сравнение точек сети: полоска доли магазина в выручке сети за месяц */
.sh-share { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.sh-share .sh-bar { flex: 1; height: 8px; border-radius: 6px; background: var(--c-border, rgba(0, 0, 0, 0.1)); overflow: hidden; }
.sh-share .sh-bar i { display: block; height: 100%; border-radius: 6px; background: var(--c-action, #1f2a5c); }

/* Отчёт: продажи по часам */
.hr-box { display: grid; gap: 8px; }
.hr-bars { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; align-items: end; height: 120px; }
.hr-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; min-width: 0; }
.hr-col i { display: block; width: 100%; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--c-brand) 55%, var(--surface-3)); min-height: 2px; }
.hr-col i.peak { background: var(--c-action); }
.hr-col small { font-size: 10px; color: var(--muted); height: 12px; line-height: 12px; }
