:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #e3e8f0;
  --line-2: #cfd8e5;
  --text: #0e1a2b;
  --muted: #53627a;
  --faint: #8a96a9;
  --brand: #0f2748;
  --brand-2: #1c3f78;
  --brand-3: #2d5aa8;
  --gold: #bf9230;
  --gold-2: #e2c275;
  --gold-soft: #f7efdb;
  --teal: #0f8a7e;
  --violet: #7458d6;
  --green: #17915a; --green-soft: #e3f4ea;
  --lime: #5f9416; --lime-soft: #edf5dc;
  --amber: #c58304; --amber-soft: #fcf1d8;
  --red: #cd3b3b; --red-soft: #fbe6e4;
  --blue: #2b67d1; --blue-soft: #e7eefc;
  --gray-soft: #eceff4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 26, 43, .05), 0 8px 24px rgba(14, 26, 43, .06);
  --shadow-lg: 0 12px 48px rgba(14, 26, 43, .18);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-head: 'Manrope', 'Inter', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
}
* { box-sizing: border-box; }
.ic { width: 18px; height: 18px; flex: none; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }

/* ─── Раскладка ─────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #dfe6f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px; }
.logo { display: flex; gap: 11px; align-items: center; padding: 4px 6px 18px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 12px; }
.logo-mark { width: 38px; height: 38px; flex: none; }
.logo-text { font-family: var(--font-head); font-weight: 800; font-size: 13.5px; line-height: 1.2; color: #fff; }
.logo-text span { display: block; color: var(--gold-2); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 9px; color: #c9d3e4; font-weight: 500; text-decoration: none; }
.nav a svg { width: 18px; height: 18px; opacity: .85; flex: none; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav .count { margin-left: auto; background: var(--gold); color: var(--brand); font-size: 11px; font-weight: 700; border-radius: 20px; padding: 0 7px; }
.nav-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #8494b3; padding: 14px 10px 4px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; font-size: 12.5px; }
.who { display: flex; gap: 10px; align-items: center; padding: 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.who b { color: #fff; display: block; font-weight: 600; }
.who span { color: #9aa8c2; font-size: 11.5px; }
.side-foot .links { display: flex; gap: 10px; flex-wrap: wrap; padding: 6px; }
.side-foot .links a { color: #aebbd3; font-size: 12px; cursor: pointer; }
.expiry { margin: 8px 6px 0; padding: 7px 9px; border-radius: 8px; background: rgba(191,146,48,.14); color: var(--gold-2); font-size: 11.5px; }
.main { min-width: 0; padding: 22px 28px 60px; }
.topbar { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; }
.topbar .crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 4px; }
.topbar .crumbs a { color: var(--muted); }
.mobile-bar { display: none; }

/* ─── Карточки и сетки ──────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card.flat { box-shadow: none; }
.card h3 + .muted { margin-top: 2px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.g-5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.mt { margin-top: 16px; }
.mt2 { margin-top: 24px; }

/* ─── Кнопки и поля ─────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 10px; padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; text-decoration: none; }
.btn:hover { background: var(--surface-2); border-color: var(--faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: #a97f22; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-3); }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.danger { color: var(--red); border-color: #efc3c0; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(45,90,168,.15); }
.input.sm { padding: 5px 8px; border-radius: 8px; font-size: 12.5px; }
label.field { display: block; }
label.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 11px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: #fff; }

/* ─── Бейджи, источники, статусы ────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; border-radius: 20px; padding: 2px 9px; white-space: nowrap; background: var(--gray-soft); color: var(--muted); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.lime { background: var(--lime-soft); color: var(--lime); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.gold { background: var(--gold-soft); color: #8a6613; }
.badge.navy { background: var(--brand); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.green { background: var(--green); } .dot.yellow, .dot.amber { background: var(--amber); } .dot.red { background: var(--red); } .dot.missing, .dot.gray { background: var(--line-2); } .dot.lime { background: var(--lime); }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; border: 1px solid; white-space: nowrap; cursor: help; }
.src.public, .src.document { color: var(--green); border-color: #bfe3cf; background: var(--green-soft); }
.src.demo { color: #6b7890; border-color: var(--line-2); background: var(--surface-2); }
.src.declared { color: var(--blue); border-color: #c8d8f6; background: var(--blue-soft); }
.src.confirmed { color: var(--teal); border-color: #b9e0db; background: #e2f4f1; }
.src.estimate, .src.plan { color: var(--amber); border-color: #efd9a6; background: var(--amber-soft); }
.src.missing { color: var(--faint); border-color: var(--line); background: transparent; }
.score-pill { display: inline-grid; place-items: center; min-width: 38px; height: 26px; border-radius: 8px; font-weight: 800; font-family: var(--font-head); font-size: 13.5px; }
.score-pill.red { background: var(--red-soft); color: var(--red); }
.score-pill.amber { background: var(--amber-soft); color: var(--amber); }
.score-pill.lime { background: var(--lime-soft); color: var(--lime); }
.score-pill.green { background: var(--green-soft); color: var(--green); }
.score-pill.gray { background: var(--gray-soft); color: var(--faint); }
.bar { height: 6px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand-3); border-radius: 6px; transition: width .6s ease; }
.bar.gold > i { background: var(--gold); }
.delta { font-weight: 700; font-size: 12.5px; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }

/* ─── KPI ───────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s; box-shadow: var(--shadow); }
.kpi:hover { border-color: var(--line-2); }
.kpi.on { border-color: var(--brand-3); box-shadow: 0 0 0 3px rgba(45,90,168,.12); }
.kpi b { display: block; font-family: var(--font-head); font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .kbar { height: 3px; border-radius: 3px; margin-top: 10px; }

/* ─── Таблицы ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
table.t th.sortable { cursor: pointer; }
table.t th.sortable:hover { color: var(--text); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t tr.hero td { background: #fffaf0; }
table.t tr.hero:hover td { background: #fff4de; }
table.t td.r, table.t th.r { text-align: right; }
table.t td.c, table.t th.c { text-align: center; }
.cname { min-width: 250px; max-width: 330px; }
.cname b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cname span { display: block; color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cname span .badge { display: inline-flex; font-size: 10.5px; padding: 0 7px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ─── Индексы ───────────────────────────────────────────── */
.idx-card { cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.idx-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.idx-card .idx-top { display: flex; align-items: center; gap: 12px; }
.idx-card .idx-name { font-weight: 700; font-family: var(--font-head); font-size: 13.5px; line-height: 1.25; }
.idx-card .ring-num { font-family: var(--font-head); font-weight: 800; fill: var(--text); }
.idx-card .compl { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.idx-card .compl .bar { flex: 1; }
.idx-card.flash { animation: flash 1.6s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(23,145,90,.6); } 30% { box-shadow: 0 0 0 10px rgba(23,145,90,.0); background: var(--green-soft); } 100% { background: var(--surface); } }
.ring-num { font-family: var(--font-head); font-weight: 800; fill: var(--text); }
.stop-flag { position: absolute; top: 10px; right: 10px; }
.chart .axis { font-size: 11px; fill: var(--faint); }
.chart .axis.strong { fill: var(--text); font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.factor { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.factor:last-child { border-bottom: 0; }
.factor .dot { margin-top: 6px; }
.factor b { font-weight: 600; }
.ind-row td:first-child { width: 36%; }
.ind-row .explain { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.contrib { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.contrib .bar { flex: 1; }

/* ─── Задачи ────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.col h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 4px 6px 10px; display: flex; justify-content: space-between; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(14,26,43,.04); }
.task .t-title { font-weight: 600; line-height: 1.35; }
.task .t-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; align-items: center; }
.task .t-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.task.confirmed { opacity: .92; border-color: #bfe3cf; }
.task.pulse { animation: pulse 1.2s ease; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(191,146,48,.55); } 100% { box-shadow: 0 0 0 14px rgba(191,146,48,0); } }
.gain { font-weight: 700; font-size: 11.5px; color: var(--green); background: var(--green-soft); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.sug { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.sug:last-child { border-bottom: 0; }
.sug .grow b { font-weight: 600; }

/* ─── Загрузка файла ────────────────────────────────────── */
.drop { display: block; border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; cursor: pointer; }
.drop.over { border-color: var(--brand-3); background: var(--blue-soft); }
.drop svg { width: 34px; height: 34px; color: var(--brand-3); }
.finding { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid; margin-bottom: 10px; }
.finding.amber { background: #fffaf0; border-color: #f2dfae; }
.finding.red { background: #fff5f4; border-color: #f2c9c5; }
.finding.info { background: var(--blue-soft); border-color: #c8d8f6; }
.finding b { display: block; margin-bottom: 2px; }
.finding svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.finding.amber svg { color: var(--amber); } .finding.red svg { color: var(--red); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 110px 46px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13px; }
.hbar .bar { height: 8px; }
.change-banner { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: linear-gradient(90deg, #e9f6ef, #f7fbf8); border: 1px solid #bfe3cf; border-radius: var(--radius); padding: 14px 18px; }
.change-banner .big { font-family: var(--font-head); font-weight: 800; font-size: 22px; }
.change-banner > .ic { width: 30px; height: 30px; color: var(--green); }
.hint .ic { width: 16px; height: 16px; vertical-align: -3px; }

/* ─── Документ для банка ────────────────────────────────── */
.sheet { background: #fff; max-width: 820px; margin: 0 auto; padding: 44px 52px; box-shadow: var(--shadow-lg); border-radius: 4px; color: #1a2433; font-size: 13.5px; }
.sheet h1 { font-size: 22px; color: var(--brand); }
.sheet h2 { font-size: 15px; color: var(--brand); margin: 22px 0 8px; }
.sheet table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 12.5px; }
.sheet th, .sheet td { border: 1px solid #d3dbe6; padding: 5px 8px; text-align: left; vertical-align: top; }
.sheet th { background: #e8eef6; font-weight: 600; }
.sheet .note { color: #667085; font-size: 11.5px; }
.sheet ul { margin: 6px 0; padding-left: 20px; }
.ai-note { font-size: 11.5px; color: var(--teal); }

/* ─── Методика ──────────────────────────────────────────── */
.meth { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }

table.edit td, table.edit th { padding: 5px 4px; }
table.edit input.input { padding: 5px 7px; border-radius: 7px; font-size: 12.5px; }
table.edit .formula { font-family: var(--mono); font-size: 12px; }
table.edit tr.err td { background: #fff6f5; }
table.edit tr.off td { opacity: .45; }
.sticky { position: sticky; top: 16px; }
.lock { display: flex; gap: 10px; align-items: flex-start; background: var(--gold-soft); border: 1px solid #ecd9a6; border-radius: 12px; padding: 12px 14px; }
.lock svg { width: 20px; height: 20px; color: var(--gold); flex: none; margin-top: 1px; }
.cmp { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.chip { display: inline-block; font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin: 2px; cursor: pointer; }
.chip:hover { border-color: var(--brand-3); }

/* ─── Вход ──────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand { background: radial-gradient(1200px 600px at 0% 0%, #1c3f78 0%, #0f2748 55%, #0a1c35 100%); color: #e6ecf5; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-brand h1 { font-size: 38px; line-height: 1.12; color: #fff; max-width: 520px; }
.login-brand h1 em { font-style: normal; color: var(--gold-2); }
.login-brand p { color: #b9c6dc; max-width: 500px; font-size: 15px; }
.login-idx { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 560px; }
.login-idx div { border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 12px 10px; font-size: 12px; color: #c9d3e4; background: rgba(255,255,255,.03); }
.login-idx b { display: block; font-family: var(--font-head); font-size: 20px; color: var(--gold-2); }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form .card { width: 100%; max-width: 440px; padding: 30px; }
.role-pick { display: grid; gap: 10px; margin: 14px 0 18px; }
.role-pick label { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.role-pick label:hover { background: var(--surface-2); }
.role-pick input { margin-top: 3px; accent-color: var(--brand); }
.role-pick label.on { border-color: var(--brand-3); background: var(--blue-soft); }
.role-pick b { display: block; }
.error { color: var(--red); font-size: 13px; margin-top: 8px; }

/* ─── Помощник, модалки, тосты, тур ─────────────────────── */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 50; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease; }
.drawer.open { transform: none; }
.drawer-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; background: var(--surface-2); }
.drawer-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 13px; margin-bottom: 10px; white-space: pre-wrap; line-height: 1.45; }
.msg.me { margin-left: auto; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .meta { display: block; font-size: 11px; color: var(--faint); margin-top: 5px; }
.suggest-q { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.suggest-q button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 20px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; }
.suggest-q button:hover { border-color: var(--brand-3); color: var(--brand-3); }
.backdrop { position: fixed; inset: 0; background: rgba(10, 20, 36, .45); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 22px 24px; }
.modal h2 { margin-bottom: 8px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--brand); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500; animation: rise .25s ease; max-width: 90vw; }
.toast.green { background: var(--green); } .toast.red { background: var(--red); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.progress-steps { display: grid; gap: 10px; margin: 16px 0 4px; }
.progress-steps div { display: flex; gap: 10px; align-items: center; color: var(--faint); }
.progress-steps div.on { color: var(--text); font-weight: 600; }
.progress-steps div.done { color: var(--green); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--brand-3); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.tour { position: fixed; right: 20px; bottom: 20px; width: 360px; max-width: calc(100vw - 32px); background: var(--brand); color: #e6ecf5; border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 40; padding: 16px 18px; }
.tour h4 { font-family: var(--font-head); color: #fff; font-size: 15px; margin: 2px 0 6px; }
.tour .step { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-2); }
.tour p { color: #c5d0e3; font-size: 13px; }
.tour .say { border-left: 3px solid var(--gold); padding-left: 10px; color: #fff; font-style: italic; font-size: 13px; margin: 8px 0; }
.tour .row { margin-top: 10px; }
.tour .btn { border-color: rgba(255,255,255,.25); background: transparent; color: #fff; }
.tour .btn.gold { background: var(--gold); border-color: var(--gold); }
.tour .x { position: absolute; top: 10px; right: 12px; cursor: pointer; color: #9aa8c2; font-size: 18px; line-height: 1; background: none; border: 0; }
.empty { padding: 28px; text-align: center; color: var(--faint); }
.hint { background: var(--blue-soft); border: 1px solid #c8d8f6; border-radius: 12px; padding: 12px 14px; color: #274b8d; font-size: 13px; }
.hint.gold { background: var(--gold-soft); border-color: #ecd9a6; color: #6e5212; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--gold); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills a { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--muted); font-weight: 600; font-size: 12.5px; cursor: pointer; text-decoration: none; background: var(--surface); }
.pills a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.head-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.iceberg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.iceberg ul { margin: 8px 0 0; padding-left: 18px; }
.iceberg li { margin-bottom: 6px; }
.arch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.arch .box { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; background: var(--surface-2); font-size: 12.5px; position: relative; }
.arch .box b { display: block; font-family: var(--font-head); margin-bottom: 4px; color: var(--brand); }
.arch .box:not(:last-child)::after { content: '→'; position: absolute; right: -11px; top: 50%; transform: translateY(-50%); color: var(--gold); font-weight: 800; }
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.timeline .st { border-top: 3px solid var(--line-2); padding-top: 10px; }
.timeline .st.now { border-top-color: var(--gold); }
.browser { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fff; }
.browser .bar-top { background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 8px 12px; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--faint); }
.browser .bar-top i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); display: inline-block; }
.browser .site { padding: 18px; background: linear-gradient(180deg, #fafbfd, #fff); }
.site-mock { height: 12px; border-radius: 6px; background: var(--gray-soft); margin-bottom: 8px; }
pre.code { background: #0e1a2b; color: #d7e0ee; border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

/* ─── Адаптив ───────────────────────────────────────────── */
#pf-table td, #pf-table th { padding-left: 8px; padding-right: 8px; }
@media (max-width: 1500px) { .hide-l { display: none !important; } }
@media (max-width: 1280px) {
  .meth { grid-template-columns: minmax(0, 1fr); }
  .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1060px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-7-5, .g-5-7, .g2 { grid-template-columns: minmax(0, 1fr); }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iceberg, .arch, .timeline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .arch .box::after { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 55; transform: translateX(-102%); transition: transform .2s ease; }
  .side.open { transform: none; box-shadow: var(--shadow-lg); }
  .mobile-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; background: var(--brand); color: #fff; padding: 10px 16px; }
  .mobile-bar button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; }
  .mobile-bar b { font-family: var(--font-head); font-size: 14px; }
  .main { padding: 16px 16px 60px; }
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 20px; }
  .login-brand h1 { font-size: 26px; }
  .login-idx { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .login-idx div { padding: 8px 6px; font-size: 10.5px; }
  .login-idx b { font-size: 16px; }
  .login-form { padding: 16px; }
  .meth { grid-template-columns: minmax(0, 1fr); }
  .g3 { grid-template-columns: minmax(0, 1fr); }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .idx-card { padding: 14px; }
  .idx-card .idx-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .idx-card .ring { width: 64px; height: 64px; }
  .head-meta .faint { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban, .iceberg, .arch, .timeline { grid-template-columns: minmax(0, 1fr); }
  .sheet { padding: 22px 18px; }
  .hide-m { display: none !important; }
  .tour { right: 16px; left: 16px; width: auto; bottom: 16px; }
  .drawer { width: 100vw; }
  h1 { font-size: 21px; }
}
@media (max-width: 480px) {
  .login-idx { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .login-brand h1 { font-size: 24px; }
}
@media print {
  .side, .mobile-bar, .topbar .actions, .tabs, .no-print, .tour, #toast, .drawer { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .sheet { box-shadow: none; padding: 0; max-width: none; }
}

/* ─── v0.2: уведомления, роли, документы, заявки ───────── */
.bell { display: flex; gap: 10px; align-items: center; padding: 8px 10px; margin: -4px 0 10px; border-radius: 9px; color: #c9d3e4; cursor: pointer; text-decoration: none; font-weight: 500; }
.bell:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.bell svg { width: 18px; height: 18px; }
.bell-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.mobile-bar .bell-m { margin-left: auto; position: relative; }
.mobile-bar .bell-m .bell-count { position: absolute; top: -4px; right: -8px; }
.note-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.note-row:hover { background: var(--surface-2); text-decoration: none; }
.persona-list { display: grid; gap: 8px; }
.persona { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: 12px; padding: 11px 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.persona:hover { border-color: var(--brand-3); background: var(--blue-soft); }
.persona svg { width: 22px; height: 22px; color: var(--brand-3); margin-top: 2px; flex: none; }
.persona b { display: block; }
.persona span span { display: block; }
.tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gray-soft); color: var(--muted); font-size: 11px; margin-left: 4px; }
.tab-badge.red { background: var(--red); color: #fff; }
.hidden-idx { background: repeating-linear-gradient(135deg, var(--surface), var(--surface) 10px, var(--surface-2) 10px, var(--surface-2) 20px); cursor: default; }
.hidden-idx:hover { transform: none; box-shadow: var(--shadow); }
.lock-ring { width: 76px; height: 76px; border-radius: 50%; border: 8px solid var(--gray-soft); display: grid; place-items: center; flex: none; color: var(--faint); }
.lock-ring svg { width: 26px; height: 26px; }
.idx-card .target { font-size: 11.5px; color: var(--muted); display: grid; gap: 4px; }
.pills a.disabled { opacity: .5; cursor: not-allowed; display: inline-flex; gap: 4px; align-items: center; }
.pills a.disabled svg { width: 13px; height: 13px; }
.seg button[disabled] { cursor: not-allowed; opacity: .7; }
.doc-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.analysis { margin-top: 10px; border: 1px solid #c8d8f6; border-radius: 10px; background: #f7faff; }
.analysis summary { cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 12.5px; color: var(--brand-3); }
.analysis-body { padding: 4px 14px 12px; font-size: 13px; }
.analysis-body h4 { font-family: var(--font-head); font-size: 13.5px; color: var(--brand); margin: 12px 0 4px; }
.analysis-body p { margin: 0 0 6px; }
.analysis-body li { margin: 0 0 4px 16px; }
.req-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.req-row:last-child { border-bottom: 0; }
.req-result { display: flex; gap: 8px; margin-top: 8px; padding: 9px 12px; border-radius: 10px; background: var(--green-soft); color: #11663f; font-size: 13px; }
.req-result svg { width: 18px; height: 18px; flex: none; }
.req-card { margin-bottom: 12px; }
.task.overdue { border-color: #f2c9c5; box-shadow: inset 3px 0 0 var(--red); }
.evidence { border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); margin-top: 12px; }
.msg .rate { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.msg .rate button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; font-size: 12px; padding: 0 5px; line-height: 18px; opacity: .6; }
.msg .rate button.on { opacity: 1; border-color: var(--brand-3); background: var(--blue-soft); }

/* ─── Модуль «Кредитование» ─────────────────────────────────────────── */
.tab-badge.amber { background: var(--amber); color: #fff; }
.tab-badge.green { background: var(--green); color: #fff; }
.tab-badge.gold { background: var(--gold-soft); color: #8a6613; font-weight: 600; }
.cr-borrower { padding: 14px 18px; margin-bottom: 16px; }
.cr-facts { display: grid; grid-template-columns: 2fr repeat(5, minmax(0, 1fr)); gap: 14px 18px; }
.cr-facts > div { min-width: 0; }
.cr-facts span { display: block; font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.cr-facts b { font-family: var(--font-head); font-size: 15px; }
.cr-facts i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
.cr-strategy { margin-bottom: 16px; }
.cr-grid { grid-template-columns: minmax(0, 8fr) minmax(0, 5fr); align-items: start; }
.cr-teaser h3 { margin-bottom: 6px; }
.cr-teaser-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--gold-soft); color: #8a6613; display: grid; place-items: center; flex: none; }
.cr-teaser-ic .ic { width: 26px; height: 26px; }
.cr-list { margin: 10px 0 16px; padding-left: 18px; color: var(--text); }
.cr-list li { margin: 4px 0; }
.prog { border: 1px solid var(--line); border-left: 4px solid var(--line-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.prog.yes { border-left-color: var(--green); }
.prog.maybe { border-left-color: var(--amber); }
.prog.no { border-left-color: var(--red); background: var(--surface-2); }
.prog-head { display: flex; gap: 12px; align-items: flex-start; }
.prog-head b { font-size: 14.5px; }
.prog-fit { text-align: right; flex: none; }
.prog-terms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0 4px; }
.prog-terms span { display: block; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.prog-terms b { font-size: 13.5px; }
.prog-terms i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.prog-why { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12.5px; }
.prog-why li { padding-left: 18px; position: relative; margin: 2px 0; }
.prog-why li::before { position: absolute; left: 2px; top: 0; font-weight: 700; }
.prog-why li.ok::before { content: '✓'; color: var(--green); }
.prog-why li.warn::before { content: '!'; color: var(--amber); left: 5px; }
.prog-why li.no::before { content: '×'; color: var(--red); }
.prog-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.prog.compact { padding: 9px 12px; }
.prog.compact .prog-foot { margin-top: 6px; }
.cr-no summary { cursor: pointer; list-style: none; }
.cr-no summary::-webkit-details-marker { display: none; }
.cr-no summary::before { content: '▸ '; color: var(--faint); }
.cr-no[open] summary::before { content: '▾ '; }
.app-row { border-bottom: 1px solid var(--line); padding: 10px 0; }
.app-row:last-child { border-bottom: 0; }
.app-note { margin-top: 6px; color: var(--muted); }
.offer { display: flex; gap: 8px; margin-top: 8px; background: var(--green-soft); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; }
.offer .ic { color: var(--green); width: 16px; height: 16px; margin-top: 2px; }
select.input.sm { padding: 4px 8px; font-size: 12.5px; border-radius: 8px; width: auto; }
table.cmp td { vertical-align: top; }
.cmp-bar { height: 4px; background: var(--gray-soft); border-radius: 3px; margin-top: 6px; }
.cmp-bar i { display: block; height: 100%; background: var(--brand-3); border-radius: 3px; }
.dc { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.dc:last-child { border-bottom: 0; }
.dc-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--gray-soft); color: var(--muted); }
.dc-ic .ic { width: 13px; height: 13px; }
.dc.ok .dc-ic, .dc.auto .dc-ic { background: var(--green-soft); color: var(--green); }
.cr-big { font-family: var(--font-head); font-size: 28px; font-weight: 800; line-height: 1.2; margin: 4px 0; }
.cr-big.amber { color: var(--amber); }
.cr-big.green { color: var(--green); }
table.cr-cat td { vertical-align: top; }
table.cr-cat tr.off td { opacity: .5; }
td.nowrap, .nowrap { white-space: nowrap; }
label.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.cr-checks { gap: 6px 14px; }
.field .lbl { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
@media (max-width: 1100px) {
  .cr-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cr-facts .wide { grid-column: 1 / -1; }
  .cr-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prog-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cr-compare { margin-bottom: 16px; }
table.cmp tr.best td { background: #f4fbf7; }
.prog-rate { margin: 2px 0 2px; }
.prog-pros { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--green); }
.prog-why li.cond { color: var(--muted); }
.prog-why li.cond::before { content: '•'; color: var(--faint); left: 5px; }
