/* ============================================================
   ОРБИТА.АГЕНТ — демо. Синяя палитра застройщика (--vx-primary: #0a66c2).
   Все цвета — через CSS-переменные --vx-*. Тёмная тема: html.dark.
   Кабинет менеджера и дашборд следуют глобальной теме наравне
   с клиентским приложением.
   ============================================================ */

:root {
  /* Нативные контролы и скроллбары под тему. */
  color-scheme: light;
  --vx-bg: #f4f6f9;
  --vx-bg-solid: #f4f6f9;
  --vx-bg-alt: #eaeef4;
  --vx-surface: #ffffff;
  --vx-surface-hover: #f3f7fc;
  --vx-glass: rgba(255, 255, 255, 0.82);
  --vx-glass-border: rgba(15, 23, 42, 0.08);
  --vx-text: #0f172a;
  --vx-text-secondary: #475569;
  --vx-text-muted: #94a3b8;
  --vx-border: #e0e6ee;
  --vx-border-light: #edf1f6;
  --vx-primary: #0a66c2;
  --vx-primary-light: rgba(10, 102, 194, 0.1);
  --vx-primary-hover: #084d92;
  /* Моно-тональный градиент одного оттенка — ТОЛЬКО для hero-карточки кошелька. */
  --vx-primary-gradient: linear-gradient(135deg, #0a66c2 0%, #1d4ed8 100%);
  --vx-primary-glow: 0 2px 8px rgba(10, 102, 194, 0.18);
  --vx-accent: #4338ca;
  --vx-accent-light: rgba(67, 56, 202, 0.1);
  --vx-success: #15803d;
  --vx-success-light: rgba(21, 128, 61, 0.12);
  --vx-warning: #b45309;
  --vx-warning-light: rgba(180, 83, 9, 0.13);
  --vx-danger: #b91c1c;
  --vx-danger-light: rgba(185, 28, 28, 0.12);
  --vx-info: #1d4ed8;
  --vx-info-light: rgba(29, 78, 216, 0.12);
  --vx-radius: 10px;
  --vx-radius-sm: 6px;
  --vx-radius-lg: 12px;
  --vx-radius-xl: 14px;
  --vx-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --vx-shadow-md: 0 8px 28px rgba(15, 23, 42, 0.1);
  --vx-shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.14);
  --vx-shadow-glow: 0 2px 8px rgba(15, 23, 42, 0.1);
  --vx-spring: cubic-bezier(0.2, 0, 0, 1);
}

html.dark {
  color-scheme: dark;
  --vx-bg: linear-gradient(180deg, #0c1322 0%, #080d18 100%);
  --vx-bg-solid: #0a0f1a;
  --vx-bg-alt: #161d2c;
  --vx-surface: #141b29;
  --vx-surface-hover: #1c2436;
  --vx-glass: rgba(20, 27, 41, 0.72);
  --vx-glass-border: rgba(148, 163, 184, 0.12);
  --vx-text: #f1f5f9;
  --vx-text-secondary: #cbd5e1;
  --vx-text-muted: #76839c;
  --vx-border: #27324c;
  --vx-border-light: #1c2539;
  --vx-primary: #63a4ff;
  --vx-primary-light: rgba(99, 164, 255, 0.16);
  --vx-primary-hover: #8dbdff;
  --vx-primary-gradient: linear-gradient(135deg, #1a5fb4 0%, #3b82f6 100%);
  --vx-primary-glow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --vx-accent: #a78bfa;
  --vx-accent-light: rgba(167, 139, 250, 0.16);
  --vx-success: #4ade80;
  --vx-success-light: rgba(74, 222, 128, 0.16);
  --vx-warning: #e0a83a;
  --vx-warning-light: rgba(224, 168, 58, 0.16);
  --vx-danger: #ea6b6b;
  --vx-danger-light: rgba(234, 107, 107, 0.16);
  --vx-info: #6c9ff0;
  --vx-info-light: rgba(108, 159, 240, 0.16);
  --vx-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  --vx-shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --vx-shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --vx-shadow-glow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--vx-bg);
  /* Фон привязан к вьюпорту: иначе градиент упирается в height:100% body
     и при прокрутке повторяется — видна горизонтальная граница заливки. */
  background-attachment: fixed;
  color: var(--vx-text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
#app { min-height: 100%; }
button { font-family: inherit; }
.tnum { font-feature-settings: 'tnum'; }

/* Заливки под цвет колонки канбана / стадии воронки */
.bg-primary { background: var(--vx-primary); }
.bg-info { background: var(--vx-info); }
.bg-success { background: var(--vx-success); }
.bg-danger { background: var(--vx-danger); }
.bg-warning { background: var(--vx-warning); }
.bg-muted { background: var(--vx-text-muted); }

/* ── Top demo nav ── */
.demo-nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--vx-glass); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--vx-glass-border);
}
.demo-nav .brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; letter-spacing: -0.02em; flex-shrink: 0; }
.demo-nav .brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--vx-primary); display: grid; place-items: center; box-shadow: var(--vx-primary-glow); flex-shrink: 0; }
.demo-nav .brand .badge { font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--vx-text-muted); background: var(--vx-bg-alt); border: 1px solid var(--vx-border); padding: 2px 6px; border-radius: 5px; margin-left: 2px; }
/* min-width:0 + overflow-x — иначе на промежуточной ширине (≈560–700px)
   сегментированный переключатель не даёт nav сжаться и кнопки справа
   выталкивают страницу в горизонтальный скролл. */
.demo-nav .seg { display: flex; gap: 4px; background: var(--vx-bg-alt); border-radius: 11px; padding: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.demo-nav .seg::-webkit-scrollbar { display: none; }
.demo-nav .seg button {
  border: none; background: transparent; cursor: pointer;
  padding: 7px 13px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  color: var(--vx-text-muted); display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s ease; white-space: nowrap;
}
.demo-nav .seg button.active { background: var(--vx-surface); color: var(--vx-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.demo-nav .spacer { flex: 1; min-width: 0; }
.demo-nav .icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--vx-glass-border); background: var(--vx-glass); color: var(--vx-text-secondary); display: grid; place-items: center; cursor: pointer; transition: all 0.15s ease; flex-shrink: 0; }
.demo-nav .icon-btn:hover { color: var(--vx-primary); border-color: var(--vx-primary); }
/* Выход из демо на сайт. Вид берёт у .icon-btn, но растянут под подпись —
   правило обязано идти ПОСЛЕ .icon-btn, иначе его width/display перебьют. */
.demo-nav .site-btn {
  width: auto; padding: 0 12px; gap: 6px;
  display: inline-flex; align-items: center;
  font-size: 12.5px; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}

/* ── Disclaimer ribbon ── */
.demo-ribbon {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11.5px; text-align: center; padding: 6px 10px;
  color: var(--vx-text-secondary); background: var(--vx-bg-alt);
  font-weight: 700; letter-spacing: 0.01em; border-bottom: 1px solid var(--vx-glass-border);
}
.demo-ribbon .pill { width: 7px; height: 7px; border-radius: 50%; background: var(--vx-primary); box-shadow: 0 0 0 3px var(--vx-primary-light); }

/* ── Shared blocks ── */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.title { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; color: var(--vx-text); }
.title svg { color: var(--vx-primary); }
.sub { font-size: 13px; color: var(--vx-text-muted); margin: 0; }

.btn-prime {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--vx-primary); color: #fff; border: none;
  padding: 11px 18px; border-radius: var(--vx-radius); font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: var(--vx-primary-glow); transition: transform 0.2s var(--vx-spring), filter 0.2s ease;
}
.btn-prime:hover { filter: brightness(1.06); }
.btn-prime:active { transform: scale(0.97); }
.btn-prime:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; filter: grayscale(0.3); }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--vx-glass); border: 1px solid var(--vx-border);
  color: var(--vx-text-secondary); padding: 10px 16px; border-radius: var(--vx-radius);
  font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.18s ease;
}
.btn-ghost:hover { color: var(--vx-primary); border-color: var(--vx-primary); }
.btn-ghost:active { transform: scale(0.97); }
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--vx-danger-light); border: 1px solid transparent; color: var(--vx-danger);
  padding: 10px 16px; border-radius: var(--vx-radius); font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.18s ease;
}
.btn-danger:hover { background: var(--vx-danger); color: #fff; }
.btn-success {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--vx-success); border: none; color: #fff;
  padding: 10px 16px; border-radius: var(--vx-radius); font-weight: 700; font-size: 13px; cursor: pointer; transition: all 0.18s ease;
  box-shadow: 0 8px 20px rgba(21, 128, 61, 0.2);
}
.btn-success:hover { filter: brightness(1.06); }
.btn-success:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; filter: grayscale(0.4); }

/* Tabs (разделы кабинета) */
.tabs { display: flex; gap: 4px; background: var(--vx-bg-alt); border-radius: 12px; padding: 4px; margin-bottom: 16px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 15px; background: transparent; border: none; border-radius: 8px; color: var(--vx-text-muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.15s ease; }
.tab.active { background: var(--vx-surface); color: var(--vx-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.07); }
.cnt { background: var(--vx-danger); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; font-feature-settings: 'tnum'; }

/* Toolbar / search / chips */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--vx-surface); border: 1.5px solid var(--vx-border); border-radius: 10px; padding: 0 12px; height: 42px; flex: 1; min-width: 200px; max-width: 380px; transition: all 0.2s ease; }
.search-box:focus-within { border-color: var(--vx-primary); box-shadow: 0 0 0 3px var(--vx-primary-light); }
.search-box input { flex: 1; border: none; background: transparent; outline: none; color: var(--vx-text); font-family: inherit; font-size: 15px; min-width: 0; }
.search-box svg { color: var(--vx-text-muted); flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; background: var(--vx-surface); border: 1px solid var(--vx-border); color: var(--vx-text-secondary); border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s ease; }
.chip:hover { border-color: var(--vx-primary); color: var(--vx-primary); }
.chip.active { background: var(--vx-primary); color: #fff; border-color: transparent; box-shadow: var(--vx-primary-glow); }
.chip .c-cnt { font-feature-settings: 'tnum'; opacity: 0.85; }
/* точка «ждёт подтверждения» на чипе брокера */
.chip .c-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--vx-warning); box-shadow: 0 0 0 2px var(--vx-warning-light); }
.chip.active .c-dot { background: #fff; box-shadow: none; }

/* Rows */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 13px; padding: 12px 6px; border-bottom: 1px solid var(--vx-border-light); border-radius: 10px; transition: background 0.15s ease; }
.row:last-child { border-bottom: none; }
.row-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.row-icon.green { background: var(--vx-success-light); color: var(--vx-success); }
.row-icon.red { background: var(--vx-danger-light); color: var(--vx-danger); }
.row-icon.indigo { background: var(--vx-primary-light); color: var(--vx-primary); }
.row-icon.purple { background: var(--vx-accent-light); color: var(--vx-accent); }
.row-icon.blue { background: var(--vx-info-light); color: var(--vx-info); }
.row-icon.amber { background: var(--vx-warning-light); color: var(--vx-warning); }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 700; color: var(--vx-text); }
.row-meta { font-size: 12px; color: var(--vx-text-muted); display: flex; gap: 6px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.row-amt { text-align: right; flex-shrink: 0; }
.amt-main { font-size: 14px; font-weight: 700; font-feature-settings: 'tnum'; color: var(--vx-text); white-space: nowrap; }
.amt-main.pos { color: var(--vx-success); }
.amt-main.neg { color: var(--vx-danger); }
.sr-val.pos { color: var(--vx-success); }
.sr-val.neg { color: var(--vx-danger); }

/* Status pills */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.status.s-primary { background: var(--vx-primary-light); color: var(--vx-primary); }
.status.s-info { background: var(--vx-info-light); color: var(--vx-info); }
.status.s-warning { background: var(--vx-warning-light); color: var(--vx-warning); }
.status.s-success { background: var(--vx-success-light); color: var(--vx-success); }
.status.s-danger { background: var(--vx-danger-light); color: var(--vx-danger); }
.status.s-muted { background: var(--vx-bg-alt); color: var(--vx-text-muted); }

/* Empty */
.empty { text-align: center; padding: 48px 20px; color: var(--vx-text-muted); }
.empty svg { opacity: 0.3; margin-bottom: 12px; }
.empty p { font-size: 14px; margin: 0; }

/* Toast */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 300; pointer-events: none; padding: 0 16px; }
.toast { display: inline-flex; align-items: center; gap: 9px; background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 700; box-shadow: var(--vx-shadow-lg); max-width: 92vw; animation: toast-in 0.35s var(--vx-spring); }
.toast.success { background: var(--vx-success); color: #fff; }
.toast.danger { background: var(--vx-danger); color: #fff; }
.toast.sync { background: var(--vx-primary); color: #fff; }
.toast svg { flex-shrink: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.94); } to { opacity: 1; transform: none; } }

.fade-up { animation: fade-up 0.35s var(--vx-spring); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Panel */
.panel { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); padding: 20px; }
.panel h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.panel h2 svg { color: var(--vx-primary); }
.panel h2 .h2-right { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--vx-text-muted); display: inline-flex; align-items: center; }

/* ============================================================
   PWA БРОКЕРА (mobile)
   ============================================================ */
.pwa { max-width: 460px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; position: relative; }
.pwa-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; background: var(--vx-glass); backdrop-filter: blur(14px); border-bottom: 1px solid var(--vx-glass-border); }
.pwa-head .brand-row { display: flex; align-items: center; gap: 10px; }
.pwa-head .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--vx-primary); display: grid; place-items: center; box-shadow: var(--vx-primary-glow); }
.pwa-head .hello { font-size: 12px; color: var(--vx-text-muted); font-weight: 600; }
.pwa-head .name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.pwa-head .bell { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--vx-glass-border); background: var(--vx-surface); display: grid; place-items: center; color: var(--vx-text-secondary); position: relative; cursor: pointer; }
.pwa-body { flex: 1; padding: 18px 16px 100px; }

/* Login */
.login-wrap { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px calc(32px + env(safe-area-inset-bottom)); max-width: 460px; margin: 0 auto; }
.login-logo { width: 64px; height: 64px; border-radius: var(--vx-radius-xl); background: var(--vx-primary); display: grid; place-items: center; box-shadow: var(--vx-primary-glow); margin-bottom: 22px; }
.login-title { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 6px; }
.login-sub { font-size: 14px; color: var(--vx-text-muted); margin: 0 0 26px; line-height: 1.5; }
.login-hint { display: flex; align-items: center; gap: 8px; background: var(--vx-primary-light); color: var(--vx-primary); border-radius: 12px; padding: 11px 14px; font-size: 12.5px; font-weight: 700; margin-top: 14px; }

/* Hero кошелька — единственная поверхность с моно-тональным градиентом */
.hero-card { position: relative; overflow: hidden; background: var(--vx-primary-gradient); color: #fff; border-radius: var(--vx-radius-xl); padding: 22px; box-shadow: var(--vx-shadow); }
.hero-card .hc-lbl { font-size: 12px; font-weight: 600; opacity: 0.85; display: inline-flex; align-items: center; gap: 6px; }
.hero-card .hc-amt { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 0; font-feature-settings: 'tnum'; line-height: 1; }
.hero-card .hc-amt span { font-size: 18px; opacity: 0.85; margin-left: 4px; }
.hero-card .hc-meta { font-size: 12.5px; opacity: 0.8; margin-top: 8px; }
.hero-card .hc-badge { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; background: rgba(255,255,255,0.18); backdrop-filter: blur(6px); padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.hero-card .hc-badge .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.8s ease-in-out infinite; }

/* Баннер подтверждения выплаты (фаза 2 двухфазного списания) */
.pay-banner { background: var(--vx-surface); border: 1.5px solid var(--vx-warning); border-radius: var(--vx-radius-lg); padding: 16px; margin-top: 16px; box-shadow: var(--vx-shadow); }
.pay-banner .pb-top { display: flex; align-items: center; gap: 12px; }
.pay-banner .pb-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--vx-warning-light); color: var(--vx-warning); display: grid; place-items: center; flex-shrink: 0; }
.pay-banner .pb-title { font-size: 14.5px; font-weight: 700; }
.pay-banner .pb-sub { font-size: 11.5px; color: var(--vx-text-muted); margin-top: 2px; }
.pay-banner .pb-amt { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; font-feature-settings: 'tnum'; margin: 14px 0 6px; }
.pay-banner .pb-note { font-size: 12px; color: var(--vx-text-secondary); line-height: 1.45; margin-bottom: 14px; }

/* Мини-карточки (прогноз / выплачено) */
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.mini-card { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); padding: 14px; }
.mini-card .mc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.mini-card .mc-ic.green { background: var(--vx-success-light); color: var(--vx-success); }
.mini-card .mc-ic.indigo { background: var(--vx-primary-light); color: var(--vx-primary); }
.mini-card .mc-lbl { font-size: 11px; color: var(--vx-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.mini-card .mc-num { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-top: 3px; font-feature-settings: 'tnum'; }
.mini-card .mc-sub { font-size: 11px; color: var(--vx-text-muted); margin-top: 3px; line-height: 1.35; }

.section-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; margin: 26px 0 12px; display: flex; align-items: center; justify-content: space-between; }
.section-title .more { font-size: 12.5px; font-weight: 700; color: var(--vx-primary); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.section-title .cnt-inline { font-size: 12px; color: var(--vx-text-muted); font-weight: 700; }

/* История операций */
.day-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--vx-text-muted); margin: 14px 0 8px; }
.op-row { display: flex; align-items: center; gap: 12px; background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }

/* Карточка лида (PWA) */
.lead-card { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); padding: 14px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s var(--vx-spring); }
.lead-card:hover { border-color: var(--vx-primary); box-shadow: var(--vx-shadow); }
.lead-card:active { transform: scale(0.99); }
.lead-card .lc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lead-card .lc-id { font-size: 11px; font-weight: 700; color: var(--vx-text-muted); font-feature-settings: 'tnum'; }
.lead-card .lc-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.lead-card .lc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--vx-text-muted); margin-top: 5px; }
.lead-card .lc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.lead-card .lc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--vx-border-light); }
.lead-card .lc-earned { font-size: 17px; font-weight: 700; font-feature-settings: 'tnum'; color: var(--vx-success); }
.lead-card .lc-base { font-size: 11px; color: var(--vx-text-muted); margin-top: 1px; }
.lead-card .lc-pct { font-size: 13px; font-weight: 700; color: var(--vx-primary); font-feature-settings: 'tnum'; }

/* QR-карточка. Полотно всегда светлое: тёмный QR на тёмном фоне не читается
   сканером, поэтому здесь белый фон захардкожен намеренно. */
.qr-card { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); padding: 18px; text-align: center; }
.qr-box { width: 100%; max-width: 240px; margin: 0 auto 14px; background: #fff; border-radius: 12px; padding: 12px; }
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-name { font-size: 15px; font-weight: 700; }
.qr-link { font-size: 12.5px; color: var(--vx-primary); font-weight: 700; margin-top: 4px; word-break: break-all; }

/* Калькулятор бонуса */
.calc-card { background: var(--vx-primary); color: #fff; border-radius: var(--vx-radius-lg); padding: 18px; box-shadow: var(--vx-primary-glow); margin-bottom: 18px; }
.calc-lbl { font-size: 12px; opacity: 0.85; font-weight: 700; }
.calc-num { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 0; font-feature-settings: 'tnum'; line-height: 1; }
.calc-num span { font-size: 16px; opacity: 0.85; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; margin-top: 12px; opacity: 0.92; }
.calc-row b { font-feature-settings: 'tnum'; text-align: right; }

/* Wizard head */
.wiz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.wiz-back { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--vx-border); background: var(--vx-surface); color: var(--vx-text-secondary); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.wiz-stepnum { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }

/* Fields */
.field-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--vx-text-muted); margin: 14px 0 6px; display: block; }
.input { width: 100%; height: 48px; border: 1.5px solid var(--vx-border); background: var(--vx-surface); border-radius: 12px; padding: 0 14px; font-size: 16px; font-family: inherit; color: var(--vx-text); outline: none; transition: all 0.18s ease; }
.input:focus { border-color: var(--vx-primary); box-shadow: 0 0 0 3px var(--vx-primary-light); }
.input.input-error { border-color: var(--vx-danger); }
.input.input-error:focus { box-shadow: 0 0 0 3px var(--vx-danger-light); }
select.input { appearance: none; cursor: pointer; }
.field-error { font-size: 12px; font-weight: 600; color: var(--vx-danger); margin: 6px 0 0; }
textarea.input { height: auto; min-height: 76px; padding: 12px 14px; resize: vertical; line-height: 1.5; }

.guard-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--vx-warning); background: var(--vx-warning-light); padding: 9px 12px; border-radius: 10px; margin-top: 10px; font-weight: 700; line-height: 1.4; }
.guard-note svg { flex-shrink: 0; }

/* Bottom nav */
.bottom-nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 460px; display: flex; justify-content: space-around; align-items: stretch; background: var(--vx-glass); backdrop-filter: blur(18px); border-top: 1px solid var(--vx-glass-border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 30; }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: none; background: transparent; color: var(--vx-text-muted); font-size: 10.5px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color 0.15s ease; position: relative; }
.bn-item.active { color: var(--vx-primary); }
.bn-item .bn-badge { position: absolute; top: 2px; right: 50%; margin-right: -18px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 100px; background: var(--vx-danger); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.bn-item.apply .bn-fab { width: 50px; height: 50px; margin-top: -22px; border-radius: 50%; background: var(--vx-primary); color: #fff; display: grid; place-items: center; box-shadow: var(--vx-primary-glow); }

/* Onboarding */
.onboard { background: var(--vx-surface); border: 1px solid var(--vx-primary); border-radius: var(--vx-radius-lg); padding: 16px; margin-bottom: 18px; position: relative; box-shadow: var(--vx-shadow-glow); }
.onboard .ob-close { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 8px; border: none; background: var(--vx-bg-alt); color: var(--vx-text-muted); display: grid; place-items: center; cursor: pointer; }
.onboard .ob-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.onboard .ob-title svg { color: var(--vx-primary); }
.onboard .ob-step { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--vx-text-secondary); padding: 5px 0; line-height: 1.4; }
.onboard .ob-num { width: 20px; height: 20px; border-radius: 50%; background: var(--vx-primary-light); color: var(--vx-primary); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }

/* Profile */
.prof-head { display: flex; align-items: center; gap: 14px; padding: 6px 0 18px; }
.prof-ava { width: 60px; height: 60px; border-radius: 50%; background: var(--vx-primary); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; box-shadow: var(--vx-primary-glow); }
.prof-list { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); overflow: hidden; }
.prof-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--vx-border-light); font-size: 14px; }
.prof-row:last-child { border-bottom: none; }
.prof-row .pr-ic { color: var(--vx-text-muted); flex-shrink: 0; }
.prof-row .pr-lbl { flex: 1; font-weight: 600; min-width: 0; }
.prof-row .pr-val { color: var(--vx-text-muted); font-weight: 700; font-feature-settings: 'tnum'; text-align: right; }
.switch { width: 44px; height: 26px; border-radius: 100px; background: var(--vx-border); position: relative; cursor: pointer; transition: background 0.2s ease; flex-shrink: 0; }
.switch.on { background: var(--vx-primary); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--vx-spring); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.switch.on::after { transform: translateX(18px); }

/* Stepper (стадии лида) */
.stepper { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); padding: 18px 18px 6px; }
.step { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.step:last-child { padding-bottom: 6px; }
.step-line { position: absolute; left: 16px; top: 34px; bottom: -2px; width: 2px; background: var(--vx-border); }
.step.done .step-line { background: var(--vx-success); }
.step.active .step-line { background: linear-gradient(180deg, var(--vx-primary) 0%, var(--vx-border) 100%); }
.step-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; z-index: 1; border: 1.5px solid var(--vx-border); background: var(--vx-bg-alt); color: var(--vx-text-muted); }
.step.done .step-dot { background: var(--vx-success-light); border-color: var(--vx-success); color: var(--vx-success); }
.step.active .step-dot { background: var(--vx-primary-light); border-color: var(--vx-primary); color: var(--vx-primary); box-shadow: 0 0 0 4px var(--vx-primary-light); }
.step.rejected .step-dot { background: var(--vx-danger-light); border-color: var(--vx-danger); color: var(--vx-danger); }
.step-body { flex: 1; padding-top: 5px; min-width: 0; }
.step-name { font-size: 14px; font-weight: 700; color: var(--vx-text); }
.step.pending .step-name { color: var(--vx-text-muted); font-weight: 600; }
.step.active .step-name { color: var(--vx-primary); }
.step.rejected .step-name { color: var(--vx-danger); }
.step-meta { font-size: 11.5px; color: var(--vx-text-muted); margin-top: 2px; }
.step-badge { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 6px; background: var(--vx-primary-light); color: var(--vx-primary); }

/* Grid карточек (деталь лида) */
.contract-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 14px; }
.cg-item { background: var(--vx-bg-alt); border-radius: 12px; padding: 12px 14px; }
.cg-lbl { font-size: 11px; color: var(--vx-text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.cg-val { font-size: 17px; font-weight: 700; margin-top: 3px; font-feature-settings: 'tnum'; }

/* Развилка / опции */
.pay-option { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: var(--vx-surface); border: 1.5px solid var(--vx-border); border-radius: var(--vx-radius-lg); padding: 14px; margin-bottom: 10px; cursor: pointer; transition: all 0.18s var(--vx-spring); font-family: inherit; }
.pay-option:hover:not(:disabled) { border-color: var(--vx-primary); box-shadow: var(--vx-shadow); transform: translateY(-1px); }
.pay-option:active:not(:disabled) { transform: scale(0.99); }
.pay-option:disabled { opacity: 0.5; cursor: not-allowed; }
.po-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--vx-primary-light); color: var(--vx-primary); display: grid; place-items: center; flex-shrink: 0; }
.po-ic.accent { background: var(--vx-accent-light); color: var(--vx-accent); }
.po-body { flex: 1; min-width: 0; }
.po-name { font-size: 14px; font-weight: 700; color: var(--vx-text); }
.po-sub { font-size: 12px; color: var(--vx-text-muted); margin-top: 2px; line-height: 1.4; }

/* ── Нижний лист (деталь лида) ── */
.sheet-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; animation: fade-in 0.2s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.chat-sheet { width: 100%; max-width: 460px; max-height: 88vh; background: var(--vx-bg-solid); border-radius: 16px 16px 0 0; display: flex; flex-direction: column; box-shadow: var(--vx-shadow-lg); animation: sheet-up 0.32s var(--vx-spring); padding-bottom: env(safe-area-inset-bottom); }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--vx-border); }
.chat-head-info { flex: 1; min-width: 0; }
.chat-head-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.chat-head-role { font-size: 12px; color: var(--vx-text-muted); display: inline-flex; align-items: center; gap: 6px; margin-top: 1px; }
.chat-close { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--vx-border); background: var(--vx-surface); color: var(--vx-text-secondary); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.pay-head-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--vx-primary-light); color: var(--vx-primary); display: grid; place-items: center; flex-shrink: 0; }
.pay-body { padding: 18px 16px 22px; overflow-y: auto; }
.pay-body .section-title:first-child { margin-top: 0; }

/* ── Чат ── */
.chat-body { display: flex; flex-direction: column; gap: 4px; padding: 16px; overflow-y: auto; }
.chat-body--panel { max-height: 300px; border: 1px solid var(--vx-border-light); border-radius: 12px; background: var(--vx-bg-alt); padding: 12px; }
.chat-msg { display: flex; flex-direction: column; max-width: 82%; margin-bottom: 8px; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-msg.them { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.chat-msg.them .chat-bubble { background: var(--vx-surface); border: 1px solid var(--vx-border); color: var(--vx-text); border-bottom-left-radius: 5px; }
.chat-msg.me .chat-bubble { background: var(--vx-primary); color: #fff; border-bottom-right-radius: 5px; box-shadow: var(--vx-shadow-glow); }
.chat-time { font-size: 10px; color: var(--vx-text-muted); margin-top: 3px; font-feature-settings: 'tnum'; }
.chat-empty { text-align: center; color: var(--vx-text-muted); padding: 24px 16px; margin: auto 0; }
.chat-empty svg { opacity: 0.35; margin-bottom: 8px; }
.chat-empty p { font-size: 12.5px; margin: 0; line-height: 1.5; }
.chat-input-row { display: flex; gap: 8px; align-items: center; padding: 12px 0 0; }
.chat-input { flex: 1; height: 44px; border: 1.5px solid var(--vx-border); background: var(--vx-surface); border-radius: 100px; padding: 0 16px; font-size: 15px; font-family: inherit; color: var(--vx-text); outline: none; transition: all 0.18s ease; min-width: 0; }
.chat-input:focus { border-color: var(--vx-primary); box-shadow: 0 0 0 3px var(--vx-primary-light); }
.chat-send { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--vx-primary); color: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; box-shadow: var(--vx-primary-glow); transition: transform 0.15s var(--vx-spring), filter 0.15s ease; }
.chat-send:hover { filter: brightness(1.06); }
.chat-send:active { transform: scale(0.94); }
.chat-send:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; filter: grayscale(0.3); }

/* ============================================================
   КАБИНЕТ / ДАШБОРД (desktop)
   ============================================================ */
.surface { min-height: 100%; padding: 24px clamp(16px, 4vw, 40px) 60px; max-width: 1240px; margin: 0 auto; }

/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kb-col { background: var(--vx-bg-alt); border-radius: var(--vx-radius-lg); padding: 12px; min-width: 230px; border: 1.5px dashed transparent; transition: border-color 0.2s ease, background 0.2s ease; }
/* подсветка зон приёма во время перетаскивания карточки */
.kb-col.kb-drop { border-color: var(--vx-border); }
.kb-col.kb-drop:hover { border-color: var(--vx-primary); background: var(--vx-primary-light); }
.kb-col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 0 4px; }
.kb-col-head .kb-badge { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.kb-col-head .kb-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.kb-col-head .kb-pct { font-size: 10.5px; font-weight: 700; color: var(--vx-primary); background: var(--vx-primary-light); padding: 1px 6px; border-radius: 5px; font-feature-settings: 'tnum'; }
.kb-col-head .kb-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--vx-text-muted); background: var(--vx-surface); padding: 1px 9px; border-radius: 6px; font-feature-settings: 'tnum'; }
.kb-card { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: 12px; padding: 13px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s var(--vx-spring); position: relative; }
.kb-card:hover { border-color: var(--vx-primary); box-shadow: var(--vx-shadow-md); transform: translateY(-2px); }
.kb-card:active { cursor: grabbing; }
.kb-card.sel { border-color: var(--vx-primary); box-shadow: 0 0 0 2px var(--vx-primary-light); }
.kb-card .kc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.kb-card .kc-id { font-size: 11px; font-weight: 700; color: var(--vx-text-muted); font-feature-settings: 'tnum'; }
.kb-card .kc-client { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.kb-card .kc-ava { width: 34px; height: 34px; border-radius: 50%; background: var(--vx-primary); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.kb-card .kc-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-card .kc-purpose { font-size: 11px; color: var(--vx-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-card .kc-amt { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.kb-card .kc-amt .a { font-size: 17px; font-weight: 700; font-feature-settings: 'tnum'; color: var(--vx-success); }
.kb-card .kc-amt .t { font-size: 11.5px; color: var(--vx-text-muted); font-feature-settings: 'tnum'; }
.kb-card .kc-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kb-timer { font-size: 10.5px; color: var(--vx-text-muted); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* Detail */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 980px) { .detail-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--vx-text-muted); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb .bc-link { color: var(--vx-primary); font-weight: 700; cursor: pointer; }
.breadcrumb .bc-cur { font-weight: 700; color: var(--vx-text-secondary); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.form-group .fg-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--vx-text-muted); margin-bottom: 3px; }
.form-group .fg-val { font-size: 14px; font-weight: 700; color: var(--vx-text); }

.mgr-ava { width: 48px; height: 48px; border-radius: 50%; background: var(--vx-primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }

/* Бонус лида */
.score-box { text-align: center; padding: 8px 0 14px; }
.score-num { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; color: var(--vx-text); font-feature-settings: 'tnum'; line-height: 1; }
.score-cap { font-size: 12.5px; color: var(--vx-text-muted); margin-top: 6px; }
.score-bar { height: 10px; border-radius: 100px; background: var(--vx-bg-alt); overflow: hidden; margin: 14px 0 6px; }
.score-fill { height: 100%; border-radius: 100px; background: var(--vx-success); transition: width 0.6s var(--vx-spring); }
.score-range { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--vx-text-muted); font-weight: 600; font-feature-settings: 'tnum'; }

/* Кнопки перевода стадии (мобильная замена drag&drop) */
.stage-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stage-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--vx-surface); border: 1.5px solid var(--vx-border); border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--vx-text-secondary); cursor: pointer; transition: all 0.18s ease; }
.stage-btn:hover:not(:disabled) { border-color: var(--vx-primary); color: var(--vx-primary); }
.stage-btn.back:hover:not(:disabled) { border-color: var(--vx-danger); color: var(--vx-danger); }
.stage-btn.on { background: var(--vx-primary); border-color: transparent; color: #fff; }
.stage-btn:disabled { cursor: default; }

.side-rows { display: flex; flex-direction: column; margin-top: 8px; }
.sr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--vx-border-light); font-size: 13px; }
.sr:last-child { border-bottom: none; }
.sr-lbl { color: var(--vx-text-secondary); display: flex; align-items: center; gap: 6px; min-width: 0; }
.sr-val { font-weight: 700; font-feature-settings: 'tnum'; text-align: right; flex-shrink: 0; }

/* Строка неподтверждённой выплаты */
.pay-pending-row { display: flex; align-items: center; gap: 13px; padding: 12px; margin-bottom: 12px; background: var(--vx-warning-light); border: 1.5px solid var(--vx-warning); border-radius: var(--vx-radius); flex-wrap: wrap; }

/* Чат кабинета: список тредов + переписка */
.chat-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { .chat-grid { grid-template-columns: 280px 1fr; } }
.thread-item { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px; cursor: pointer; transition: background 0.15s ease; }
.thread-item:hover { background: var(--vx-bg-alt); }
.thread-item.active { background: var(--vx-primary-light); }
.thread-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 100px; background: var(--vx-danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; font-feature-settings: 'tnum'; }

/* Модалки */
.modal-overlay { position: fixed; inset: 0; z-index: 250; background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade-in 0.2s ease; }
.modal { width: 100%; max-width: 420px; background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-xl); padding: 24px; box-shadow: var(--vx-shadow-lg); animation: modal-in 0.28s var(--vx-spring); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--vx-primary-light); color: var(--vx-primary); display: grid; place-items: center; margin-bottom: 14px; }
.modal-ic.danger { background: var(--vx-danger-light); color: var(--vx-danger); }
.modal-title { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.modal-text { font-size: 13.5px; color: var(--vx-text-secondary); line-height: 1.55; margin: 0; }
.modal-text b { color: var(--vx-text); font-feature-settings: 'tnum'; }
.modal-btns { display: flex; gap: 10px; margin-top: 20px; }
.modal-btns > * { flex: 1; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius); padding: 18px; box-shadow: 0 1px 3px rgba(15,23,42,0.04); transition: transform 0.3s var(--vx-spring), box-shadow 0.3s var(--vx-spring); }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--vx-shadow-md); }
.kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.kpi-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ic.indigo { background: var(--vx-primary-light); color: var(--vx-primary); }
.kpi-ic.purple { background: var(--vx-accent-light); color: var(--vx-accent); }
.kpi-ic.green { background: var(--vx-success-light); color: var(--vx-success); }
.kpi-ic.amber { background: var(--vx-warning-light); color: var(--vx-warning); }
.kpi-ic.blue { background: var(--vx-info-light); color: var(--vx-info); }
.kpi-cap { font-size: 12px; color: var(--vx-text-muted); font-weight: 700; }
.kpi-num { font-size: 27px; font-weight: 700; letter-spacing: -0.03em; font-feature-settings: 'tnum'; line-height: 1; }
.kpi-was { font-size: 12px; color: var(--vx-text-muted); margin-top: 6px; line-height: 1.4; }
.kpi-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-top: 8px; background: var(--vx-success-light); color: var(--vx-success); }

/* Charts */
.charts-row { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 20px; }
@media (min-width: 900px) { .charts-row { grid-template-columns: 1fr 1fr; } }
.chart-card { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius); padding: 20px; }
.cc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.cc-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.cc-sub { font-size: 12px; color: var(--vx-text-muted); margin-top: 2px; }
.cc-badge { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 6px; background: var(--vx-success-light); color: var(--vx-success); white-space: nowrap; }

.chart { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding: 8px 4px 0; }
.chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .bar { width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: var(--vx-primary); transition: height 0.6s var(--vx-spring); min-height: 4px; }
.chart .bar-lbl { font-size: 11px; color: var(--vx-text-muted); font-weight: 700; }
.chart .bar-group { display: flex; align-items: flex-end; justify-content: center; gap: 5px; width: 100%; height: 100%; }
.chart .bar-group .bar { max-width: 16px; min-height: 3px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--vx-text-muted); }
.chart-legend .lg i { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }

/* Funnel */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.fn-row { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 12px; }
.fn-lbl { font-size: 12.5px; font-weight: 700; color: var(--vx-text-secondary); }
.fn-track { height: 26px; border-radius: 8px; background: var(--vx-bg-alt); overflow: hidden; }
.fn-fill { height: 100%; border-radius: 8px; background: var(--vx-primary); transition: width 0.6s var(--vx-spring); min-width: 3px; }
.fn-val { font-size: 13px; font-weight: 700; text-align: right; font-feature-settings: 'tnum'; }

/* Bottom row */
.bottom-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .bottom-row { grid-template-columns: 1fr 1fr; } }
.mgr-bar-track { height: 4px; border-radius: 100px; background: var(--vx-bg-alt); margin-top: 4px; overflow: hidden; }
.mgr-bar-fill { height: 100%; border-radius: 100px; background: var(--vx-primary); }

/* Журнал событий */
.intlog { display: flex; flex-direction: column; gap: 2px; }
.intlog-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 12.5px; border-bottom: 1px solid var(--vx-border-light); }
.intlog-row:last-child { border-bottom: none; }
.intlog-row .il-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--vx-success-light); color: var(--vx-success); }
.intlog-row .il-ic.bad { background: var(--vx-danger-light); color: var(--vx-danger); }
.intlog-row .il-text { flex: 1; color: var(--vx-text-secondary); }
.intlog-row .il-time { font-size: 11px; color: var(--vx-text-muted); font-feature-settings: 'tnum'; white-space: nowrap; }

/* ── Админские разделы (настройка системы) ── */

/* Пояснение к разделу: что именно правка тут делает с деньгами */
.admin-intro { display: flex; gap: 13px; padding: 14px 16px; margin-bottom: 16px; background: var(--vx-primary-light); border: 1px solid transparent; border-radius: var(--vx-radius-lg); }
.admin-intro .ai-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--vx-surface); color: var(--vx-primary); display: grid; place-items: center; flex-shrink: 0; }
.admin-intro .ai-title { font-size: 14px; font-weight: 700; color: var(--vx-text); }
.admin-intro .ai-text { font-size: 12.5px; color: var(--vx-text-secondary); line-height: 1.5; margin-top: 3px; }
.admin-intro .ai-text b { color: var(--vx-primary); }

/* Строка таблицы настроек */
.adm-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--vx-border-light); }
.adm-row:last-child { border-bottom: none; }
.adm-row.adm-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--vx-text-muted); padding-bottom: 8px; border-bottom: 1px solid var(--vx-border); }
.inp-sm { width: 74px; height: 38px; border: 1.5px solid var(--vx-border); background: var(--vx-surface); border-radius: 9px; padding: 0 10px; font-size: 15px; font-weight: 700; font-family: inherit; color: var(--vx-text); outline: none; transition: all 0.18s ease; }
.inp-sm:focus { border-color: var(--vx-primary); box-shadow: 0 0 0 3px var(--vx-primary-light); }
.set-row { display: flex; align-items: center; gap: 10px; }

/* Приглашения */
.inv-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.inv-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.inv-card.off { opacity: 0.62; }
/* QR всегда на белом: тёмный код на тёмном фоне не читается сканером */
.inv-qr { width: 110px; background: #fff; border-radius: 10px; padding: 8px; align-self: center; }
.inv-qr svg { width: 100%; height: auto; display: block; }
.inv-body { flex: 1; min-width: 0; }
.inv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--vx-border-light); }

/* Topbar кабинета */
.mgr-user { display: flex; align-items: center; gap: 9px; }
.mgr-user-ava { width: 38px; height: 38px; border-radius: 50%; background: var(--vx-primary-light); color: var(--vx-primary); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.mgr-user-name { font-size: 13px; font-weight: 700; }
.mgr-user-role { font-size: 11px; color: var(--vx-text-muted); }
.mgr-select { height: 40px; border: 1.5px solid var(--vx-border); background: var(--vx-surface); border-radius: 10px; padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--vx-text); font-family: inherit; cursor: pointer; outline: none; }
.mgr-select:focus { border-color: var(--vx-primary); }

/* ============================================================
   PWA / АДАПТИВ — ДЕРЖАТЬ В КОНЦЕ ФАЙЛА.
   Все @media и утилиты ниже переопределяют базовые правила выше по
   каскаду (при равной специфичности выигрывает правило, идущее позже).
   ============================================================ */

/* Таблица ↔ карточки: .resp-table — десктоп, .resp-cards — мобила. */
.resp-cards { display: none; }

/* PWA-режим (установленное приложение / standalone): полноэкранные
   мобильные контейнеры возвращаем к 100vh (демо-навигация/риббон скрыты). */
.pwa-mode .pwa { min-height: 100vh; }
.pwa-mode .login-wrap { min-height: 100vh; padding-top: calc(32px + env(safe-area-inset-top)); }
/* Липкая мобильная шапка: safe-area сверху под чёлку (status-bar translucent). */
.pwa-mode .pwa-head { padding-top: calc(16px + env(safe-area-inset-top)); }

/* ── Демо-навигация в иконочный режим на узком экране ──
   Бренд прячем раньше сегментов (≤700px): три подписи поверхностей нужнее
   для навигации, чем название, и без этого шага nav упирается в край. */
@media (max-width: 700px) {
  .demo-nav { gap: 8px; padding: 9px 12px; }
  .demo-nav .brand-txt { display: none; }
}
@media (max-width: 560px) {
  .demo-nav .seg-l { display: none; }
  .demo-nav .seg { gap: 2px; padding: 3px; }
  .demo-nav .seg button { padding: 7px 10px; }
}

/* ── «Десктопные» поверхности пригодны на телефоне ── */
@media (max-width: 640px) {
  .surface { padding: 18px 14px 48px; }
  .title { font-size: 20px; }
  .panel { padding: 16px; }

  .toolbar .search-box { max-width: none; width: 100%; }
  .toolbar .spacer { display: none; }

  /* канбан: колонки вертикально, без горизонтального скролла */
  .kanban { grid-auto-flow: row; grid-auto-columns: 1fr; overflow-x: visible; }
  .kb-col { min-width: auto; }

  /* таблицы → карточки */
  .resp-table { display: none; }
  .resp-cards { display: flex; flex-direction: column; gap: 10px; }

  /* воронка: подпись стадии уже, чтобы влезла полоса */
  .fn-row { grid-template-columns: 96px 1fr 30px; gap: 8px; }
  .fn-lbl { font-size: 11.5px; }

  /* Админские таблицы → карточки: фиксированные колонки (inline width в
     разметке) на телефоне не помещаются, поэтому строку переносим, а шапку
     таблицы убираем — подписи колонок там всё равно теряют смысл. */
  .adm-row { flex-wrap: wrap; gap: 10px; padding: 14px 4px; }
  .adm-row.adm-head { display: none; }
  /* !important — ширины колонок заданы inline в разметке (они же держат
     выравнивание с шапкой на десктопе), а инлайн-стиль иначе победит. */
  .adm-row > div, .adm-row > span { width: auto !important; }
  .adm-row > div:first-child { flex: 1 1 100% !important; }
  .inv-form .input, .inv-form .btn-prime { width: 100% !important; }
  .admin-intro { padding: 12px; }

}

/* Кнопка выхода на сайт: на узком экране остаётся одна стрелка — так же, как
   переключатель ролей теряет подписи. Держим в конце файла: правила выше
   иначе перебьют (см. соглашение о каскаде в styles.css). */
@media (max-width: 560px) {
  .demo-nav .site-btn { padding: 0 9px; }
  .demo-nav .site-btn .site-l { display: none; }
}
