/* ============================================================
   ZeroSell Design System — Premium Dark SaaS
   Один источник правды для всего приложения: токены, shell, навигация,
   карточки, таблицы, формы, кнопки, бейджи, модалки/drawer, графики,
   POS, пустые/скелетные состояния.
   Все классы предыдущей версии сохранены (card, btn, chip, table.data…),
   поэтому существующие шаблоны продолжают работать.
   ============================================================ */

:root {
  /* фон и поверхности */
  --bg: #050A14;
  --bg-2: #080F1D;
  --surface: #0D1728;
  --surface-2: #111D31;
  --surface-3: #16233A;
  --surface-solid: #0D1728;
  --outline: rgba(255, 255, 255, .08);
  --outline-strong: rgba(255, 255, 255, .14);

  /* акценты */
  --primary: #7C3AED;
  --primary-strong: #8B5CF6;
  --primary-soft: rgba(124, 58, 237, .16);
  --blue: #2563EB;
  --blue-soft: rgba(37, 99, 235, .16);
  --cyan: #06B6D4;
  --cyan-soft: rgba(6, 182, 212, .16);
  --primary-grad: linear-gradient(135deg, #7C3AED 0%, #2563EB 100%);
  --primary-grad-h: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 100%);
  --primary-container: rgba(124, 58, 237, .18);
  --lavender: #8B5CF6;
  --lavender-soft: rgba(124, 58, 237, .14);
  --focus-ring: rgba(124, 58, 237, .45);

  /* семантика */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, .14);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, .14);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, .14);
  --info: #06B6D4;
  --info-bg: rgba(6, 182, 212, .14);

  /* текст */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-on-sage: #FFFFFF;
  --text-on-primary: #FFFFFF;

  /* тени и свечения */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --glow-primary: 0 0 0 1px rgba(124, 58, 237, .35), 0 8px 28px rgba(124, 58, 237, .28);
  --glow: 0 0 0 3px var(--focus-ring);
  --clay: var(--shadow);
  --clay-soft: var(--shadow-sm);
  --clay-inset: none;

  /* геометрия */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 64px;

  --font: "Inter", "Manrope", -apple-system, "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* совместимость: старая светлая тема больше не используется */
[data-theme="light"] { color-scheme: dark; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(124, 58, 237, .14), transparent 60%),
    radial-gradient(700px 400px at 95% 0%, rgba(37, 99, 235, .12), transparent 60%),
    var(--bg);
}

h1, h2, h3, h4, .display {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-primary);
}
h1 { font-size: 24px; margin: 0 0 2px; line-height: 1.2; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 10px; }
h4 { font-size: 13px; margin: 0 0 8px; }
p { margin: 0 0 10px; }

a { color: var(--primary-strong); text-decoration: none; transition: color .15s; }
a:hover { color: #A78BFA; text-decoration: none; }

.num { font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-muted); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.strong { font-weight: 700; }
.grad-text {
  background: var(--primary-grad-h);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.success-text { color: var(--success); }
.danger-text { color: var(--danger); }
.warning-text { color: var(--warning); }
.info-text { color: var(--cyan); }

::selection { background: rgba(124, 58, 237, .45); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .2); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

[x-cloak] { display: none !important; }

.ico { flex: none; vertical-align: middle; }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns .2s var(--ease);
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--outline);
  padding: 18px 12px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
  gap: 2px;
}
.sidebar::-webkit-scrollbar { width: 6px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 16px;
  color: var(--text-primary);
}
.brand:hover { color: var(--text-primary); }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  border-radius: 10px;
  background: var(--primary-grad);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(124, 58, 237, .4);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.brand-tagline { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; }

.logo { font-size: 18px; font-weight: 800; padding: 0 12px 18px; color: var(--text-primary); }
.logo span { color: var(--primary-strong); }

/* переключатель магазина в сайдбаре */
.store-switch {
  position: relative;
  margin: 0 0 12px;
}
.store-switch select {
  padding: 10px 34px 10px 40px;
  border-radius: var(--r);
  font-weight: 600;
  background-color: var(--surface);
  font-size: 13px;
}
.store-switch .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }

.nav-section {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
  padding: 14px 12px 6px;
  font-weight: 600;
}
.nav-sep { height: 1px; background: var(--outline); margin: 10px 8px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13.5px;
  border: 1px solid transparent;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover { background: rgba(255, 255, 255, .05); color: var(--text-primary); text-decoration: none; }
.nav-link.active {
  background: var(--primary-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(124, 58, 237, .32);
}
.nav-link .icon, .nav-link .ico { width: 18px; height: 18px; flex: none; display: inline-flex; justify-content: center; }
.nav-link .badge-count { margin-left: auto; }
.nav-link.w-full { width: 100%; text-align: left; }
.nav-footer { margin-top: auto; padding-top: 10px; }
.nav-caret { margin-left: auto; display: inline-flex; color: inherit; opacity: .7; transition: transform .2s var(--ease); }
.nav-caret.open { transform: rotate(180deg); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px; padding-left: 14px; position: relative; }
.nav-sub::before { content: ""; position: absolute; left: 21px; top: 4px; bottom: 6px; width: 1px; background: var(--outline-strong); }
.nav-link.sub { padding: 7px 10px 7px 22px; font-size: 13px; color: var(--text-secondary); position: relative; }
.nav-link.sub::before { content: ""; position: absolute; left: 4px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--outline-strong); transform: translateY(-50%); transition: background .15s; }
.nav-link.sub:hover::before { background: var(--text-secondary); }
.nav-link.sub.on { color: var(--text-primary); font-weight: 600; background: rgba(124, 58, 237, .12); }
.nav-link.sub.on::before { background: var(--primary-strong); box-shadow: 0 0 8px var(--primary-strong); }
.plan-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--outline); margin-bottom: 8px; color: var(--text-primary);
}
.plan-card:hover { border-color: rgba(124, 58, 237, .4); color: var(--text-primary); }
.desktop-only { display: inline-flex; }
@media (max-width: 1024px) { .desktop-only { display: none !important; } }

.app.collapsed .brand-text, .app.collapsed .nav-section, .app.collapsed .nav-label,
.app.collapsed .store-switch, .app.collapsed .badge-count { display: none; }
.app.collapsed .sidebar { padding: 18px 10px 14px; }
.app.collapsed .nav-link { justify-content: center; padding: 10px; }
.app.collapsed .brand { justify-content: center; padding-bottom: 14px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.page { padding: 24px 28px 64px; }

/* верхняя панель */
.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: rgba(5, 10, 20, .75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--outline);
}
.appbar .icon-btn { color: var(--text-secondary); }
.appbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.appbar-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.appbar-right { display: flex; align-items: center; gap: 8px; }

.store-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--outline);
  font-weight: 600; font-size: 13px; color: var(--text-primary);
  max-width: 260px;
}
.store-pill .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-pill .ico { color: var(--text-secondary); }

.gsearch {
  width: 100%; max-width: 520px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; height: 38px;
  border-radius: 10px; border: 1px solid var(--outline);
  background: var(--surface); color: var(--text-secondary);
  cursor: text; font-family: inherit; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.gsearch:hover { border-color: var(--outline-strong); }
.gsearch span { flex: 1; text-align: left; }
.gsearch kbd { margin-left: auto; }

.appbar-date { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; padding: 0 8px; }
.appbar-date b { color: var(--text-primary); font-weight: 600; display: block; line-height: 1.15; }
.appbar-date small { display: block; color: var(--text-muted); font-size: 11px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--outline); background: var(--surface);
  color: var(--text-secondary); cursor: pointer; position: relative;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--outline-strong); background: var(--surface-2); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn .dot {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--bg);
}

.user-menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 3px 8px 3px 3px; border-radius: 999px;
  border: 1px solid var(--outline); background: var(--surface);
  color: var(--text-primary); cursor: pointer; font-family: inherit;
}
.user-btn:hover { border-color: var(--outline-strong); }

.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.avatar.soft { background: var(--primary-soft); color: var(--primary-strong); }

/* выпадающие меню */
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 220px;
  background: var(--surface); border: 1px solid var(--outline-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: dd-in .14s var(--ease);
}
.dropdown.left { right: auto; left: 0; }
.dropdown-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--outline); margin-bottom: 6px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: 9px;
  color: var(--text-primary); font-size: 13.5px; font-family: inherit;
  background: transparent; border: none; cursor: pointer; text-align: left;
}
.dropdown-item:hover { background: rgba(255, 255, 255, .06); color: var(--text-primary); }
.dropdown-item .ico { color: var(--text-secondary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--outline); margin: 6px 4px; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* мобильная навигация */
.sidebar-backdrop { display: none; }
.mobile-only { display: none !important; }

/* ============================================================
   Заголовок страницы
   ============================================================ */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.topbar > div:first-child { min-width: 0; }
.topbar .muted { font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }

/* ============================================================
   Карточки
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card + .card { margin-top: 16px; }
.card.pad-0 { padding: 0; }
.card.pad-sm { padding: 14px 16px; }
.card.glass { background: rgba(13, 23, 40, .7); backdrop-filter: blur(10px); }
.card.accent { border-color: rgba(124, 58, 237, .35); box-shadow: var(--glow-primary); }
.card-title {
  font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px;
  font-weight: 600; letter-spacing: .01em;
  display: flex; align-items: center; gap: 8px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.card-head h3 .ico { color: var(--primary-strong); }
.card-link { font-size: 12.5px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }
.card-link:hover { color: var(--text-primary); }

.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }  /* длинные таблицы/графики не растягивают колонки */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid > .card + .card { margin-top: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* KPI / StatCard */
.kpi-value {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--text-primary);
}
.kpi-value.success { color: var(--success); }
.kpi-value.danger { color: var(--danger); }
.kpi-value.sm { font-size: 20px; }

.stat {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  overflow: hidden;
}
.stat-head { display: flex; align-items: center; gap: 12px; }
.stat-icon {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
  background: var(--primary-grad);
  box-shadow: 0 8px 20px rgba(124, 58, 237, .3);
}
.stat-icon.green { background: linear-gradient(135deg, #10B981, #059669); box-shadow: 0 8px 20px rgba(16, 185, 129, .28); }
.stat-icon.blue { background: linear-gradient(135deg, #3B82F6, #2563EB); box-shadow: 0 8px 20px rgba(37, 99, 235, .3); }
.stat-icon.cyan { background: linear-gradient(135deg, #22D3EE, #0891B2); box-shadow: 0 8px 20px rgba(6, 182, 212, .28); }
.stat-icon.orange { background: linear-gradient(135deg, #FB923C, #EA580C); box-shadow: 0 8px 20px rgba(249, 115, 22, .28); }
.stat-icon.red { background: linear-gradient(135deg, #F87171, #DC2626); box-shadow: 0 8px 20px rgba(239, 68, 68, .28); }
.stat-icon.purple { background: linear-gradient(135deg, #A78BFA, #7C3AED); }
.stat-icon.soft { background: var(--primary-soft); color: var(--primary-strong); box-shadow: none; }
.stat-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; line-height: 1.2; }
.stat-value { font-size: clamp(17px, 1.45vw, 23px); font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.stat-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 4px; }
.stat-spark { width: 96px; height: 34px; flex: none; }
.stat-spark svg { width: 100%; height: 100%; overflow: visible; }

.delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
}
.delta.up { color: var(--success); background: var(--success-bg); }
.delta.down { color: var(--danger); background: var(--danger-bg); }
.delta.flat { color: var(--text-secondary); background: rgba(255, 255, 255, .06); }
.delta-hint { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   Бейджи / чипы
   ============================================================ */
.chip, .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.5;
  border: 1px solid transparent;
}
.chip.success, .badge.success { color: #34D399; background: var(--success-bg); border-color: rgba(16, 185, 129, .25); }
.chip.warning, .badge.warning { color: #FBBF24; background: var(--warning-bg); border-color: rgba(245, 158, 11, .25); }
.chip.danger, .badge.danger { color: #F87171; background: var(--danger-bg); border-color: rgba(239, 68, 68, .25); }
.chip.neutral, .badge.neutral { color: var(--text-secondary); background: rgba(255, 255, 255, .06); border-color: var(--outline); }
.chip.primary, .badge.primary { color: #A78BFA; background: var(--primary-soft); border-color: rgba(124, 58, 237, .3); }
.chip.info, .badge.info { color: #22D3EE; background: var(--info-bg); border-color: rgba(6, 182, 212, .3); }
.chip.sm { font-size: 10.5px; padding: 1px 7px; }
.chip.lg { font-size: 13px; padding: 5px 12px; }
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
a.chip:hover { filter: brightness(1.15); text-decoration: none; }

.badge-count {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
}

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--primary-grad);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(124, 58, 237, .25);
  transition: transform .12s, box-shadow .15s, filter .15s, background .15s, border-color .15s;
  position: relative;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(124, 58, 237, .35); }
.btn:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(124, 58, 237, .25); }
.btn:focus-visible { outline: none; box-shadow: var(--glow); }
.btn.secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--outline-strong);
  box-shadow: none;
}
.btn.secondary:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, .22); box-shadow: none; color: var(--text-primary); }
.btn.ghost { background: transparent; color: var(--text-secondary); box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); color: var(--text-primary); box-shadow: none; }
.btn.outline { background: transparent; color: var(--primary-strong); border-color: rgba(124, 58, 237, .5); box-shadow: none; }
.btn.outline:hover { background: var(--primary-soft); box-shadow: none; color: #A78BFA; }
.btn.danger { background: linear-gradient(135deg, #EF4444, #B91C1C); box-shadow: 0 6px 16px rgba(239, 68, 68, .25); }
.btn.danger:hover { box-shadow: 0 10px 22px rgba(239, 68, 68, .35); }
.btn.success { background: linear-gradient(135deg, #10B981, #047857); box-shadow: 0 6px 16px rgba(16, 185, 129, .25); }
.btn.success:hover { box-shadow: 0 10px 22px rgba(16, 185, 129, .35); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.lg { padding: 13px 24px; font-size: 15px; border-radius: 12px; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }
.btn.loading { color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.scan { padding: 8px 11px; background: var(--surface-2); color: var(--primary-strong); border-color: rgba(124, 58, 237, .4); box-shadow: none; }
.btn.scan:hover { background: var(--primary-soft); box-shadow: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-group { display: inline-flex; gap: 6px; }

/* быстрые действия */
.qa-list { display: flex; flex-direction: column; gap: 8px; }
.qa {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--outline);
  color: var(--text-primary); font-weight: 600; font-size: 13.5px;
  transition: border-color .15s, background .15s, transform .12s;
}
.qa:hover { border-color: rgba(124, 58, 237, .45); background: var(--surface-3); color: var(--text-primary); transform: translateX(2px); }
.qa .qa-ico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
}
.qa .qa-ico.purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }
.qa .qa-ico.green { background: linear-gradient(135deg, #34D399, #059669); }
.qa .qa-ico.blue { background: linear-gradient(135deg, #60A5FA, #2563EB); }
.qa .qa-ico.orange { background: linear-gradient(135deg, #FBBF24, #EA580C); }
.qa .qa-ico.pink { background: linear-gradient(135deg, #F472B6, #DB2777); }
.qa .qa-ico.cyan { background: linear-gradient(135deg, #22D3EE, #0891B2); }
.qa .ico-arrow { margin-left: auto; color: var(--text-muted); }

/* ============================================================
   Формы
   ============================================================ */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.field.error input, .field.error select, .field.error textarea { border-color: var(--danger); }
.field .error-text { color: var(--danger); font-size: 12px; margin-top: 6px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="month"],
input[type="tel"], input[type="email"], input[type="search"], input[type="file"], input[type="datetime-local"],
select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--outline-strong);
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
  color-scheme: dark;
}
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .22); }
textarea { border-radius: 12px; min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--primary-strong);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .25);
  background: var(--surface);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input[readonly] { color: var(--text-secondary); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-position: calc(100% - 10px) 50%;
  background-repeat: no-repeat;
  padding-right: 34px;
}
select option { background: var(--surface); color: var(--text-primary); }
input[type="file"] { padding: 7px 10px; }
input[type="file"]::file-selector-button {
  background: var(--surface-3); color: var(--text-primary); border: 1px solid var(--outline);
  border-radius: 7px; padding: 5px 10px; margin-right: 10px; font-family: inherit; cursor: pointer;
}

.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; color: var(--text-primary); font-weight: 500; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }

.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon input { padding-left: 36px; }

.filters {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters input, .filters select { width: auto; min-width: 150px; }
.filters .searchbar input, .filters .input-icon input { width: 100%; }
.searchbar { flex: 1; min-width: 200px; max-width: 420px; }

/* ============================================================
   Таблицы
   ============================================================ */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.card > .table-wrap:last-child { margin-bottom: -6px; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--outline-strong);
  white-space: nowrap;
  background: var(--surface);
  position: sticky; top: 0; z-index: 1;
}
table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--outline);
  vertical-align: middle;
  color: var(--text-primary);
}
table.data tbody tr { transition: background .12s; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: rgba(255, 255, 255, .03); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td > a:first-child { white-space: nowrap; }
table.data td a { color: var(--text-primary); font-weight: 600; }
table.data td a:hover { color: var(--primary-strong); }
table.data td .muted, table.data td .small { font-weight: 400; }
table.data tfoot td { font-weight: 700; border-top: 1px solid var(--outline-strong); background: var(--surface-2); }
table.data.compact td { padding: 8px 10px; }
table.data td input, table.data td textarea, table.data td select { min-width: 80px; padding: 6px 10px; font-size: 13px; }
table.data tr.sched-paid td { background: rgba(16, 185, 129, .07); }
table.data tr.sched-partial td { background: rgba(245, 158, 11, .07); }
table.data tr.sched-overdue td { background: rgba(239, 68, 68, .08); }
table.data tr.sched-paid:hover td { background: rgba(16, 185, 129, .11); }
table.data tr.sched-partial:hover td { background: rgba(245, 158, 11, .11); }
table.data tr.sched-overdue:hover td { background: rgba(239, 68, 68, .12); }
.row-idx { color: var(--text-muted); font-variant-numeric: tabular-nums; width: 32px; }

.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main .sub { font-size: 12px; color: var(--text-muted); }

.pagination { display: flex; align-items: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.pagination .info { color: var(--text-muted); font-size: 12.5px; margin-right: auto; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid var(--outline); background: var(--surface-2);
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
}
.page-btn:hover { border-color: var(--outline-strong); color: var(--text-primary); text-decoration: none; }
.page-btn.active { background: var(--primary-grad); color: #fff; border-color: transparent; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ============================================================
   Табы / сегменты
   ============================================================ */
.tabs {
  display: flex; gap: 2px; margin-bottom: 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--outline);
}
.tab {
  padding: 9px 14px;
  color: var(--text-secondary);
  font-weight: 600; font-size: 13.5px;
  border: none; background: transparent;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; cursor: pointer;
}
.tab:hover { color: var(--text-primary); text-decoration: none; }
.tab.active { color: var(--text-primary); border-bottom-color: var(--primary-strong); }
.tab .chip { margin-left: 2px; }
.tabs.pills { border-bottom: none; gap: 6px; }
.tabs.pills .tab { border: 1px solid var(--outline); border-radius: 999px; padding: 6px 13px; margin: 0; background: var(--surface-2); }
.tabs.pills .tab.active { background: var(--primary-grad); color: #fff; border-color: transparent; }

.segment {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--outline); border-radius: 10px;
  background: var(--surface-2);
}
.segment-item {
  padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: 13px;
  color: var(--text-secondary); font-family: inherit; border: none; background: transparent; cursor: pointer;
  transition: background .15s, color .15s;
}
.segment-item:hover { text-decoration: none; color: var(--text-primary); }
.segment-item.active { background: var(--surface-3); color: var(--text-primary); box-shadow: var(--shadow-sm); }

kbd {
  background: var(--surface-2); border: 1px solid var(--outline-strong);
  border-radius: 6px; padding: 1px 6px; font-size: 11px;
  font-family: inherit; color: var(--text-secondary); font-weight: 600;
}

/* ============================================================
   Сообщения / тосты / баннеры / алерты
   ============================================================ */
.messages { position: fixed; top: 16px; right: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; max-width: 400px; }
.message {
  padding: 12px 16px 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--outline-strong);
  box-shadow: var(--shadow-lg);
  font-weight: 500; font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  border-left-width: 3px;
  animation: toast-in .2s var(--ease);
}
.message.success { border-left-color: var(--success); }
.message.error { border-left-color: var(--danger); }
.message.warning { border-left-color: var(--warning); }
.message.info { border-left-color: var(--cyan); }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

.banner {
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-weight: 500; font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--outline);
  background: var(--surface);
}
.banner.trial { background: var(--primary-soft); border-color: rgba(124, 58, 237, .3); color: #C4B5FD; }
.banner.grace { background: var(--warning-bg); border-color: rgba(245, 158, 11, .3); color: #FCD34D; }
.banner.readonly, .banner.blocked { background: var(--danger-bg); border-color: rgba(239, 68, 68, .3); color: #FCA5A5; }
.banner .btn { flex: none; }

.alert {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--outline);
  background: var(--surface-2); display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px;
}
.alert.info { border-color: rgba(6, 182, 212, .3); background: var(--info-bg); }
.alert.warning { border-color: rgba(245, 158, 11, .3); background: var(--warning-bg); }
.alert.danger { border-color: rgba(239, 68, 68, .3); background: var(--danger-bg); }
.alert.success { border-color: rgba(16, 185, 129, .3); background: var(--success-bg); }

/* ============================================================
   Пустые и скелетные состояния
   ============================================================ */
.empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-secondary);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty .icon {
  width: 56px; height: 56px; border-radius: 16px; margin-bottom: 8px;
  display: grid; place-items: center; font-size: 26px;
  background: var(--primary-soft); color: var(--primary-strong);
}
.empty .icon .ico { width: 26px; height: 26px; }
.empty h4 { margin: 0; font-size: 15px; color: var(--text-primary); }
.empty p { margin: 0 0 12px; font-size: 13.5px; max-width: 360px; }
.empty .btn { margin-top: 4px; }

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 25%, rgba(255, 255, 255, .1) 37%, rgba(255, 255, 255, .05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
  min-height: 12px;
}
.skeleton.text { height: 12px; margin: 6px 0; }
.skeleton.title { height: 20px; width: 40%; }
.skeleton.block { height: 120px; }
.skeleton.circle { border-radius: 50%; width: 36px; height: 36px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.htmx-request .htmx-indicator { display: block; }
.htmx-indicator { display: none; }

/* ============================================================
   Модалки и drawer
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(2, 6, 14, .7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in .15s var(--ease);
}
.modal {
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  border-radius: 16px; border: 1px solid var(--outline-strong);
  box-shadow: var(--shadow-lg); background: var(--surface);
  animation: modal-in .18s var(--ease);
}
.modal.wide { max-width: 720px; }
.modal h3 { margin-bottom: 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--outline); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.drawer-overlay {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(2, 6, 14, .6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in .15s var(--ease);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 810;
  width: min(760px, 96vw);
  background: var(--bg-2);
  border-left: 1px solid var(--outline-strong);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: drawer-in .22s var(--ease);
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--outline);
  background: rgba(13, 23, 40, .6);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 40px; }
.drawer-body .topbar h1 { font-size: 20px; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* палитра поиска ⌘K */
.palette-overlay { align-items: flex-start; padding-top: 12vh; }
.palette { max-width: 620px; padding: 0; overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--outline); }
.palette-input input { border: none; background: transparent; box-shadow: none !important; font-size: 15px; padding: 12px 4px; }
.palette-input .ico { color: var(--text-muted); }
.palette-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); padding: 10px 12px 4px; font-weight: 600; }
.palette-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--text-primary); cursor: pointer;
}
.palette-item:hover, .palette-item.active { background: rgba(255, 255, 255, .06); color: var(--text-primary); }
.palette-item .pi-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-secondary); flex: none; }
.palette-item .pi-title { font-weight: 600; font-size: 13.5px; }
.palette-item .pi-sub { font-size: 12px; color: var(--text-muted); }
.palette-item .pi-right { margin-left: auto; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.palette-empty { padding: 26px; text-align: center; color: var(--text-muted); }

/* ============================================================
   Auth
   ============================================================ */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--outline-strong);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(124, 58, 237, .12);
}
.auth-card.wide { max-width: 600px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 22px; font-weight: 800; margin-bottom: 6px; letter-spacing: -.02em; }
.auth-logo span { color: var(--primary-strong); }
.auth-logo .brand-mark { width: 40px; height: 40px; }
.auth-sub { text-align: center; color: var(--text-secondary); margin-bottom: 22px; font-size: 13.5px; }

.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 500px) { .type-grid { grid-template-columns: repeat(2, 1fr); } }
.type-card {
  border: 1px solid var(--outline);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  font-weight: 500; font-size: 13px;
  transition: border-color .15s, background .15s, transform .12s;
}
.type-card:hover { border-color: var(--outline-strong); transform: translateY(-1px); }
.type-card .emoji { font-size: 24px; display: block; margin-bottom: 6px; }
.type-card input { display: none; }
.type-card.selected { border-color: var(--primary-strong); background: var(--primary-soft); color: var(--text-primary); font-weight: 600; box-shadow: 0 0 0 3px rgba(124, 58, 237, .2); }

/* ============================================================
   Утилиты
   ============================================================ */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.gap-6 { gap: 6px; }
.row.gap-8 { gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hr-line { border-top: 1px solid var(--outline); margin: 14px 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress {
  height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden;
}
.progress > div { height: 100%; border-radius: 999px; background: var(--primary-grad); transition: width .4s var(--ease); }
.progress.success > div { background: linear-gradient(90deg, #34D399, #10B981); }
.progress.warn > div { background: linear-gradient(90deg, #FBBF24, #F59E0B); }
.progress.danger > div { background: linear-gradient(90deg, #F87171, #EF4444); }

.props { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; }
.props dt { color: var(--text-muted); }
.props dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text-primary); }

.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--outline); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.pvc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--outline); }
.pvc-row:last-of-type { border-bottom: none; }
.pvc-row .num { font-size: 15px; }
.pvc-row > span:first-child { color: var(--text-secondary); }

.pvc-hint { position: relative; }
.pvc-hint summary { list-style: none; cursor: pointer; color: var(--text-muted); font-weight: 700; user-select: none; }
.pvc-hint summary::-webkit-details-marker { display: none; }
.pvc-hint[open] summary { color: var(--primary-strong); }
.pvc-hint p {
  position: absolute; z-index: 60; max-width: 340px; margin: 6px 0 0; right: 0;
  padding: 12px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--outline-strong);
  box-shadow: var(--shadow-lg);
}

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.doc-thumb {
  display: block; border: 1px solid var(--outline); border-radius: 12px;
  overflow: hidden; background: var(--surface-2);
  transition: border-color .15s, transform .15s;
}
.doc-thumb:hover { border-color: var(--primary-strong); transform: translateY(-2px); }
.doc-thumb img { width: 100%; height: 110px; object-fit: cover; display: block; }
.doc-thumb .cap { padding: 6px 10px; font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

.thumb-mini {
  width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none;
  border: 1px solid var(--outline); display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--surface-2); font-size: 16px; color: var(--text-muted);
}
.thumb-placeholder { color: var(--text-muted); }

.chips-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--outline-strong); background: var(--surface-2);
  cursor: text;
}
.chips-input input { flex: 1; min-width: 120px; border: none; background: transparent; padding: 4px 6px; border-radius: 0; box-shadow: none !important; }
.chip .chip-x { border: none; background: transparent; color: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0 0 0 2px; line-height: 1; }
.chip .chip-x:hover { opacity: .7; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo-card { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--outline); background: var(--surface-2); aspect-ratio: 1; }
.photo-card.main { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-badge { position: absolute; top: 8px; left: 8px; }
.photo-actions { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 6px; justify-content: space-between; padding: 8px; background: linear-gradient(transparent, rgba(2, 6, 14, .8)); }

.staff-photo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--outline-strong); }

.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.att-grid form { display: contents; }
.att-day {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 50px;
  border: 1px solid var(--outline); border-radius: 10px;
  background: var(--surface-2); color: var(--text-secondary);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.att-day:hover { border-color: var(--primary-strong); }
.att-day.worked { background: var(--success-bg); border-color: rgba(16, 185, 129, .4); color: #34D399; }
.att-day .att-mark { font-size: 11px; line-height: 1; }

/* поиск с выпадашкой */
.search-wrap { position: relative; }
.search-pop {
  position: absolute; z-index: 50; left: 0; right: 0; top: 100%;
  margin-top: 6px; background: var(--surface); border: 1px solid var(--outline-strong);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: 320px; overflow-y: auto;
}
.search-pop:empty { display: none; }
.search-item {
  display: flex; width: 100%; justify-content: space-between; gap: 12px;
  align-items: baseline; padding: 10px 14px; text-align: left;
  background: transparent; border: none; border-bottom: 1px solid var(--outline);
  color: var(--text-primary); font-family: inherit; font-size: 13.5px; cursor: pointer;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: rgba(255, 255, 255, .05); }

/* ============================================================
   POS
   ============================================================ */
.pos-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .pos-grid { grid-template-columns: 1fr; } }
.pos-search input { height: 48px; font-size: 15px; padding-left: 44px; border-radius: 12px; }
.pos-search .ico { left: 14px; }
.pos-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px; max-height: calc(100vh - 290px); overflow-y: auto;
  padding: 2px;
}
.pos-item {
  border: 1px solid var(--outline); border-radius: 12px; padding: 12px 14px;
  background: var(--surface-2); cursor: pointer;
  transition: border-color .12s, transform .12s, box-shadow .12s, background .12s;
}
.pos-item:hover { border-color: rgba(124, 58, 237, .5); background: var(--surface-3); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.pos-item .price { font-weight: 700; font-variant-numeric: tabular-nums; }
.pos-total { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pos-sticky { position: sticky; top: calc(var(--topbar-h) + 16px); }
.cart-line { border-bottom: 1px solid var(--outline); padding: 10px 0; }
.cart-line:last-of-type { border-bottom: none; }
.cart-lines { max-height: 40vh; overflow-y: auto; padding-right: 4px; }
.price-input { max-width: 120px; padding: 6px 10px !important; text-align: right; font-variant-numeric: tabular-nums; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--outline-strong);
  background: var(--surface-2); color: var(--text-primary); font-weight: 700; cursor: pointer;
  display: inline-grid; place-items: center; font-family: inherit;
  transition: border-color .12s, background .12s;
}
.qty-btn:hover { border-color: var(--primary-strong); background: var(--surface-3); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-method {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--outline); background: var(--surface-2);
  color: var(--text-secondary); font-weight: 600; font-size: 12.5px; font-family: inherit;
  transition: border-color .12s, background .12s, color .12s;
}
.pay-method:hover { border-color: var(--outline-strong); color: var(--text-primary); }
.pay-method.active { border-color: var(--primary-strong); background: var(--primary-soft); color: var(--text-primary); box-shadow: 0 0 0 3px rgba(124, 58, 237, .15); }
.sale-success .pos-total { font-size: 36px; }

/* ============================================================
   Гарантия / рассрочка
   ============================================================ */
.claim-action { margin-bottom: 10px; }
.claim-action summary { list-style: none; cursor: pointer; user-select: none; }
.claim-action summary::-webkit-details-marker { display: none; }
.claim-action[open] summary { border-color: var(--primary-strong); color: var(--text-primary); }
.claim-action form { border: 1px solid var(--outline); border-top: none; border-radius: 0 0 12px 12px; padding: 14px 14px 16px; background: var(--surface-2); }

.status-timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.status-step { display: flex; align-items: flex-start; gap: 12px; padding: 0 0 16px 0; position: relative; }
.status-step::before {
  content: ""; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px;
  background: var(--outline);
}
.status-step:last-child::before { display: none; }
.status-step .dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-3); border: 2px solid var(--outline-strong); color: var(--text-muted); font-size: 11px;
}
.status-step.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.status-step.current .dot { background: var(--primary-grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px rgba(124, 58, 237, .25); }
.status-step .chip { min-width: 130px; justify-content: center; }

.pipeline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pipeline .stage {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--outline); background: var(--surface-2); color: var(--text-muted); font-size: 12.5px; font-weight: 600;
}
.pipeline .stage.done { color: #34D399; border-color: rgba(16, 185, 129, .35); background: var(--success-bg); }
.pipeline .stage.current { color: #fff; background: var(--primary-grad); border-color: transparent; }
.pipeline .arrow { color: var(--text-muted); }

.wizard-steps { gap: 6px; }
.wizard-step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--outline); background: var(--surface-2);
  color: var(--text-secondary); font-family: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.wizard-step .num { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); font-size: 12px; }
.wizard-step.active { border-color: var(--primary-strong); color: var(--text-primary); background: var(--primary-soft); }
.wizard-step.active .num { background: var(--primary-grad); color: #fff; }
.wizard-step.done { color: #34D399; border-color: rgba(16, 185, 129, .4); }
.wizard-step.done .num { background: var(--success-bg); color: #34D399; }

.term-chip {
  min-width: 120px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--outline); background: var(--surface-2);
  color: var(--text-primary); font-family: inherit; cursor: pointer; text-align: left;
  transition: border-color .12s, background .12s, transform .12s;
}
.term-chip:hover { border-color: var(--outline-strong); transform: translateY(-2px); }
.term-chip.selected { border-color: var(--primary-strong); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(124, 58, 237, .18); }

.onboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.onboard-step {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  border: 1px dashed var(--outline-strong); background: var(--surface-2);
  color: var(--text-primary); font-weight: 600; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.onboard-step:hover { text-decoration: none; border-color: var(--primary-strong); color: var(--text-primary); }
.onboard-step.done { border-style: solid; border-color: rgba(16, 185, 129, .4); color: #34D399; background: var(--success-bg); }

/* ============================================================
   Графики
   ============================================================ */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface-3); border: 1px solid var(--outline-strong);
  border-radius: 10px; padding: 8px 10px; font-size: 12px;
  box-shadow: var(--shadow-lg); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px));
  opacity: 0; transition: opacity .1s;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-tip .d { color: var(--text-muted); }
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-item .sw { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend-item .lbl { flex: 1; color: var(--text-secondary); }
.legend-item .val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-item .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { position: relative; width: 150px; height: 150px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center b { font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.donut-center span { font-size: 11px; color: var(--text-muted); }

svg .bar { fill: url(#zsBarGrad); opacity: .95; }
svg .bar:hover { opacity: 1; }
svg .bar-label { fill: var(--text-muted); font-size: 9px; font-family: var(--font); }
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
.mini-bars > div { flex: 1; border-radius: 4px 4px 0 0; background: var(--primary-grad); min-height: 3px; opacity: .85; }

/* ============================================================
   Дашборд
   ============================================================ */
.welcome {
  display: grid; grid-template-columns: 1fr minmax(320px, 470px); gap: 16px; align-items: stretch;
  margin-bottom: 18px;
}
.welcome h1 { font-size: 30px; line-height: 1.15; margin-bottom: 8px; }
.welcome .lead { color: var(--text-secondary); font-size: 14px; }
.promo {
  position: relative; overflow: hidden;
  border-radius: 16px; padding: 20px 22px;
  background:
    radial-gradient(400px 200px at 110% 110%, rgba(6, 182, 212, .35), transparent 60%),
    linear-gradient(135deg, rgba(124, 58, 237, .5), rgba(37, 99, 235, .35));
  border: 1px solid rgba(124, 58, 237, .4);
  color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  min-height: 132px;
}
.promo h3 { font-size: 17px; margin: 0; color: #fff; line-height: 1.25; }
.promo h3 span { color: #C4B5FD; }
.promo p { margin: 0; color: rgba(255, 255, 255, .8); font-size: 12.5px; max-width: 260px; }
.promo .btn { align-self: flex-start; margin-top: 8px; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .2); box-shadow: none; }
.promo .btn:hover { background: rgba(255, 255, 255, .22); box-shadow: none; }
.promo-art { position: absolute; right: -10px; top: -20px; width: 180px; height: 180px; opacity: .9; pointer-events: none; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.dash-main { display: grid; gap: 16px; min-width: 0; }
.dash-side { display: grid; gap: 16px; min-width: 0; }
.dash-side > .card { min-width: 0; overflow: hidden; }
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--outline); }
.feed-item:last-child { border-bottom: none; }
.feed-item .f-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.feed-item .f-body { flex: 1; min-width: 0; }
.feed-item .f-title { font-weight: 600; font-size: 13px; }
.feed-item .f-sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item .f-time { font-size: 11.5px; color: var(--text-muted); flex: none; font-variant-numeric: tabular-nums; }
.f-ico.green { background: linear-gradient(135deg, #34D399, #059669); }
.f-ico.blue { background: linear-gradient(135deg, #60A5FA, #2563EB); }
.f-ico.purple { background: linear-gradient(135deg, #A78BFA, #7C3AED); }
.f-ico.red { background: linear-gradient(135deg, #F87171, #DC2626); }
.f-ico.orange { background: linear-gradient(135deg, #FBBF24, #EA580C); }
.f-ico.cyan { background: linear-gradient(135deg, #22D3EE, #0891B2); }
.f-ico.gray { background: var(--surface-3); color: var(--text-secondary); }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-kpi { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--outline); }
.mini-kpi .lbl { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.mini-kpi .val { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-kpi.danger .val { color: var(--danger); }
.mini-kpi.success .val { color: var(--success); }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 1440px) {
  .page { padding: 22px 24px 60px; }
}
@media (max-width: 1280px) {
  .dash-grid { grid-template-columns: 1fr; }
  .welcome { grid-template-columns: 1fr; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, 1fr); }
  .appbar-date { display: none; }
}
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
  .app:not(.mobile-open) .brand-text, .app:not(.mobile-open) .nav-section, .app:not(.mobile-open) .nav-label,
  .app:not(.mobile-open) .store-switch, .app:not(.mobile-open) .badge-count { display: none; }
  .app:not(.mobile-open) .nav-link { justify-content: center; padding: 10px; }
  .app:not(.mobile-open) .brand { justify-content: center; }
  .app:not(.mobile-open) .sidebar { padding: 18px 10px 14px; }
  .gsearch { max-width: 360px; }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform .2s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .app.mobile-open .sidebar { transform: none; }
  .app.mobile-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(2, 6, 14, .6); z-index: 35; }
  .mobile-only { display: inline-flex !important; }
  .appbar { padding: 0 14px; gap: 8px; }
  .store-pill { display: none; }
  .gsearch span { display: none; }
  .gsearch { width: 38px; padding: 0; justify-content: center; }
  .gsearch kbd { display: none; }
  .page { padding: 16px 14px 60px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .welcome h1 { font-size: 24px; }
  .donut-wrap { flex-direction: column; }
  .split-2 { grid-template-columns: 1fr; }
  .drawer { width: 100vw; }
  .modal-overlay { padding: 12px; }
  .pay-methods { grid-template-columns: repeat(3, 1fr); }
  table.data th, table.data td { padding: 9px 8px; }
}

/* ============================================================
   Печать
   ============================================================ */
@media print {
  body::before { display: none; }
  .sidebar, .appbar, .messages, .banner { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .page { padding: 0; }
}

.cur { font-size: .78em; color: var(--text-secondary); font-weight: 500; }
.kpi-value .cur, .stat-value .cur { font-size: .5em; }
.pos-total .cur { font-size: .55em; }

/* карточки-ссылки (отчёты, настройки) */
.report-card { display: flex; align-items: center; gap: 14px; color: var(--text-primary); transition: border-color .15s, transform .12s, box-shadow .15s; }
.report-card:hover { border-color: rgba(124, 58, 237, .45); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text-primary); }
.report-card h3 { margin: 0 0 3px; font-size: 14.5px; }
.report-card p { margin: 0; }
.report-card > div { flex: 1; min-width: 0; }
.grid .report-card + .report-card { margin-top: 0; }

/* выбор типа товара */
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kind-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--outline); background: var(--surface); cursor: pointer;
  font-weight: 600; font-size: 13px; color: var(--text-secondary); margin: 0;
  transition: border-color .15s, background .15s, color .15s;
}
.kind-card input { display: none; }
.kind-card .kind-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-secondary); flex: none; }
.kind-card:hover { border-color: var(--outline-strong); color: var(--text-primary); }
.kind-card.selected { border-color: var(--primary-strong); background: var(--primary-soft); color: var(--text-primary); }
.kind-card.selected .kind-ico { background: var(--primary-grad); color: #fff; }

/* склад — плитка с фото */
.stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.stock-card { display: flex; flex-direction: column; border: 1px solid var(--outline); border-radius: 14px; background: var(--surface-2); overflow: hidden; color: var(--text-primary); transition: border-color .15s, transform .12s; }
.stock-card:hover { border-color: rgba(124, 58, 237, .5); transform: translateY(-2px); color: var(--text-primary); }
.stock-photo { aspect-ratio: 4 / 3; background: var(--surface-3); display: grid; place-items: center; }
.stock-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stock-body { padding: 10px 12px 12px; }

/* выбор вариации в кассе */
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.variant-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border-radius: 10px; border: 1px solid var(--outline-strong); background: var(--surface-2); color: var(--text-primary); font-family: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.variant-opt:hover { border-color: var(--primary-strong); background: var(--surface-3); }
.variant-opt.off { opacity: .45; }

/* центр внимания */
.attention-list { display: flex; flex-direction: column; gap: 6px; }
.attention-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--outline); background: var(--surface-2); color: var(--text-primary); transition: border-color .15s, background .15s; }
.attention-item:hover { border-color: var(--outline-strong); background: var(--surface-3); color: var(--text-primary); }
.attention-item .a-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.attention-item.danger .a-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.attention-item.warning .a-dot { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.attention-item.info .a-dot { background: var(--cyan); }
.attention-item.success .a-dot { background: var(--success); }
.attention-item .a-ico { color: var(--text-secondary); display: inline-flex; }
.attention-item .a-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attention-item .a-title { font-weight: 600; font-size: 13.5px; }
.attention-item .a-sub { font-size: 12px; color: var(--text-muted); }
.attention-item .ico-arrow { color: var(--text-muted); }
.explain { position: absolute; z-index: 20; top: 52px; left: 12px; right: 12px; background: var(--surface-3); border: 1px solid var(--outline-strong); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow-lg); font-size: 13px; }
.explain .kv { padding: 6px 0; }

/* --- профиль клиента / матрица доступа --- */
.avatar.lg { width: 48px; height: 48px; font-size: 20px; border-radius: 14px; }
.btn.danger-text { color: var(--danger); }
.btn.danger-text:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.chip.sm { padding: 1px 7px; font-size: 11px; }
table.matrix tr.group td { background: var(--bg-elev-2, rgba(255,255,255,.03)); padding-top: 10px; padding-bottom: 6px; }
table.matrix .ok { color: var(--success); display: inline-flex; }
table.matrix .no { color: var(--text-muted); opacity: .5; }

/* --- Store Profile: «другие типы» в форме товара, обязательные атрибуты --- */
.kind-card.kind-more { border-style: dashed; color: var(--text-muted); cursor: pointer; background: transparent; font: inherit; }
.kind-card.kind-more:hover { color: var(--text); border-color: var(--primary); }
label .req { color: var(--danger); }

/* --- поддержка: лента сообщений --- */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--outline); background: var(--surface-2, rgba(255,255,255,.03)); }
.msg.staff { border-color: rgba(124, 58, 237, .35); background: rgba(124, 58, 237, .08); }
.msg.internal { border-style: dashed; border-color: rgba(245, 158, 11, .5); background: rgba(245, 158, 11, .06); }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.msg-body { white-space: pre-wrap; font-size: 14px; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.app.platform .sidebar .brand-tagline { color: #22D3EE; }
.stat[href] { color: inherit; text-decoration: none; }
.stat[href]:hover { border-color: var(--primary); }

/* --- онбординг --- */
.setup-list { display: flex; flex-direction: column; gap: 10px; }
.setup-step { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.setup-step.complete { opacity: .75; }
.setup-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: #A78BFA; }
.setup-ico.done { background: var(--success-bg); color: #34D399; }
.setup-ico.skipped { background: rgba(255,255,255,.06); color: var(--text-muted); }
.setup-body { flex: 1; min-width: 0; }
.progress { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress .bar { height: 100%; background: var(--primary-grad); border-radius: 999px; transition: width .3s; }
.setup-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.setup-banner .progress { flex: 1; min-width: 140px; }
@media (max-width: 640px) { .setup-step { flex-wrap: wrap; } .setup-body { flex-basis: calc(100% - 54px); } .setup-step > .row { width: 100%; justify-content: flex-start !important; } }

/* --- международный телефон --- */
.phone-row { display: grid; grid-template-columns: minmax(150px, 40%) auto 1fr; gap: 8px; align-items: center; }
.phone-row .phone-code { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: 600; padding: 0 2px; white-space: nowrap; }
.phone-row select.phone-country { min-width: 0; }
@media (max-width: 520px) { .phone-row { grid-template-columns: 1fr; } .phone-row .phone-code { display: none; } }
.btn.is-loading { opacity: .7; pointer-events: none; position: relative; }
.btn.is-loading::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; margin-left: 8px; display: inline-block; animation: zs-spin .7s linear infinite; vertical-align: -2px; }
@keyframes zs-spin { to { transform: rotate(360deg); } }

/* ---------- Телефон: страна с поиском + номер без кода ---------- */
.phone-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.phone-picker { position: relative; }
.phone-trigger {
  display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  color: var(--text); cursor: pointer; white-space: nowrap; font: inherit;
}
.phone-trigger:hover { border-color: var(--primary); }
.phone-trigger .fl { font-size: 18px; line-height: 1; }
.phone-trigger .cd { font-variant-numeric: tabular-nums; font-weight: 600; }
.phone-drop {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 320px; max-width: 78vw;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45); overflow: hidden;
}
.phone-search { width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: var(--surface-2); }
.phone-search:focus { outline: none; border-bottom-color: var(--primary); }
.phone-list { max-height: 280px; overflow-y: auto; }
.phone-opt {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; width: 100%;
  padding: 9px 12px; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit;
}
.phone-opt:hover, .phone-opt:focus-visible { background: var(--surface-2); outline: none; }
.phone-opt.on { background: var(--primary-soft); }
.phone-opt .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-opt .cd { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.phone-empty { padding: 14px 12px; color: var(--text-muted); font-size: 13px; }
@media (max-width: 520px) { .phone-drop { width: 280px; } }

/* Список возможностей в блоке «На телефоне» */
.ld-mobile-list { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ld-mobile-list li { position: relative; padding-left: 18px; color: var(--text-secondary); line-height: 1.55; }
.ld-mobile-list li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
