/* TG Lead Finder — минималистичная дизайн-система.
   Монохром + один акцент (лайм). Цвета только через токены; тёмная тема переопределяет токены. */
:root {
  --bg: #e7e7e2;
  --panel: #f2f2ee;            /* боковая панель — между фоном и карточками */
  --surface: #ffffff;
  --surface-2: #f4f4f0;
  --line: #deded8;
  --line-strong: #c4c4bc;
  --ink: #09090a;
  --ink-2: #5a5a53;
  --ink-3: #a3a39a;
  --hi: rgba(255, 255, 255, .9);              /* блик по верхней кромке карточек */
  --depth: 0 1px 2px rgba(10, 10, 11, .06), 0 10px 28px rgba(10, 10, 11, .07);
  --glow: radial-gradient(1100px 420px at 70% -10%, rgba(198, 244, 50, .14), transparent 60%);
  --accent: #c6f432;          /* лайм — заливки, полосы, индикаторы */
  --accent-ink: #0b0b0c;      /* текст на лайме */
  --accent-text: #4d6b00;     /* лайм, читаемый как текст на светлом */
  --primary: #0b0b0c;         /* основная кнопка */
  --primary-ink: #ffffff;
  --ok: #3f8f3a; --warn: #b7791f; --bad: #c2412d;
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 232px;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #040405; --panel: #0a0a0c; --surface: #16161a; --surface-2: #202026; --line: #2b2b32; --line-strong: #3e3e47;
    --hi: rgba(255, 255, 255, .06); --depth: 0 1px 0 rgba(0, 0, 0, .6), 0 14px 34px rgba(0, 0, 0, .45);
    --glow: radial-gradient(1100px 420px at 70% -10%, rgba(198, 244, 50, .10), transparent 60%);
    --ink: #ffffff; --ink-2: #8e8e87; --ink-3: #55554f;
    --accent: #c6f432; --accent-ink: #0b0b0c; --accent-text: #c6f432;
    --primary: #ededea; --primary-ink: #0b0b0c;
    --ok: #7bd389; --warn: #e5b45a; --bad: #ef7a63;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #040405; --panel: #0a0a0c; --surface: #16161a; --surface-2: #202026; --line: #2b2b32; --line-strong: #3e3e47;
    --hi: rgba(255, 255, 255, .06); --depth: 0 1px 0 rgba(0, 0, 0, .6), 0 14px 34px rgba(0, 0, 0, .45);
    --glow: radial-gradient(1100px 420px at 70% -10%, rgba(198, 244, 50, .10), transparent 60%);
  --ink: #ffffff; --ink-2: #8e8e87; --ink-3: #55554f;
  --accent: #c6f432; --accent-ink: #0b0b0c; --accent-text: #c6f432;
  --primary: #ededea; --primary-ink: #0b0b0c;
  --ok: #7bd389; --warn: #e5b45a; --bad: #ef7a63;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Geist", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--ink); border-bottom: 1px solid var(--line-strong); }
a.link:hover { border-color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.025em; }
h1 { font-size: 34px; line-height: 1.1; }
h2 { font-size: 16px; letter-spacing: -.01em; }
h3 { font-size: 14px; letter-spacing: -.005em; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i-sm { width: 15px; height: 15px; }
svg.i-lg { width: 22px; height: 22px; }

/* --- каркас --- */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--line); padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-weight: 600; letter-spacing: -.02em; font-size: 15px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink); color: var(--accent);
}
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2; }
.niche-switch { padding: 0 6px; display: flex; flex-direction: column; gap: 6px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 500; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav .count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 12px;
}
.user-chip .who { min-width: 0; line-height: 1.3; }
.user-chip .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-actions { display: flex; gap: 2px; padding: 0 2px; }

.main { padding: 36px 44px 72px; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.page-head > div { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.page-head > form, .page-head > a { flex-shrink: 0; }
.page-head .sub { color: var(--ink-2); max-width: 680px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack > * { min-width: 0; }   /* широкие таблицы и воронка скроллятся внутри, а не растягивают страницу */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --- поверхности --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head .more { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }
.card-head .more:hover { color: var(--ink); }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric { padding: 20px 22px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.metric:first-child { border-left: none; }
.metric .value { font-family: var(--mono); font-size: 34px; font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.metric.lead .value { display: inline-flex; align-items: center; gap: 10px; }
.metric.lead .value::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .glyph { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; border: 1px dashed var(--line-strong); color: var(--ink-3); }

/* --- кнопки и формы --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .06s, opacity .15s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { opacity: .88; border-color: var(--primary); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(.96); border-color: var(--accent); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: none; border: none; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

label.field { display: flex; flex-direction: column; gap: 7px; font-weight: 500; }
label.field .hint { font-weight: 400; color: var(--ink-3); font-size: 12.5px; margin-top: -3px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], textarea, select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238f8f87' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
textarea { min-height: 104px; resize: vertical; }
::placeholder { color: var(--ink-3); opacity: 1; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--ink-2); cursor: pointer; }
.checkbox input { accent-color: var(--ink); margin-top: 3px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.input-icon { position: relative; flex: 1; min-width: 220px; }
.input-icon svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.input-icon input { padding-left: 38px; }

.mode-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-pick input { display: none; }
.mode-pick label {
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.mode-pick label:hover { border-color: var(--ink-3); }
.mode-pick input:checked + label { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.mode-pick input:checked + label .tile { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tile { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-2); }

/* --- таблицы --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding-top: 12px; padding-bottom: 12px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tr:last-child td { border-bottom: none; }
table.dense th, table.dense td { padding-left: 14px; padding-right: 14px; }
table.dense th:first-child, table.dense td:first-child { padding-left: 22px; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr.is-red { opacity: .5; }
.lead-text { max-width: 440px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.lead-text.open { -webkit-line-clamp: unset; }
.lead-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.handle { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
a.handle:hover { color: var(--ink); }
.pitch { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--accent); color: var(--ink); }

/* --- индикаторы --- */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.tag-new { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; height: 20px; padding: 0 7px; }
.tag-ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex-shrink: 0; display: inline-block; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.dot.accent { background: var(--accent); }
.verdict { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }

.score { display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 8px; border-radius: 8px; font-family: var(--mono); font-weight: 500; font-size: 13px; border: 1px solid var(--line-strong); color: var(--ink-2); }
.score-very { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.score-hot { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.score-warm { color: var(--ink); }
.score-none { border-style: dashed; color: var(--ink-3); }
.status-select { width: auto; height: 32px; padding: 0 30px 0 10px; font-size: 13px; border-radius: 999px; }
.status-select.saved { border-color: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }

.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.bar.accent > span { background: var(--accent); }

/* --- уведомления и прогресс --- */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.flash::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex-shrink: 0; }
.flash-ok::before { background: var(--ok); }
.flash-info::before { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.flash-error { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.flash-error::before { background: var(--bad); }
.running { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius); background: var(--ink); color: var(--bg); font-weight: 500; }
.running .faint { color: color-mix(in srgb, var(--bg) 55%, transparent); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; border-left: 1px solid var(--line); }
.step:first-child { border-left: none; }
.step .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 12px; flex-shrink: 0; }
.step.done .num { background: var(--ink); border-color: var(--ink); color: var(--accent); }
.step.done h3 { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }
a.step:hover h3 { text-decoration: underline; }

/* --- карточки ниш и режимов --- */
.choice { display: flex; flex-direction: column; gap: 18px; padding: 24px; transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--ink-3); transform: translateY(-2px); }
.choice .go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

/* --- вход и регистрация --- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-visual { position: relative; overflow: hidden; background: #0b0b0c; color: #ededea; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,11,12,.15) 0%, rgba(11,11,12,0) 40%, rgba(11,11,12,.85) 100%); }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual .brand-mark { background: #ededea; color: #0b0b0c; }
.auth-visual h1 { font-size: 44px; max-width: 520px; letter-spacing: -.035em; }
.auth-visual .lede { color: rgba(237,237,234,.72); max-width: 460px; font-size: 15px; margin-top: 16px; }
.auth-points { display: flex; gap: 28px; margin-top: 32px; flex-wrap: wrap; }
.auth-points div { display: flex; flex-direction: column; gap: 4px; }
.auth-points b { font-family: var(--mono); font-weight: 500; font-size: 22px; color: #c6f432; }
.auth-points span { font-size: 12.5px; color: rgba(237,237,234,.6); }
.auth-side { display: grid; place-items: center; padding: 40px 24px; position: relative; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card h2 { font-size: 26px; letter-spacing: -.03em; }
.theme-fab { position: absolute; right: 18px; top: 18px; }

/* --- CRM: переключатель, воронка, карточка лида --- */
input[type=date] { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; outline: none; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.segmented a { padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.segmented a.on { background: var(--ink); color: var(--bg); }
tr.clickable { cursor: pointer; }
.tag-due { border-color: var(--bad); color: var(--bad); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0 8px; }

.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 320px; }
.board-col header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; font-size: 13px; }
.board-col header .mono { margin-left: auto; }
.board-col.drop { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.board-list { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 12px; flex: 1; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: grab; transition: border-color .15s, transform .1s; }
.lead-card:hover { border-color: var(--ink-3); }
.lead-card.dragging { opacity: .4; }
.lead-card .score { height: 24px; min-width: 34px; font-size: 12px; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 11, .35); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 21;
  background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease;
}
.drawer.open { transform: none; box-shadow: -20px 0 60px rgba(0, 0, 0, .18); }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer-body { padding: 22px 24px 40px; overflow-y: auto; gap: 24px; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 118px 1fr; gap: 10px; font-size: 13px; padding-left: 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.timeline li:first-child::before { background: var(--accent); }
.timeline .when { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }

/* --- иерархия внимания: важное выделяется, второстепенное уходит на второй план --- */
.card { box-shadow: 0 1px 2px rgba(10, 10, 11, .05), 0 6px 18px rgba(10, 10, 11, .04); }
.card.attention { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent), 0 8px 24px color-mix(in srgb, var(--accent) 14%, transparent); }
.card.attention .card-head h2::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: middle; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }

.metric.key .value { color: var(--accent-text); }
.metric.key .eyebrow { color: var(--ink); }
.metric.quiet .value { color: var(--ink-2); font-size: 28px; }

.btn-accent { height: 42px; padding: 0 20px; font-weight: 600; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-accent:hover { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 26%, transparent), 0 8px 22px color-mix(in srgb, var(--accent) 36%, transparent); }

/* Баллы: горячие кричат, тёплые спокойны, холодные почти не видны. */
.score-hot { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); border-color: var(--accent); color: var(--ink); box-shadow: none; font-weight: 600; }
.score-warm { color: var(--ink-2); border-color: var(--line-strong); }
.score:not(.score-very):not(.score-hot):not(.score-warm) { color: var(--ink-3); border-color: var(--line); }

/* Строки лидов: горячим — лаймовая кромка и жирное имя, закрытым и холодным — приглушение. */
tbody tr.hot { background: color-mix(in srgb, var(--accent) 5%, transparent); }
tbody tr.hot td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tbody tr.hot .lead-name { font-weight: 700; }
tbody tr.quiet { opacity: .55; }
tbody tr.quiet:hover { opacity: .9; }
.lead-card.hot { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.lead-card.quiet { opacity: .6; }

.tag-due { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }

/* Следующий шаг настройки — подсвечен, сделанные — тихие. */
.step.next { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.step.next .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.step.next h3 { color: var(--ink); }
.step.done { opacity: .6; }

th { color: var(--ink-3); }
.handle { color: var(--ink-3); }
.lead-text { color: var(--ink-2); }

/* --- глубина и типографика: три уровня поверхности и чёткая лестница текста --- */
body { background: var(--glow), var(--bg); background-attachment: fixed; }
.sidebar { background: var(--panel); border-right-color: var(--line); }
.card { box-shadow: inset 0 1px 0 var(--hi), var(--depth); }
.card.attention { box-shadow: inset 0 3px 0 var(--accent), inset 0 4px 0 var(--hi), 0 10px 30px color-mix(in srgb, var(--accent) 16%, transparent); }

h1 { font-size: 40px; font-weight: 700; letter-spacing: -.035em; }
.card-head h2 { font-weight: 650; }
.card-head { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); border-radius: var(--radius) var(--radius) 0 0; }
.eyebrow { color: var(--ink-3); }
.page-head .sub { color: var(--ink-2); }

.nav a { color: var(--ink-2); }
.nav a.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 1px 0 var(--hi), 0 1px 0 rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.nav a.active::before { width: 4px; box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 60%, transparent); }
.nav a.active svg { color: var(--accent-text); }

.metric .value { font-size: 36px; }
.metric.key .value { font-size: 42px; font-weight: 600; }
.metric.quiet .value { font-size: 26px; color: var(--ink-3); }
.metric.quiet .eyebrow { color: var(--ink-3); }
.metric.key { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%); }

.pitch { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-left-width: 3px; padding: 8px 10px; border-radius: 0 8px 8px 0; color: var(--ink); }
tbody tr.hot { background: color-mix(in srgb, var(--accent) 8%, transparent); }
tbody tr.hot td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
tbody tr:not(.hot) .lead-name { font-weight: 500; }
tbody tr.quiet { opacity: .45; }
td { border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }

.btn:not(.btn-primary):not(.btn-accent):not(.btn-ghost) { background: transparent; }
.btn-primary { box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 6px 16px rgba(0,0,0,.18); }
.score-very { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); font-weight: 700; }
.tag-new { box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent); }

/* --- диалоги с лидами --- */
.dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px 2px; }
.chat:empty { display: none; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.bubble .at { display: block; font-family: var(--mono); font-size: 10.5px; opacity: .6; margin-top: 4px; }
.bubble.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; }
.chat-loading { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; }
.chat-loading .pulse { width: 7px; height: 7px; }
[data-compose] { background: var(--surface); }
.tag-msg { background: var(--ink); border-color: var(--ink); color: var(--accent); font-weight: 600; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-family: var(--mono); font-size: 11px; font-weight: 700; }

/* --- тур по кабинету --- */
.tour { position: fixed; inset: 0; z-index: 40; }
.tour-shade { position: absolute; inset: 0; background: rgba(10, 10, 11, .45); }
.tour-ring {
  position: absolute; border-radius: 12px; pointer-events: none; transition: all .25s ease;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(10, 10, 11, .45);
}
.tour.centered .tour-ring { display: none; }
.tour.centered .tour-shade { background: rgba(10, 10, 11, .55); }
.tour:not(.centered) .tour-shade { background: transparent; }
.tour-pop {
  position: absolute; width: min(360px, calc(100vw - 32px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 8px; transition: top .25s, left .25s;
}
.tour-pop h3 { font-size: 16px; }

/* --- помощь --- */
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.help-section h2 { display: flex; align-items: center; gap: 10px; }
.help-section ul, .help-section ol { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); }
.help-section b { color: var(--ink); }

/* --- адаптив --- */
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:nth-child(4) { border-left: none; }
  .metric:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; z-index: 3; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; border-right: none; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; gap: 4px; }
  .nav a { white-space: nowrap; padding: 7px 10px; }
  .nav a.active::before { display: none; }
  .niche-switch { flex: 1; min-width: 150px; padding: 0; }
  .niche-switch .eyebrow { display: none; }
  .sidebar-foot { margin: 0; flex-direction: row; align-items: center; }
  .user-chip { display: none; }
  .main { padding: 24px 16px 56px; }
  h1 { font-size: 28px; }
  .page-head > div { min-width: 0; }
  .page-head > form, .page-head > form .btn { width: 100%; }
  .grid-2, .grid-3, .mode-pick { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step { border-left: none; border-top: 1px solid var(--line); }
  .step:first-child { border-top: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { border-left: none !important; border-top: 1px solid var(--line); }
  .metric:nth-child(-n+2) { border-top: none; }
  .metric:nth-child(even) { border-left: 1px solid var(--line) !important; }
  th, td { padding: 12px 14px; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { min-height: 300px; padding: 24px; }
  .auth-visual h1 { font-size: 30px; }
  .auth-points { display: none; }
}
