/* Fase 18 — Dashboard Executivo */
.alert--danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert--danger[hidden] {
  display: none;
}

.dashboard-hero {
  margin-bottom: 1.25rem;
}

.dashboard-hero__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.dashboard-hero__subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.dashboard-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard-filters .form-field {
  margin: 0;
}

.dashboard-loading {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.dashboard-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 0.5rem 0 1rem;
}

.cards-grid--executive {
  grid-template-columns: 1fr;
}

.stat-card--executive .stat-card__hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chart-card__header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.chart-card__header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.chart-card__body {
  padding: 1rem;
  min-height: 140px;
}

.chart-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.chart-donut-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.chart-donut {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: relative;
}

.chart-donut__center {
  position: absolute;
  inset: 18%;
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.chart-donut-wrap {
  position: relative;
}

.chart-donut-wrap .chart-donut {
  position: relative;
}

.chart-donut-wrap .chart-donut__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
}

.chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.chart-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.chart-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-bar-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.chart-bar-row__label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chart-bar-row__track {
  height: 8px;
  background: var(--surface-elevated, #f4f4f5);
  border-radius: 4px;
  overflow: hidden;
}

.chart-bar-row__fill {
  height: 100%;
  border-radius: 4px;
  min-width: 2px;
}

.chart-bar-row__value {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 1.5rem;
  text-align: right;
}

.chart-line {
  width: 100%;
  height: auto;
  max-height: 140px;
}

.chart-line-label {
  font-size: 8px;
  fill: var(--text-muted);
}

.ranking-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 1fr auto;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.ranking-row__name {
  font-size: 0.85rem;
  font-weight: 500;
}

.ranking-row__track {
  height: 8px;
  background: var(--surface-elevated, #f4f4f5);
  border-radius: 4px;
  overflow: hidden;
}

.ranking-row__fill {
  height: 100%;
  background: #2563eb;
  border-radius: 4px;
}

.ranking-row__value {
  font-weight: 600;
  font-size: 0.85rem;
}

.saude-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.saude-grid > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.saude-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.saude-grid small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dashboard-panels {
  margin-top: 0.5rem;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

@media (min-width: 480px) {
  .dashboard-filters {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
  }
  .dashboard-filters .form-field {
    flex: 1 1 140px;
  }
}

@media (min-width: 768px) {
  .cards-grid--executive {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .saude-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards-grid--executive {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1366px) {
  .charts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .chart-card--wide {
    grid-column: span 2;
  }
}
