/* «ДНТ Аналитика сделок» — раскладка как в BI: две плитки + график в строке, когорты, круговые по сотрудникам */
.dl-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 4fr); gap: 12px; margin-bottom: 12px; }
.dl-row .kpi .v { font-size: 30px; }
.dl-row .chart { height: 240px; }
/* Сводные показатели: две цифры одна под другой, колонка цифр — 2/3 прежних двух плиток, остальное графику */
.dl-kpi { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 7fr); gap: 12px; margin-bottom: 12px; }
.dl-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.dl-kpi .kpi .t { min-height: 0; }
.dl-kpi .kpi .v { font-size: 28px; }
.dl-kpi .chart { height: 250px; }
.dl-half { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.dl-pies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.dl-pies .chart { height: 280px; }
.kpi.new .v { color: #0f5f78; }
.kpi.closed .v { color: #4a3594; }
.kpi.win .v { color: #1d6b40; }
.kpi.lose .v { color: #8f2633; }
.gauge { height: 220px; }
.cohort td, .cohort th { text-align: right; white-space: nowrap; padding: 4px 5px; font-size: 12px; }
.cohort td:first-child, .cohort th:first-child { text-align: left; }
.cohort tr.tot td { font-weight: 600; border-top: 2px solid var(--line); }
.dt { font-size: 12px; }
/* Таблица в своём окне: обе полосы прокрутки всегда под рукой, шапка не уезжает */
.dt-box { overflow: auto; max-height: calc(100vh - 60px); }
.dt thead { position: sticky; top: 0; z-index: 2; background: var(--card, #fff); }
.dt tfoot { position: sticky; bottom: 0; z-index: 2; background: var(--card, #fff); }
.dt th.sort { cursor: pointer; user-select: none; }
.dt th.sort:hover { color: var(--text); }
.dt th, .dt th.n { white-space: normal; padding: 6px 5px; vertical-align: bottom; }
.dt td { padding: 5px; }
.dt td.wrap { white-space: normal; min-width: 70px; overflow-wrap: anywhere; }
.dt td.c { white-space: pre-line; min-width: 150px; color: var(--muted); }
.dt a { color: #1a73b8; text-decoration: none; }
.dt a:hover { text-decoration: underline; }
.dt .p2 { background: #f7b955; text-align: center; font-weight: 600; }
.dt .p1 { background: #fde7bd; text-align: center; }
.dt .p0 { text-align: center; color: var(--muted); }
.dt .zero { background: rgba(239, 161, 170, .55); }
.dt .od { background: #a7323f; color: #fff; }
@media (max-width: 1000px) {
  .dl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dl-row > .card:last-child { grid-column: 1 / -1; }
  .dl-half, .dl-pies, .dl-kpi { grid-template-columns: minmax(0, 1fr); }
  .dl-stack { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 600px) { .dl-row .kpi .v { font-size: 20px; } }
/* Три графика в сетке на две колонки: третий — во всю ширину */
.dl-half > .card:nth-child(3):last-child { grid-column: 1 / -1; }
/* Подпись под заголовком графика: по фильтру «Период» или период задан в отчёте */
.scope { margin: -6px 0 8px; font-size: 12px; color: var(--muted); }
.scope.fixed { color: #8a5a00; }
/* «Финансы»: четыре плитки оплат столбиком слева от графика поступлений */
.fin-stack { display: grid; grid-template-rows: repeat(4, 1fr); gap: 12px; }
.dl-kpi.fin .chart { height: 440px; }
.kpi .scope { margin: 2px 0 0; }
/* «Сегменты»: в строке разреза — кольцо и динамика */
.seg-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; margin-bottom: 12px; }
@media (max-width: 900px) { .seg-row { grid-template-columns: minmax(0, 1fr); } }
