/* Ads Hub: стиль «achromatic ledger» (tasteskill, seed 1234514090). Хром без цвета, синий только на главном графике,
   фон — сине-серый, как у бухгалтерской книги. Остальное — app.css. */
:root {
  --ground: #f2f4f7;
  --surface: #ffffff;
  --raised: #eceef2;
  --active: #e3e6eb;
  --border: #e2e5ea;
  --rule: #eef0f3;
  --control: #cfd3da;
  --text: #0a0a0a;
  --muted: #5d636b;
  --faint: #6b7078;
  --accent: #141414;
  --primary: #141414;
  --positive: #2e7d32;
  --negative: #c4242a;
  --warning: #92400e;
  --chart-1: #1d5fbf;
  --chart-2: #8a8a8a;
  --chart-3: #1d5fbf;
  --chart-muted: #c9cdd3;
  --font: "Geist", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-kpi: 30px;
  --sidebar-width: 240px;
  --gap: 12px;
  --pad: 32px;
  --control-height: 36px;
  --row-height: 44px;
  --radius-card: 8px;
  --radius-control: 6px;
}
:focus-visible { outline-color: #1d5fbf; }
body { font-size: 14px; }
.money { font-weight: 700; }
.muted { color: var(--muted); }
.zero { color: var(--faint); }
.hidden { display: none !important; }

/* ---------- sidebar ---------- */
.sidebar { background: var(--ground); padding: 24px 12px 16px; }
.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 8px 4px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.brand span { font-weight: 400; color: var(--muted); font-size: 13px; }
.project-switch { margin: 16px 0 0; display: grid; gap: 2px; }
.project-switch button { display: flex; justify-content: space-between; align-items: center; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.project-switch button:hover { background: var(--raised); color: var(--text); }
.project-switch button[aria-pressed="true"] { background: var(--active); color: var(--text); font-weight: 500; }
.project-switch .code { font-size: 12px; color: var(--faint); }
.nav-item { width: 100%; border: 0; background: transparent; cursor: pointer; font-size: 14px; text-align: left; }
.sidebar .bottom { padding: 0 8px; color: var(--faint); font-size: 12px; display: grid; gap: 8px; }
.sidebar .bottom form button { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.sidebar .bottom form button:hover { color: var(--text); text-decoration: underline; }

/* ---------- canvas ---------- */
.canvas { max-width: 1480px; padding-top: 32px; }
.title-row .sub { max-width: 80ch; }
.title-row .actions { display: flex; gap: 8px; flex: none; }
.btn.primary:hover { background: #2b2b2b; }
.btn:disabled { opacity: .5; cursor: default; }
.filters .input { height: var(--control-height); }
.filters label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

/* обзор: основная колонка и правая колонка 384px */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 24px; align-items: start; }
.stack { display: grid; gap: 16px; min-width: 0; }
.rail { display: grid; gap: 16px; min-width: 0; }
.rail h2 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.rail .panel { padding: 4px 16px; }
.rail .row { min-height: 44px; }
.rail .row .grow { flex: 1; min-width: 0; }
.rail .row .n { text-align: right; white-space: nowrap; }
.dash-kpis { margin-bottom: 16px; }
.kpi-value { white-space: nowrap; }
td .card-link { white-space: nowrap; text-align: left; }
td.neg { color: var(--negative); }
.rail .n.down { color: var(--negative); }
.issue { padding: 12px 0; line-height: 20px; }
.issue + .issue { border-top: 1px solid var(--rule); }

.kpi-value .unit { font-size: .55em; color: var(--muted); font-weight: 400; margin-left: 2px; }
.kpi .delta { min-height: 16px; }

/* сверка «кабинет → бот»: шаги воронки слева направо, потери между ними */
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.funnel .step { padding: 4px 16px 4px 0; min-width: 0; }
.funnel .step + .step { padding-left: 16px; border-left: 1px solid var(--rule); }
.funnel .who { font-size: 12px; color: var(--muted); }
.funnel .v { font-size: 22px; line-height: 28px; margin-top: 4px; }
.funnel .bar { height: 6px; margin-top: 10px; background: var(--raised); border-radius: 0; }
.funnel .bar i { display: block; height: 100%; background: var(--text); }
.funnel .step.ours .bar i { background: #1d5fbf; }
.funnel .loss { margin-top: 8px; font-size: 12px; color: var(--muted); }
.funnel .loss b { font-weight: 500; color: var(--negative); }

/* таблицы */
.panel.flush { padding: 0; }
.panel.flush > header { padding: 16px 20px 0; margin-bottom: 8px; }
.panel.flush .table-wrap { padding: 0 8px 8px; }
th.sortable { cursor: pointer; }
th[aria-sort] { color: var(--text); }
td.label { max-width: 32ch; }
tr.total td { font-weight: 500; border-top: 1px solid var(--border); }
td .del { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0 4px; font-size: 13px; }
td .del:hover { color: var(--negative); text-decoration: underline; }

/* формы */
.forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.field label { font-size: 14px; }
.field .input { width: 100%; }
.form-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.msg { font-size: 13px; color: var(--muted); }
.msg.err { color: var(--negative); }
.msg.ok { color: var(--positive); }
pre.code { margin: 0; padding: 12px; background: var(--raised); border-radius: 6px; overflow-x: auto; font: 12px/18px "Geist Mono", ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; }
.dropzone { display: grid; place-items: center; gap: 8px; min-height: 140px; padding: 20px; border: 1px dashed var(--control); border-radius: 8px; background: var(--surface); text-align: center; cursor: pointer; transition: background-color var(--t-hover) ease; }
.dropzone:hover, .dropzone.over { background: var(--raised); }
.dropzone strong { font-weight: 500; }

.notes { display: grid; gap: 4px; margin-top: 12px; color: var(--muted); font-size: 12px; }

.segmented button { white-space: nowrap; }
.segmented.scroll { overflow-x: auto; scrollbar-width: none; }
.segmented.scroll button { flex: none; white-space: nowrap; }
/* телефон */
.topbar { display: none; }
@media (max-width: 1180px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .topbar { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 16px; position: sticky; top: 0; z-index: 10; background: var(--ground); border-bottom: 1px solid var(--border); }
  .topbar strong { font-size: 15px; }
  .sidebar .close { display: inline-flex; align-self: flex-end; }
  .canvas { padding-top: 16px; }
  .forms, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .funnel { grid-template-columns: minmax(0, 1fr); }
  .funnel .step + .step { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); padding-top: 10px; margin-top: 10px; }
  .kpi-value { font-size: 24px; }
  .filters > .segmented.scroll { display: flex; width: 100%; }
  .title-row .actions { flex: 1 1 100%; flex-wrap: wrap; }
}
.sidebar .close { display: none; }
