/* ════════════════════════════════════════════════════════════════
   SellerPulse — кабинет селлера
   Зелёный — цвет денег и «в продаже»: хвойная боковая панель, изумрудные
   действия, мятные подложки. Цвет иконки в меню кодирует раздел. Единственный
   громкий элемент — хвойная панель с пульсом; всё остальное спокойное.
   (Имена --violet* исторические: это основной акцент, теперь изумрудный.)
   ════════════════════════════════════════════════════════════════ */

:root {
  /* база */
  --ink: #11241c;
  --ink-2: #3c5248;
  --ink-3: #6b7f76;
  --paper: #f3f6f4;
  --surface: #ffffff;
  --line: #e1e9e4;
  --line-2: #cbd8d0;
  --hover: #ebf2ee;
  --rail: #0f3b2e;
  --rail-2: #164a3a;
  --rail-ink: #b7d3c6;

  /* бренд и разделы */
  --violet: #0e8a5f;
  --violet-2: #0b7550;
  --violet-soft: #e3f3ea;
  --rose: #ff3d7f;
  --rose-ink: #c41d58;
  --rose-soft: #ffe4ee;
  --sun: #ffc233;
  --sun-ink: #8a5a00;
  --sun-soft: #fff3d1;
  --sky: #1b8fe8;
  --sky-ink: #0b62a8;
  --sky-soft: #e0f0fd;
  --orange: #e07a00;
  --orange-soft: #ffeedb;
  --teal: #0f9e9e;
  --teal-soft: #d9f5f3;

  /* статусы (только с иконкой/знаком) */
  --good: #0e9f6e;
  --good-soft: #dcf5ea;
  --bad: #e5484d;
  --bad-soft: #fde5e5;
  --warn: #c27400;
  --warn-soft: #fff1d6;

  /* серии графиков — проверены на дальтонизм (validator: ALL PASS) */
  --c1: #0e8a5f;
  --c2: #e07a00;
  --c3: #1b8fe8;
  --c4: #d62a66;
  --grid: #e5ece8;
  --indigo: #4f46e5;
  --indigo-soft: #e7e7ff;

  --section: var(--violet);
  --section-soft: var(--violet-soft);

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Onest', system-ui, sans-serif;

  --r-hero: 28px;
  --r-panel: 18px;
  --r-ctl: 12px;
  --shadow: 0 1px 0 rgba(15, 59, 46, 0.04), 0 8px 24px -12px rgba(15, 59, 46, 0.18);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--violet) 55%, white); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Каркас ─────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--rail) 248px, var(--paper) 248px); }
.rail {
  background: var(--rail);
  color: #fff;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  /* пунктов больше, чем влезает по высоте — меню прокручивается само, страница не обрезает его низ */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: #2fd889; display: grid; place-items: center; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--rail-ink); margin-top: -2px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 12px;
  color: #d6e8df; font-weight: 600; font-size: 14.5px;
  position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; color: #fff; }
.nav-item .pill {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08); color: var(--c, #fff); font-size: 16px; flex: none;
}
.nav-item.active { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-item.active .pill { background: var(--c); color: var(--rail); }
.nav-item .count {
  margin-left: auto; background: var(--rose); color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 0 7px; min-width: 22px; text-align: center;
}
.rail-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 13px; color: var(--rail-ink); }
.rail-foot strong { color: #fff; font-weight: 700; }
.rail-foot button { background: none; border: 0; color: var(--rail-ink); padding: 0; cursor: pointer; margin-top: 8px; }
.rail-foot button:hover { color: #fff; }

.main { min-width: 0; padding: 22px 32px 64px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title {
  font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -0.025em;
  line-height: 1.15; margin: 0; display: flex; align-items: center; gap: 12px;
}
.page-title .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--section); transform: rotate(45deg); flex: none; }
.page-sub { color: var(--ink-2); margin: 4px 0 0; max-width: 70ch; }
.topbar .spacer { flex: 1; }

/* ── Элементы управления ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer;
  background: var(--violet); color: #fff; white-space: nowrap;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--violet-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--hover); }
.btn.quiet { background: transparent; color: var(--ink-2); padding: 6px 10px; }
.btn.quiet:hover { background: var(--hover); color: var(--ink); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, white); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 10px; }

.input, .select, textarea.input {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-ctl);
  padding: 8px 12px; min-height: 38px; width: 100%; outline: none;
}
.input:focus, .select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .err { font-size: 12.5px; color: var(--bad); }
.grid-form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.check { display: inline-flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); margin-top: 2px; }

/* Сегментированный выбор периода */
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 3px; gap: 2px; }
.segmented button {
  white-space: nowrap;
  border: 0; background: transparent; padding: 6px 12px; border-radius: 11px; font-weight: 600; font-size: 13.5px;
  color: var(--ink-2); cursor: pointer;
}
.segmented button:hover { color: var(--ink); background: var(--hover); }
.segmented button[aria-pressed='true'] { background: var(--rail); color: #fff; }
.date-pair { display: inline-flex; align-items: center; gap: 6px; }
.date-pair input { width: 150px; min-height: 36px; padding: 5px 10px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button, .tabs .tab-link {
  border: 0; background: none; padding: 10px 12px; font-weight: 700; color: var(--ink-3);
  border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
}
.tabs button:hover, .tabs .tab-link:hover { color: var(--ink); }
.tabs button[aria-selected='true'], .tabs .tab-link[aria-selected='true'] { color: var(--ink); border-color: var(--section); }
.tabs .tab-count { background: var(--section-soft); color: var(--ink); border-radius: 999px; font-size: 12px; padding: 0 8px; }

/* ── Панели ────────────────────────────────────────────────────── */
.panel { background: var(--surface); border-radius: var(--r-panel); padding: 20px 22px; border: 1px solid var(--line); }
.panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 16.5px; font-weight: 800; letter-spacing: -0.01em; }
.panel-head .spacer { flex: 1; }
.panel-head p { margin: 0; color: var(--ink-3); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cols { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* ── Пульс (главный элемент обзора) ────────────────────────────── */
.pulse {
  position: relative; overflow: hidden;
  background: var(--violet); color: #fff; border-radius: var(--r-hero);
  padding: 26px 30px 18px;
  display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 28px; align-items: stretch;
}
.pulse::after {
  content: ''; position: absolute; inset: auto -120px -160px auto; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 61, 127, 0.45), transparent);
  pointer-events: none;
}
.pulse-label { font-weight: 600; color: #ddd3ff; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pulse-value { font-family: var(--font); font-weight: 800; font-size: clamp(40px, 4.6vw, 58px); letter-spacing: -0.03em; line-height: 1.05; margin: 8px 0 10px; }
.pulse-value small { font-size: 0.5em; font-weight: 700; margin-left: 4px; color: #ddd3ff; }
.pulse-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: #ece6ff; }
.pulse-meta b { color: #fff; }
.pulse .delta-chip { background: rgba(255, 255, 255, 0.16); color: #fff; }
.pulse-chart { position: relative; z-index: 1; min-height: 170px; }
.beat { width: 9px; height: 9px; border-radius: 50%; background: #39f0a6; box-shadow: 0 0 0 0 rgba(57, 240, 166, 0.7); animation: beat 2.2s infinite; flex: none; }
.beat.stale { background: var(--sun); animation: none; }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 rgba(57, 240, 166, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(57, 240, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(57, 240, 166, 0); }
}
@media (prefers-reduced-motion: reduce) { .beat { animation: none; } }

/* ── Показатели ────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-label { font-size: 13px; color: var(--ink-2); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.kpi-value { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; margin: 2px 0 4px; white-space: nowrap; }
.kpi-note { font-size: 12.5px; color: var(--ink-3); }

.delta-chip { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.delta-chip.up { background: var(--good-soft); color: #08744f; }
.delta-chip.down { background: var(--bad-soft); color: #b42328; }
.delta-chip.flat { background: var(--hover); color: var(--ink-2); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--hover); color: var(--ink-2); white-space: nowrap; }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.sun { background: var(--sun-soft); color: var(--sun-ink); }
.badge.sky { background: var(--sky-soft); color: var(--sky-ink); }
.badge.rose { background: var(--rose-soft); color: var(--rose-ink); }
.badge.good { background: var(--good-soft); color: #08744f; }
.badge.bad { background: var(--bad-soft); color: #b42328; }
.badge.warn { background: var(--warn-soft); color: #8a5300; }

.meter { height: 10px; background: var(--violet-soft); border-radius: 999px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--violet); border-radius: 999px; }
.meter.sun { background: var(--sun-soft); }
.meter.sun > i { background: var(--sun); }
.meter.rose { background: var(--rose-soft); }
.meter.rose > i { background: var(--rose); }
.meter.sky { background: var(--sky-soft); }
.meter.sky > i { background: var(--sky); }

/* ── Таблицы ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-weight: 700; font-size: 12.5px; color: var(--ink-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
  position: sticky; top: 0;
}
table.data th.r, table.data td.r { text-align: right; white-space: nowrap; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
table.data th button:hover { color: var(--ink); }
table.data th button:focus-visible { outline: 2px solid var(--violet); }
table.data td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
table.data tr.clickable { cursor: pointer; }
table.data tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--line-2); }
.cell-product { display: flex; align-items: center; gap: 12px; min-width: 240px; max-width: 420px; }
.cell-product .name { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell-product .sku { font-size: 12.5px; color: var(--ink-3); }
.thumb {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: var(--ink); background: var(--t, var(--violet-soft)); overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Графики ───────────────────────────────────────────────────── */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .tick { font-size: 11.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart.on-dark .tick { fill: #cfc4ff; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 9px 12px; font-size: 13px; min-width: 150px; box-shadow: 0 12px 30px -12px rgba(15, 59, 46, 0.35);
  transform: translate(-50%, calc(-100% - 12px)); z-index: 5; white-space: nowrap;
}
.tooltip .t-title { color: var(--ink-3); font-size: 12px; margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; }
.tooltip .t-row b { font-size: 14px; }
.tooltip .t-key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.tooltip .t-row span { color: var(--rail-ink); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend i.box { height: 10px; width: 10px; border-radius: 3px; }

/* ── Ленты событий ─────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; }
.feed-item .title { font-weight: 600; line-height: 1.4; }
.feed-item.unread .title { font-weight: 800; }
.feed-item .when { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }

/* ── Пустые состояния, ошибки, загрузка ────────────────────────── */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 10px 0 6px; color: var(--ink); }
.empty .icon { font-size: 30px; color: var(--section); }
.notice { border-radius: 14px; padding: 12px 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.notice.warn { background: var(--warn-soft); color: #6b4300; }
.notice.info { background: var(--sky-soft); color: #0b4a80; }
.notice.bad { background: var(--bad-soft); color: #8f1b20; }
.notice.good { background: var(--good-soft); color: #085c3f; }
.notice svg { flex: none; margin-top: 2px; }
.loading { opacity: 0.55; transition: opacity 0.2s; }
.skeleton { background: linear-gradient(90deg, #e9f0ec, #f5f9f7, #e9f0ec); background-size: 200% 100%; border-radius: 12px; animation: sk 1.4s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ── Выдвижная панель и модалка ────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(15, 59, 46, 0.35); z-index: 40; display: flex; justify-content: flex-end; }
.drawer { background: var(--paper); width: min(560px, 100%); height: 100%; overflow-y: auto; padding: 24px 26px 40px; box-shadow: -20px 0 50px -20px rgba(15, 59, 46, 0.4); animation: slide 0.18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: none; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.drawer-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.25; flex: 1; }

.toast-zone { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
/* уведомление: светлая карточка с цветной полосой слева — зелёной (готово) или красной (ошибка) */
.toast {
  background: var(--surface); color: var(--ink); padding: 12px 16px 12px 14px; border-radius: 12px; font-weight: 600;
  border: 1px solid var(--line); border-left: 4px solid var(--violet); box-shadow: 0 14px 34px -14px rgba(15, 59, 46, 0.4);
  max-width: 380px; display: flex; gap: 10px; align-items: center;
}
.toast.bad { background: var(--rose-soft); border-color: #f6c6d6; border-left-color: var(--rose); color: var(--rose-ink); }

/* ── Карточка-рекомендация (рынок) ─────────────────────────────── */
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.opp {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 16px;
  display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; transition: border-color 0.15s;
}
.opp:hover { border-color: var(--sun); }
.opp .opp-name { font-weight: 800; line-height: 1.3; }
.opp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.opp-stats b { display: block; font-size: 16px; color: var(--ink); }

.niche-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) 1fr 1fr 1fr 90px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.niche-row:last-child { border-bottom: 0; }
.score { font-family: var(--display); font-weight: 600; font-size: 20px; text-align: right; }

/* ── Вход ──────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--violet); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4vw, 52px); line-height: 1.05; letter-spacing: -0.03em; margin: auto 0 18px; max-width: 13ch; }
.auth-art p { color: #e2dbff; max-width: 46ch; font-size: 17px; margin: 0 0 28px; }
.auth-art .facts { display: flex; gap: 28px; flex-wrap: wrap; position: relative; z-index: 1; }
.auth-art .facts div { font-size: 14px; color: #ddd3ff; }
.auth-art .facts b { display: block; color: #fff; font-size: 20px; font-weight: 800; }
.auth-art svg.ecg { position: absolute; left: 0; right: 0; top: 36%; width: 100%; opacity: 0.9; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth-form h2 { font-family: var(--display); font-weight: 600; font-size: 26px; margin: 0 0 4px; }
.demo-hint { background: var(--sun-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: #5f4100; }

/* ── Адаптив ───────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  .cols-21, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .pulse { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  /* minmax(0, …): широкая таблица или график не растягивают страницу шире экрана */
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--paper); }
  /* на телефоне все колонки — одна под другой, в том числе заданные прямо в разметке */
  .cols { grid-template-columns: minmax(0, 1fr) !important; }
  .topbar > * { min-width: 0; max-width: 100%; }
  .panel { padding: 16px; }
  .topline { gap: 8px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 20px; white-space: normal; }
  .rail {
    position: sticky; top: auto; bottom: 0; height: auto; order: 2; flex-direction: row; overflow-x: auto;
    padding: 8px; gap: 2px; z-index: 30;
  }
  .rail .brand, .rail-foot { display: none; }
  .nav-item { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 6px 4px; min-width: 84px; text-align: center; }
  .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .topbar > div:first-child { width: 100%; }
  .nav-item .count { position: absolute; top: 2px; right: 6px; }
  .main { padding: 16px 16px 40px; }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 0 !important; border-top: 1px solid var(--line); }
  .kpi:nth-child(-n + 2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .pulse { padding: 20px; border-radius: 22px; }
  .page-title { font-size: 22px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 32px 24px; min-height: 340px; }
  .niche-row { grid-template-columns: 1fr 70px; }
  .niche-row .hide-sm { display: none; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
}

/* ── Загрузка файлов ───────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--line-2); border-radius: var(--r-panel); padding: 28px 20px; text-align: center;
  background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--section); background: var(--section-soft); }
.dropzone .icon { font-size: 30px; color: var(--section); }
.file-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--hover); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.layout-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.layout-opt { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; background: var(--surface); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.layout-opt[aria-pressed='true'] { border-color: var(--section); box-shadow: inset 0 0 0 1px var(--section); background: var(--section-soft); }
.layout-opt svg { display: block; }

/* ── Таблица отчёта «статьи по строкам» ────────────────────────── */
table.data tr.strong td { font-weight: 800; background: var(--section-soft); }
table.data td.neg { color: var(--bad); }

/* ── Печать: только содержимое листа сборки ───────────────────── */
@media print {
  body { background: #fff; }
  .shell { display: block; background: #fff; }
  .rail, .no-print, .topbar, .toast-zone { display: none !important; }
  .main { padding: 0; }
  .panel { border: 0; padding: 0; }
  .print-only { display: block !important; }
  table.data td, table.data th { padding: 6px 8px; }
  a { color: inherit; }
}
.print-only { display: none; }

/* ── Закупка 1688 ─────────────────────────────────────────────── */
.opp-wrap { position: relative; display: flex; }
.opp-wrap > .opp { flex: 1; padding-bottom: 52px; }
.opp-1688 {
  position: absolute; left: 16px; right: 16px; bottom: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: 1px solid color-mix(in srgb, var(--rose) 35%, transparent); background: var(--rose-soft); color: var(--rose-ink);
  font-weight: 700; font-size: 13px; padding: 7px 10px; cursor: pointer;
}
.opp-1688:hover { background: color-mix(in srgb, var(--rose) 18%, var(--surface)); }
.sourcing-hero {
  display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; border-radius: var(--r-panel); padding: 18px 20px;
  background: linear-gradient(120deg, var(--rail) 0%, var(--violet) 110%); color: #fff;
}
.sourcing-hero .kpi-label { color: rgba(255, 255, 255, 0.85); }
.sourcing-hero .hero-num { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1.05; margin: 4px 0; }
.sourcing-hero .small { color: rgba(255, 255, 255, 0.92); max-width: 420px; }
.sourcing-hero .hero-side { display: grid; gap: 10px; align-content: center; }
.sourcing-hero .hero-side span { display: block; color: rgba(255, 255, 255, 0.85); }
.sourcing-hero .hero-side b { font-size: 20px; }
.query-chip {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface-2, var(--hover)); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; color: var(--ink);
}
.query-chip:hover { border-color: var(--rose); }
.query-chip b { font-size: 15px; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; }
.form-grid > :first-child { grid-column: 1 / -1; }
.econ { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 12px 0 6px; }
.econ-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.econ-row span:last-child { font-variant-numeric: tabular-nums; }
.econ-row.total { border-bottom: 0; font-weight: 800; }
.econ-row.total.pos span:last-child { color: var(--good); }
.econ-row.total.neg span:last-child, .kpi-value.neg { color: var(--bad); }
@media (max-width: 640px) {
  .econ { grid-template-columns: minmax(0, 1fr); }
  .sourcing-hero .hero-num { font-size: 36px; }
  .candidate .kpis { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Анализ товара ─────────────────────────────────────────────── */
.analysis-head { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; align-items: start; }
.analysis-photo { width: 132px; height: 132px; border-radius: 16px; background: var(--hover); overflow: hidden; display: grid; place-items: center; }
.analysis-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.analysis-photo .thumb { width: 72px; height: 72px; font-size: 22px; }
.analysis-title { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; }
.analysis-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.analysis-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.analysis-charts section h3 { margin: 0 0 8px; font-size: 14px; font-weight: 800; }
.analysis-charts section .legend { margin-bottom: 6px; }
.analysis-table { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.analysis-table summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.analysis-table summary:hover { color: var(--ink); }
.analysis-table .table-wrap { margin-top: 10px; }
tr.muted-row td { color: var(--ink-3); }
tr.muted-row td b { color: var(--ink-2); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.watch-list { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 13.5px; }
.watch-chip .small { color: var(--ink-3); }
.watch-chip button { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; padding: 2px 6px; border-radius: 999px; }
.watch-chip button:hover { background: var(--hover); color: var(--ink); }
@media (max-width: 1100px) { .analysis-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .analysis-head { grid-template-columns: minmax(0, 1fr); }
  .analysis-photo { width: 100%; height: 200px; }
  .analysis-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Поиск поставщика по фото ──────────────────────────────────── */
.photo-search { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: start; padding: 12px; border-radius: 14px; background: var(--violet-soft); }
.photo-search-img { display: block; width: 112px; height: 112px; border-radius: 12px; overflow: hidden; background: #fff; }
.photo-search-img img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 860px) { .photo-search { grid-template-columns: minmax(0, 1fr); } .photo-search-img { width: 100%; height: 180px; } }

/* ── Магазин «как на Kaspi» ─────────────────────────────────────── */
.kaspi-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kaspi-facts > div { padding: 12px 14px; border-radius: 14px; background: var(--hover); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kaspi-facts span { font-size: 12.5px; color: var(--ink-3); }
.kaspi-facts b { font-size: 18px; font-weight: 800; }
.kaspi-facts small { font-size: 12px; color: var(--ink-3); }
.catalog-tree { display: flex; flex-direction: column; }
.catalog-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 6px 4px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ink); text-align: left; border-bottom: 1px solid var(--line); }
button.catalog-row { cursor: pointer; }
button.catalog-row:hover { background: var(--hover); }
.catalog-row.sub { padding-left: 22px; font-size: 13px; color: var(--ink-2); }
.catalog-caret { display: inline-block; width: 16px; color: var(--ink-3); }
@media (max-width: 1100px) { .kaspi-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .kaspi-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Цены и предзаказ ──────────────────────────────────────────── */
.pricing-table td { vertical-align: middle; }
.num-input { width: 110px; min-height: 34px; padding: 5px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.num-input.sm { width: 70px; }
.btn.bot-on { background: var(--violet-soft); color: var(--violet-2); border-color: color-mix(in srgb, var(--violet) 30%, white); }
.btn.bot-on:hover { background: color-mix(in srgb, var(--violet-soft) 70%, var(--violet) 10%); }
.bulk-bar { gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: var(--violet-soft); }
.install-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }

/* ── Товары: продажа, импорт, строка-форма ─────────────────────── */
.sale-switch {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); font: inherit; font-size: 12.5px; font-weight: 700;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sale-switch span {
  width: 30px; height: 18px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background 0.2s;
}
.sale-switch span::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(15, 59, 46, 0.3); transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.sale-switch.on { color: var(--violet-2); border-color: color-mix(in srgb, var(--violet) 35%, white); background: var(--violet-soft); }
.sale-switch.on span { background: var(--violet); }
.sale-switch.on span::after { transform: translateX(12px); }
.sale-switch:disabled { opacity: 0.55; cursor: wait; }
.import-panel { display: grid; gap: 10px; padding: 14px; margin-bottom: 14px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--paper); }
.import-panel textarea { min-height: 120px; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; }
.table-wrap.loading { opacity: 0.6; transition: opacity 0.2s; }
table.data tbody tr:hover td { background: #f6faf8; }
.row-form td { background: var(--violet-soft) !important; padding-top: 12px; padding-bottom: 12px; }
.list-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; animation: unfold 0.22s ease-out; }
.list-form > label:not(.check) { display: grid; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.list-form .check { align-self: center; font-size: 13.5px; font-weight: 600; }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }

/* ── Ниши ──────────────────────────────────────────────────────── */
.niche-hero {
  display: flex; gap: 20px 32px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 16px;
  border: 0; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--violet) 70%, #39f0a6) 0%, transparent 55%), linear-gradient(120deg, var(--rail) 0%, var(--rail-2) 60%, var(--violet) 130%);
}
.niche-hero .kpi-label, .niche-hero .muted { color: rgba(255, 255, 255, 0.82); }
.niche-hero .hero-num { font-family: var(--display); font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.niche-hero .btn { background: #fff; color: var(--rail); }
.niche-hero .btn:hover { background: var(--violet-soft); }
.niche-packs {
  display: grid; gap: 8px; max-width: 420px; padding: 14px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(6px);
}
.niche-packs .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.niche-packs .btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
@media (max-width: 640px) { .niche-hero .hero-num { font-size: 42px; } }

/* ── Реклама ───────────────────────────────────────────────────── */
.track-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--violet-2); background: var(--violet-soft); padding: 4px 11px 4px 9px; border-radius: 999px; }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: live 2s infinite; }
@keyframes live {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 760px) { .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Уведомления по дням ───────────────────────────────────────── */
.feed-day + .feed-day { margin-top: 18px; }
.feed-item .title a { color: inherit; }
.feed-item .title a:hover { color: var(--violet-2); }
.feed-day-title { margin: 0 0 2px; font-size: 13px; font-weight: 800; color: var(--ink-3); letter-spacing: 0.01em; }
.feed-item.unread { background: linear-gradient(90deg, var(--violet-soft), transparent 70%); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background-color: color-mix(in srgb, var(--violet) 18%, transparent); } }

/* ── Шапка: дата, колокольчик, профиль ─────────────────────────── */
.topline { display: flex; align-items: center; gap: 12px; margin: -6px 0 14px; min-height: 40px; }
.topline .spacer { flex: 1; }
.topline-date { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.topline-date::first-letter { text-transform: uppercase; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--rail); color: #5ee0a0; font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
}
.avatar:hover { text-decoration: none; box-shadow: 0 0 0 3px var(--violet-soft); }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 4px; }
.user-chip-text { display: grid; line-height: 1.25; }
.user-chip-text a { color: var(--ink); font-size: 13.5px; }
.user-chip-text a.user-plan { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.user-chip-text a:hover { color: var(--violet-2); text-decoration: none; }
.shop-select { width: auto; max-width: 220px; }
.logout { color: var(--ink-2); }
@media (max-width: 860px) { .user-chip-text, .logout span, .topline-date { display: none; } }
.bell { position: relative; }
.bell-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); font-size: 19px; transition: background 0.15s, color 0.15s, box-shadow 0.2s;
}
.bell-btn:hover, .bell-btn[aria-expanded='true'] { background: var(--violet-soft); color: var(--violet-2); }
.bell-btn.ring svg { animation: ring 1.1s ease-in-out; transform-origin: 50% 2px; }
@keyframes ring {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); }
  60% { transform: rotate(-7deg); } 75% { transform: rotate(3deg); }
}
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--rose); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--paper); animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes pop { from { transform: scale(0.3); } }
.bell-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 48px -16px rgba(15, 59, 46, 0.35); transform-origin: top right; animation: drop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bell-list { max-height: 420px; overflow-y: auto; }
.bell-item {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 11px 16px; color: var(--ink); border-bottom: 1px solid var(--line);
  animation: rise 0.3s ease-out both;
}
.bell-item:hover { background: var(--hover); text-decoration: none; }
.bell-item.new { background: linear-gradient(90deg, var(--violet-soft), transparent 80%); }
.bell-item .t { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.bell-item.new .t { font-weight: 800; }
.bell-item .when { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.bell-foot { display: block; text-align: center; padding: 11px; font-weight: 700; font-size: 13.5px; }
.bell-foot:hover { background: var(--hover); text-decoration: none; }

/* ── Заказы ────────────────────────────────────────────────────── */
.order-groups { margin-bottom: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg-count { margin-left: 6px; font-size: 11.5px; font-weight: 800; padding: 0 6px; border-radius: 999px; background: var(--hover); color: var(--ink-2); }
.segmented button[aria-pressed='true'] .seg-count { background: rgba(255, 255, 255, 0.2); color: #fff; }
.chev { transition: transform 0.25s ease; color: var(--ink-3); }
.chev.up { transform: rotate(180deg); }
table.data tr.row-open td { background: var(--hover); }
table.data tr.row-fresh td { animation: fresh-row 2.4s ease-out; }
@keyframes fresh-row { 0%, 30% { background: color-mix(in srgb, var(--violet) 22%, var(--surface)); } }
.order-detail { display: grid; gap: 8px; animation: unfold 0.22s ease-out; }
.order-line { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 12px; align-items: center; }
.order-line b { min-width: 90px; text-align: right; }

/* ── Распределение ниш (админка) ───────────────────────────────── */
.mix-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mix-cell { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.mix-input { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.mix-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.mix-bar i { display: block; height: 100%; background: var(--violet); border-radius: inherit; transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ── Обслуживание (админка) ────────────────────────────────────── */
.maint-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.maint-card { display: flex; flex-direction: column; gap: 8px; }

/* ── Движение: сервис живой, но не суетится ────────────────────── */
/* смена раздела: блоки поднимаются лесенкой */
.page-enter > * { animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.page-enter > :nth-child(2) { animation-delay: 0.06s; }
.page-enter > :nth-child(3) { animation-delay: 0.12s; }
.page-enter > :nth-child(4) { animation-delay: 0.18s; }
.page-enter > :nth-child(5) { animation-delay: 0.24s; }
.page-enter > :nth-child(n + 6) { animation-delay: 0.3s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
/* строки таблиц проявляются по очереди */
table.data tbody tr { animation: row-in 0.4s ease-out both; }
table.data tbody tr:nth-child(2) { animation-delay: 0.03s; } table.data tbody tr:nth-child(3) { animation-delay: 0.06s; }
table.data tbody tr:nth-child(4) { animation-delay: 0.09s; } table.data tbody tr:nth-child(5) { animation-delay: 0.12s; }
table.data tbody tr:nth-child(6) { animation-delay: 0.15s; } table.data tbody tr:nth-child(7) { animation-delay: 0.18s; }
table.data tbody tr:nth-child(n + 8) { animation-delay: 0.21s; }
@keyframes row-in { from { opacity: 0; transform: translateX(-6px); } }
/* графики: линии прорисовываются, заливка проявляется, столбики растут */
.chart path.ln { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart path.ar { animation: fade 1.1s ease-out 0.35s both; }
@keyframes fade { from { opacity: 0; } }
.chart path.br { transform-box: fill-box; transform-origin: 50% 100%; animation: grow 0.65s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
@keyframes grow { from { transform: scaleY(0); } }
/* логотип: пульс пробегает по линии раз в несколько секунд */
.beat-line { stroke-dasharray: 1; animation: beat-line 4.5s ease-in-out infinite; }
@keyframes beat-line { 0% { stroke-dashoffset: 1; } 35%, 100% { stroke-dashoffset: 0; } }
/* «Пульс» на обзоре: мягкое движение света */
.pulse::after { animation: glow 9s ease-in-out infinite alternate; }
@keyframes glow { to { transform: translate(-90px, -60px) scale(1.15); } }
/* отклик на действия */
.btn { position: relative; overflow: hidden; }
.btn:not(.ghost):not(.quiet):not(.danger)::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-120%); pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
}
.btn:not(.ghost):not(.quiet):not(.danger):hover::after { transform: translateX(120%); transition: transform 0.7s ease; }
.btn:active { transform: translateY(1px) scale(0.98); }
.nav-item .pill { transition: transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1), background 0.2s; }
.nav-item:hover .pill { transform: translateY(-1px) scale(1.08); }
.nav-item.active .pill { animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.kpi { transition: background 0.2s; }
.kpi:hover { background: color-mix(in srgb, var(--section-soft) 55%, transparent); }
.kpi:first-child { border-radius: var(--r-panel) 0 0 var(--r-panel); }
.kpi:last-child { border-radius: 0 var(--r-panel) var(--r-panel) 0; }
.toast { animation: toast-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
.kpi-value, .count-up { font-variant-numeric: tabular-nums; }

/* Админка: последнее действие с «Отменить» */
.undo-bar { padding: 10px 16px; margin-bottom: 16px; }
.undo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.undo-title { min-width: 0; overflow-wrap: anywhere; }

/* Вход: тёмно-зелёная «бумага кардиограммы», пульс прорисовывается один раз, рядом — пример обзора */
.auth-art {
  background-color: var(--rail);
  background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}
.auth-art p, .auth-art .facts div { color: var(--rail-ink); }
.auth-art svg.ecg path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s 0.2s cubic-bezier(0.5, 0, 0.2, 1) forwards; }
.auth-preview {
  position: absolute; z-index: 1; top: 96px; right: 48px; width: 270px; margin: 0; padding: 16px 18px 12px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 18px;
  backdrop-filter: blur(6px); animation: rise 0.7s 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.ap-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--rail-ink); }
.ap-dot { width: 8px; height: 8px; border-radius: 50%; background: #4fd18b; animation: live 2s infinite; }
.ap-big { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.ap-sub { font-size: 12.5px; color: var(--rail-ink); }
.ap-sub b { color: #7ff0b2; }
.ap-spark { display: block; width: 100%; height: 44px; margin: 8px 0 6px; }
.ap-spark path { fill: none; stroke: #7ff0b2; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s 1.1s ease-out forwards; }
.ap-rows div { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.ap-rows span { color: var(--rail-ink); }
.auth-preview figcaption { font-size: 11px; color: rgba(255, 255, 255, 0.45); margin-top: 6px; }
.auth-lead { margin: -8px 0 6px; color: var(--ink-3); }
@media (max-width: 1180px) { .auth-preview { display: none; } }

/* Проверка брендов: этапы */
.check-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: st; }
.check-steps li { counter-increment: st; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; border-radius: 999px; background: var(--hover); color: var(--ink-3); font-size: 13px; font-weight: 600; }
.check-steps li::before { content: counter(st); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--line-2); color: #fff; font-size: 11px; }
.check-steps li.done { background: var(--violet-soft); color: var(--violet-2); }
.check-steps li.done::before { content: '✓'; background: var(--violet); }
.check-steps li.now { background: var(--sky-soft); color: var(--sky-ink); }
.check-steps li.now::before { background: var(--sky); animation: live 1.6s infinite; }
.check-steps li.bad { background: var(--rose-soft); color: var(--rose-ink); }
.check-steps li.bad::before { content: '!'; background: var(--rose); }
.bad-text { color: var(--rose-ink); font-weight: 600; }

/* Раздел «скоро» и пометка в меню */
.soon { display: grid; justify-items: start; gap: 10px; max-width: 640px; padding: 28px; }
.soon h2 { margin: 0; font-family: var(--display); font-size: 22px; }
.soon p { margin: 0; color: var(--ink-2); }
.soon-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--section-soft, var(--hover)); color: var(--section, var(--violet)); font-size: 24px; }
.nav-soon { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: var(--rail-ink); }

/* Ниши: выбранные товары и массовый предзаказ */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: var(--sun-soft); }
.bulk-form { display: grid; gap: 10px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--line-2); border-radius: 14px; animation: unfold 0.25s ease-out; }
.bulk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bulk-head label, .inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.bulk-head .spacer { flex: 1; }

/* «Уменьшить движение» в системе: без сдвигов и покачиваний, только мягкое проявление */
@media (prefers-reduced-motion: reduce) {
  .page-enter > *, table.data tbody tr, .bell-item, .bell-pop, .order-detail, .list-form { animation: fade 0.3s ease-out both; }
  .toast, .feed-item.unread, .live-dot::before, .bell-btn.ring svg, .bell-count, .beat-line, .pulse::after,
  .nav-item.active .pill, .chart path.br, table.data tr.row-fresh td { animation: none; }
  .chart path.ln, .auth-art svg.ecg path, .ap-spark path { animation: none; stroke-dashoffset: 0; }
  .beat-line { stroke-dasharray: none; }
  .ap-dot, .check-steps li.now::before { animation: none; }
  .sale-switch, .sale-switch span, .sale-switch span::after, .btn::after, .nav-item .pill, .chev, .mix-bar i { transition: none; }
}

/* Товары: стрелка «открыть товар» рядом с названием */
.open-arrow { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 6px; color: var(--violet-2); background: var(--violet-soft); vertical-align: -4px; }
.open-arrow:hover { background: var(--violet); color: #fff; text-decoration: none; }

/* Поиск товаров администратора: фильтры в сетке */
.search-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; align-items: center; }

/* Обслуживание: управление задачами и ход работы */
.maint-title { all: unset; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.maint-title:disabled { cursor: default; }
.maint-title:hover:not(:disabled) { color: var(--violet-2); }
.run-controls { display: inline-flex; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 15px; }
.icon-btn:hover:not(:disabled) { border-color: var(--violet); color: var(--violet-2); }
.icon-btn.danger:hover:not(:disabled) { border-color: var(--rose); color: var(--rose-ink); }
.icon-btn:disabled { opacity: 0.45; cursor: default; }
.progress { height: 8px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--violet); border-radius: 999px; transition: width 0.4s ease; }
.run-log { max-height: 420px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--paper); font: 12.5px/1.6 ui-monospace, monospace; color: var(--ink-2); }

/* Админка: пользователи квадратиками — зелёный онлайн, красный офлайн */
.user-squares { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; padding-right: 2px; }
.user-square { aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; background: #e05267; cursor: default; }
.user-square.on { background: #1fae6a; box-shadow: 0 0 0 2px var(--violet-soft); }
.presence { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e05267; vertical-align: 0; }
.presence.on { background: #1fae6a; }

/* Остаток по тарифу в шапке раздела */
.limits { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.limit { position: relative; overflow: hidden; display: grid; gap: 1px; min-width: 150px; padding: 7px 12px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12px; line-height: 1.25; }
.limit span { color: var(--ink-3); }
.limit b { font-size: 13px; }
.limit i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--violet); }
.limit.low i { background: var(--warn); }
.limit.low b { color: var(--warn); }
.limit.out { border-color: color-mix(in srgb, var(--bad) 45%, white); background: var(--bad-soft); }
.limit.out i { background: var(--bad); }
.limit.out b { color: #b42328; }
@media (max-width: 720px) { .limits { justify-content: flex-start; } .limit { min-width: 0; flex: 1 1 140px; } }

/* Переключатель «Кабинет / Администрация» — только у администраторов сервиса */
.mode-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.mode-switch a:hover { color: var(--ink); background: var(--hover); }
.mode-switch a.on { background: var(--rail); color: #fff; }
@media (max-width: 720px) { .mode-switch a { padding: 6px 9px; } .mode-switch svg { display: none; } }
.mode-switch .short { display: none; }
@media (max-width: 480px) { .mode-switch .full { display: none; } .mode-switch .short { display: inline; } }

/* Журнал выдачи: группа клиента сворачивается */
.journal-group { padding: 0; }
.journal-group > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; cursor: pointer; list-style: none; }
.journal-group > summary::-webkit-details-marker { display: none; }
.journal-group > summary::before { content: '▸'; color: var(--ink-3); transition: transform .15s; }
.journal-group[open] > summary::before { transform: rotate(90deg); }
.journal-group[open] > summary { border-bottom: 1px solid var(--line); }
.journal-group .table-wrap { padding: 0 8px 8px; }
.tabs .tab-link { text-decoration: none; display: inline-block; }
.chip-x { border: 0; background: none; padding: 0 0 0 4px; cursor: pointer; color: inherit; display: inline-flex; vertical-align: -2px; }
/* итог над графиком */
.chart-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.chart-total b { font-size: 22px; letter-spacing: -0.01em; }

/* Тарифы: скидка первого месяца — заметно */
.plan-deal { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--good-soft, #e3f7ec); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.plan-deal-pct { justify-self: start; background: var(--good); color: #fff; font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.plan-deal-price { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.plan-deal-price s { font-size: 16px; font-weight: 600; color: var(--ink-3); }

/* «Каталог без продавцов → Сбор»: сбор и перепроверка — две группы в один ряд */
.collect-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.collect-groups > section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--hover); }
.collect-groups .group-title { margin: 0; font-size: 18px; }
.collect-groups > section > p { margin: -8px 0 0; }
/* в половине ширины внутренние пары колонок встают друг под друга */
.collect-groups .cols-2 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1100px) { .collect-groups { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .collect-groups > section { padding: 10px; } }
