.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
  transition: all 0.25s ease;
}

.kpi-card.clickable {
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.kpi-card.clickable:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.kpi-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.kpi-card .value {
  font-size: 30px;
  font-weight: 600;
  color: #111827;
}

.kpi-card .value.overdue {
  color: var(--danger);
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cabinet-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.cabinet-debug {
  display: none;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.3;
  color: #64748b;
  white-space: pre-wrap;
}

.card--done {
  grid-column: span 2;
}

.section-head--stats {
  margin-top: 8px;
}

.cabinet-stats-note {
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cabinet-mode-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  width: 100%;
  padding: 4px;
  border-radius: 16px;
  background: #eef2f7;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cabinet-mode-pill {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.cabinet-mode-pill--active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}
