/* Рента — тёмная тема. Токены в :root, серии графиков — --s-*. */
:root {
  color-scheme: dark;
  --bg: #0b0e13;
  --bg-2: #0e1218;
  --surface: #131821;
  --surface-2: #19202a;
  --surface-3: #202834;
  --line: #222a36;
  --line-2: #2d3746;
  --text: #e8ecf1;
  --text-2: #adb6c3;
  --muted: #7b8595;
  --accent: #a99df7;
  --accent-2: #8676f2;
  --accent-ink: #0b0e13;
  --accent-wash: rgba(169, 157, 247, .12);
  --good: #3fbf6f;
  --good-wash: rgba(63, 191, 111, .12);
  --bad: #e66767;
  --bad-wash: rgba(230, 103, 103, .12);
  --warn: #e8b04a;
  /* серии графиков (проверенная категориальная палитра, тёмные шаги) */
  --s-coupon: #3987e5;
  --s-dividend: #d95926;
  --s-principal: #199e70;
  --s-rent: #9085e9;      /* прошла проверку на различимость рядом с оранжевым и бирюзовым */
  --s-expense: #6b7686;   /* расходы — нейтральный серый, столбики вниз от нуля */
  --s-none: #5d6878;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .8);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
small { font-size: 12.5px; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.b { font-weight: 600; }
.r { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.warn { color: var(--warn); display: flex; gap: 6px; align-items: center; margin: 8px 0 0; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.ic.logo { width: 34px; height: 34px; stroke: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- каркас ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: none;
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand b { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  color: var(--text-2); font-size: 14.5px;
}
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--accent-wash); color: var(--text); }
.nav a.on .ic { color: var(--accent); }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.who { display: flex; gap: 10px; align-items: center; min-width: 0; padding: 0 6px; }
.ava { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; flex: none; }
.who-t { min-width: 0; }
.who-t b, .who-t small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-t b { font-size: 13.5px; font-weight: 500; }
.who-t small { color: var(--muted); font-size: 12px; }
.side-foot form { padding: 0 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: rgba(11, 14, 19, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-title { font-size: 20px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.burger { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }
.content { padding: 24px 28px 10px; display: flex; flex-direction: column; gap: 18px; max-width: 1400px; width: 100%; }
.foot { padding: 18px 28px 26px; color: var(--muted); font-size: 12.5px; }
.side-scrim { display: none; }

/* ---------- кнопки и формы ---------- */
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font: 500 14px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s;
}
.btn { background: var(--accent); color: var(--accent-ink); }
.btn:hover { background: #bcb3fa; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: #3a4556; }
.btn.sm, .btn-ghost.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn-ghost.icon-only { width: 34px; height: 34px; padding: 0; }
.btn-ghost.danger { color: #f09a9a; }
.btn-ghost.danger:hover { background: var(--bad-wash); border-color: rgba(230, 103, 103, .45); }
button[disabled], .is-busy button[type=submit] { opacity: .6; pointer-events: none; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; cursor: pointer; font: 500 13px var(--font); color: var(--text-2); height: 38px; align-items: stretch; }
.seg span { padding: 0 11px; border-radius: 7px; display: flex; align-items: center; }
.seg span.on { background: var(--surface-3); color: var(--text); }

.form { display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > span { font-size: 13px; color: var(--text-2); }
.fld small { color: var(--muted); }
input, select, textarea {
  font: 14.5px var(--font); color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; height: 40px; width: 100%; min-width: 0;
}
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--accent); padding: 0; flex: none; }
input[type=file] { padding: 8px; height: auto; }
input:focus, select:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-wash); }
input::placeholder { color: #5b6574; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type=date] { color-scheme: dark; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 2px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
legend { font-size: 13px; color: var(--text-2); margin-bottom: 8px; padding: 0; }
.form fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.grid-form .span2 { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { width: 230px; height: 38px; }

/* ---------- уведомления и подсказки ---------- */
.flash {
  display: flex; gap: 10px; align-items: flex-start; margin: 16px 28px 0; padding: 12px 14px;
  border-radius: 12px; border: 1px solid; font-size: 14px;
}
.content .flash, .auth-card .flash { margin: 0 0 4px; }
.flash span { flex: 1; }
.flash-ok { background: var(--good-wash); border-color: rgba(63, 191, 111, .35); color: #cdeed8; }
.flash-ok .ic { color: var(--good); }
.flash-error { background: var(--bad-wash); border-color: rgba(230, 103, 103, .4); color: #f6d4d4; }
.flash-error .ic { color: var(--bad); }
.flash-x { background: none; border: 0; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .6; padding: 0 2px; }
.tip {
  position: fixed; z-index: 100; pointer-events: none; min-width: 190px; max-width: 280px;
  background: #1d2430; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .8); font-size: 13px;
}
.tip b { display: block; margin-bottom: 6px; font-weight: 600; }
.tip .row { display: flex; gap: 12px; justify-content: space-between; align-items: center; color: var(--text-2); }
.tip .row span:first-child { display: flex; gap: 7px; align-items: center; }
.tip .row.total { color: var(--text); border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 6px; font-weight: 600; }
.tip .hint { color: var(--muted); margin-top: 6px; font-size: 12px; }

/* ---------- карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.card > h2 { margin-bottom: 14px; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.card-h h2 { display: flex; gap: 8px; align-items: center; }
.card-h p { margin: 3px 0 0; }
.link { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; white-space: nowrap; }
.link .ic { width: 15px; height: 15px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid2.tight { gap: 22px; align-items: center; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.note { margin: 12px 0 0; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); vertical-align: 2px; letter-spacing: .01em; }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); margin-right: 6px; line-height: 17px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-l { color: var(--text-2); font-size: 13px; }
.kpi-v { font-size: 25px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-v.sm-v { font-size: 17px; padding: 6px 0 4px; }
.kpi-s { color: var(--muted); font-size: 12.5px; }

/* ---------- графики ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -4px 0 10px; font-size: 13px; color: var(--text-2); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw-hatch { background: repeating-linear-gradient(45deg, var(--text-2) 0 2px, transparent 2px 5px); outline: 1px solid var(--line-2); }
.chart-wrap { overflow-x: auto; overflow-y: hidden; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
svg.chart { display: block; width: 100%; height: auto; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .axis { stroke: var(--line-2); stroke-width: 1; }
svg.chart .tick { fill: var(--muted); font-size: 11px; }
svg.chart .xl { fill: var(--text-2); font-size: 11.5px; }
svg.chart .xl.cur { fill: var(--text); font-weight: 600; }
svg.chart .xs { fill: var(--muted); font-size: 10.5px; }
svg.chart .cur-dot { fill: var(--accent); }
svg.chart .hit { fill: transparent; }
svg.chart .col { cursor: pointer; }
svg.chart .col:hover .hit { fill: rgba(255, 255, 255, .035); }
svg.chart .col.is-current .hit { fill: rgba(169, 157, 247, .05); }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 0 10px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.r { text-align: right; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl td small { display: block; margin-top: 2px; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.tbl tr.cur td { background: var(--accent-wash); }
.tbl tr.cur td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.tbl tr.past td { color: var(--text-2); }
.tbl tfoot td { border-top: 1px solid var(--line-2); border-bottom: 0; font-weight: 600; padding-top: 12px; }
.tbl.periods td a { color: var(--text); font-weight: 500; }
.tbl.periods td small { display: block; }
tr.clickable { cursor: pointer; }
.note-cell { max-width: 220px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px 2px 6px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.b-received { color: #bfe9cd; border-color: rgba(63, 191, 111, .45); background: var(--good-wash); }
.b-received .ic { color: var(--good); }
.b-paid { color: var(--text-2); }
.b-known { color: #c9dcf6; border-color: rgba(57, 135, 229, .45); }
.b-forecast { color: #d8d2fb; border-color: rgba(169, 157, 247, .45); }
.b-estimate { color: var(--muted); border-style: dashed; }
.b-error { color: #f6c7c7; border-color: rgba(230, 103, 103, .45); background: var(--bad-wash); }
.kind { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.broker { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); letter-spacing: .01em; }
.br-bcs { background: rgba(57, 135, 229, .16); color: #a9cbf3; }
.br-finam { background: rgba(232, 176, 74, .15); color: #ecd09a; }
.br-sber { background: rgba(25, 158, 112, .17); color: #9be0c4; }
.br-aton { background: rgba(169, 157, 247, .15); color: #cfc8fb; }
.br-realty { background: rgba(144, 133, 233, .16); color: #d3cdfa; }
.pill-ok { background: var(--good-wash); color: #bfe9cd; }
.up-t { color: var(--text); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- обзор ---------- */
.upcoming { list-style: none; margin: 0; padding: 0; }
.upcoming li { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.upcoming li:last-child { border-bottom: 0; }
.up-date { width: 44px; flex: none; text-align: center; background: var(--surface-2); border-radius: 10px; padding: 5px 0; line-height: 1.1; }
.up-date b { display: block; font-size: 17px; }
.up-date small { color: var(--muted); font-size: 11.5px; }
.up-main { flex: 1; min-width: 0; }
.up-main a { color: var(--text); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-main small { color: var(--muted); }
.up-sum { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.pf-list { display: flex; flex-direction: column; }
.pf-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.pf-row:last-child { border-bottom: 0; }
.pf-row:hover { text-decoration: none; background: rgba(255, 255, 255, .015); }
.pf-name { flex: 1; min-width: 0; }
.pf-name b { display: block; font-weight: 500; }
.pf-name small { color: var(--muted); }
.pf-val { text-align: right; font-weight: 600; }
.pf-val small { display: block; font-weight: 400; }

.onboard { max-width: 760px; }
.onboard h2 { font-size: 24px; margin-bottom: 8px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { counter-increment: s; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 18px 64px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.steps li::before { content: counter(s); position: absolute; left: 20px; top: 17px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); display: grid; place-items: center; font-weight: 600; }
.steps span { color: var(--text-2); }
.steps .btn { margin-top: 6px; }
.empty { text-align: center; padding: 60px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-card { text-align: center; padding: 34px 22px; }
.empty-card .actions { justify-content: center; margin-top: 8px; }

/* ---------- фильтры, календарь, отчёт ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.sel { display: flex; flex-direction: column; gap: 5px; }
.sel span { font-size: 12.5px; color: var(--muted); }
.sel select { min-width: 170px; height: 38px; }
.sel.wide select { min-width: 280px; }
.year-nav { display: flex; align-items: center; gap: 10px; }
.year-nav b { font-size: 20px; min-width: 52px; text-align: center; }
.seg-links { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-links a { padding: 6px 12px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; }
.seg-links a:hover { text-decoration: none; color: var(--text); }
.seg-links a.on { background: var(--surface-3); color: var(--text); }
.seg-links.sm a { padding: 3px 9px; font-size: 12.5px; }
.tabs { align-self: flex-start; }
.sumline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sumline > div { background: var(--surface); padding: 14px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sumline span { display: flex; gap: 7px; align-items: center; }
.sumline b { font-size: 18px; font-weight: 600; }
.month { padding: 16px 22px; }
.month.is-empty { padding: 12px 22px; background: transparent; box-shadow: none; }
.month-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.month-h h2 { font-size: 16px; }
.month.is-empty .month-h h2 { color: var(--text-2); font-weight: 500; font-size: 15px; }
.month:not(.is-empty) .month-h { margin-bottom: 12px; }
.month-sum { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.month-sum b { font-size: 17px; }
.month.is-cur { border-color: rgba(169, 157, 247, .35); }
.month.is-target { box-shadow: 0 0 0 2px var(--accent-2); }
.legend-help summary { cursor: pointer; color: var(--text-2); }
.legend-help dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 14px 0 0; align-items: center; }
.legend-help dd { margin: 0; color: var(--text-2); font-size: 13.5px; }

/* ---------- портфели ---------- */
.pf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pf-card { color: var(--text); display: flex; flex-direction: column; gap: 6px; transition: border-color .15s; }
.pf-card:hover { text-decoration: none; border-color: var(--line-2); }
.pf-card-h { display: flex; justify-content: space-between; align-items: center; }
.pf-card h3 { font-size: 17px; margin-top: 6px; }
.pf-card p { margin: 0; }
.pf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 10px 0 0; }
.pf-stats dt { color: var(--muted); font-size: 12px; }
.pf-stats dd { margin: 0; font-weight: 600; }
.sub-h { margin: 22px 0 8px; color: var(--text-2); }
.page-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-h p { margin: 4px 0 0; }
.crumbs { color: var(--muted); font-size: 13.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.sync-line { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.sync-line.ok .ic { color: var(--good); }
.sync-line.bad { border-color: rgba(230, 103, 103, .4); }
.sync-line.bad .ic { color: var(--bad); }
.hint { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.hint summary { cursor: pointer; color: var(--text-2); font-size: 14px; }
.hint ol { margin: 10px 0 0; padding-left: 20px; color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.hint p { color: var(--text-2); font-size: 14px; margin: 8px 0; }
aside .hint:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.danger-zone { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.log-msg { white-space: pre-wrap; margin: 6px 0 0; font: 12.5px/1.45 var(--mono); color: var(--text-2); max-height: 160px; overflow: auto; }

/* ---------- импорт ---------- */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 30px 16px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent-2); background: var(--accent-wash); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: 100%; }
.drop .ic { width: 30px; height: 30px; color: var(--accent); }
.drop b { font-weight: 500; }
.preview td { vertical-align: middle; }
.preview tr.missing td { color: var(--muted); }
.qty-in { width: 120px; height: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.commit-bar { display: grid; grid-template-columns: 200px 1fr auto; gap: 18px; align-items: end; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.checks { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; }
.checks li { display: flex; gap: 6px; align-items: center; }
.checks li.ok { color: var(--text-2); }
.checks li.ok .ic { color: var(--good); }
.checks li.bad { color: #f2b7b7; }
.checks li.bad .ic { color: var(--bad); }

/* ---------- вход ---------- */
.auth-body {
  background: var(--bg);
  /* затемнение поверх фото гор: слева плотнее — там текст, снизу — переход в фон */
  --auth-shade: linear-gradient(90deg, rgba(7, 9, 14, .72) 0%, rgba(7, 9, 14, .38) 34%, rgba(7, 9, 14, .06) 62%, rgba(7, 9, 14, .18) 100%),
                linear-gradient(180deg, rgba(7, 9, 14, 0) 60%, rgba(7, 9, 14, .55) 100%);
}
.auth-bg { position: fixed; inset: 0; z-index: 0; background-color: #10121c; background-size: cover; background-position: 62% 40%; background-repeat: no-repeat; }
.auth { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(360px, 440px); gap: 56px; align-items: center; max-width: 1120px; margin: 0 auto; padding: 40px 28px; }
.auth-side { text-shadow: 0 1px 18px rgba(0, 0, 0, .55); }
.auth-side h2 { font-size: 38px; line-height: 1.12; letter-spacing: -.025em; margin: 30px 0 24px; max-width: 540px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; color: #c9d0db; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; }
.auth-points .ic { color: var(--accent); margin-top: 2px; }
.auth-cta { margin-top: 30px; height: 46px; padding: 0 22px; text-shadow: none; box-shadow: 0 10px 30px -10px rgba(134, 118, 242, .7); }
.brand.big b { font-size: 22px; }
.auth-card {
  background: rgba(17, 21, 30, .74); border: 1px solid rgba(255, 255, 255, .09); border-radius: 20px; padding: 26px 30px 28px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .85); display: flex; flex-direction: column; gap: 14px;
  -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
}
.auth-card h1 { font-size: 24px; }
.auth-card .btn { height: 44px; }
.auth-card input { background: rgba(9, 12, 18, .72); }
.auth-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; margin-bottom: 6px; background: rgba(9, 12, 18, .6); border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; }
.auth-tabs a { text-align: center; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 14.5px; }
.auth-tabs a:hover { color: var(--text); text-decoration: none; }
.auth-tabs a.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset; }
.steps-sm { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha-box { min-height: 102px; }
.cap-note { margin: 0; font-size: 12px; color: var(--muted); }
.cap-note a { color: var(--text-2); }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sumline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 40px rgba(0, 0, 0, .5); }
  body.side-open .side { transform: none; }
  body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  .burger { display: block; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-side h2 { font-size: 26px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .top { padding: 10px 16px; gap: 8px; }
  .top-title { font-size: 17px; }
  .content { padding: 16px 16px 6px; gap: 14px; }
  .flash { margin: 12px 16px 0; }
  .foot { padding: 14px 16px 22px; }
  .card { padding: 16px; }
  .tbl-wrap { margin: 0 -16px; padding: 0 16px; }
  .hide-sm { display: none !important; }
  .kpis { gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi-v { font-size: 20px; }
  .sumline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2, .grid-form, .commit-bar, .checks { grid-template-columns: minmax(0, 1fr); }
  .sel select, .sel.wide select { min-width: 0; width: 100%; }
  .sel, .sel.wide { flex: 1 1 140px; }
  .seg span { padding: 0 8px; }
  .card-h { flex-wrap: wrap; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { width: 100%; }
  .auth { padding: 24px 16px; gap: 24px; }
  .auth-card { padding: 22px 18px; }
  .auth-side h2 { font-size: 22px; margin: 18px 0 4px; }
  .auth-points, .auth-cta { display: none; }
  .auth-bg { background-position: 30% 30%; }
}
@media (forced-colors: active) {
  .sw-hatch { forced-color-adjust: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
