/* cadence — дизайн-система v1: кремовый фон, терракотовый акцент, Manrope. */
:root {
    --bg: oklch(0.975 0.008 85);
    --panel: oklch(0.993 0.004 85);
    --sunk: oklch(0.945 0.012 80);
    --line: oklch(0.9 0.012 80);
    --line2: oklch(0.82 0.014 75);
    --ink: oklch(0.23 0.012 60);
    --ink2: oklch(0.45 0.012 60);
    --ink3: oklch(0.6 0.01 65);
    --acc: oklch(0.6 0.14 42);
    --acc-soft: oklch(0.6 0.14 42 / 0.13);
    --on-acc: oklch(0.99 0.005 85);
    --pos: oklch(0.55 0.12 150);
    --pos-soft: oklch(0.55 0.12 150 / 0.12);
    --neg: oklch(0.55 0.16 22);
    --neg-soft: oklch(0.55 0.16 22 / 0.12);
    --code: oklch(0.22 0.012 60);
    --code-ink: oklch(0.9 0.01 85);
    --sans: Manrope, system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: oklch(0.18 0.008 60);
    --panel: oklch(0.215 0.009 60);
    --sunk: oklch(0.25 0.01 60);
    --line: oklch(0.29 0.01 60);
    --line2: oklch(0.38 0.012 60);
    --ink: oklch(0.95 0.01 85);
    --ink2: oklch(0.76 0.012 80);
    --ink3: oklch(0.6 0.012 70);
    --acc: oklch(0.7 0.13 42);
    --acc-soft: oklch(0.7 0.13 42 / 0.16);
    --on-acc: oklch(0.16 0.01 60);
    --pos: oklch(0.72 0.13 150);
    --pos-soft: oklch(0.72 0.13 150 / 0.14);
    --neg: oklch(0.7 0.15 22);
    --neg-soft: oklch(0.7 0.15 22 / 0.14);
    --code: oklch(0.14 0.008 60);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font: 500 14px/1.45 var(--sans);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--acc); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2, h3, p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.92em; font-weight: 400; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.muted { color: var(--ink3); }
.small { font-size: 12.5px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Каркас: сайдбар + контент ---------- */

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.side {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 22px;
    padding: 22px 14px 18px;
    background: var(--panel); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -0.04em; }
.brand:hover { color: var(--ink); }
.brand-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--acc); }

.switch { position: relative; }
.switch > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.switch > summary::-webkit-details-marker { display: none; }
.switch[open] > summary { border-color: var(--line2); }
.switch-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.switch-sub { font-size: 11px; color: var(--ink3); font-family: var(--mono); }
.switch-caret { color: var(--ink3); font-size: 12px; }
.switch-menu {
    position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
    display: flex; flex-direction: column; padding: 6px; max-height: 60vh; overflow-y: auto;
    background: var(--panel); border: 1px solid var(--line2); border-radius: 12px;
    box-shadow: 0 20px 40px -20px oklch(0.3 0.03 60 / 0.35);
}
.switch-menu a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; color: var(--ink); font-size: 13px; font-weight: 600; }
.switch-menu a:hover, .switch-menu a.on { background: var(--sunk); }
.switch-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

.app-icon {
    width: 32px; height: 32px; flex: none; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--acc-soft); color: var(--acc); font-weight: 800; font-size: 14px;
}
.app-icon.sm { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }
.app-icon.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }

.nav { display: flex; flex-direction: column; gap: 18px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink3); padding: 0 10px 6px; font-weight: 700; }
.nav a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
    color: var(--ink2); font-size: 13.5px; font-weight: 500;
}
.nav a::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; }
.nav a:hover { color: var(--ink); background: var(--sunk); }
.nav a.on { background: var(--sunk); color: var(--ink); font-weight: 700; }
.nav a.on::before { background: var(--acc); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 22px; }
.theme { display: flex; padding: 3px; border-radius: 999px; background: var(--sunk); font-size: 11.5px; font-weight: 600; }
.theme button { flex: 1; padding: 6px 0; border: 0; border-radius: 999px; background: transparent; color: var(--ink3); cursor: pointer; }
.theme button[aria-pressed="true"] { background: var(--panel); color: var(--ink); }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.avatar {
    width: 30px; height: 30px; flex: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 700;
}
.me-name { font-size: 12.5px; font-weight: 700; }
.me-sub { font-size: 11px; color: var(--ink3); }
.me form { margin-left: auto; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 64px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 0 32px; border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink3); min-width: 0; white-space: nowrap; }
.crumbs a { color: var(--ink3); }
.crumbs a:hover { color: var(--ink); }
.crumbs b { color: var(--ink); font-weight: 600; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.search {
    width: 300px; display: flex; align-items: center; gap: 8px; padding: 0 14px;
    border-radius: 10px; background: var(--sunk); font-size: 13px; color: var(--ink3);
}
.search input { flex: 1; min-width: 0; padding: 9px 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.search input::placeholder { color: var(--ink3); }
.search kbd { font-family: var(--mono); font-size: 11px; }

.content { flex: 1; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.page-title { font-size: 38px; font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.page-sub { font-size: 13.5px; color: var(--ink3); margin-top: 8px; }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Кнопки, переключатели, бейджи ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent;
    color: var(--ink); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn:hover { color: var(--ink); border-color: var(--ink3); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-dark:hover { color: var(--bg); opacity: 0.88; }
.btn-acc { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.btn-acc:hover { color: var(--on-acc); opacity: 0.9; }
.btn-danger { color: var(--neg); }
.btn-lg { padding: 15px 26px; font-size: 15px; }
.btn-ghost { border-color: transparent; color: var(--ink2); }
.link { padding: 0; border: 0; background: none; color: var(--acc); font-weight: 700; cursor: pointer; }
.link:hover { color: var(--ink); }

.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--sunk); font-size: 13px; font-weight: 600; }
.seg a, .seg button { padding: 7px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink2); cursor: pointer; white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--ink); }
.seg .on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px oklch(0 0 0 / 0.06); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-pos { background: var(--pos-soft); color: var(--pos); }
.pill-neg { background: var(--neg-soft); color: var(--neg); }
.pill-acc { background: var(--acc-soft); color: var(--acc); }
.pill-mute { background: var(--sunk); color: var(--ink2); }
.chip { font-family: var(--mono); font-size: 12px; padding: 4px 9px; border-radius: 6px; background: var(--sunk); color: var(--ink); }

.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ink3); display: inline-block; }
.tone-pos { --tone: var(--pos); }
.tone-neg { --tone: var(--neg); }
.tone-acc { --tone: var(--acc); }
.tone-ink2 { --tone: var(--ink2); }
.tone-ink3 { --tone: var(--ink3); }
.tone-ink { --tone: var(--ink); }
[class*="tone-"] .dot, .dot[class*="tone-"] { background: var(--tone); }

/* ---------- Карточки и KPI ---------- */

.card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
    padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card-flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-flush > .card-head { padding: 18px 24px; }
.card-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-value { font-size: 30px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink3); }
.legend span { display: flex; gap: 6px; align-items: center; }
.legend i { width: 10px; height: 3px; border-radius: 2px; background: var(--acc); }
.legend i.sq { width: 8px; height: 8px; }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.kpi-label { font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.kpi-value { font-size: 27px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
.kpis.k3 .kpi-value { font-size: 30px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink3); }
.delta { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.delta.good { color: var(--pos); background: var(--pos-soft); }
.delta.bad { color: var(--neg); background: var(--neg-soft); }

.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.grid-1-12 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }

/* ---------- Графики ---------- */

.chart { position: relative; height: 190px; }
.chart.tall { height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--ink3); font: 10.5px var(--mono); }
.chart-tip {
    position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, calc(-100% - 12px));
    padding: 8px 10px; border-radius: 10px; background: var(--ink); color: var(--bg);
    font-size: 12px; line-height: 1.5; white-space: nowrap; display: none;
}
.chart-tip b { font-weight: 700; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

.bars { flex: 1; min-height: 200px; display: flex; gap: 6px; align-items: stretch; }
.bar { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bar-up { flex: 3; display: flex; flex-direction: column; justify-content: flex-end; }
.bar-down { flex: 1; border-top: 1px solid var(--ink2); }
.bar-up i { display: block; background: var(--acc); border-radius: 4px 4px 0 0; min-height: 1px; }
.bar-down i { display: block; background: var(--ink3); opacity: 0.55; border-radius: 0 0 4px 4px; }
.bar-label { position: relative; height: 20px; font: 10.5px var(--mono); color: var(--ink3); white-space: nowrap; }
.bar-label span { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); }

.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--sunk); }
.stack i { display: block; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.share-row:last-child { border-bottom: 0; }
.share-row .sw { width: 9px; height: 9px; flex: none; border-radius: 3px; }
.share-row .name { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row .p { color: var(--ink3); width: 44px; text-align: right; }
.share-row .v { font-weight: 700; width: 84px; text-align: right; }

/* ---------- Лента событий ---------- */

.feed { display: flex; flex-direction: column; }
.ev {
    display: grid; grid-template-columns: 170px minmax(0, 1fr) 84px 56px; gap: 12px; align-items: center;
    padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink);
}
a.ev:hover { color: var(--ink); background: var(--sunk); margin: 0 -24px; padding: 9px 24px; }
.ev-kind { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.ev-kind span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-who { color: var(--ink2); font: 11.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-amt { text-align: right; font-weight: 700; white-space: nowrap; }
.ev-time { text-align: right; color: var(--ink3); font-size: 12px; white-space: nowrap; }

/* ---------- Таблицы ---------- */

.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
    padding: 14px 12px; text-align: left; white-space: nowrap; background: var(--sunk);
    font-size: 11.5px; font-weight: 700; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.06em;
}
.tbl td { padding: 13px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl th:first-child, .tbl td:first-child { padding-left: 24px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tbody tr:hover { background: color-mix(in oklch, var(--sunk) 55%, transparent); }
.tbl .strong { font-weight: 700; }
.tbl .sub { font-size: 12px; color: var(--ink3); }
.tbl a.row-link { color: var(--ink); font-weight: 700; }
.tbl a.row-link:hover { color: var(--acc); }
.tbl input.sm { width: 100%; max-width: 160px; padding: 6px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--sunk); font: 12px var(--mono); }
.tbl input.xs { max-width: 80px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 16px; border-top: 1px solid var(--line); font-size: 13px; }

/* ---------- Формы ---------- */

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink2); }
.field small { font-size: 12.5px; color: var(--ink3); line-height: 1.45; }
.input, .field input:not([type="checkbox"]), .field select, .field textarea, .toolbar input, .toolbar select {
    width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel);
    font-size: 15px; color: var(--ink); outline: none;
}
.toolbar input, .toolbar select { width: auto; padding: 9px 12px; border-radius: 10px; font-size: 13px; }
.toolbar input[type="search"] { min-width: 260px; }
.field textarea { font: 13px/1.5 var(--mono); resize: vertical; }
.field ::placeholder, .toolbar ::placeholder { color: var(--ink3); opacity: 0.7; font-weight: 500; }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus, .toolbar select:focus { border: 1px solid var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.field .mono-input { font-family: var(--mono); font-size: 13.5px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--acc); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.code {
    display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
    padding: 12px 14px; border-radius: 10px; background: var(--code); color: var(--code-ink);
    font: 13px/1.85 var(--mono); overflow-x: auto;
}
.code pre { margin: 0; font: inherit; white-space: pre; }
.code .kw { color: var(--acc); }
.code .str { opacity: 0.65; }
.code .cm { opacity: 0.5; }
.copy-btn { flex: none; padding: 0; border: 0; background: none; color: inherit; opacity: 0.55; font: 600 12.5px var(--sans); cursor: pointer; }
.copy-btn:hover { opacity: 1; }

.ok-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--pos-soft); font-size: 13.5px; }
.ok-row b { color: var(--pos); font-weight: 800; }
.note { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--sunk); font-size: 13.5px; color: var(--ink2); line-height: 1.45; }

.flash { padding: 12px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; background: var(--pos-soft); color: var(--pos); }
.flash-error { background: var(--neg-soft); color: var(--neg); }

.empty { align-items: flex-start; padding: 40px; gap: 16px; }
.empty h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.04em; }
.empty p { color: var(--ink2); max-width: 560px; }

/* ---------- Приложения (главная) ---------- */

.hello { font-size: 15px; color: var(--ink2); }
.hero-num { font-size: 56px; font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.hero-num small { font-size: 20px; letter-spacing: -0.01em; color: var(--ink2); font-weight: 500; }
.apps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.app-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px;
    display: flex; flex-direction: column; gap: 22px; color: var(--ink); min-width: 0;
}
.app-card:hover { color: var(--ink); border-color: var(--line2); }
.app-card-head { display: flex; align-items: center; gap: 14px; }
.app-card-name { font-weight: 700; font-size: 16px; }
.app-card-id { font: 11.5px var(--mono); color: var(--ink3); }
.app-card-num { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.app-card-num .lbl { font-size: 12.5px; color: var(--ink3); font-weight: 600; }
.app-card-num .val { display: flex; align-items: baseline; gap: 8px; }
.app-card-num .val b { font-size: 34px; font-weight: 600; letter-spacing: -0.04em; white-space: nowrap; }
.app-card-num > div { min-width: 0; }
.app-card-num .val span { font-size: 12.5px; font-weight: 700; }
.app-card svg { width: 150px; height: 48px; flex: none; overflow: visible; }
.app-card-foot { display: flex; gap: 24px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; color: var(--ink2); }
.app-card-foot b { color: var(--ink); }
.app-add {
    border: 1.5px dashed var(--line2); border-radius: 18px; padding: 24px; min-height: 220px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; color: var(--ink);
}
.app-add:hover { color: var(--ink); border-color: var(--ink3); }
.app-add .plus { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--ink2); }

/* ---------- Когорты ---------- */

.cohort { display: grid; gap: 4px; align-items: center; font-size: 13px; }
.cohort-head { font: 700 11.5px var(--mono); color: var(--ink3); padding-bottom: 8px; }
.cohort-head div { text-align: center; }
.cohort-head div:nth-child(-n+2) { text-align: left; }
.cohort-head div:nth-child(2), .cohort .size { text-align: right; padding-right: 8px; }
.cohort .size { color: var(--ink2); }
.cohort .m { font-weight: 700; white-space: nowrap; }
.cell { height: 40px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; }

/* ---------- Клиент ---------- */

.cust { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.cust-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cust-id { display: flex; align-items: center; gap: 14px; }
.cust-avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--acc-soft); color: var(--acc); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
.cust-name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; word-break: break-all; }
.ltv { border-top: 1px solid var(--line); padding-top: 18px; display: flex; flex-direction: column; gap: 4px; }
.ltv b { font-size: 44px; font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.kv { padding: 8px 24px; gap: 0; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--ink3); }
.kv dd { margin: 0; font-weight: 600; text-align: right; word-break: break-all; }
.ent-hero {
    background: var(--ink); color: var(--bg); border-radius: 16px; padding: 24px 28px;
    display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; align-items: end;
}
.ent-hero .lbl { font-size: 12.5px; opacity: 0.6; font-weight: 600; }
.ent-hero .big { font-size: 30px; font-weight: 600; letter-spacing: -0.04em; }
.ent-hero .val { font-size: 18px; font-weight: 700; }
.ent-hero .mono { font-size: 13px; opacity: 0.6; }
.tl { display: grid; grid-template-columns: 24px minmax(0, 1fr) 110px 100px 90px; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.tl .dot { width: 10px; height: 10px; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--tone); }
.tl-title { font-weight: 700; }
.tl-sub { font: 12px var(--mono); color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Продукты ---------- */

.ent-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.ent-card-head { display: flex; justify-content: space-between; align-items: center; font: 500 15px var(--mono); }
.ent-card-nums { display: flex; gap: 28px; }
.ent-card-nums b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.04em; }
.ent-card-nums span { font-size: 12px; color: var(--ink3); }

/* ---------- Мастер и вход (без сайдбара) ---------- */

.bare-page { min-height: 100vh; display: flex; flex-direction: column; }
.wiz-top { height: 76px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 48px; border-bottom: 1px solid var(--line); }
.wiz-top .brand { padding: 0; font-size: 19px; }
.wiz-top .sep { color: var(--line2); }
.wiz-top .ctx { font-size: 14.5px; font-weight: 600; color: var(--ink2); }
.close-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; color: var(--ink2); }
.wiz { flex: 1; display: grid; grid-template-columns: 360px minmax(0, 1fr); }
.steps { padding: 56px 48px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.steps-label { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); margin-bottom: 18px; }
.step { display: flex; gap: 16px; padding: 14px 0; color: var(--ink3); }
.step-mark { width: 30px; height: 30px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 1px solid var(--line2); }
.step-title { font-size: 15.5px; font-weight: 700; padding-top: 4px; }
.step-desc { font-size: 13.5px; color: var(--ink3); line-height: 1.45; margin-top: 4px; }
.step.done, .step.cur { color: var(--ink); }
.step.done .step-mark { background: var(--ink); color: var(--bg); border-color: transparent; }
.step.cur .step-mark { background: var(--acc); color: var(--on-acc); border-color: transparent; }
a.step:hover { color: var(--ink); }
.wiz-body { padding: 56px 72px; display: flex; flex-direction: column; gap: 32px; max-width: 880px; min-width: 0; }
.wiz-title { font-size: 46px; font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.wiz-lead { font-size: 16.5px; color: var(--ink2); line-height: 1.5; margin-top: 12px; max-width: 640px; }
.wiz-body .field input:not([type="checkbox"]) { padding: 15px 16px; font-size: 16px; font-weight: 600; }
.store-card { border-radius: 16px; border: 1.5px solid var(--ink); background: var(--panel); padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.store-card-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 700; }
.waiting { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; border-radius: 14px; border: 1px dashed var(--line2); background: var(--panel); }
.pulse { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 6px var(--acc-soft); }
.pulse.ok { background: var(--pos); box-shadow: 0 0 0 6px var(--pos-soft); }

.ready { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 64px; padding: 80px 96px; align-items: center; }
.ready-title { font-size: 84px; font-weight: 600; letter-spacing: -0.055em; line-height: 0.95; }
.ready-lead { font-size: 19px; line-height: 1.5; color: var(--ink2); max-width: 560px; }
.checklist { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 8px 24px; }
.checklist > div { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.checklist > div:last-child { border-bottom: 0; }
.checklist .mark { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--bg); }
.checklist .ok .mark { background: var(--pos); border-color: var(--pos); }
.checklist .t { flex: 1; font-weight: 600; color: var(--ink2); }
.checklist .ok .t { color: var(--ink); }
.checklist .s { font-size: 12.5px; color: var(--ink3); }

.login { flex: 1; display: grid; grid-template-columns: 1fr 1fr; }
.login-form { padding: 56px 96px; display: flex; flex-direction: column; }
.login-form .brand { padding: 0; font-size: 21px; }
.login-form .brand-dot { width: 18px; height: 18px; }
.login-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 36px; max-width: 440px; padding: 48px 0; }
.login-body h1 { font-size: 48px; font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.login-aside {
    margin: 14px; border-radius: 14px; background: var(--ink); color: var(--bg); padding: 64px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.login-aside .quote { font-size: 44px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; text-wrap: balance; }
.login-aside .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; border-top: 1px solid color-mix(in oklch, var(--bg) 20%, transparent); padding-top: 28px; }
.login-aside .facts b { display: block; font-size: 40px; font-weight: 600; letter-spacing: -0.04em; }
.login-aside .facts span { font-size: 13.5px; opacity: 0.6; }

/* ---------- Адаптивность ---------- */

/* ---------- Воронки ---------- */

.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) 64px 140px; gap: 14px; align-items: center; font-size: 13.5px; }
.funnel-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.funnel-num { width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--sunk); color: var(--ink2); font: 700 11.5px var(--mono); display: flex; align-items: center; justify-content: center; }
.funnel-bar { height: 30px; border-radius: 8px; background: var(--sunk); overflow: hidden; }
.funnel-bar i { display: block; height: 100%; min-width: 3px; border-radius: 8px; background: var(--acc); }
.funnel-row:nth-child(n+2) .funnel-bar i { background: color-mix(in oklch, var(--acc) 72%, var(--panel)); }
.funnel-n { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.funnel-p { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--ink3); line-height: 1.3; }
.funnel-p b { font-size: 13.5px; color: var(--ink); }
.funnel-step { flex-direction: row; align-items: center; gap: 10px; }
.funnel-step > span { width: 18px; flex: none; font: 700 12px var(--mono); color: var(--ink3); }
.saved-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; }
.saved-row.on { background: var(--sunk); }
.saved-row a { color: var(--ink); min-width: 0; }

@media (max-width: 1280px) {
    .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .apps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ready { grid-template-columns: 1fr; padding: 56px; }
}

@media (max-width: 1080px) {
    .grid-2-1, .grid-1-12, .grid-2, .grid-side, .cust { grid-template-columns: 1fr; }
    .wiz { grid-template-columns: 1fr; }
    .steps { border-right: 0; border-bottom: 1px solid var(--line); padding: 24px 32px; flex-direction: row; flex-wrap: wrap; gap: 4px 24px; }
    .steps-label { width: 100%; margin-bottom: 4px; }
    .step-desc { display: none; }
    .wiz-body { padding: 32px; }
    .login { grid-template-columns: 1fr; }
    .login-aside { display: none; }
}

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
    .switch { flex: 1; min-width: 180px; }
    .nav { order: 3; width: 100%; flex-direction: row; gap: 4px; overflow-x: auto; }
    .nav-group { flex-direction: row; gap: 4px; }
    .nav-label { display: none; }
    .nav a { white-space: nowrap; }
    .side-foot { margin: 0; flex-direction: row; align-items: center; gap: 12px; }
    .me-name, .me-sub { display: none; }
    .theme button { padding: 6px 10px; }
    .topbar { padding: 0 16px; }
    .search { width: auto; flex: 1; max-width: 300px; }
    .content { padding: 20px 16px 40px; }
    .page-title { font-size: 30px; }
    .kpis, .kpis.k3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .apps-grid { grid-template-columns: 1fr; }
    .ev { grid-template-columns: minmax(0, 1fr) 80px; }
    .ev-who, .ev-time { display: none; }
    .ent-hero { grid-template-columns: 1fr 1fr; }
    .tl { grid-template-columns: 24px minmax(0, 1fr) 80px; }
    .tl > :nth-child(3), .tl > :nth-child(4) { display: none; }
    .funnel-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
    .funnel-bar { grid-column: 1 / -1; order: 3; height: 22px; }
    .funnel-p { grid-column: 1 / -1; order: 4; flex-direction: row; gap: 8px; }
    .form-row { grid-template-columns: 1fr; }
    .wiz-top { padding: 0 16px; }
    .wiz-body { padding: 24px 16px; }
    .wiz-title { font-size: 34px; }
    .ready { padding: 32px 16px; }
    .ready-title { font-size: 52px; }
    .login-form { padding: 32px 16px; }
    .login-body h1 { font-size: 36px; }
    .hero-num { font-size: 40px; }
}
