/* Только блоки «Обзора». Шапка, карточки и таблицы общие, в app.css. */

body.dash-page main { max-width: 1360px; }

.dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.dash-head h1 { margin: 0; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.kpi {
  margin: 0;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  min-height: 44px;
}

.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-link);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.kpi-icon svg { width: 20px; height: 20px; }

.kpi-label {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  margin: 0;
}

.kpi-value {
  font-size: var(--kpi-size);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 var(--space-2);
  font-variant-numeric: tabular-nums;
}

.kpi-delta {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
}

.kpi-delta.tone-good { color: var(--color-good); }
.kpi-delta.tone-bad { color: var(--color-bad); }
.kpi-delta.tone-flat { color: var(--color-text-muted); }

.delta-icon { width: 14px; height: 14px; margin-top: 2px; flex: 0 0 auto; }

.how { margin-top: auto; }
.how summary { cursor: pointer; color: var(--color-text-muted); font-size: var(--text-xs); font-weight: var(--weight-medium); }
.kpi-note { font-size: var(--text-xs); margin: var(--space-2) 0 0; color: var(--color-text-muted); }

.scope-note { margin: 0 0 var(--space-4); font-size: var(--text-sm); }
.section-lead { margin: 0 0 var(--space-3); font-size: var(--text-sm); }

.status-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-2);
}

.status-pill {
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--color-surface-2);
}

.status-pill .kpi-label { margin-bottom: var(--space-1); }
.status-pill .kpi-value { font-size: 1.6rem; margin: 0; }
.status-deposit { background: var(--status-deposit); }
.status-deal { background: var(--status-deal); }
.status-settled { background: var(--status-settled); }
.status-failed { background: var(--status-failed); }
.status-failed_retained { background: var(--status-failed-retained); }

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.chart-grid .card { margin: 0; }
.chart-box { height: 340px; width: 100%; }

.links { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-card);
}

.plan-list { display: flex; flex-direction: column; gap: var(--space-3); }

.plan-item {
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.plan-head,
.plan-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: baseline;
}

.plan-title { font-weight: var(--weight-semibold); }

.level-badge {
  display: inline-block;
  margin-left: var(--space-2);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-link);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.plan-pct { font-variant-numeric: tabular-nums; font-weight: var(--weight-bold); white-space: nowrap; }

.plan-track {
  height: 8px;
  margin: var(--space-2) 0;
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.plan-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-brand);
}

.tone-good .plan-fill { background: var(--color-good); }
.tone-mid .plan-fill { background: var(--color-warn); }
.tone-low .plan-fill { background: var(--color-bad); }

.plan-meta { color: var(--color-text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.norm-flag { margin: var(--space-1) 0 0; color: var(--color-bad); font-size: var(--text-xs); font-weight: var(--weight-semibold); }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .chart-grid,
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .status-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .dash-head { flex-direction: column; align-items: flex-start; }
  .kpi-grid,
  .chart-grid { grid-template-columns: 1fr; }
  .status-row { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 1.7rem; }
  .chart-box { height: 260px; }
  .plan-head,
  .plan-meta { flex-direction: column; align-items: flex-start; gap: 2px; }
}
