:root {
  --bg-navy: #173b67;
  --bg-navy-2: #123255;
  --panel-bg: #f4f6fb;
  --panel-border: #d9deea;
  --text: #203052;
  --muted: #68758e;
  --white: #ffffff;
  --shadow: 0 16px 26px rgba(6, 28, 56, 0.12);

  --blue-1: #4a9bff;
  --blue-2: #2c7ae8;
  --green-1: #45b26b;
  --green-2: #2f9e59;
  --orange-1: #f6a238;
  --orange-2: #ea8f1c;
  --purple-1: #8b67ff;
  --purple-2: #6c4ce6;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-navy);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-shell {
  width: min(96vw, 1920px);
  height: min(96vh, 1080px);
  aspect-ratio: 16 / 9;
  margin: auto;
  background: linear-gradient(180deg, var(--bg-navy) 0%, var(--bg-navy-2) 100%);
  padding: 14px 16px 12px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  overflow: hidden;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 348px 1fr 394px;
  gap: 12px;
  min-height: 0;
}

.left-column, .center-column, .right-column {
  min-height: 0;
  display: grid;
  gap: 12px;
}

.left-column {
  grid-template-rows: 164px 300px 1fr;
}

.center-column {
  grid-template-rows: 1.02fr 0.56fr 0.34fr;
}

.right-column {
  grid-template-rows: auto 1fr;
  align-content: stretch;
}

.brand-card,
.panel-card {
  background: rgba(244, 246, 251, 0.98);
  border: 1px solid rgba(217, 222, 234, 0.88);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.brand-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.brand-logo-wrap {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f5fa 100%);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow: hidden;
}

.brand-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-fallback {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  color: var(--bg-navy);
}

.metric-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(128px, 1fr);
  gap: 14px;
}

.metric-card {
  position: relative;
  border-radius: 24px;
  color: var(--white);
  padding: 14px 14px 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255,255,255,0.16) 0 30%, transparent 30% 100%);
  pointer-events: none;
}

.metric-blue { background: linear-gradient(135deg, var(--blue-1), var(--blue-2)); }
.metric-green { background: linear-gradient(135deg, var(--green-1), var(--green-2)); }
.metric-orange { background: linear-gradient(135deg, var(--orange-1), var(--orange-2)); }
.metric-purple { background: linear-gradient(135deg, var(--purple-1), var(--purple-2)); }

.metric-label {
  position: relative;
  z-index: 1;
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.metric-value {
  position: relative;
  z-index: 1;
  font-size: 3.35rem;
  line-height: 1;
  font-weight: 900;
}

.panel-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #fafbfe 0%, #f3f5fa 100%);
}

.panel-head.compact {
  padding: 11px 14px 8px;
}

.panel-head h2 {
  margin: 0 0 2px;
  font-size: 1.02rem;
  font-weight: 800;
}

.panel-head p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.recent-list {
  padding: 10px;
  display: grid;
  gap: 8px;
  overflow: hidden;
}

.recent-item {
  display: grid;
  grid-template-columns: 76px 1.05fr 1.8fr 80px;
  gap: 10px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 8px 12px;
  min-height: 84px;
}

.recent-time-hour {
  font-size: 0.98rem;
  font-weight: 900;
  color: #244b86;
}

.recent-time-date {
  margin-top: 3px;
  font-size: 0.68rem;
  color: var(--muted);
}

.recent-emissor-name,
.recent-evento {
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.15;
}

.recent-emissor-loc,
.recent-desc {
  font-size: 0.7rem;
  line-height: 1.2;
  color: #44506a;
  margin-top: 2px;
}

.recent-tag {
  justify-self: center;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.recent-tag.baixo { background: rgba(76, 175, 80, 0.18); color: #2f7d32; }
.recent-tag.medio { background: rgba(210, 190, 69, 0.22); color: #8a7420; }
.recent-tag.alto { background: rgba(240, 140, 36, 0.2); color: #a05a10; }
.recent-tag.severo { background: rgba(219, 61, 52, 0.18); color: #a32620; }
.recent-tag.extremo { background: rgba(106, 67, 217, 0.18); color: #5d37c1; }

.map-holder {
  padding: 4px 8px 8px;
  height: 100%;
}

.top-panel {
  align-self: start;
}

.top-panel .top-list {
  overflow: visible;
}

.map-inner {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #f9fbff 0%, #f4f6fb 100%);
  padding: 2px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.map-svg-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.map-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.municipio-shape {
  stroke: #ffffff;
  stroke-width: 1.15;
  vector-effect: non-scaling-stroke;
  transition: fill 0.18s ease, filter 0.18s ease;
}

.municipio-shape:hover {
  filter: brightness(0.94);
}

.alerta-shape {
  pointer-events: auto;
  transition: fill-opacity 0.18s ease, stroke-width 0.18s ease;
}

.alerta-shape:hover {
  fill-opacity: 0.4;
  stroke-width: 2.8;
}

.top-list {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.top-item {
  display: grid;
  gap: 6px;
}

.top-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.top-item-name {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-item-value {
  font-size: 1.02rem;
  font-weight: 900;
}

.top-track {
  height: 14px;
  border-radius: 999px;
  background: #e7ebf3;
  overflow: hidden;
}

.top-fill {
  height: 100%;
  border-radius: 999px;
}

.top-blue { background: linear-gradient(90deg, #4a9bff, #2c7ae8); }
.top-green { background: linear-gradient(90deg, #45b26b, #2f9e59); }
.top-orange { background: linear-gradient(90deg, #f6c23e, #e3b620); }
.top-red { background: linear-gradient(90deg, #f05d52, #e23d2f); }
.top-purple { background: linear-gradient(90deg, #8b67ff, #6c4ce6); }

.chart-holder {
  padding: 12px 14px 20px;
  height: 100%;
  min-height: 0;
}

.chart-holder canvas {
  width: 100% !important;
  height: 100% !important;
}

.donut-holder {
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.small-donut {
  height: 255px;
  max-height: none;
}

.recent-desc {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hourly-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.hourly-breakdown {
  padding: 8px 12px 10px;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.hourly-chart {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 118px;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: linear-gradient(180deg, #fbfcff 0%, #f4f6fb 100%);
  padding: 10px 14px 8px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
}

.hourly-grid {
  position: absolute;
  inset: 10px 14px 28px 14px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  pointer-events: none;
}

.hourly-grid-line {
  border-top: 1px solid rgba(102, 112, 133, 0.12);
}

.hourly-bars {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  min-height: 0;
}

.hourly-bar-col {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.hourly-bar-value {
  font-size: 0.62rem;
  line-height: 1;
  font-weight: 800;
  color: #4f5b76;
  margin-bottom: 4px;
}

.hourly-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #3394f0 0%, #1f74c8 100%);
}

.hourly-labels {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 4px;
  align-items: start;
}

.hourly-label {
  text-align: center;
  font-size: 0.6rem;
  color: #5c6882;
  white-space: nowrap;
}

.hourly-label.muted {
  color: transparent;
}

.footer-bar {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0 10px;
  color: #ffffff;
  font-size: 1.12rem;
}

.footer-left,
.footer-right {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-item strong {
  font-weight: 900;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 120px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 20px;
}

@media (max-width: 1600px) {
  .dashboard-grid {
    grid-template-columns: 320px 1fr 380px;
  }

  .metric-value { font-size: 3.1rem; }

  .recent-desc {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hourly-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
  }

  .hourly-breakdown {
    padding: 8px 12px 10px;
    min-height: 0;
    display: flex;
    align-items: stretch;
  }

  .hourly-chart {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 118px;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfcff 0%, #f4f6fb 100%);
    padding: 10px 14px 8px;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 8px;
  }

  .hourly-grid {
    position: absolute;
    inset: 10px 14px 28px 14px;
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    pointer-events: none;
  }

  .hourly-grid-line {
    border-top: 1px solid rgba(102, 112, 133, 0.12);
  }

  .hourly-bars {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    align-items: end;
    gap: 4px;
    min-height: 0;
  }

  .hourly-bar-col {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
  }

  .hourly-bar-value {
    font-size: 0.62rem;
    line-height: 1;
    font-weight: 800;
    color: #4f5b76;
    margin-bottom: 4px;
  }

  .hourly-bar {
    width: 100%;
    min-height: 2px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #3394f0 0%, #1f74c8 100%);
  }

  .hourly-labels {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 4px;
    align-items: start;
  }

  .hourly-label {
    text-align: center;
    font-size: 0.6rem;
    color: #5c6882;
    white-space: nowrap;
  }

  .hourly-label.muted {
    color: transparent;
  }

  .footer-bar { font-size: 0.98rem; }
}

@media (max-width: 1280px) {
  html, body {
    overflow: auto;
    height: auto;
  }

  body {
    align-items: flex-start;
  }

  .app-shell {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    min-height: auto;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .left-column,
  .center-column,
  .right-column {
    grid-template-rows: auto;
  }
}

.top-panel .panel-head { padding-bottom: 8px; }
.top-list { gap: 12px; padding: 12px 14px 14px; }
.top-item { gap: 5px; }

.right-column .panel-card {
  min-height: 0;
}

.right-column .chart-holder {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.right-column .chart-holder canvas {
  flex: 1;
}

.event-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.event-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.event-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(217, 222, 234, .92);
  font-size: .74rem;
  font-weight: 700;
  color: #33415f;
  line-height: 1;
}

.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 10px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.event-c1 { background: #f08c24; }
.event-c2 { background: #db3d34; }
.event-c3 { background: #6a43d9; }
.event-c4 { background: #2382ea; }
.event-c5 { background: #4caf50; }

.event-breakdown {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.event-row {
  display: grid;
  gap: 6px;
}

.event-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.event-row-name {
  flex: 1;
  min-width: 0;
  font-size: .96rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #283a62;
}

.event-row-value {
  font-size: 1.12rem;
  font-weight: 900;
  color: #283a62;
}

.event-track {
  height: 16px;
  border-radius: 999px;
  background: #e7ebf3;
  overflow: hidden;
}

.event-fill {
  height: 100%;
  border-radius: 999px;
}

.event-fill.event-c1 { background: linear-gradient(90deg, #f6a238, #ea8f1c); }
.event-fill.event-c2 { background: linear-gradient(90deg, #f05d52, #db3d34); }
.event-fill.event-c3 { background: linear-gradient(90deg, #8b67ff, #6c4ce6); }
.event-fill.event-c4 { background: linear-gradient(90deg, #4a9bff, #2c7ae8); }
.event-fill.event-c5 { background: linear-gradient(90deg, #45b26b, #2f9e59); }

@media (max-width: 1600px) {
  .event-row-name { font-size: .9rem; }
  .event-row-value { font-size: 1.02rem; }
}

@media (max-width: 1280px) {
  .event-head {
    align-items: flex-start;
  }
}

.severity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.severity-head h2 {
  margin: 0;
  flex: 0 0 auto;
}

.severity-panel-compact .panel-head {
  padding-bottom: 8px;
}

.severity-breakdown {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.severity-row {
  display: grid;
  gap: 6px;
}

.severity-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.severity-row-name {
  flex: 1;
  min-width: 0;
  font-size: .96rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #283a62;
}

.severity-row-value {
  font-size: 1.12rem;
  font-weight: 900;
  color: #283a62;
}

.severity-track {
  height: 16px;
  border-radius: 999px;
  background: #e7ebf3;
  overflow: hidden;
}

.severity-fill {
  height: 100%;
  border-radius: 999px;
}

.severity-fill.sev-c1 { background: linear-gradient(90deg, #45b26b, #2f9e59); }
.severity-fill.sev-c2 { background: linear-gradient(90deg, #f6c23e, #e3b620); }
.severity-fill.sev-c3 { background: linear-gradient(90deg, #f6a238, #ea8f1c); }
.severity-fill.sev-c4 { background: linear-gradient(90deg, #f05d52, #e23d2f); }
.severity-fill.sev-c5 { background: linear-gradient(90deg, #8b67ff, #6c4ce6); }

@media (max-width: 1600px) {
  .severity-row-name { font-size: .9rem; }
  .severity-row-value { font-size: 1.02rem; }
}

.recent-panel-wide .panel-head {
  padding-bottom: 8px;
}

.recent-list-wide {
  padding: 14px;
  gap: 5px;
}

.recent-list-wide .recent-item {
  grid-template-columns: 90px 1.05fr 2fr 84px;
  min-height: 108px;
  padding: 12px 14px;
  position: relative;
  top: -12px;
}

.recent-list-wide .recent-emissor {
  position: relative;
  top: -6px;
}

.recent-list-wide .recent-time-hour {
  font-size: 1.22rem;
}

.recent-list-wide .recent-time-date {
  font-size: 0.78rem;
}

.recent-list-wide .recent-emissor-name,
.recent-list-wide .recent-evento {
  font-size: 0.96rem;
  line-height: 1.18;
}

.recent-list-wide .recent-emissor-loc,
.recent-list-wide .recent-desc {
  font-size: 0.83rem;
  line-height: 1.28;
}

.recent-list-wide .recent-tag {
  font-size: 0.78rem;
  padding: 8px 14px;
}

.recent-list-wide {
  position: relative;
  min-height: 210px;
  transition: opacity 260ms ease, transform 260ms ease;
}

.recent-list-wide.recent-list-leave {
  opacity: 0;
  transform: translateY(10px);
}

.recent-list-wide.recent-list-enter {
  opacity: 1;
  transform: translateY(0);
}

.app-shell {
  width: min(99vw, 1536px);
  height: min(96vh, 864px);
  padding: 22px 28px 10px 40px;
}

.dashboard-grid {
  grid-template-columns: 274px 460px minmax(380px, 1fr) 278px;
  grid-template-rows: 142px 292px minmax(0, 326px);
  grid-template-areas:
    "brand map hourly hourly"
    "metrics map hourly hourly"
    "event recent recent severity";
  gap: 14px 18px;
  min-height: 0;
}

.brand-card { grid-area: brand; }
.metric-stack { grid-area: metrics; }
.map-panel { grid-area: map; }
.hourly-panel { grid-area: hourly; }
.event-panel { grid-area: event; }
.recent-panel { grid-area: recent; }
.severity-panel { grid-area: severity; }

.left-column,
.center-column,
.right-column {
  display: contents;
}

.left-column {
  border-left: 0;
  border-bottom: 0;
  padding: 0;
}

.brand-card,
.panel-card {
  border-radius: 22px;
}

.brand-card {
  padding: 12px;
}

.brand-logo-wrap {
  border-radius: 16px;
  padding: 10px 18px;
}

.metric-stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 140px;
  gap: 14px 12px;
}

.map-panel,
.hourly-panel,
.recent-panel,
.severity-panel,
.event-panel {
  min-height: 0;
}

.map-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.map-holder {
  padding: 0 10px 10px;
  min-height: 0;
}

.map-inner {
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

.map-svg-wrap {
  align-items: center;
  justify-content: center;
}

.map-svg-wrap svg {
  width: auto;
  height: 100%;
  max-width: 100%;
}

.hourly-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  align-self: start;
  min-height: 410px;
}

.hourly-panel .panel-head h2 {
  font-size: 1.55rem;
  letter-spacing: 0;
}

.hourly-breakdown {
  padding: 20px 16px 14px;
}

.hourly-chart {
  min-height: 0;
  border-radius: 18px;
  padding: 12px 18px 8px;
}

.event-panel {
  align-self: start;
  max-height: 118px;
}

.event-breakdown {
  padding: 13px 14px 14px;
}

.recent-panel-wide {
  display: grid;
  grid-template-rows: auto 1fr;
}

.recent-panel-wide .panel-head h2 {
  font-size: 1.55rem;
  letter-spacing: 0;
}

.recent-list-wide {
  padding: 14px 20px 12px;
  gap: 10px;
  min-height: 0;
}

.recent-list-wide .recent-item {
  grid-template-columns: 108px 290px minmax(160px, 1fr) 232px;
  gap: 10px;
  min-height: 118px;
  padding: 10px 16px;
  border-radius: 14px;
  top: 0;
}

.recent-list-wide .recent-time-hour {
  font-size: 1.28rem;
}

.recent-list-wide .recent-time-date {
  font-size: 0.8rem;
}

.recent-list-wide .recent-emissor-name,
.recent-list-wide .recent-evento {
  font-size: 1rem;
}

.recent-list-wide .recent-emissor-loc,
.recent-list-wide .recent-desc {
  font-size: 0.78rem;
}

.recent-status {
  justify-self: end;
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.recent-list-wide .recent-tag {
  flex: 0 0 auto;
  min-width: 108px;
  text-align: center;
  font-size: 0.78rem;
  padding: 8px 12px;
}

.recent-expira {
  flex: 0 0 94px;
  max-width: 94px;
  text-align: right;
  font-size: 0.72rem;
  line-height: 1.15;
}

.right-column .severity-panel,
.severity-panel {
  grid-row: auto;
  width: auto;
  justify-self: stretch;
  align-self: end;
}

.severity-panel-compact {
  display: grid;
  grid-template-rows: auto 1fr;
}

.severity-breakdown {
  padding: 16px 14px;
  gap: 14px;
}

.footer-bar {
  min-height: 42px;
  padding: 0 0 0 0;
}

@media (max-width: 1280px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "brand"
      "metrics"
      "map"
      "hourly"
      "event"
      "recent"
      "severity";
  }

  .hourly-panel {
    min-height: 320px;
  }

  .recent-list-wide .recent-item {
    grid-template-columns: 70px 1fr;
  }

  .recent-content,
  .recent-status {
    grid-column: 1 / -1;
  }

  .recent-status {
    justify-self: stretch;
    justify-content: flex-start;
  }
}

/* =========================================================
   AJUSTES RESPONSIVOS FINAIS
   - Grid fluido por áreas
   - Cards alinhados no mesmo eixo
   - Mapa do ES com zoom visual reduzido dentro do bloco
   ========================================================= */

html {
  min-width: 320px;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100svh;
}

.app-shell {
  width: min(100vw, 1536px);
  height: min(100svh, 864px);
  min-height: 640px;
  padding: clamp(12px, 1.5vw, 22px) clamp(12px, 1.8vw, 28px) clamp(8px, 1vw, 12px);
  gap: clamp(8px, 1vw, 12px);
}

.dashboard-grid {
  width: 100%;
  height: 100%;
  grid-template-columns:
    minmax(220px, 0.72fr)
    minmax(320px, 1.1fr)
    minmax(360px, 1.45fr)
    minmax(230px, 0.8fr);
  grid-template-rows:
    minmax(118px, 0.72fr)
    minmax(245px, 1.52fr)
    minmax(230px, 1.2fr);
  gap: clamp(10px, 1.1vw, 18px);
  align-items: stretch;
}

.brand-card,
.metric-card,
.panel-card {
  min-width: 0;
}

.brand-card,
.panel-card {
  border-radius: clamp(16px, 1.5vw, 22px);
}

.brand-card {
  min-height: 0;
}

.metric-stack {
  height: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(10px, 1vw, 14px);
  align-self: stretch;
}

.metric-card {
  min-height: 0;
  border-radius: clamp(16px, 1.5vw, 22px);
  padding: clamp(10px, 1vw, 14px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-label {
  font-size: clamp(0.78rem, 0.8vw, 0.98rem);
  line-height: 1.15;
  margin-bottom: 6px;
}

.metric-value {
  font-size: clamp(2.25rem, 3.2vw, 3.35rem);
}

.panel-head,
.panel-head.compact {
  padding: clamp(9px, 0.85vw, 12px) clamp(12px, 1vw, 16px) clamp(7px, 0.65vw, 9px);
}

.panel-head h2,
.hourly-panel .panel-head h2,
.recent-panel-wide .panel-head h2 {
  font-size: clamp(0.95rem, 1.1vw, 1.55rem);
  line-height: 1.15;
}

.map-panel,
.hourly-panel,
.event-panel,
.recent-panel-wide,
.severity-panel-compact {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  max-height: none;
  min-height: 0;
}

.map-holder,
.hourly-breakdown,
.event-breakdown,
.recent-list-wide,
.severity-breakdown {
  min-height: 0;
  overflow: hidden;
}

/* Reduz o zoom visual do mapa, deixando o ES respirar dentro do card. */
.map-holder {
  height: auto;
  padding: clamp(8px, 1vw, 14px);
}

.map-inner {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(8px, 1vw, 16px);
  align-items: center;
  justify-content: center;
}

.map-svg-wrap {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.map-svg-wrap svg {
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 88%;
  transform: scale(0.92);
  transform-origin: center center;
}

.hourly-panel {
  min-height: 0;
}

.hourly-breakdown {
  padding: clamp(10px, 1.25vw, 20px) clamp(10px, 1vw, 16px) clamp(10px, 1vw, 14px);
}

.hourly-chart {
  height: 100%;
  min-height: 0;
}

.event-panel {
  align-self: stretch;
}

.event-breakdown,
.severity-breakdown {
  gap: clamp(8px, 0.85vw, 14px);
  padding: clamp(10px, 1vw, 16px);
}

.event-row-name,
.severity-row-name {
  font-size: clamp(0.78rem, 0.8vw, 0.96rem);
}

.event-row-value,
.severity-row-value {
  font-size: clamp(0.9rem, 0.95vw, 1.12rem);
}

.event-track,
.severity-track {
  height: clamp(10px, 1.05vw, 16px);
}

.recent-panel-wide {
  min-width: 0;
}

.recent-list-wide {
  padding: clamp(10px, 1.15vw, 20px);
  gap: clamp(8px, 0.8vw, 10px);
  align-content: start;
}

.recent-list-wide .recent-item {
  width: 100%;
  grid-template-columns:
    minmax(76px, 0.55fr)
    minmax(150px, 1.2fr)
    minmax(180px, 1.8fr)
    minmax(150px, 0.95fr);
  gap: clamp(8px, 0.9vw, 14px);
  min-height: clamp(92px, 13vh, 118px);
  padding: clamp(9px, 0.9vw, 14px);
  align-items: center;
}

.recent-list-wide .recent-time-hour {
  font-size: clamp(1rem, 1.15vw, 1.28rem);
}

.recent-list-wide .recent-emissor-name,
.recent-list-wide .recent-evento {
  font-size: clamp(0.82rem, 0.85vw, 1rem);
}

.recent-list-wide .recent-emissor-loc,
.recent-list-wide .recent-desc {
  font-size: clamp(0.7rem, 0.72vw, 0.83rem);
}

.recent-status {
  justify-self: stretch;
  justify-content: flex-end;
  gap: clamp(8px, 0.85vw, 12px);
}

.recent-list-wide .recent-tag {
  min-width: clamp(86px, 7vw, 108px);
}

.recent-expira {
  flex-basis: clamp(78px, 6.2vw, 94px);
  max-width: clamp(78px, 6.2vw, 94px);
}

.severity-panel {
  align-self: stretch;
}

.footer-bar {
  min-height: clamp(34px, 4.8vh, 42px);
  font-size: clamp(0.76rem, 0.9vw, 1rem);
  line-height: 1.25;
}

.footer-left,
.footer-right {
  gap: clamp(8px, 1.1vw, 18px);
}

@media (max-width: 1366px) {
  .app-shell {
    width: 100vw;
    height: 100svh;
    min-height: 620px;
  }

  .dashboard-grid {
    grid-template-columns:
      minmax(200px, 0.7fr)
      minmax(285px, 1fr)
      minmax(330px, 1.35fr)
      minmax(210px, 0.78fr);
    grid-template-rows: minmax(108px, 0.65fr) minmax(220px, 1.35fr) minmax(215px, 1fr);
  }

  .map-svg-wrap svg {
    max-width: 86%;
    max-height: 86%;
    transform: scale(0.9);
  }
}

@media (max-width: 1180px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  body {
    align-items: flex-start;
  }

  .app-shell {
    width: 100%;
    height: auto;
    min-height: 100svh;
    aspect-ratio: auto;
    overflow: visible;
  }

  .dashboard-grid {
    height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas:
      "brand metrics"
      "map map"
      "hourly hourly"
      "recent recent"
      "event severity";
  }

  .brand-card {
    min-height: 160px;
  }

  .metric-stack {
    min-height: 160px;
  }

  .map-panel {
    min-height: 520px;
  }

  .hourly-panel {
    min-height: 340px;
  }

  .recent-panel-wide {
    min-height: 280px;
  }

  .event-panel,
  .severity-panel {
    min-height: 230px;
  }

  .map-svg-wrap svg {
    max-width: 78%;
    max-height: 78%;
    transform: scale(0.88);
  }

  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "metrics"
      "map"
      "hourly"
      "recent"
      "event"
      "severity";
    gap: 12px;
  }

  .brand-card {
    min-height: 120px;
  }

  .metric-stack {
    grid-template-columns: 1fr 1fr;
    min-height: 280px;
  }

  .map-panel {
    min-height: 440px;
  }

  .map-svg-wrap svg {
    max-width: 82%;
    max-height: 82%;
    transform: scale(0.88);
  }

  .hourly-panel {
    min-height: 300px;
  }

  .recent-list-wide .recent-item {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: auto;
  }

  .recent-emissor,
  .recent-content,
  .recent-status {
    grid-column: 1 / -1;
  }

  .recent-status {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .recent-expira {
    text-align: left;
  }

  .event-panel,
  .severity-panel {
    min-height: 220px;
  }
}

@media (max-width: 480px) {
  .metric-stack {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .metric-card {
    min-height: 116px;
  }

  .map-panel {
    min-height: 380px;
  }

  .hourly-bars,
  .hourly-labels {
    gap: 2px;
  }

  .hourly-label,
  .hourly-bar-value {
    font-size: 0.5rem;
  }

  .footer-left,
  .footer-right {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================
   Ajuste: rolagem interna no bloco "Últimos Alertas"
   ========================================================= */
.recent-panel,
.recent-panel-wide {
  min-height: 0;
  overflow: hidden;
}

.recent-panel-wide {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.recent-list,
.recent-list-wide {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: clamp(12px, 1.2vw, 22px);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.recent-list::-webkit-scrollbar,
.recent-list-wide::-webkit-scrollbar {
  width: 8px;
}

.recent-list::-webkit-scrollbar-track,
.recent-list-wide::-webkit-scrollbar-track {
  background: rgba(217, 222, 234, 0.65);
  border-radius: 999px;
}

.recent-list::-webkit-scrollbar-thumb,
.recent-list-wide::-webkit-scrollbar-thumb {
  background: rgba(104, 117, 142, 0.65);
  border-radius: 999px;
}

.recent-list::-webkit-scrollbar-thumb:hover,
.recent-list-wide::-webkit-scrollbar-thumb:hover {
  background: rgba(104, 117, 142, 0.9);
}

/* =========================================================
   Ajustes finais solicitados
   ========================================================= */
.map-inner {
  padding: clamp(4px, 0.55vw, 8px);
}

.map-svg-wrap svg {
  max-width: 98%;
  max-height: 98%;
  transform: none;
}

.recent-list-wide .recent-item {
  grid-template-columns:
    minmax(76px, 0.52fr)
    minmax(150px, 1.08fr)
    minmax(0, 1.58fr)
    minmax(228px, 0.95fr);
}

.recent-content {
  min-width: 0;
  overflow: hidden;
}

.recent-list-wide .recent-desc {
  max-width: 100%;
  line-clamp: 2;
  word-break: normal;
  overflow-wrap: anywhere;
}

.recent-status {
  min-width: 228px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.recent-list-wide .recent-tag {
  min-width: clamp(82px, 6.4vw, 104px);
}

.recent-expira {
  flex-basis: clamp(100px, 7.4vw, 118px);
  max-width: clamp(100px, 7.4vw, 118px);
  font-weight: 900;
}

@media (max-width: 1366px) {
  .map-svg-wrap svg {
    max-width: 96%;
    max-height: 96%;
    transform: none;
  }

  .recent-list-wide .recent-item {
    grid-template-columns:
      minmax(68px, 0.5fr)
      minmax(135px, 1fr)
      minmax(0, 1.35fr)
      minmax(210px, 0.9fr);
  }

  .recent-status {
    min-width: 210px;
  }
}

/* =========================================================
   Layout operacional amplo
   ========================================================= */
.app-shell {
  width: 100vw;
  max-width: none;
  height: 100svh;
  max-height: none;
  padding: clamp(8px, 1vw, 14px);
}

.dashboard-grid {
  grid-template-columns:
    minmax(230px, 0.78fr)
    minmax(350px, 1.16fr)
    minmax(520px, 1.82fr)
    minmax(260px, 0.88fr);
  grid-template-rows:
    minmax(130px, 0.72fr)
    minmax(280px, 1.55fr)
    minmax(220px, 1.08fr);
  grid-template-areas:
    "brand map recent recent"
    "metrics map recent recent"
    "event hourly hourly severity";
  gap: clamp(8px, 0.85vw, 14px);
}

.recent-panel-wide {
  min-height: 0;
}

.recent-list-wide {
  align-content: start;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

.recent-list-wide .recent-item {
  grid-template-columns:
    minmax(82px, 0.52fr)
    minmax(170px, 1.12fr)
    minmax(0, 1.65fr)
    minmax(230px, 0.95fr);
  min-height: clamp(126px, 15vh, 154px);
}

.hourly-panel {
  min-height: 0;
}

.hourly-breakdown {
  padding: clamp(8px, 0.85vw, 14px);
}

.hourly-chart {
  border-radius: 14px;
  padding: 8px 12px 6px;
}

.severity-panel {
  min-height: 0;
  overflow: hidden;
}

.severity-breakdown {
  min-height: 0;
  max-height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.severity-breakdown::-webkit-scrollbar {
  width: 8px;
}

.severity-breakdown::-webkit-scrollbar-track {
  background: rgba(217, 222, 234, 0.65);
  border-radius: 999px;
}

.severity-breakdown::-webkit-scrollbar-thumb {
  background: rgba(104, 117, 142, 0.65);
  border-radius: 999px;
}

@media (max-width: 1366px) {
  .dashboard-grid {
    grid-template-columns:
      minmax(205px, 0.74fr)
      minmax(300px, 1.04fr)
      minmax(440px, 1.66fr)
      minmax(225px, 0.82fr);
    grid-template-rows:
      minmax(110px, 0.64fr)
      minmax(245px, 1.42fr)
      minmax(205px, 1fr);
  }

  .recent-list-wide .recent-item {
    grid-template-columns:
      minmax(70px, 0.48fr)
      minmax(145px, 1fr)
      minmax(0, 1.42fr)
      minmax(210px, 0.9fr);
    min-height: clamp(112px, 14vh, 138px);
  }
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-areas:
      "brand metrics"
      "map map"
      "recent recent"
      "hourly hourly"
      "event severity";
  }
}

@media (max-width: 760px) {
  .dashboard-grid {
    grid-template-areas:
      "brand"
      "metrics"
      "map"
      "recent"
      "hourly"
      "event"
      "severity";
  }
}

/* =========================================================
   Reset responsivo final
   Mantem o layout amplo somente no desktop.
   ========================================================= */
@media (max-width: 1180px) {
  html,
  body {
    width: 100%;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    display: block;
  }

  .app-shell {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100svh;
    max-height: none;
    aspect-ratio: auto;
    margin: 0;
    overflow: visible;
  }

  .dashboard-grid {
    width: 100%;
    height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
    grid-auto-rows: auto;
    grid-template-areas:
      "brand metrics"
      "map map"
      "recent recent"
      "hourly hourly"
      "event severity";
    align-items: stretch;
  }

  .metric-stack {
    width: 100%;
    height: auto;
    min-height: 170px;
    grid-auto-rows: minmax(76px, auto);
  }

  .map-panel,
  .recent-panel-wide,
  .hourly-panel,
  .event-panel,
  .severity-panel {
    width: 100%;
    max-height: none;
  }

  .map-panel {
    min-height: 500px;
  }

  .recent-panel-wide {
    min-height: 420px;
  }

  .recent-list-wide {
    max-height: 360px;
  }

  .hourly-panel {
    min-height: 320px;
  }

  .event-panel,
  .severity-panel {
    min-height: 250px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-auto-rows: auto;
    grid-template-areas:
      "brand"
      "metrics"
      "map"
      "recent"
      "hourly"
      "event"
      "severity";
    gap: 12px;
  }

  .brand-card {
    min-height: 132px;
  }

  .metric-stack {
    height: auto;
    min-height: 286px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(136px, auto);
  }

  .metric-card {
    min-height: 136px;
  }

  .map-panel {
    min-height: 430px;
  }

  .recent-panel-wide {
    min-height: 470px;
  }

  .recent-list-wide {
    max-height: 410px;
    padding: 10px;
  }

  .recent-list-wide .recent-item {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: auto;
    padding: 12px;
  }

  .recent-emissor,
  .recent-content,
  .recent-status {
    grid-column: 1 / -1;
  }

  .recent-status {
    min-width: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  .recent-expira {
    text-align: left;
  }

  .hourly-panel {
    min-height: 300px;
  }

  .event-panel,
  .severity-panel {
    min-height: 250px;
  }

  .severity-breakdown {
    max-height: 205px;
  }

  .footer-bar {
    margin-top: 12px;
  }
}

@media (max-width: 480px) {
  .metric-stack {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(120px, auto);
  }

  .metric-card {
    min-height: 120px;
  }

  .map-panel {
    min-height: 370px;
  }
}

/* =========================================================
   Mapa dinamico do dashboard
   O bloco #mapa-uf agora e o container Leaflet.
   ========================================================= */
#mapa-uf.map-holder {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: clamp(14px, 1.4vw, 22px);
  background: #eef3fb;
  overflow: hidden;
}

#mapa-uf.leaflet-container {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}

.map-panel > #mapa-uf.map-holder {
  align-self: stretch;
  justify-self: stretch;
}

.leaflet-container a {
  color: #244b86;
}

.leaflet-control-zoom {
  border: 1px solid rgba(217, 222, 234, 0.92) !important;
  border-radius: 12px !important;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(6, 28, 56, 0.14);
}

.leaflet-control-zoom a {
  color: #203052 !important;
  border-bottom-color: rgba(217, 222, 234, 0.92) !important;
}

.leaflet-control-attribution {
  font-size: 0.58rem;
  background: rgba(255, 255, 255, 0.78) !important;
}

.leaflet-popup-content {
  margin: 12px 14px;
  min-width: 240px;
  font-family: Arial, Helvetica, sans-serif;
}

.popup {
  display: grid;
  gap: 8px;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
}

.popup h3 {
  margin: 0;
  font-size: 16px;
}

.popup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  font-weight: 700;
  font-size: 12px;
}

@media (max-width: 760px) {
  #mapa-uf.map-holder {
    min-height: 330px;
  }
}

@media (max-width: 480px) {
  #mapa-uf.map-holder {
    min-height: 280px;
  }
}

/* =========================================================
   Layout conforme mockup operacional
   Desktop: esquerda fixa, mapa central alto e paineis a direita.
   ========================================================= */
@media (min-width: 1181px) {
  html,
  body {
    overflow: hidden;
  }

  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .app-shell {
    width: 100vw;
    height: 100svh;
    max-width: none;
    max-height: none;
    min-height: 720px;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: clamp(8px, 0.7vw, 12px);
    padding: clamp(10px, 0.75vw, 14px);
    overflow: hidden;
  }

  .dashboard-grid {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns:
      minmax(285px, 310px)
      minmax(430px, 470px)
      minmax(520px, 1fr)
      minmax(300px, 350px);
    grid-template-rows:
      minmax(150px, 0.92fr)
      minmax(360px, 2.35fr)
      minmax(220px, 1.5fr);
    grid-template-areas:
      "brand map recent recent"
      "metrics map recent recent"
      "event map hourly severity";
    gap: clamp(8px, 0.75vw, 14px);
    align-items: stretch;
  }

  .brand-card,
  .metric-stack,
  .map-panel,
  .recent-panel-wide,
  .event-panel,
  .hourly-panel,
  .severity-panel {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-height: none;
    align-self: stretch;
    justify-self: stretch;
  }

  .brand-card {
    grid-area: brand;
    padding: clamp(10px, 0.85vw, 14px);
  }

  .metric-stack {
    grid-area: metrics;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: clamp(10px, 0.85vw, 14px);
  }

  .event-panel {
    grid-area: event;
  }

  .map-panel {
    grid-area: map;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .recent-panel,
  .recent-panel-wide {
    grid-area: recent;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .hourly-panel {
    grid-area: hourly;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .severity-panel {
    grid-area: severity;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .brand-card,
  .panel-card {
    border-radius: clamp(16px, 1.25vw, 24px);
  }

  .brand-logo-wrap {
    border-radius: clamp(12px, 1vw, 18px);
    padding: clamp(8px, 0.9vw, 16px);
  }

  .metric-card {
    min-height: 0;
    padding: clamp(12px, 1vw, 18px);
    border-radius: clamp(16px, 1.25vw, 22px);
  }

  .metric-label {
    font-size: clamp(0.86rem, 0.8vw, 1rem);
  }

  .metric-value {
    font-size: clamp(2.9rem, 3.2vw, 4.2rem);
  }

  .panel-head,
  .panel-head.compact {
    padding: clamp(10px, 0.9vw, 14px) clamp(14px, 1vw, 18px);
  }

  .panel-head h2,
  .hourly-panel .panel-head h2,
  .recent-panel-wide .panel-head h2 {
    font-size: clamp(1.05rem, 1.15vw, 1.48rem);
    line-height: 1.15;
  }

  .map-panel .panel-head h2 {
    font-size: clamp(1.28rem, 1.35vw, 1.82rem);
  }

  #mapa-uf.map-holder {
    height: 100%;
    min-height: 0;
    border-radius: 0 0 clamp(16px, 1.25vw, 22px) clamp(16px, 1.25vw, 22px);
  }

  .recent-list,
  .recent-list-wide {
    max-height: none;
    padding: clamp(12px, 1vw, 18px);
    overflow-y: auto;
    align-content: start;
  }

  .recent-list-wide .recent-item {
    grid-template-columns:
      minmax(78px, 0.42fr)
      minmax(155px, 0.9fr)
      minmax(220px, 1.35fr)
      minmax(210px, 0.82fr);
    min-height: clamp(120px, 14vh, 152px);
    gap: clamp(10px, 0.9vw, 16px);
  }

  .hourly-breakdown,
  .event-breakdown,
  .severity-breakdown {
    min-height: 0;
    max-height: none;
    padding: clamp(12px, 1vw, 18px);
  }

  .hourly-chart {
    min-height: 0;
    height: 100%;
    border-radius: 14px;
  }

  .severity-breakdown {
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .footer-bar {
    min-height: clamp(36px, 4.8vh, 46px);
    padding: 0;
    font-size: clamp(0.88rem, 0.92vw, 1.08rem);
  }
}

/* Ajustes finais do bloco "Últimos Alertas" */
.recent-list-wide .recent-emissor-loc {
  display: block;
  max-height: 3.7em;
  overflow-y: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.22;
  scrollbar-gutter: stable;
}

.recent-expira {
  display: grid;
  gap: 2px;
  align-content: center;
  flex-basis: clamp(112px, 8vw, 132px);
  max-width: clamp(112px, 8vw, 132px);
  text-align: right;
  white-space: normal;
  line-height: 1.12;
  font-weight: 900;
}

.recent-expira-label,
.recent-expira-value {
  display: block;
  text-align: center;
}

@media (max-width: 760px) {
  .recent-expira {
    max-width: none;
    text-align: left;
  }
}

/* Recuo interno da expiração nos cards de alertas */
.recent-list-wide .recent-item {
  grid-template-columns:
    minmax(78px, 0.42fr)
    minmax(155px, 0.9fr)
    minmax(220px, 1.18fr)
    minmax(280px, 0.98fr);
}

.recent-status {
  justify-self: stretch;
  justify-content: flex-end;
  gap: clamp(28px, 2vw, 44px);
  padding-left: clamp(20px, 1.6vw, 34px);
  padding-right: clamp(16px, 1.4vw, 28px);
  box-sizing: border-box;
}

.recent-list-wide .recent-tag {
  flex: 0 0 clamp(92px, 6.2vw, 116px);
}

.recent-expira {
  flex: 0 0 clamp(96px, 7vw, 120px);
  max-width: clamp(96px, 7vw, 120px);
  overflow: visible;
  justify-items: center;
  text-align: center;
}

.recent-content {
  padding-right: clamp(12px, 1vw, 20px);
}

.severity-breakdown {
  gap: clamp(3px, 0.35vw, 5px);
  padding: clamp(5px, 0.45vw, 8px) clamp(12px, 0.9vw, 16px) clamp(6px, 0.5vw, 9px);
  overflow-y: hidden;
  justify-content: start;
}

.severity-row {
  gap: 2px;
}

.severity-row-head {
  min-height: 17px;
}

.severity-row-name {
  font-size: clamp(0.72rem, 0.66vw, 0.82rem);
}

.severity-row-value {
  font-size: clamp(0.78rem, 0.72vw, 0.9rem);
}

.severity-track {
  height: clamp(7px, 0.58vw, 10px);
}

.severity-panel .panel-head {
  padding-top: clamp(8px, 0.65vw, 11px);
  padding-bottom: clamp(5px, 0.45vw, 8px);
}

/* Visual refinado para manter todos os 5 níveis visíveis */
.severity-panel-compact {
  grid-template-rows: auto minmax(0, 1fr);
}

.severity-panel .panel-head,
.severity-panel .panel-head.compact {
  padding-top: 9px;
  padding-bottom: 7px;
}

.severity-panel .panel-head h2 {
  font-size: clamp(1.02rem, 1vw, 1.22rem);
  line-height: 1.1;
}

.severity-breakdown {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(5px, 0.48vw, 8px);
  min-height: 0;
  max-height: none;
  height: 100%;
  padding: clamp(8px, 0.7vw, 12px) clamp(16px, 1vw, 22px) clamp(10px, 0.8vw, 14px);
  overflow: hidden;
}

.severity-row {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: clamp(3px, 0.28vw, 5px);
}

.severity-row-head {
  min-height: 15px;
  line-height: 1.05;
}

.severity-row-name {
  font-size: clamp(0.72rem, 0.68vw, 0.84rem);
  line-height: 1.05;
}

.severity-row-value {
  font-size: clamp(0.78rem, 0.74vw, 0.92rem);
  line-height: 1.05;
}

.severity-track {
  width: 100%;
  height: clamp(8px, 0.62vw, 11px);
  box-shadow: inset 0 1px 1px rgba(40, 58, 98, 0.06);
}

@media (max-width: 760px) {
  .recent-list-wide .recent-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .recent-status {
    padding-left: 0;
    padding-right: 0;
  }
}
