/* Веб agro: каркас кабинета по бренду MidMillion (токены — /styles/tokens.css).
   Светлая тема, тонкие рамки вместо теней, одна главная кнопка (ink) на экран, индиго — активное
   состояние и фокус. Без градиентов, эмодзи и цветных полос. Телефон: меню в выдвижной панели, поля 16px. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.display { margin-bottom: var(--space-6); }
.caption { color: var(--ink-muted); }

.brand-word { font-weight: 600; color: var(--ink); }

/* Каркас: меню 240px слева на surface-sunken, контент с полями 32px. */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface-sunken); border-right: 1px solid var(--border); }
.content { padding: var(--space-8); min-width: 0; }
.drawer { display: none; }

.nav { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-6) var(--space-4); height: 100%; }
.nav-brand { display: block; padding: 0 var(--space-2) var(--space-6); color: var(--ink); }
.nav-brand:hover { text-decoration: none; }
.nav-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2); border-radius: var(--radius-md);
  color: var(--ink); font-size: 14px; line-height: 20px; font-weight: 500;
}
.nav-item:hover { background: var(--surface-hover); text-decoration: none; }
.nav-item.is-active { background: var(--surface-hover); color: var(--brand); }
.nav-button { width: 100%; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-6); }
.nav-foot .caption { padding: 0 var(--space-2) var(--space-2); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: var(--space-6); }
.empty { color: var(--ink-muted); display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; max-width: 640px; }

/* Вход */
.bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-4); background: var(--surface-sunken); }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: var(--space-4); }
.login-brand { font-size: 17px; }
.form { display: flex; flex-direction: column; gap: var(--space-4); }
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.label { font-size: 14px; line-height: 20px; font-weight: 500; }
input {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-control); border-radius: var(--radius-sm);
  padding: var(--space-2) 12px; min-height: 40px;
}
input:focus { border-color: var(--brand); outline: 2px solid var(--brand-tint); outline-offset: 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  border: 1px solid var(--border-control); background: var(--surface); color: var(--ink);
  font: 500 14px/20px var(--font-sans); cursor: pointer;
}
.button:hover { background: var(--surface-hover); text-decoration: none; }
.button-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.button-primary:hover { background: var(--ink-muted); border-color: var(--ink-muted); }
.notice { border-radius: var(--radius-sm); padding: var(--space-2) 12px; font-size: 14px; }
.notice-negative { color: var(--negative); border: 1px solid var(--negative); background: var(--surface); }
.lang-link { align-self: flex-start; }

/* Телефон: меню — выдвижная панель (details), поля 16px, одна колонна. */
@media (max-width: 768px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { display: none; }
  .drawer { display: block; background: var(--surface-sunken); border-bottom: 1px solid var(--border); }
  .drawer-toggle {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px var(--space-4); cursor: pointer; list-style: none;
  }
  .drawer-toggle::-webkit-details-marker { display: none; }
  .drawer-label { font-size: 14px; font-weight: 500; color: var(--ink-muted); }
  .drawer .nav { padding-top: 0; }
  .drawer .nav-brand { display: none; }
  .content { padding: var(--space-4); }
  .display { font-size: 28px; line-height: 34px; }
}

/* ---------- Экран объёмов (PR B) ---------- */
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.code { font-family: var(--font-mono); font-size: 13px; line-height: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon-16 { width: 16px; height: 16px; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; margin-bottom: var(--space-6); }
.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pill {
  display: inline-flex; flex-direction: column; justify-content: center;
  padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  color: var(--ink); font-size: 14px; line-height: 20px; font-weight: 500; background: var(--surface);
}
.pill:hover { background: var(--surface-hover); text-decoration: none; }
.pill.is-active { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.pill-note { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--ink-muted); }
.notice { margin-bottom: var(--space-4); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.layout.has-panel { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.crop-title { margin: var(--space-6) 0 var(--space-4); display: flex; gap: var(--space-4); align-items: baseline; flex-wrap: wrap; }
.crop-title:first-child { margin-top: 0; }
.tree { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.region + .region { border-top: 1px solid var(--border); }
.region > summary {
  display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  padding: 12px var(--space-4); cursor: pointer; background: var(--surface-sunken); list-style: none;
}
.region > summary::-webkit-details-marker { display: none; }
.region > summary::before { content: "›"; margin-right: var(--space-2); color: var(--ink-muted); transition: transform .15s; }
.region[open] > summary::before { transform: rotate(90deg); }
.region > summary .label { flex: 1; }
.districts { list-style: none; margin: 0; padding: 0; }
.district > a {
  display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
  padding: 10px var(--space-4) 10px var(--space-8); color: var(--ink); border-top: 1px solid var(--border);
}
.district > a:hover { background: var(--surface-hover); text-decoration: none; }
.district.is-open > a { color: var(--brand); background: var(--brand-tint); }
.hint { margin-top: var(--space-4); }

.vrows { border-top: 1px solid var(--border); }
.vrow {
  display: grid; grid-template-columns: 40px 80px 90px minmax(0, 1.2fr) 80px minmax(0, 2fr);
  gap: var(--space-2); align-items: center; padding: 8px var(--space-4); border-bottom: 1px solid var(--border);
}
.vrow-head { background: var(--surface-sunken); color: var(--ink-muted); font-size: 13px; line-height: 18px; font-weight: 500; }
.vrow.is-selected { background: var(--brand-tint); }
.vrow .num { text-align: right; }
.m-label { display: none; }
.status { color: var(--ink); }
.status-positive { color: var(--positive); }
.status-negative { color: var(--negative); }
.star-form { margin: 0; }
.star {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--radius-md); background: none; color: var(--ink-muted); cursor: pointer;
}
.star:hover { background: var(--surface-hover); }
.star.is-on { color: var(--brand); }
.star.is-on svg { fill: currentColor; }
.pager { display: flex; gap: var(--space-2); align-items: center; justify-content: flex-end; padding: 12px var(--space-4); }
.pager .caption { margin-right: auto; }

.panel {
  position: sticky; top: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); background: var(--surface);
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.panel-actions { display: flex; align-items: center; gap: var(--space-2); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--space-4); margin: 0; }
.facts dt { color: var(--ink-muted); font-size: 14px; }
.facts dd { margin: 0; }
.prices, .calls { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.prices li { display: flex; flex-direction: column; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.figure-sm { font-size: 17px; line-height: 24px; font-weight: 600; }
.deal { border-top: 1px solid var(--border); padding-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.deal-form { display: flex; gap: var(--space-2); flex-wrap: wrap; }

@media (max-width: 1024px) {
  .vrow { grid-template-columns: 40px 70px 80px minmax(0, 1fr) 70px; }
  .vrow > :last-child { grid-column: 2 / -1; }
  .vrow-head > :last-child { display: none; }
}
@media (max-width: 768px) {
  .layout.has-panel { grid-template-columns: minmax(0, 1fr); }
  .panel { position: fixed; inset: 0; z-index: 10; border: 0; border-radius: 0; max-height: none; padding: var(--space-4); }
  .vrow.vrow-head { display: none; }
  /* Строка — поток с переносом (QA 29.10: была в четыре линии, страница района ~5800 px): номер, объём,
     качество, км — в линию, статус — с новой; звёздочка слева на высоту строки. */
  .vrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; position: relative;
          min-height: 52px; padding: 6px var(--space-4) 6px 52px; }
  .vrow > :nth-child(1) { position: absolute; left: 4px; top: 4px; }
  .vrow > :nth-child(6) { flex-basis: 100%; font-size: 14px; }
  .vrow .num { text-align: left; }
  .m-label { display: inline; color: var(--ink-muted); }
  .vrow > .num .m-label { display: none; }
  .star { width: 44px; height: 44px; }
  .district > a { padding-left: var(--space-6); }
  .toolbar { flex-direction: column; }
}

/* ---------- Дашборд звонков (PR C) ---------- */
.period { align-items: flex-end; }
.period-dates { display: flex; gap: var(--space-2); align-items: flex-end; flex-wrap: wrap; }
.period-dates .field { gap: 2px; }
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--border); gap: 1px;
}
.metric { background: var(--surface); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.metric-money { background: var(--accent-tint); }
.metric-money .figure { color: var(--accent-ink); }
.figure.muted { color: var(--ink-muted); font-size: 17px; line-height: 24px; }
.section-title { margin: var(--space-8) 0 var(--space-4); }
.table { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.trow { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--space-2); padding: 10px var(--space-4);
  border-top: 1px solid var(--border); align-items: center; }
.trow:first-child { border-top: 0; }
.thead { background: var(--surface-sunken); color: var(--ink-muted); font-size: 13px; font-weight: 500; }
.trow .num { text-align: right; }
.dispute-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }
.dispute-actions form { margin: 0; }
@media (max-width: 768px) { .trow .num { text-align: left; } .dispute-actions { justify-content: flex-start; } }

/* ---------- Задания на обзвон (0019) ---------- */
select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-control); border-radius: var(--radius-sm);
  padding: var(--space-2) 12px; min-height: 40px; max-width: 100%;
}
select:focus { border-color: var(--brand); outline: 2px solid var(--brand-tint); outline-offset: 0; }
.task-form { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-4); }
.task-form > summary { cursor: pointer; }
.task-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.task-items .trow { grid-template-columns: minmax(90px, 1fr) minmax(120px, 1.4fr) repeat(2, minmax(80px, .8fr)) minmax(160px, 2fr) minmax(100px, 1fr) auto; }
.belt { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; border: 0; padding: 0; margin: 0; }
.belt legend { width: 100%; padding: 0; margin-bottom: var(--space-1); }
.belt label { display: inline-flex; gap: var(--space-1); align-items: center; min-height: 44px; }
.belt input[type="radio"] { min-height: auto; }
.belt input[name^="rate"] { width: 140px; }
.task-items .thead span { white-space: normal; }
.task-queue .trow { grid-template-columns: minmax(140px, 1.2fr) minmax(120px, 1fr) minmax(260px, 2fr); }
.call-list .trow { grid-template-columns: minmax(160px, 1.6fr) minmax(90px, 1fr) minmax(110px, 1fr) repeat(4, minmax(80px, .8fr)); }
.call-list .thead span { white-space: normal; }
.call-list-anon .trow { grid-template-columns: minmax(160px, 1.6fr) minmax(90px, 1fr) minmax(110px, 1fr) repeat(3, minmax(80px, .8fr)); }
.button:disabled { opacity: .4; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-2) 0; }
.chip { border: 1px solid var(--border); border-radius: 999px; padding: var(--space-1) var(--space-3); color: inherit; min-height: 32px; display: inline-flex; align-items: center; }
.chip:hover { background: var(--surface-hover); text-decoration: none; }
.chip.is-active { background: var(--surface-hover); color: var(--brand); border-color: var(--brand); }
.results-title { margin-bottom: var(--space-1); }
.results-list .trow { grid-template-columns: minmax(170px, 1.8fr) repeat(4, minmax(70px, .8fr)) minmax(100px, 1fr) minmax(100px, 1fr) minmax(60px, .6fr) minmax(110px, 1fr); }
.results-list .thead span { white-space: normal; }
/* Девять колонок не помещаются в узкое окно рядом с меню: таблица прокручивается по горизонтали, а не обрезается. */
.table.results-list { overflow-x: auto; }
.results-list .trow { min-width: 920px; }
.point-decide { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-2); }
@media (max-width: 768px) {
  .task-items .trow, .task-queue .trow, .call-list .trow, .results-list .trow { grid-template-columns: 1fr; gap: var(--space-1); }
  .results-list .trow { min-width: 0; }
  .task-items .thead, .call-list .thead, .results-list .thead { display: none; }
  select, .belt input[name^="rate"] { font-size: 16px; width: 100%; }
}

/* ================= Пилот V&V: «Разговоры», карточка звонка, воронка, задание (макеты vv-front) ================= */
:root { --positive-tint: color-mix(in srgb, var(--positive) 10%, var(--surface)); --negative-tint: color-mix(in srgb, var(--negative) 8%, var(--surface)); }
.notice-accent { border: 1px solid var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
.badge { display: inline-flex; }
.chip .n { color: var(--ink-muted); font-variant-numeric: tabular-nums; margin-left: 6px; }
.figure { font-size: 28px; line-height: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.heading { font-size: 17px; line-height: 24px; font-weight: 600; margin-bottom: var(--space-2); }
.label { font-size: 14px; line-height: 20px; font-weight: 500; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.positive { color: var(--positive); } .negative { color: var(--negative); } .muted { color: var(--ink-muted); }
.stage-list.is-open { display: flex; flex-direction: column; gap: var(--space-2); }
.lane { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.contact .row, .field .row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.page-head { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); align-items: baseline; justify-content: space-between; margin-bottom: var(--space-4); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--positive); }
.section-title { margin: var(--space-8) 0 var(--space-3); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }

/* Бейджи итогов: цвет — только смысл (зелёный — готов, янтарь — своя цена/перезвон, красный — отказ). */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface-sunken); color: var(--ink); white-space: nowrap; }
.badge-positive { background: var(--positive-tint); border-color: transparent; color: var(--positive); }
.badge-accent { background: var(--accent-tint); border-color: transparent; color: var(--accent-ink); }
.badge-negative { background: var(--negative-tint); border-color: transparent; color: var(--negative); }
.badge-brand { background: var(--brand-tint); border-color: transparent; color: var(--brand); }
.badge-muted { color: var(--ink-muted); }
.new-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 6px; vertical-align: middle; }

/* Фильтры */
.filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) auto; gap: var(--space-3); align-items: end; margin: var(--space-4) 0; }
.filters .field .label { font-size: 13px; color: var(--ink-muted); }
.filters select, .filters input { width: 100%; }

/* Лента разговоров */
.feed { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; container-type: inline-size; }
.frow { display: grid; grid-template-columns: 92px minmax(180px, 1.3fr) minmax(320px, 2.6fr) 64px minmax(120px, .9fr);
  gap: var(--space-4); padding: 12px var(--space-4); border-top: 1px solid var(--border); align-items: start; color: var(--ink); }
a.frow:hover { background: var(--surface-hover); text-decoration: none; }
.frow.is-new { background: color-mix(in srgb, var(--brand-tint) 50%, var(--surface)); }
.frow.thead { border-top: 0; background: var(--surface-sunken); color: var(--ink-muted); font-size: 13px; font-weight: 500; padding-top: 8px; padding-bottom: 8px; }
.frow .when { font-variant-numeric: tabular-nums; }
.frow .dur { text-align: right; font-variant-numeric: tabular-nums; }
.farm { font-weight: 500; }
.crop-line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.crop-line + .crop-line { margin-top: 6px; }
.crop-name { font-weight: 500; min-width: 108px; }
.kv { font-size: 13px; color: var(--ink-muted); white-space: nowrap; }
.kv b { color: var(--ink); font-weight: 500; }
.frow.is-muted { color: var(--ink-muted); }
/* Узкая лента (окно 769–1100 px минус меню и поля): пять колонок (≥ 776 px) не помещаются — та же компактная раскладка,
   что на телефоне, по ширине самой ленты, а не окна (ревью #122). Стоит после базовых правил .frow: специфичность та же,
   иначе база перекрывает. */
@container (max-width: 820px) {
  .frow { grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-3); }
  .frow.thead { display: none; }
  .frow > .when { grid-column: 2; grid-row: 1; text-align: right; font-size: 13px; color: var(--ink-muted); }
  .frow > .who { grid-column: 1; grid-row: 1; }
  .frow > .ai { grid-column: 1 / -1; }
  .frow > .dur { grid-column: 2; grid-row: 2; display: none; }
  .frow > .lead { grid-column: 1 / -1; }
}

/* Карточка звонка */
.crumbs { margin-bottom: var(--space-2); }
.call-head { display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-6); }
.call-head .actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.call-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: var(--space-6); align-items: start; }
.player { display: flex; flex-direction: column; gap: var(--space-2); }
.player audio { width: 100%; }
.transcript { display: flex; flex-direction: column; gap: var(--space-2); max-height: 560px; overflow-y: auto; padding-right: 4px; }
.msg { max-width: 86%; padding: var(--space-2) 12px; border-radius: var(--radius-md); font-size: 14px; line-height: 20px; }
.msg .who { display: block; font-size: 12px; line-height: 16px; color: var(--ink-muted); margin-bottom: 2px; }
.msg-bot { background: var(--surface-sunken); align-self: flex-start; }
.msg-farmer { background: var(--brand-tint); align-self: flex-end; }
.msg mark { background: var(--accent-tint); color: inherit; padding: 0 2px; border-radius: 3px; }
.ai-crop { border-top: 1px solid var(--border); padding-top: var(--space-3); margin-top: var(--space-3); }
.ai-crop:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.prices3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; gap: 1px; background: var(--border); margin-top: var(--space-2); }
.prices3 > div { background: var(--surface); padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; }
.prices3 .first { background: var(--surface-sunken); }
.prices3 .v { font-size: 17px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.phone { font-size: 22px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.contact { display: flex; flex-direction: column; gap: var(--space-2); }
.contact .row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.lead-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.lead-form .wide { grid-column: 1 / -1; }
.stage-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.stage-steps .step { font-size: 12px; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border); color: var(--ink-muted); }
.stage-steps .step.done { color: var(--ink); }
.stage-steps .step.now { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 84px 20px minmax(0, 1fr); gap: var(--space-2); padding: var(--space-2) 0; border-top: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.timeline li:first-child { border-top: 0; }
.timeline .t { color: var(--ink-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.quick { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mobile-bar { display: none; }

/* Воронка */
.today { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); }
.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-3); align-items: start; }
.lane { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); min-height: 120px; }
.lane-head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px; }
.lead-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-2) 10px; color: var(--ink); font-size: 13px; line-height: 18px; }
a.lead-card:hover { border-color: var(--brand); text-decoration: none; }
.lead-card .farm { font-size: 14px; line-height: 20px; }
.lead-card .meta { display: flex; justify-content: space-between; gap: 6px; color: var(--ink-muted); }
.lead-card.overdue { border-left: 3px solid var(--negative); }
.lead-card.due { border-left: 3px solid var(--accent); }
.avatar { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--on-primary); font-size: 11px; font-weight: 600; align-items: center; justify-content: center; }
.avatar.b { background: var(--brand); }
.lane-more { font-size: 13px; padding: 2px 6px; }
.stage-tabs { display: none; }

/* Задание V&V */
.gate3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px var(--space-2); font-size: 13px; }
.gate3 .h { color: var(--ink-muted); font-size: 12px; }
.gate3 .v { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.bar { height: 8px; border-radius: var(--radius-pill); background: var(--surface-hover); overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; background: var(--ink); }
.bar > span.b { background: var(--brand); }
.bar > span.p { background: var(--positive); }
.bar-lg { height: 12px; }
.progress-list { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--space-3); font-size: 13px; }
.progress-list dt { color: var(--ink-muted); }
.progress-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.minutes { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-6); align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: 13px; color: var(--ink-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--ink); }
.legend i.b { background: var(--brand); } .legend i.s { background: var(--surface-hover); border: 1px solid var(--border); }

@media (max-width: 1180px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .call-layout { grid-template-columns: minmax(0, 1fr); }
  }
@media (max-width: 1440px) {
}

@media (max-width: 768px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: var(--space-3); }
  .metric .figure { font-size: 22px; line-height: 28px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .wide-m { grid-column: 1 / -1; }
  details.filter-box > summary { cursor: pointer; }
  .feed { border: 0; border-radius: 0; margin: 0 calc(-1 * var(--space-4)); }
  .frow { grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--space-3); padding: 12px var(--space-4); }
  .frow.thead { display: none; }
  .frow > .when { grid-column: 2; grid-row: 1; text-align: right; font-size: 13px; color: var(--ink-muted); }
  .frow > .who { grid-column: 1; grid-row: 1; }
  .frow > .ai { grid-column: 1 / -1; }
  .frow > .dur { grid-column: 2; grid-row: 2; display: none; }
  .frow > .lead { grid-column: 1 / -1; }
  .crop-name { min-width: 0; }

  .call-layout { display: flex; flex-direction: column; gap: var(--space-4); }
  .call-layout > .stack { display: contents; }
  .o-1 { order: 1; } .o-2 { order: 2; } .o-3 { order: 3; } .o-4 { order: 4; } .o-5 { order: 5; } .o-6 { order: 6; }
  .card { padding: var(--space-4); }
  .call-head { margin-bottom: var(--space-4); }
  .call-head .actions { display: none; }
  .prices3 .v { font-size: 15px; }
  .lead-form { grid-template-columns: 1fr; }
  .transcript { max-height: none; }
  .msg { max-width: 94%; }
  .mobile-bar { display: flex; position: sticky; bottom: 0; gap: var(--space-2); padding: var(--space-3) var(--space-4);
    margin: var(--space-6) calc(-1 * var(--space-4)) calc(-1 * var(--space-4)); background: var(--surface); border-top: 1px solid var(--border); }
  .mobile-bar .button { flex: 1; min-height: 48px; }

  .board { grid-template-columns: minmax(0, 1fr); }  /* телефон — те же этапы столбиком: квота = показанные карточки */
  .stage-tabs { display: flex; overflow-x: auto; gap: var(--space-2); padding-bottom: var(--space-2); margin: 0 calc(-1 * var(--space-4)); padding-left: var(--space-4); padding-right: var(--space-4); }
  .stage-tabs .chip { flex: none; }
  .stage-list { display: flex; flex-direction: column; gap: var(--space-2); }
  .stage-list .lead-card { padding: 12px; font-size: 14px; }

  .minutes { grid-template-columns: 1fr; gap: var(--space-3); }
  .timeline li { grid-template-columns: 64px 20px minmax(0, 1fr); }
  .gate3 { gap: 2px 6px; font-size: 12px; }
}
@media (min-width: 769px) { .stage-list { display: none; } .only-m { display: none; } }
@media (max-width: 768px) { .only-d { display: none !important; } }

