/* ============================================================
   Кредитный сервис — демо. Индиго-фиолетовая палитра, «банковский» тон.
   Все цвета — через CSS-переменные --vx-*. Тёмная тема: html.dark.
   Кабинеты менеджера и руководителя следуют глобальной теме наравне
   с клиентским порталом.
   ============================================================ */

:root {
  /* Нативные контролы и скроллбары под тему. */
  color-scheme: light;
  --vx-bg: #f4f5f8;
  --vx-bg-solid: #f4f5f8;
  --vx-bg-alt: #eceef3;
  --vx-surface: #ffffff;
  --vx-surface-hover: #f4f6fb;
  --vx-glass: rgba(255, 255, 255, 0.82);
  --vx-glass-border: rgba(17, 24, 39, 0.08);
  --vx-text: #111827;
  --vx-text-secondary: #4b5563;
  --vx-text-muted: #9ca3af;
  --vx-border: #e2e5ec;
  --vx-border-light: #eef0f4;
  --vx-primary: #33308f;
  --vx-primary-light: rgba(51, 48, 143, 0.1);
  --vx-primary-hover: #282569;
  /* Моно-тональный градиент одного оттенка — ТОЛЬКО для одной hero-поверхности. */
  --vx-primary-gradient: linear-gradient(135deg, #33308f 0%, #453f9e 100%);
  --vx-primary-glow: 0 2px 8px rgba(51, 48, 143, 0.16);
  --vx-accent: #5b21b6;
  --vx-accent-light: rgba(91, 33, 182, 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(17, 24, 39, 0.06);
  --vx-shadow-md: 0 8px 28px rgba(17, 24, 39, 0.1);
  --vx-shadow-lg: 0 18px 48px rgba(17, 24, 39, 0.14);
  --vx-shadow-glow: 0 2px 8px rgba(17, 24, 39, 0.1);
  --vx-spring: cubic-bezier(0.2, 0, 0, 1);
}

html.dark {
  color-scheme: dark;
  --vx-bg: linear-gradient(180deg, #0d1122 0%, #090c18 100%);
  --vx-bg-solid: #0a0e1a;
  --vx-bg-alt: #161c2e;
  --vx-surface: #141a2b;
  --vx-surface-hover: #1c2438;
  --vx-glass: rgba(20, 26, 43, 0.72);
  --vx-glass-border: rgba(148, 163, 184, 0.12);
  --vx-text: #f1f5f9;
  --vx-text-secondary: #cbd5e1;
  --vx-text-muted: #7683a0;
  --vx-border: #283350;
  --vx-border-light: #1d2740;
  --vx-primary: #8b91e8;
  --vx-primary-light: rgba(139, 145, 232, 0.16);
  --vx-primary-hover: #a8ade8;
  --vx-primary-gradient: linear-gradient(135deg, #6d72c9 0%, #8b91e8 100%);
  --vx-primary-glow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --vx-accent: #a78bda;
  --vx-accent-light: rgba(167, 139, 218, 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'; }

/* ── 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; }
.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); }
.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; }
.demo-nav .seg { display: flex; gap: 4px; background: var(--vx-bg-alt); border-radius: 11px; padding: 4px; }
.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; }
.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; }
.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-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.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(5,150,105,0.24);
}
.btn-success:hover { filter: brightness(1.06); }
.btn-success:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; filter: grayscale(0.4); }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 12px; background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: 14px; padding: 15px 16px; transition: transform 0.3s var(--vx-spring), box-shadow 0.3s var(--vx-spring); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--vx-shadow); }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-card.primary .stat-icon { background: var(--vx-primary-light); color: var(--vx-primary); }
.stat-card.accent  .stat-icon { background: var(--vx-accent-light);  color: var(--vx-accent); }
.stat-card.success .stat-icon { background: var(--vx-success-light); color: var(--vx-success); }
.stat-card.warning .stat-icon { background: var(--vx-warning-light); color: var(--vx-warning); }
.stat-card.danger  .stat-icon { background: var(--vx-danger-light);  color: var(--vx-danger); }
.stat-card.info    .stat-icon { background: var(--vx-info-light);    color: var(--vx-info); }
.stat-num { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--vx-text); font-feature-settings: 'tnum'; line-height: 1.1; }
.stat-lbl { font-size: 11px; color: var(--vx-text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; margin-top: 3px; }
.stat-sub { font-size: 11px; color: var(--vx-success); font-weight: 700; margin-top: 3px; }
.stat-sub.muted { color: var(--vx-text-muted); }

/* 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-bg-alt); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; color: var(--vx-text-muted); font-feature-settings: 'tnum'; }
.tab.active .cnt { background: var(--vx-primary-light); color: var(--vx-primary); }

/* 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; }

/* 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-meta .dot { opacity: 0.5; }
.row-amt { text-align: right; flex-shrink: 0; }
.amt-main { font-size: 14px; font-weight: 700; font-feature-settings: 'tnum'; color: var(--vx-text); }

/* 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: #111827; 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; } }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Panel / card */
.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); }

/* ============================================================
   CLIENT 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-head .bell .dot { position: absolute; top: 8px; right: 8px; 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; border: 2px solid var(--vx-surface); }
.pwa-body { flex: 1; padding: 18px 16px 100px; }

/* Login screen */
.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; }
.otp-row { display: flex; gap: 10px; margin-top: 10px; }
.otp-cell { flex: 1; height: 58px; border: 1.5px solid var(--vx-border); background: var(--vx-surface); border-radius: 14px; text-align: center; font-size: 26px; font-weight: 700; color: var(--vx-text); outline: none; font-feature-settings: 'tnum'; transition: all 0.18s ease; }
.otp-cell:focus { border-color: var(--vx-primary); box-shadow: 0 0 0 3px var(--vx-primary-light); }

/* status 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; position: relative; }
.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; position: relative; }
.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; position: relative; }
.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; position: relative; }
.hero-card .hc-badge .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }

.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; }

/* vertical stepper (client status) */
.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: linear-gradient(180deg, var(--vx-success) 0%, var(--vx-success) 100%); }
.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); }

/* manager card (client side) */
.mgr-card { display: flex; align-items: center; gap: 14px; background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); padding: 16px; }
.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; }
.mgr-info { flex: 1; min-width: 0; }
.mgr-name { font-size: 14.5px; font-weight: 700; }
.mgr-role { font-size: 12px; color: var(--vx-text-muted); }
.mgr-call { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--vx-border); background: var(--vx-bg-alt); color: var(--vx-primary); display: grid; place-items: center; cursor: pointer; }

/* doc items */
.doc-item { 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; }
.doc-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.doc-icon.ok { background: var(--vx-success-light); color: var(--vx-success); }
.doc-icon.wait { background: var(--vx-warning-light); color: var(--vx-warning); }
.doc-icon.req { background: var(--vx-primary-light); color: var(--vx-primary); }
.doc-body { flex: 1; min-width: 0; }
.doc-name { font-size: 13.5px; font-weight: 700; color: var(--vx-text); }
.doc-sub { font-size: 11.5px; color: var(--vx-text-muted); margin-top: 1px; }

/* notifications */
.notif { display: flex; gap: 12px; background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: 14px; padding: 14px; margin-bottom: 10px; position: relative; }
.notif.unread { border-color: var(--vx-primary); background: var(--vx-primary-light); }
.notif .n-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.notif .n-body { flex: 1; min-width: 0; }
.notif .n-title { font-size: 13.5px; font-weight: 700; }
.notif .n-text { font-size: 12.5px; color: var(--vx-text-secondary); margin-top: 3px; line-height: 1.45; }
.notif .n-time { font-size: 11px; color: var(--vx-text-muted); margin-top: 5px; }
.notif .n-unread-dot { position: absolute; top: 14px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--vx-primary); }

/* contract card */
.contract-card { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); padding: 18px; }
.contract-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.contract-title { font-size: 15px; font-weight: 700; }
.contract-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; 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'; }
.progress-track { height: 10px; border-radius: 100px; background: var(--vx-bg-alt); overflow: hidden; margin: 6px 0; }
.progress-fill { height: 100%; border-radius: 100px; background: var(--vx-primary); transition: width 0.6s var(--vx-spring); }
.sched-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--vx-border-light); }
.sched-row:last-child { border-bottom: none; }
.sched-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 12px; font-weight: 700; }
.sched-dot.paid { background: var(--vx-success-light); color: var(--vx-success); }
.sched-dot.next { background: var(--vx-primary-light); color: var(--vx-primary); border: 1.5px solid var(--vx-primary); }
.sched-dot.future { background: var(--vx-bg-alt); color: var(--vx-text-muted); }

/* wizard */
.wiz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.wiz-steps { display: flex; gap: 6px; flex: 1; }
.wiz-pip { flex: 1; height: 5px; border-radius: 100px; background: var(--vx-bg-alt); }
.wiz-pip.on { background: var(--vx-primary); }
.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: 12px; font-weight: 700; color: var(--vx-text-muted); flex-shrink: 0; }
.wiz-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 4px; }
.wiz-desc { font-size: 13px; color: var(--vx-text-muted); margin: 0 0 20px; }

/* calc preview */
.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; font-size: 12.5px; margin-top: 12px; opacity: 0.92; }
.calc-row b { font-feature-settings: 'tnum'; }

.slider-block { margin-bottom: 22px; }
.slider-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.slider-lbl { font-size: 13px; font-weight: 700; color: var(--vx-text-secondary); }
.slider-val { font-size: 20px; font-weight: 700; color: var(--vx-primary); font-feature-settings: 'tnum'; }
input[type="range"].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 100px; background: var(--vx-bg-alt); outline: none; }
input[type="range"].slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--vx-surface); border: 3px solid var(--vx-primary); box-shadow: var(--vx-shadow); cursor: pointer; }
input[type="range"].slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--vx-surface); border: 3px solid var(--vx-primary); box-shadow: var(--vx-shadow); cursor: pointer; }
.slider-range { display: flex; justify-content: space-between; font-size: 11px; color: var(--vx-text-muted); font-weight: 600; margin-top: 6px; font-feature-settings: 'tnum'; }

/* field */
.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); }
.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; }

/* upload emulator */
.upload-zone { border: 1.5px dashed var(--vx-border); border-radius: 14px; padding: 22px; text-align: center; background: var(--vx-bg-alt); cursor: pointer; transition: all 0.2s ease; margin-bottom: 14px; }
.upload-zone:hover { border-color: var(--vx-primary); background: var(--vx-primary-light); }
.upload-zone .uz-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--vx-primary-light); color: var(--vx-primary); display: grid; place-items: center; margin: 0 auto 10px; }
.upload-zone .uz-title { font-size: 14px; font-weight: 700; }
.upload-zone .uz-sub { font-size: 12px; color: var(--vx-text-muted); margin-top: 3px; }
.up-file { 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; }
.up-file .uf-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--vx-primary-light); color: var(--vx-primary); display: grid; place-items: center; flex-shrink: 0; }
.up-file .uf-body { flex: 1; min-width: 0; }
.up-file .uf-name { font-size: 13px; font-weight: 700; }
.up-file .uf-sub { font-size: 11.5px; color: var(--vx-text-muted); margin-top: 2px; }
.up-progress { height: 6px; border-radius: 100px; background: var(--vx-bg-alt); overflow: hidden; margin-top: 6px; }
.up-progress-fill { height: 100%; background: var(--vx-primary); transition: width 0.2s linear; }

/* 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 banner */
.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); }
.prof-row .pr-lbl { flex: 1; font-weight: 600; }
.prof-row .pr-val { color: var(--vx-text-muted); font-weight: 700; font-feature-settings: 'tnum'; }
.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); }

/* ============================================================
   MANAGER / BOSS SURFACES (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(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kb-col { background: var(--vx-bg-alt); border-radius: var(--vx-radius-lg); padding: 12px; min-width: 250px; }
.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-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.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; 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-new { font-size: 9.5px; font-weight: 700; color: #fff; background: var(--vx-primary); padding: 2px 7px; border-radius: 5px; letter-spacing: 0.04em; }
.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; }
.kb-card .kc-purpose { font-size: 11px; color: var(--vx-text-muted); }
.kb-card .kc-amt { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.kb-card .kc-amt .a { font-size: 17px; font-weight: 700; font-feature-settings: 'tnum'; }
.kb-card .kc-amt .t { font-size: 11.5px; color: var(--vx-text-muted); }
.kb-card .kc-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sla { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.sla.ok { background: var(--vx-success-light); color: var(--vx-success); }
.sla.warn { background: var(--vx-warning-light); color: var(--vx-warning); }
.sla.late { background: var(--vx-danger-light); color: var(--vx-danger); }
.sla.done { background: var(--vx-bg-alt); color: var(--vx-text-muted); }
.kb-timer { font-size: 10.5px; color: var(--vx-text-muted); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* application detail */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 980px) { .detail-grid { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--vx-text-muted); margin-bottom: 14px; }
.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); }
.form-group .fg-val.hl { color: var(--vx-primary); }
.divider { height: 1px; background: var(--vx-border); margin: 16px 0; }

/* checklist */
.checklist { display: flex; flex-direction: column; }
.cl-item { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--vx-border-light); align-items: flex-start; }
.cl-item:last-child { border-bottom: none; }
.cl-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--vx-border); background: var(--vx-surface); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; color: transparent; transition: all 0.18s var(--vx-spring); margin-top: 1px; }
.cl-box:hover { border-color: var(--vx-primary); }
.cl-box.checked { background: var(--vx-success); border-color: var(--vx-success); color: #fff; }
.cl-body { flex: 1; min-width: 0; }
.cl-name { font-size: 13.5px; font-weight: 700; }
.cl-desc { font-size: 12px; color: var(--vx-text-muted); margin-top: 1px; }
.cl-tag { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 6px; }
.cl-tag.ok { background: var(--vx-success-light); color: var(--vx-success); }
.cl-tag.pending { background: var(--vx-warning-light); color: var(--vx-warning); }
.cl-progress { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.cl-progress .clp-track { flex: 1; height: 8px; border-radius: 100px; background: var(--vx-bg-alt); overflow: hidden; }
.cl-progress .clp-fill { height: 100%; background: var(--vx-success); transition: width 0.4s var(--vx-spring); }
.cl-progress .clp-txt { font-size: 12.5px; font-weight: 700; color: var(--vx-text-secondary); font-feature-settings: 'tnum'; white-space: nowrap; }

.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; }

/* score box */
.score-box { text-align: center; padding: 8px 0 14px; }
.score-num { font-size: 44px; 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: 4px; }
.score-bar { height: 10px; border-radius: 100px; background: var(--vx-bg-alt); overflow: hidden; margin: 14px 0 6px; position: relative; }
.score-fill { height: 100%; border-radius: 100px; background: var(--vx-primary); }
.score-range { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--vx-text-muted); font-weight: 600; font-feature-settings: 'tnum'; }
.side-rows { display: flex; flex-direction: column; margin-top: 8px; }
.sr { display: flex; align-items: center; justify-content: space-between; 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; }
.sr-val { font-weight: 700; font-feature-settings: 'tnum'; }

.decision-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; }

/* integration log */
.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-text { flex: 1; color: var(--vx-text-secondary); }
.intlog-row .il-time { font-size: 11px; color: var(--vx-text-muted); font-feature-settings: 'tnum'; }

/* KPI grid (boss) */
.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; }
.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; margin-bottom: 18px; }
.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); }

.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-val { font-size: 11px; font-weight: 700; color: var(--vx-text-secondary); font-feature-settings: 'tnum'; }
.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.was { background: var(--vx-border); }
.chart .bar-lbl { font-size: 11px; color: var(--vx-text-muted); font-weight: 700; }
/* grouped bars (поступило/одобрено/выдано) + легенда */
.chart .bar-group { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; height: 100%; }
.chart .bar-group .bar { max-width: 13px; 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: 130px 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'; }

/* boss bottom */
.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); }

/* «Эффект внедрения» — компактная сноска (демотированные метрики кейса) */
.impact-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 20px; padding: 13px 18px; background: var(--vx-bg-alt); border: 1px dashed var(--vx-border); border-radius: var(--vx-radius); }
.impact-strip .impact-lbl { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--vx-text-secondary); }
.impact-strip .impact-lbl svg { color: var(--vx-accent); }
.impact-strip .impact-items { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
.impact-strip .impact-item { display: inline-flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--vx-text-muted); font-weight: 700; }
.impact-strip .impact-item b { font-size: 15px; font-weight: 700; color: var(--vx-text); font-feature-settings: 'tnum'; }

/* table */
.table-wrap { background: var(--vx-surface); border: 1px solid var(--vx-border); border-radius: var(--vx-radius-lg); overflow: hidden; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--vx-text-muted); padding: 12px 16px; background: var(--vx-bg-alt); border-bottom: 1px solid var(--vx-border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--vx-border-light); color: var(--vx-text); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { cursor: pointer; transition: background 0.15s ease; }
.table tbody tr:hover td { background: var(--vx-primary-light); }

/* manager topbar user */
.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); }

/* ============================================================
   ФИЛЬТРЫ ОЧЕРЕДИ (сумма/дата) · ЧАТ · ОПЛАТА КРЕДИТА
   ============================================================ */

/* ── Ф1: расширенные фильтры очереди по сумме и дате ── */
.toolbar-adv { margin-top: -6px; padding: 12px 14px; background: var(--vx-bg-alt); border: 1px solid var(--vx-border-light); border-radius: var(--vx-radius); }
.flt-group { display: inline-flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.flt-lbl { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--vx-text-muted); white-space: nowrap; }
.flt-lbl svg { color: var(--vx-text-muted); }
.flt-reset { color: var(--vx-danger); border-color: transparent; background: var(--vx-danger-light); }
.flt-reset:hover { background: var(--vx-danger); color: #fff; border-color: transparent; }

/* ── Ф2: индикатор непрочитанных сообщений на карточке очереди ── */
.kc-chat-badge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 100px; background: var(--vx-primary); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; box-shadow: var(--vx-shadow-md); font-feature-settings: 'tnum'; z-index: 2; }

/* индикатор непрочитанных у клиента (кнопка «написать менеджеру») */
.mgr-call { position: relative; }
.mgr-call-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 100px; background: var(--vx-danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--vx-surface); font-feature-settings: 'tnum'; }

/* ── Нижний лист (чат / оплата) — клиентское PWA ── */
.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, .pay-sheet { width: 100%; max-width: 460px; 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); }
.chat-sheet, .pay-sheet { max-height: 82vh; }
@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-head-role .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--vx-success); animation: pulse 1.8s ease-in-out infinite; }
.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; }

/* лента сообщений */
.chat-body { display: flex; flex-direction: column; gap: 4px; padding: 16px; overflow-y: auto; }
.chat-sheet .chat-body { flex: 1; min-height: 130px; }
.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 16px; border-top: 1px solid var(--vx-border); }
.chat-body--panel + .chat-input-row { padding: 12px 0 0; border-top: none; }
.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; }
.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); }

/* ── Ф3: лист оплаты кредита ── */
.pay-body { padding: 18px 16px 22px; overflow-y: auto; }
.pay-balance { text-align: center; padding: 6px 0 18px; }
.pay-balance-lbl { font-size: 12px; font-weight: 700; color: var(--vx-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pay-balance-num { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; 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; }
.po-sub { font-size: 12px; color: var(--vx-text-muted); margin-top: 2px; }
.po-amt { font-size: 16px; font-weight: 700; font-feature-settings: 'tnum'; flex-shrink: 0; }

/* ============================================================
   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)); }

/* ── A2: демо-навигация в иконочный режим на узком экране ── */
@media (max-width: 560px) {
  .demo-nav { gap: 8px; padding: 9px 12px; }
  .demo-nav .brand-txt { display: none; }
  .demo-nav .seg-l { display: none; }
  .demo-nav .seg { gap: 2px; padding: 3px; overflow-x: auto; }
  .demo-nav .seg button { padding: 7px 10px; }
}

/* ── A2/A3: «десктопные» поверхности пригодны на телефоне ── */
@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; }
}

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