:root {
  color-scheme: light;
  --brand-950: #082a50;
  --brand-900: #0d366b;
  --brand-700: #184f95;
  --brand-600: #1c5cab;
  --brand-100: #dceafe;
  --brand-50: #f2f7fd;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #eaf0f6;
  --line: #d7e0e9;
  --line-strong: #bac8d6;
  --text: #172433;
  --muted: #5b6b7d;
  --success: #16805d;
  --warning: #b76a00;
  --danger: #c13c49;
  --focus: #f0ad00;
  --sidebar-w: 270px;
  --sidebar-collapsed-w: 76px;
  --topbar-h: 64px;
  --radius-sm: .4rem;
  --radius-md: .65rem;
  --radius-lg: .85rem;
  --shadow-sm: 0 1px 2px rgba(8, 42, 80, .06);
  --shadow-md: 0 8px 24px rgba(8, 42, 80, .08);
}

html, body { min-height: 100%; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: #edf2f6; font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: .9375rem; line-height: 1.5; }
a { color: var(--brand-600); }
a:hover { color: var(--brand-900); }
.btn { min-height: 2.45rem; border-radius: var(--radius-sm); font-weight: 650; }
.btn-sm { min-height: 2rem; }
.btn-primary { background: var(--brand-600); border-color: var(--brand-600); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); border-color: var(--brand-700); }
.btn-light-2 { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-icon { display: inline-grid; width: 2.45rem; padding: 0; place-items: center; }
.btn:focus-visible, .form-control:focus, .form-select:focus { border-color: var(--brand-600); box-shadow: 0 0 0 .2rem rgba(28, 92, 171, .16); }
.card { border-color: var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card-header { min-height: 3rem; padding: .75rem 1rem; background: #f8fafc; border-color: var(--line); }
.card-body { padding: 1rem; }
.form-label { color: #34455a; font-size: .82rem; font-weight: 650; }
.form-control, .form-select { min-height: 2.65rem; border-color: var(--line-strong); border-radius: var(--radius-sm); }
.form-control:hover, .form-select:hover { border-color: #8ea4ba; }
.form-text { color: var(--muted); }
.required::after { margin-left: .2rem; color: var(--danger); content: "*"; }
.badge { border-radius: .35rem; font-weight: 700; letter-spacing: .01em; }
.alert { border-width: 1px; border-radius: var(--radius-md); }
.table { --bs-table-color: var(--text); --bs-table-hover-bg: #f3f7fb; }
.table > :not(caption) > * > * { padding: .7rem .8rem; border-bottom-color: #e5ebf1; }
.table thead th { color: #405166; background: #f5f8fb; border-bottom: 1px solid var(--line-strong); font-size: .72rem; font-weight: 750; letter-spacing: .025em; text-transform: uppercase; white-space: nowrap; }
.table tbody td { vertical-align: middle; }
.table-responsive { scrollbar-color: #aebdca transparent; }
.text-secondary { color: var(--muted) !important; }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--text); }
.brand-mark { width: 2.3rem; height: 2.3rem; display: inline-grid; place-items: center; border-radius: .65rem; background: var(--brand-600); color: #fff; font-size: 1.2rem; }
.brand-name { display: flex; flex-direction: column; font-weight: 700; line-height: 1.1; }
.brand-name span { margin-top: .2rem; color: var(--muted); font-size: .72rem; font-weight: 500; }

.public-nav { background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.hero { position: relative; overflow: hidden; color: #fff; background: var(--brand-900); }
.hero::after { position: absolute; right: -8rem; bottom: -16rem; width: 34rem; height: 34rem; content: ""; border: 5rem solid rgba(255,255,255,.035); border-radius: 50%; pointer-events: none; }
.hero h1 { max-width: 760px; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.06; font-weight: 750; }
.hero .lead { color: #dbe8f7; max-width: 760px; }
.hero-panel { border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-lg); background: rgba(255,255,255,.07); }
.hero-list { color: #dbe8f7; }

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 38%) 1fr; background: #fff; }
.auth-side { display: flex; padding: clamp(2rem, 5vw, 4.5rem); color: #fff; background: var(--brand-950); }
.auth-side-copy { color: #c6d8f2; }
.auth-side-muted { color: #92abcd; }
.auth-side .brand-name span { color: #92abcd; }
.auth-card { width: min(100%, 450px); padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.auth-card h1 { color: var(--brand-950); font-weight: 750; }
.auth-kicker { color: var(--brand-600); font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.amb-seg { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: .65rem; }
.amb-seg-op { position: relative; margin: 0; cursor: pointer; }
.amb-seg-op + .amb-seg-op { border-left: 1px solid var(--line); }
.amb-seg-op input { position: absolute; opacity: 0; pointer-events: none; }
.amb-seg-op > span { display: flex; align-items: center; gap: .55rem; min-height: 58px; padding: .55rem .7rem; border-bottom: 3px solid transparent; background: #fff; }
.amb-seg-op i { color: var(--brand-600); font-size: 1.15rem; }
.amb-seg-txt { display: flex; min-width: 0; flex-direction: column; line-height: 1.1; }
.amb-seg-txt strong { font-size: .82rem; }
.amb-seg-txt code { color: var(--muted); font-size: .68rem; }
.amb-seg-op input:focus-visible + span { outline: 3px solid #f0ad00; outline-offset: -3px; }
.ambiente-alertas input:checked + span { border-bottom-color: var(--brand-600); background: #f4f8fe; }
.ambiente-ocorrencias input:checked + span { border-bottom-color: #198754; background: #eff9f3; }
.ambiente-ocorrencias input:checked + span i, .ambiente-ocorrencias input:checked + span strong { color: #146c43; }
html[data-ambiente="ocorrencias"] .auth-card .btn-primary { background: #198754; border-color: #198754; }
html[data-ambiente="ocorrencias"] .auth-card .btn-primary:hover { background: #146c43; border-color: #146c43; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1035; display: flex; width: var(--sidebar-w); flex-direction: column; overflow-x: hidden; overflow-y: auto; color: #fff; background: #102d52; transition: width .2s ease, transform .2s ease; }
.sidebar-brand { display: flex; min-height: var(--topbar-h); align-items: center; padding: .75rem 1rem; }
.sidebar-brand .brand { min-width: 224px; }
.sidebar-nav { flex: 1 0 auto; padding: .85rem .75rem 1.5rem; gap: .15rem; }
.sidebar-group-title { margin: 0 .65rem .35rem; font-size: .66rem; font-weight: 750; letter-spacing: .075em; white-space: nowrap; }
.sidebar .nav-link { position: relative; min-height: 2.55rem; color: #d5dfed; border-radius: var(--radius-sm); padding: .55rem .65rem; white-space: nowrap; }
.sidebar .nav-link i { width: 1.25rem; flex: 0 0 1.25rem; text-align: center; font-size: 1rem; }
.sidebar button.nav-link { width: 100%; background: transparent; }
.sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar .nav-link.active { color: #fff; background: #1f64b8; box-shadow: inset 3px 0 #8fc8ff; }
.sidebar .text-secondary { color: #91a7c4 !important; }
.sidebar-switch-wrap { padding: .55rem .75rem 0; }
.sidebar-view-switch { width: 100%; min-height: 2.45rem; padding: .45rem .6rem; color: #123a63; border: 1px solid #cbd9e7; border-radius: .55rem; background: #fff; font-size: .76rem; font-weight: 650; }
.sidebar-view-switch:hover { background: #f3f7fb; }
.sidebar-view-switch i { flex: 0 0 auto; }
.sidebar-footer { padding: .8rem 1rem 1.1rem; color: #91a7c4; border-top: 1px solid rgba(255,255,255,.1); font-size: .7rem; }

/* Alertas Hidrológicos usa a identidade azul-clara aprovada. Os módulos
   adicionais continuam disponíveis sem descaracterizar o menu principal. */
body[data-ambiente="ALERTAS"] .sidebar { color: #10305c; background: #e6f1fc; border-right: 1px solid #c4dcf3; }
body[data-ambiente="ALERTAS"] .sidebar-brand { border-bottom-color: #c4dcf3 !important; }
body[data-ambiente="ALERTAS"] .sidebar-brand .brand,
body[data-ambiente="ALERTAS"] .sidebar-brand .brand-name { color: #0d366b !important; }
body[data-ambiente="ALERTAS"] .sidebar-brand .brand-name span { color: #3d6591; }
body[data-ambiente="ALERTAS"] .brand-mark { color: #fff; background: #1c5cab; }
body[data-ambiente="ALERTAS"] .sidebar-group-title,
body[data-ambiente="ALERTAS"] .sidebar .text-secondary { color: #4c73a0 !important; }
body[data-ambiente="ALERTAS"] .sidebar .nav-link { color: #10305c; }
body[data-ambiente="ALERTAS"] .sidebar .nav-link i { color: #256abf; }
body[data-ambiente="ALERTAS"] .sidebar .nav-link:hover { color: #0d366b; background: #d4e6f9; }
body[data-ambiente="ALERTAS"] .sidebar .nav-link.active { color: #0d366b; background: #c3dcf6; box-shadow: inset 3px 0 #1c5cab; }
body[data-ambiente="ALERTAS"] .sidebar .nav-link.active i { color: #184f95; }
body[data-ambiente="ALERTAS"] .sidebar-view-switch { color: #0d366b; border-color: #c4dcf3; background: #fff; }
body[data-ambiente="ALERTAS"] .sidebar-view-switch:hover { background: #f4f8fe; border-color: #84b5e5; }
body[data-ambiente="ALERTAS"] .sidebar-footer { color: #3d6591; border-top-color: #c4dcf3; }

/* O ambiente operacional precisa ser reconhecido antes de qualquer leitura ou
   ação. A paleta verde segue a referência validada para Risco de Ocorrência. */
body[data-ambiente="OCORRENCIAS"] {
  --brand-950: #0f3d27;
  --brand-900: #145233;
  --brand-700: #1f7049;
  --brand-600: #248657;
  --brand-100: #d6eee0;
  --brand-50: #f1faf5;
}
body[data-ambiente="OCORRENCIAS"] .sidebar { color: #17402b; background: #e4f5eb; border-right: 1px solid #c3e4d0; }
body[data-ambiente="OCORRENCIAS"] .sidebar-brand { border-bottom-color: #c3e4d0 !important; }
body[data-ambiente="OCORRENCIAS"] .sidebar-brand .brand,
body[data-ambiente="OCORRENCIAS"] .sidebar-brand .brand-name { color: #0f3d27 !important; }
body[data-ambiente="OCORRENCIAS"] .sidebar-brand .brand-name span { color: #3f6f55; }
body[data-ambiente="OCORRENCIAS"] .brand-mark { color: #fff; background: #248657; }
body[data-ambiente="OCORRENCIAS"] .sidebar-group-title,
body[data-ambiente="OCORRENCIAS"] .sidebar .text-secondary { color: #4f7d63 !important; }
body[data-ambiente="OCORRENCIAS"] .sidebar .nav-link { color: #17402b; }
body[data-ambiente="OCORRENCIAS"] .sidebar .nav-link i { color: #2a8f5c; }
body[data-ambiente="OCORRENCIAS"] .sidebar .nav-link:hover { color: #0f3d27; background: #d3eedf; }
body[data-ambiente="OCORRENCIAS"] .sidebar .nav-link.active { color: #0f3d27; background: #c2e6d1; box-shadow: inset 3px 0 #1f7a4d; }
body[data-ambiente="OCORRENCIAS"] .sidebar .nav-link.active i { color: #145233; }
body[data-ambiente="OCORRENCIAS"] .sidebar-view-switch { color: #0f3d27; border-color: #c3e4d0; background: #fff; }
body[data-ambiente="OCORRENCIAS"] .sidebar-view-switch:hover { background: #f4fbf7; border-color: #82c49e; }
body[data-ambiente="OCORRENCIAS"] .sidebar-footer { color: #3f6f55; border-top-color: #c3e4d0; }
body[data-ambiente="OCORRENCIAS"] .topbar-contexto strong { color: #0f3d27; }
body[data-ambiente="OCORRENCIAS"] .user-avatar { color: #1f7049; background: #d6eee0; }
body[data-ambiente="OCORRENCIAS"] .btn-primary { background: #248657; border-color: #248657; }
body[data-ambiente="OCORRENCIAS"] .btn-primary:hover { background: #1f7049; border-color: #1f7049; }
body[data-ambiente="OCORRENCIAS"] .btn-outline-primary { color: #1f7049; border-color: #248657; }
body[data-ambiente="OCORRENCIAS"] .btn-outline-primary:hover { color: #fff; background: #248657; border-color: #248657; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-w); transition: margin-left .2s ease; }
.topbar { position: sticky; top: 0; z-index: 1020; height: var(--topbar-h); display: flex; align-items: center; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); }
.topbar-inner { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1rem; padding: 0 1.1rem; }
.topbar-start { display: flex; min-width: 0; align-items: center; gap: .75rem; }
.topbar-contexto { display: flex; min-width: 0; flex-direction: column; line-height: 1.15; }
.topbar-contexto span { overflow: hidden; color: var(--muted); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }
.topbar-contexto strong { overflow: hidden; color: var(--brand-950); font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.topbar-status { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-size: .72rem; }
.status-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(22,128,93,.12); }
.topbar-user { display: flex; max-width: 260px; min-height: 2.6rem; align-items: center; gap: .55rem; padding: .25rem .5rem; color: var(--text); border: 1px solid transparent; text-align: left; }
.topbar-user:hover, .topbar-user[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); }
.user-avatar { display: inline-grid; width: 2rem; height: 2rem; flex: 0 0 2rem; place-items: center; border-radius: 50%; color: var(--brand-700); background: var(--brand-100); }
.user-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.15; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: .78rem; }
.user-copy small { color: var(--muted); font-size: .65rem; }
.app-content { width: 100%; max-width: 1800px; margin-inline: auto; padding: 1.35rem; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 1030; background: rgba(13, 25, 39, .48); }
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-w); }
.sidebar-collapsed .app-main { margin-left: var(--sidebar-collapsed-w); }
.sidebar-collapsed .sidebar .nav-label, .sidebar-collapsed .sidebar-group-title, .sidebar-collapsed .sidebar-footer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: .5rem; }
.sidebar-collapsed .sidebar-brand .brand { min-width: 0; }
.sidebar-collapsed .sidebar-switch-wrap { padding-inline: .65rem; }
.sidebar-collapsed .sidebar-view-switch { justify-content: center; padding-inline: .5rem; }
.sidebar-collapsed .sidebar-view-switch > i:last-child { display: none; }
.sidebar-collapsed .sidebar-nav { padding-inline: .65rem; }
.sidebar-collapsed .sidebar .nav-link { justify-content: center; padding-inline: .5rem; }
.grafico-historico { min-height: 320px; overflow-x: auto; }
.grafico-historico svg { display: block; min-width: 720px; }
.grafico-grade { stroke: #dfe6ee; stroke-width: 1; }
.grafico-eixo { fill: #617083; font-size: 12px; }
.grafico-unidade { fill: #34445a; font-size: 12px; font-weight: 600; }
.grafico-amostra { display: inline-block; width: 18px; height: 3px; border-radius: 999px; }
.grafico-scroll { max-width: 100%; overflow-x: auto; }
.grafico-comparativo { display: block; min-width: 620px; }
.grafico-barra { fill: var(--brand-600); }
.grafico-valor { fill: #25364c; font-size: 12px; font-weight: 650; }
.mapa-controles .painel-local-icone { background: #155f8f; }
.mapa-operacional { overflow: hidden; border: 0; box-shadow: 0 12px 34px rgba(13, 54, 107, .1); }
.mapa-operacional-cabecalho, .mapa-capitais-cabecalho { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem; background: #fff; }
.mapa-operacional-cabecalho > span { color: var(--brand-700); border: 1px solid #d8e5f2; }
.mapa-monitoramento-coluna { min-height: 650px; padding: 1.25rem; background: #eaf3f9; }
.mapa-legenda { position: absolute; z-index: 6; right: .75rem; bottom: .75rem; display: flex; flex-wrap: wrap; gap: .65rem; padding: .45rem .6rem; border: 1px solid rgba(13,54,107,.14); border-radius: .55rem; background: rgba(255,255,255,.94); color: var(--muted); font-size: .68rem; }
.mapa-legenda span { display: inline-flex; align-items: center; gap: .3rem; }
.mapa-legenda-ponto { width: .6rem; height: .6rem; border-radius: 50%; background: var(--brand-600); }
.mapa-legenda-ponto.sem-dado { background: #8795a6; }
.mapa-leaflet-wrap { position: relative; overflow: hidden; border: 1px solid #c9d9e7; border-radius: .85rem; background: #dfeef7; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.mapa-leaflet { width: 100%; height: 610px; background: #dfeef7; }
.mapa-leaflet-nacional { height: 520px; }
.mapa-leaflet .leaflet-control-zoom a { color: var(--brand-800); }
.mapa-leaflet .leaflet-control-attribution { padding: .15rem .35rem; font-size: .62rem; }
.mapa-leaflet .leaflet-tooltip { color: var(--brand-900); border: 1px solid #c9d9e7; box-shadow: 0 4px 14px rgba(13,54,107,.18); font-family: inherit; }
.mapa-leaflet-icone { border: 0; background: transparent; }
.mapa-leaflet-bolha { position: relative; display: grid; width: var(--tamanho-marcador); height: var(--tamanho-marcador); place-items: center; color: #fff; border: 2px solid #fff; border-radius: 50%; background: var(--cor-marcador, #1c5cab); box-shadow: 0 2px 8px rgba(13,54,107,.52); font-size: .64rem; font-variant-numeric: tabular-nums; font-weight: 800; line-height: 1; text-shadow: 0 1px 2px rgba(13,35,66,.72); transition: transform .18s ease, box-shadow .18s ease; }
.mapa-leaflet-bolha b { font: inherit; white-space: nowrap; }
.mapa-leaflet-bolha small { position: absolute; top: calc(100% + .22rem); left: 50%; padding: .1rem .28rem; transform: translateX(-50%); color: var(--brand-900); border: 1px solid rgba(13,54,107,.13); border-radius: .25rem; background: rgba(255,255,255,.96); font-size: .58rem; font-weight: 800; line-height: 1.1; text-shadow: none; }
.mapa-leaflet-bolha.sem-dado { background: #8795a6; text-shadow: none; }
.mapa-leaflet-bolha.ativo { box-shadow: 0 0 0 6px rgba(255,255,255,.88), 0 4px 14px rgba(13,54,107,.58); }
.mapa-leaflet-icone:hover .mapa-leaflet-bolha, .mapa-leaflet-icone:focus .mapa-leaflet-bolha { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(28,92,171,.18), 0 4px 14px rgba(13,54,107,.55); }
.mapa-tempo-marcador { outline: 3px solid var(--cor-marcador, #1c5cab); outline-offset: 1px; }
.mapa-tempo-marcador.tempo-sol { color: #563900; background: linear-gradient(145deg, #ffd763, #f59e0b); text-shadow: none; }
.mapa-tempo-marcador.tempo-nublado { background: linear-gradient(145deg, #91a4b8, #526579); }
.mapa-tempo-marcador.tempo-chuva { background: linear-gradient(145deg, #48b9ed, #126bb2); }
.mapa-tempo-marcador.sem-dado { color: #fff; background: linear-gradient(145deg, #91a4b8, #66788a); }
.mapa-tempo-conteudo { display: flex; align-items: center; flex-direction: column; justify-content: center; gap: .08rem; line-height: 1; }
.mapa-tempo-conteudo i { font-size: 1rem; line-height: 1; }
.mapa-tempo-conteudo b { font-size: .63rem; line-height: 1; }
.mapa-legenda-tempo .bi { font-size: .86rem; }
.mapa-legenda-tempo .tempo-sol { color: #e89000; }
.mapa-legenda-tempo .tempo-nublado { color: #60758a; }
.mapa-legenda-tempo .tempo-chuva { color: #087ec1; }
.mapa-leaflet-wrap .mapa-legenda { pointer-events: none; }
.mapa-operacional-lateral { padding: 1.35rem; border-left: 1px solid var(--line); background: #fff; }
.mapa-resumo-titulo, .mapa-territorio-cabecalho { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.mapa-resumo-titulo span, .mapa-territorio-cabecalho > div > span { color: var(--muted); font-size: .67rem; font-weight: 750; letter-spacing: .07em; }
.mapa-resumo-titulo h2 { margin: .12rem 0 1rem; color: var(--brand-900); font-size: 1.05rem; }
.mapa-resumo-titulo > i { display: inline-grid; width: 2.35rem; height: 2.35rem; place-items: center; border-radius: .7rem; color: var(--brand-700); background: #eaf2fc; font-size: 1.1rem; }
.mapa-cobertura { display: flex; align-items: center; gap: .55rem; margin-top: .8rem; padding: .65rem .75rem; border-radius: .65rem; color: var(--muted); background: #f3f7fb; font-size: .75rem; }
.mapa-cobertura i { color: var(--brand-600); font-size: 1rem; }
.mapa-cobertura strong { color: var(--brand-900); }
.mapa-territorio-cabecalho h2 { margin: .1rem 0; color: var(--brand-900); font-size: 1.35rem; }
.mapa-territorio-cabecalho h2 small { color: var(--muted); font-size: .82rem; }
.mapa-territorio-cabecalho p { margin: 0; color: var(--muted); font-size: .74rem; }
.mapa-territorio-valor { margin: 1rem 0 .65rem; color: var(--brand-900); font-size: clamp(2rem, 4vw, 3rem); font-variant-numeric: tabular-nums; font-weight: 760; line-height: 1; }
.mapa-territorio-valor small { color: var(--muted); font-size: .9rem; font-weight: 650; }
.mapa-territorio-meta { display: flex; min-width: 0; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .7rem; }
.mapa-territorio-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapa-territorio-meta i { margin-right: .4rem; color: var(--brand-600); }
.mapa-leituras-grade { display: grid; grid-template-columns: 1fr; gap: .45rem; margin: 1rem 0; }
.mapa-leitura-compacta { display: flex; min-width: 0; align-items: center; gap: .65rem; padding: .65rem; border: 1px solid #e4ebf2; border-radius: .65rem; background: #f9fbfd; }
.mapa-leitura-compacta > span { display: inline-grid; flex: 0 0 auto; width: 2rem; height: 2rem; place-items: center; border-radius: .55rem; color: var(--brand-700); background: #e9f2ff; }
.mapa-leitura-compacta > div { display: flex; min-width: 0; flex-direction: column; }
.mapa-leitura-compacta small { color: var(--muted); font-size: .66rem; }
.mapa-leitura-compacta strong { overflow: hidden; color: var(--brand-900); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.mapa-leitura-compacta.sem-dado { opacity: .72; }
.mapa-capitais { overflow: hidden; border: 0; box-shadow: 0 8px 24px rgba(13, 54, 107, .08); }
.mapa-capitais-cabecalho > span { color: var(--muted); font-size: .75rem; }
.mapa-capitais-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.mapa-capital-card { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .55rem .8rem; padding: .8rem; color: inherit; text-align: left; border: 1px solid #e1e8ef; border-radius: .75rem; background: #fff; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.mapa-capital-card:hover { border-color: #9ab9df; box-shadow: 0 6px 18px rgba(13,54,107,.09); transform: translateY(-1px); }
.mapa-capital-card:focus-visible { outline: 3px solid #f0ad00; outline-offset: 2px; }
.mapa-capital-card.ativo { border-color: var(--brand-600); box-shadow: 0 0 0 2px rgba(28,92,171,.12); background: #f7faff; }
.mapa-capital-identidade { display: flex; min-width: 0; align-items: center; gap: .55rem; }
.mapa-capital-identidade > i { display: inline-grid; flex: 0 0 auto; width: 2rem; height: 2rem; place-items: center; border-radius: .55rem; color: var(--brand-600); background: #eaf2fc; }
.mapa-capital-identidade > span { display: flex; min-width: 0; flex-direction: column; }
.mapa-capital-identidade strong, .mapa-capital-identidade small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapa-capital-identidade strong { color: var(--brand-900); font-size: .82rem; }
.mapa-capital-identidade small { color: var(--muted); font-size: .65rem; }
.mapa-capital-valores { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: .35rem .75rem; color: #43536a; font-size: .69rem; }
.mapa-capital-valores span { display: inline-flex; align-items: center; gap: .28rem; }
.mapa-capital-valores i { color: var(--brand-600); }
.mapa-capital-card > .badge { grid-column: 2; grid-row: 1; font-size: .6rem; }

.painel-destaques .card { overflow: hidden; }
.destaque-nacional { position: relative; border: 0; box-shadow: 0 8px 26px rgba(13, 54, 107, .09); }
.destaque-nacional::after { position: absolute; inset: auto 0 0; height: 3px; content: ""; background: linear-gradient(90deg, var(--brand-600), #7c3aed); }
.destaque-nacional-icone { display: inline-grid; flex: 0 0 auto; width: 2.65rem; height: 2.65rem; place-items: center; border-radius: .8rem; color: var(--brand-600); background: #e9f2ff; font-size: 1.2rem; }
.min-w-0 { min-width: 0; }

.painel-controles { overflow: hidden; border: 0; box-shadow: 0 8px 24px rgba(13, 54, 107, .08); }
.painel-contexto { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; }
.painel-local { display: flex; min-width: 260px; align-items: center; gap: .9rem; }
.painel-local-icone { display: inline-grid; flex: 0 0 auto; width: 3.2rem; height: 3.2rem; place-items: center; border-radius: .9rem; color: #fff; background: var(--brand-700); font-size: 1.35rem; }
.painel-local > div { display: flex; min-width: 0; flex-direction: column; }
.painel-local small { color: var(--brand-600); font-size: .68rem; font-weight: 750; letter-spacing: .07em; }
.painel-local strong { color: var(--brand-900); font-size: 1.25rem; line-height: 1.2; }
.painel-local span:last-child { margin-top: .15rem; color: var(--muted); font-size: .78rem; }
.painel-filtros { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: .75rem; }
.painel-filtros .form-label { margin-bottom: .25rem; color: var(--muted); font-size: .72rem; font-weight: 650; }
.painel-filtros .form-select { min-width: 190px; }
.painel-filtros .filter-uf, .filter-panel .filter-uf { min-width: 105px; flex: 0 1 130px; }
.painel-filtros .filter-city, .filter-panel .filter-city { min-width: 290px; flex: 1 1 340px; }
.painel-aviso { display: flex; align-items: flex-start; gap: .7rem; padding: .8rem 1rem; font-size: .84rem; }
.painel-aviso > i { margin-top: .08rem; flex: 0 0 auto; }

.secao-painel-cabecalho { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; }
.secao-painel-cabecalho h2 { margin: 0; color: var(--brand-900); font-size: 1.12rem; }
.secao-painel-cabecalho p { margin: .2rem 0 0; color: var(--muted); font-size: .82rem; }
.secao-painel-cabecalho > span { color: var(--muted); font-size: .75rem; }
.metricas-painel-grade { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .8rem; }
.metrica-painel { position: relative; min-width: 0; overflow: hidden; padding: 1rem; border: 1px solid var(--line); border-top: 3px solid var(--brand-600); border-radius: .85rem; background: #fff; box-shadow: 0 5px 18px rgba(13, 54, 107, .07); }
.metrica-painel.temperatura { border-top-color: #e76f51; }
.metrica-painel.umidade, .metrica-painel.chuva { border-top-color: #0ea5e9; }
.metrica-painel.vento { border-top-color: #64748b; }
.metrica-painel.vazao { border-top-color: #1c5cab; }
.metrica-painel.sem-dado { border-top-color: #cbd5e1; background: #f8fafc; }
.metrica-painel-topo { display: flex; align-items: center; justify-content: space-between; gap: .45rem; }
.metrica-painel-icone { display: inline-grid; width: 2.25rem; height: 2.25rem; place-items: center; border-radius: .7rem; color: var(--brand-700); background: #eaf2fc; font-size: 1.05rem; }
.metrica-painel.temperatura .metrica-painel-icone { color: #b5472f; background: #fff0eb; }
.metrica-painel.umidade .metrica-painel-icone, .metrica-painel.chuva .metrica-painel-icone { color: #087ea4; background: #e8f8fd; }
.metrica-painel.vento .metrica-painel-icone { color: #475569; background: #eef2f6; }
.metrica-painel-rotulo { min-height: 2.2rem; margin-top: .8rem; color: var(--muted); font-size: .74rem; font-weight: 650; line-height: 1.2; }
.metrica-painel-valor { margin: .2rem 0 .7rem; color: var(--brand-900); font-size: clamp(1.65rem, 2.35vw, 2.35rem); font-variant-numeric: tabular-nums; font-weight: 760; line-height: 1; white-space: nowrap; }
.metrica-painel-valor small { color: var(--muted); font-size: .78rem; font-weight: 650; }
.metrica-painel-meta { display: flex; min-width: 0; flex-direction: column; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.metrica-painel-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leituras-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1rem; }
.leitura-extra { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .7rem; padding: .65rem .75rem; border: 1px solid #e8edf3; border-radius: .65rem; }
.leitura-extra > div { display: flex; min-width: 0; flex-direction: column; }
.leitura-extra small { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.leitura-extra > span:not(.badge) { color: var(--brand-900); font-weight: 700; white-space: nowrap; }

.previsao-painel { overflow: hidden; border: 0; box-shadow: 0 8px 24px rgba(13, 54, 107, .08); }
.previsao-painel > .card-header, .painel-fenomenos > .card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem; background: #fff; }
.previsao-painel > .card-header > i { color: #0ea5e9; font-size: 1.45rem; }
.previsao-painel-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.previsao-painel-card { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #f8fbff; }
.previsao-painel-topo { display: flex; align-items: center; justify-content: space-between; gap: .6rem; color: var(--brand-700); font-size: .78rem; font-weight: 700; }
.previsao-painel-valor { margin: .75rem 0 .45rem; color: var(--brand-900); font-size: 2.15rem; font-variant-numeric: tabular-nums; font-weight: 760; line-height: 1; }
.previsao-painel-valor small { color: var(--muted); font-size: .8rem; font-weight: 650; }
.previsao-painel-periodo, .previsao-painel-fonte { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.previsao-painel-fonte { margin-top: .15rem; }
.previsao-16-dias { overflow: hidden; border: 0; box-shadow: 0 10px 30px rgba(13, 54, 107, .09); }
.previsao-16-cabecalho { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: #fff; }
.previsao-16-cabecalho strong { color: var(--brand-900); font-size: 1rem; }
.previsao-16-filtros { display: flex; flex: 1 1 520px; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: .75rem; }
.previsao-16-filtros > div:first-child { flex: 0 1 120px; }
.previsao-16-filtros > div:last-child { flex: 1 1 330px; max-width: 520px; }
.previsao-16-filtros .form-label { margin-bottom: .25rem; color: var(--muted); font-size: .72rem; font-weight: 650; }
.previsao-16-grade { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.previsao-cidade-resumo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.previsao-cidade-resumo > div { display: flex; min-width: 0; flex-direction: column; }
.previsao-cidade-resumo small { color: var(--muted); font-size: .65rem; font-weight: 750; letter-spacing: .07em; }
.previsao-cidade-resumo strong { overflow: hidden; color: var(--brand-900); font-size: 1.1rem; text-overflow: ellipsis; white-space: nowrap; }
.previsao-dia { position: relative; min-width: 0; padding: .85rem; border: 1px solid #dce6ef; border-top: 4px solid #64748b; border-radius: .8rem; background: linear-gradient(180deg, #fff, #f8fbff); }
.previsao-dia.limpo { border-top-color: #f59e0b; background: linear-gradient(180deg, #fffdf4, #fff); }
.previsao-dia.chuva { border-top-color: #0ea5e9; background: linear-gradient(180deg, #f2fbff, #fff); }
.previsao-dia.tempestade { border-top-color: #7c3aed; background: linear-gradient(180deg, #f8f5ff, #fff); }
.previsao-dia.frio { border-top-color: #38bdf8; }
.previsao-dia-data { color: var(--brand-900); font-size: .77rem; font-weight: 750; }
.previsao-dia-condicao { display: flex; min-height: 4.3rem; align-items: center; gap: .65rem; margin: .45rem 0; color: var(--muted); font-size: .72rem; }
.previsao-dia-condicao i { flex: 0 0 auto; color: var(--brand-600); font-size: 2rem; }
.previsao-dia.limpo .previsao-dia-condicao i { color: #f59e0b; }
.previsao-dia.chuva .previsao-dia-condicao i { color: #0284c7; }
.previsao-dia.tempestade .previsao-dia-condicao i { color: #7c3aed; }
.previsao-dia-temperaturas { display: flex; align-items: baseline; gap: .55rem; margin-bottom: .65rem; }
.previsao-dia-temperaturas strong { color: var(--brand-900); font-size: 1.3rem; }
.previsao-dia-temperaturas span { color: var(--muted); font-size: .82rem; }
.previsao-dia-detalhes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; padding-top: .55rem; border-top: 1px solid #e5ebf1; color: #43536a; font-size: .65rem; }
.previsao-dia-detalhes span { display: flex; min-width: 0; align-items: center; gap: .2rem; white-space: nowrap; }
.previsao-dia-detalhes i { color: var(--brand-600); }
.previsao-rodape { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: .9rem; color: var(--muted); font-size: .7rem; }
.previsao-rodape span { display: inline-flex; align-items: center; gap: .35rem; }
.previsao-rodape i { color: var(--brand-600); }
.cobertura-cabecalho { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.painel-fenomenos { overflow: hidden; }
.painel-fenomenos > .card-header > i { color: #d97706; font-size: 1.25rem; }

.painel-nacional { overflow: hidden; border: 0; box-shadow: 0 12px 34px rgba(13, 54, 107, .1); }
.painel-nacional-cabecalho { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: #fff; }
.painel-nacional-acoes { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: .75rem; }
.painel-nacional-acoes > .badge { margin-bottom: .15rem; color: var(--brand-700); border: 1px solid #d8e5f2; }
.painel-nacional-cabecalho .form-select { min-width: 230px; }
.mapa-nacional-coluna { min-height: 560px; padding: 1rem 1.25rem; background: radial-gradient(circle at 50% 45%, #f8fcff 0, #eaf3f9 72%); }
.escala-nacional { display: grid; grid-template-columns: auto minmax(100px, 240px) auto; align-items: center; justify-content: center; gap: .7rem; color: var(--muted); font-size: .78rem; font-weight: 650; }
.escala-nacional-faixa { height: 8px; border-radius: 999px; background: linear-gradient(90deg, rgb(37,99,235), rgb(124,58,237)); }
.painel-nacional-lateral { padding: 1.5rem; border-left: 1px solid var(--line); background: #fff; }
.metricas-faixa { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.metricas-faixa > div { min-width: 0; padding: .7rem .55rem; border: 1px solid var(--line); border-radius: .65rem; background: #f8fafc; }
.metricas-faixa span, .metricas-faixa strong { display: block; }
.metricas-faixa span { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.metricas-faixa strong { margin-top: .12rem; font-size: .9rem; white-space: nowrap; }
.territorio-valor-nacional { margin: 1rem 0; color: var(--brand-900); font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 750; line-height: 1; }
.territorio-valor-nacional small { color: var(--muted); font-size: 1rem; font-weight: 650; }
.painel-nacional-lateral dd { overflow-wrap: anywhere; }

.ranking-nacional-item { display: grid; width: 100%; grid-template-columns: 2rem minmax(120px, 1.1fr) minmax(90px, 1.4fr) auto; align-items: center; gap: .7rem; padding: .65rem .4rem; color: inherit; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #edf1f5; border-radius: .45rem; }
.ranking-nacional-item:last-child { border-bottom: 0; }
.ranking-nacional-item:hover { background: #f5f8fc; }
.ranking-nacional-item:focus-visible { outline: 3px solid #f0ad00; outline-offset: 1px; }
.ranking-posicao { display: inline-grid; width: 1.8rem; height: 1.8rem; place-items: center; border-radius: 50%; color: var(--brand-700); background: #e9f2ff; font-size: .75rem; font-weight: 750; }
.ranking-identificacao { display: flex; min-width: 0; flex-direction: column; }
.ranking-identificacao strong, .ranking-identificacao small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-identificacao small { color: var(--muted); }
.ranking-barra { display: block; height: 8px; overflow: hidden; border-radius: 999px; background: #e7edf4; }
.ranking-barra i { display: block; height: 100%; border-radius: inherit; }
.ranking-valor { color: var(--brand-900); font-size: .85rem; white-space: nowrap; }

.cobertura-24h { display: grid; grid-template-columns: repeat(24, minmax(8px, 1fr)); align-items: end; gap: .35rem; height: 150px; padding-top: .5rem; border-bottom: 1px solid var(--line); }
.cobertura-hora { display: grid; height: 100%; grid-template-rows: 1fr 1.15rem; align-items: end; text-align: center; }
.cobertura-hora > i { display: block; width: 100%; min-height: 2px; border-radius: .3rem .3rem 0 0; background: #cbd5e1; }
.cobertura-hora > i.observado, .legenda-cobertura i.observado { background: #1c5cab; }
.cobertura-hora > i.estimado, .legenda-cobertura i.estimado { background: #f59e0b; }
.cobertura-hora > i.previsto, .legenda-cobertura i.previsto { background: #0ea5e9; }
.cobertura-hora > i.vazio { background: #e5e7eb; }
.cobertura-hora small { overflow: visible; color: var(--muted); font-size: .62rem; white-space: nowrap; transform: translateX(-35%); }
.legenda-cobertura { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; color: var(--muted); font-size: .75rem; }
.legenda-cobertura span { display: inline-flex; align-items: center; gap: .3rem; }
.legenda-cobertura i { width: .65rem; height: .65rem; border-radius: 50%; }

.comparacao-metrica { padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #fbfdff; }
.comparacao-metrica h3 { margin: 0 0 .7rem; color: var(--brand-900); font-size: .92rem; }
.comparacao-fonte-linha { display: grid; grid-template-columns: minmax(135px, 1.35fr) minmax(70px, 1fr) auto; align-items: center; gap: .65rem; padding: .45rem 0; border-top: 1px solid #edf1f5; }
.comparacao-fonte-identificacao { display: flex; min-width: 0; flex-direction: column; }
.comparacao-fonte-identificacao strong, .comparacao-fonte-identificacao small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comparacao-fonte-identificacao strong { font-size: .78rem; }
.comparacao-fonte-identificacao small { color: var(--muted); font-size: .68rem; }
.comparacao-fonte-barra { height: 7px; overflow: hidden; border-radius: 999px; background: #e7edf4; }
.comparacao-fonte-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-600), #0ea5e9); }
.comparacao-fonte-valor { color: var(--brand-900); font-size: .78rem; white-space: nowrap; }
.fonte-card { border-top: 3px solid var(--brand-600); }
.fonte-card .fonte-licenca { min-height: 3.5rem; }

.rede-painel { overflow: hidden; border: 0; box-shadow: 0 12px 32px rgba(13, 54, 107, .1); }
.rede-cabecalho { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); background: #fff; }
.rede-cabecalho .form-select { min-width: 210px; }
.rede-mapa-coluna { padding: 1rem; background: #eef6fb; }
.mapa-rede { height: 560px; border: 1px solid #d8e4ef; border-radius: .8rem; background: #e9f2f8; }
.rede-lateral { padding: 1.25rem; border-left: 1px solid var(--line); background: #fff; }
.rede-ranking { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .7rem .25rem; color: inherit; text-decoration: none; border-bottom: 1px solid #edf1f5; border-radius: .45rem; }
.rede-ranking:hover { color: inherit; background: #f5f8fc; }
.rede-ranking:focus-visible { outline: 3px solid #f0ad00; outline-offset: 2px; }
.rede-ranking > span { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; color: var(--brand-700); border-radius: 50%; background: #e9f2ff; font-size: .72rem; font-weight: 750; }
.rede-ranking > div { display: flex; min-width: 0; flex-direction: column; }
.rede-ranking strong, .rede-ranking small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rede-ranking small { color: var(--muted); font-size: .68rem; }
.rede-ranking b { color: var(--brand-900); font-size: .8rem; white-space: nowrap; }
.rede-escala { display: grid; grid-template-columns: auto minmax(120px, 260px) auto; align-items: center; justify-content: center; gap: .65rem; min-height: 2rem; padding-top: .7rem; color: var(--muted); font-size: .75rem; font-weight: 650; }
.rede-escala i { height: 8px; border-radius: 999px; }
.metricas-meteorologia { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metricas-meteorologia .metrica-painel { min-height: 190px; }
.chuva-janelas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.chuva-janela { display: flex; min-width: 0; min-height: 128px; flex-direction: column; justify-content: space-between; padding: 1rem; border: 1px solid #cfe3f2; border-top: 4px solid #1687bd; border-radius: .8rem; background: linear-gradient(150deg, #fff 0, #f1f9fd 100%); box-shadow: var(--shadow-sm); }
.chuva-janela > span { color: #0b648e; font-size: .74rem; font-weight: 750; text-transform: uppercase; }
.chuva-janela > strong { color: var(--brand-950); font-size: 1.9rem; font-variant-numeric: tabular-nums; line-height: 1; }
.chuva-janela > strong small { color: var(--muted); font-size: .75rem; }
.chuva-janela > small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.chuva-janela.sem-dado { border-top-color: #94a3b8; background: #f8fafc; }
.chuva-janela.sem-dado > strong { color: var(--muted); font-size: 1rem; }
.reservatorio-barra { width: 120px; max-width: 100%; height: 6px; margin-left: auto; overflow: hidden; border-radius: 999px; background: #e5edf4; }
.reservatorio-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0ea5e9, #1c5cab); }
.table td small { font-weight: 500; }

.regiao-nacional + .regiao-nacional { margin-top: 1rem; }
.regiao-nacional-barra { height: 7px; margin: .35rem 0 .25rem; overflow: hidden; border-radius: 999px; background: #e7edf4; }
.regiao-nacional-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-600), #7c3aed); }
.tabela-nacional { overflow: hidden; }
.tabela-nacional > summary { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; cursor: pointer; list-style: none; }
.tabela-nacional > summary::-webkit-details-marker { display: none; }
.tabela-nacional > summary span { display: flex; flex-direction: column; }
.tabela-nacional > summary small { color: var(--muted); font-weight: 400; }
.tabela-nacional > summary i { transition: transform .2s ease; }
.tabela-nacional[open] > summary i { transform: rotate(180deg); }
.tabela-nacional > summary:focus-visible { outline: 3px solid #f0ad00; outline-offset: -3px; }

.page-heading { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1.25rem; margin-bottom: 1.15rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.page-heading-copy { min-width: 0; }
.page-heading-eyebrow { display: block; margin-bottom: .2rem; color: var(--brand-600); font-size: .68rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.page-heading h1 { margin: 0; color: var(--brand-950); font-size: clamp(1.45rem, 2.2vw, 2rem); font-weight: 760; letter-spacing: -.02em; }
.page-heading p { max-width: 850px; margin: .3rem 0 0; color: var(--muted); font-size: .88rem; }
.page-heading-meta { display: flex; align-items: center; gap: .45rem; }
.data-status { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .55rem; color: #0d684a; border: 1px solid #acd8c8; border-radius: var(--radius-sm); background: #edf9f4; font-size: .7rem; font-weight: 750; }
.data-status::before { width: .45rem; height: .45rem; content: ""; border-radius: 50%; background: var(--success); }
.data-status-pending { color: #8a5200; border-color: #ebc46c; background: #fff8df; }
.data-status-pending::before { background: #d58a00; }
.data-status-history { color: #31526f; border-color: #b9cada; background: #f0f6fb; }
.data-status-history::before { background: #557997; }
.municipio-sem-leitura { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; border: 1px solid #efd083; border-radius: var(--radius); background: linear-gradient(135deg, #fffaf0, #fffdf8); color: #5f470d; }
.municipio-sem-leitura-icone { display: grid; width: 2.75rem; height: 2.75rem; place-items: center; border-radius: .8rem; background: #fff0bf; color: #9a6500; font-size: 1.25rem; }
.municipio-sem-leitura strong { display: block; margin-bottom: .25rem; color: #684a00; font-size: 1rem; }
.municipio-sem-leitura p { margin: 0 0 .35rem; color: #785f25; }
.municipio-sem-leitura small { color: #725d2f; }
@media (max-width: 780px) { .municipio-sem-leitura { grid-template-columns: auto 1fr; } .municipio-sem-leitura .btn { grid-column: 1 / -1; } }

.app-state { display: flex; min-height: 220px; align-items: center; justify-content: center; padding: 2rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); text-align: center; }
.app-state-content { max-width: 520px; }
.app-state-icon { display: inline-grid; width: 3rem; height: 3rem; margin-bottom: .85rem; place-items: center; border-radius: 50%; color: var(--brand-700); background: var(--brand-50); font-size: 1.25rem; }
.app-state h2 { margin: 0; color: var(--brand-950); font-size: 1rem; }
.app-state p { margin: .35rem 0 0; color: var(--muted); font-size: .84rem; }
.app-state-loading .app-state-icon i { animation: app-spin .9s linear infinite; }
.app-state-error { border-left: 4px solid var(--danger); }
.app-state-error .app-state-icon { color: var(--danger); background: #fff1f2; }
.empty-table { padding: 2rem 1rem !important; text-align: center; }
.empty-table-wrap { display: inline-flex; max-width: 560px; align-items: center; gap: .75rem; color: var(--muted); text-align: left; }
.empty-table-wrap i { color: #8294a8; font-size: 1.35rem; }

.filter-panel { border: 1px solid var(--line); box-shadow: none; }
.filter-panel .card-body { display: flex; flex-wrap: wrap; align-items: end; gap: .85rem 1rem; }
.filter-panel .filter-note { display: flex; max-width: 460px; align-items: center; gap: .45rem; margin-left: auto; color: var(--muted); font-size: .78rem; }
.filter-panel .filter-note i { color: var(--brand-600); }
.operational-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.operational-kpi { position: relative; overflow: hidden; padding: 1rem; border: 1px solid var(--line); border-left: 4px solid var(--brand-600); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.operational-kpi > i { position: absolute; right: .9rem; top: .9rem; color: #bfd2e8; font-size: 1.35rem; }
.operational-kpi span { display: block; color: var(--muted); font-size: .74rem; font-weight: 650; }
.operational-kpi strong { display: block; margin: .25rem 0; color: var(--brand-950); font-size: 2rem; font-variant-numeric: tabular-nums; line-height: 1; }
.operational-kpi small { color: var(--muted); font-size: .7rem; }
.section-card { overflow: hidden; }
.section-card > .card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; background: #fff; }
.section-card > .card-header strong { color: var(--brand-950); }
.data-disclaimer { display: flex; align-items: flex-start; gap: .6rem; padding: .75rem .9rem; font-size: .8rem; }
.data-disclaimer i { margin-top: .08rem; flex: 0 0 auto; }

/* A mesma linguagem visual organiza todas as telas de dados: resumo primeiro,
   detalhe auditavel depois e ausencia de registro sempre explicita. */
.section-card { border: 0; box-shadow: 0 8px 24px rgba(8, 42, 80, .07); }
.section-card > .card-header { min-height: 3.65rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
.section-card > .card-header > div { min-width: 0; }
.section-card > .card-header .small { margin-top: .12rem; }
.table-responsive > .table { min-width: 720px; }
.table tbody tr:last-child td { border-bottom: 0; }
.app-state:not(.app-state-error) { background: linear-gradient(145deg, #fff, #f7fafc); }

.quality-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.quality-kpi { display: flex; min-width: 0; align-items: flex-start; gap: .75rem; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: linear-gradient(145deg, #fff, #f7fbff); box-shadow: var(--shadow-sm); }
.quality-kpi-icon { display: inline-grid; width: 2.35rem; height: 2.35rem; flex: 0 0 2.35rem; place-items: center; color: var(--brand-700); border-radius: .65rem; background: #e7f1ff; font-size: 1.05rem; }
.quality-kpi > div { min-width: 0; }
.quality-kpi small, .quality-kpi strong, .quality-kpi span { display: block; }
.quality-kpi small { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; }
.quality-kpi strong { margin: .18rem 0; color: var(--brand-950); font-size: 1.55rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.quality-kpi > div > span { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.uf-coverage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.uf-coverage { padding: .7rem; border: 1px solid #e2e9f0; border-radius: .65rem; background: #fbfdff; }
.uf-coverage > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.uf-coverage strong { color: var(--brand-900); }
.uf-coverage span, .uf-coverage small { color: var(--muted); font-size: .68rem; }
.coverage-track { height: 6px; margin: .45rem 0 .25rem; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.coverage-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1c5cab, #0ea5e9); }
.coverage-line { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .55rem; color: var(--muted); }
.coverage-line span { font-size: .7rem; font-weight: 700; }
.coverage-track.recent i { background: #198754; }
.coverage-track.history i { background: #0d6efd; }
.module-health-grid { display: grid; gap: .65rem; }
.module-health { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: .7rem; padding: .75rem; border: 1px solid var(--line); border-left: 4px solid #94a3b8; border-radius: .65rem; background: #fff; }
.module-health.has-data { border-left-color: var(--success); }
.module-health-icon { display: inline-grid; width: 2.15rem; height: 2.15rem; place-items: center; color: #64748b; border-radius: .55rem; background: #f1f5f9; }
.module-health.has-data .module-health-icon { color: #087051; background: #e9f8f2; }
.module-health > div { min-width: 0; }
.module-health strong { color: var(--brand-950); font-size: .82rem; }
.module-health b { display: block; margin-top: .1rem; color: var(--brand-900); font-size: 1.15rem; }
.module-health small { display: block; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.source-error { max-width: 360px; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }

.aviso-sistema { width: min(390px, calc(100vw - 2rem)); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.aviso-sistema .toast-header i { color: var(--danger); }
.aviso-erro { border-left: 4px solid var(--danger); }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: var(--surface-2); }
.error-panel { width: min(100%, 620px); border-top: 4px solid var(--danger); }
.error-code { display: inline-grid; width: 3rem; height: 3rem; place-items: center; border-radius: 50%; color: var(--danger); background: #fff1f2; font-size: 1.3rem; }

@keyframes app-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 1399.98px) {
  .quality-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metricas-painel-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metricas-meteorologia { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chuva-janelas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mapa-capitais-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .previsao-16-grade { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
  .quality-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { min-height: 285px; padding: 2rem; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .app-main, .sidebar-collapsed .app-main { margin-left: 0; }
  .sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  .sidebar-collapsed .sidebar .nav-label, .sidebar-collapsed .sidebar-group-title, .sidebar-collapsed .sidebar-footer { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: nowrap; }
  .sidebar-collapsed .sidebar-brand { justify-content: flex-start; padding-inline: 1rem; }
  .sidebar-collapsed .sidebar-brand .brand { min-width: 224px; }
  .sidebar-collapsed .sidebar-switch-wrap { padding-inline: .75rem; }
  .sidebar-collapsed .sidebar-view-switch { justify-content: flex-start; padding-inline: .6rem; }
  .sidebar-collapsed .sidebar-view-switch > i:last-child { display: inline-block; }
  .sidebar-collapsed .sidebar-nav { padding-inline: .75rem; }
  .sidebar-collapsed .sidebar .nav-link { justify-content: flex-start; padding-inline: .65rem; }
  .mapa-nacional-coluna { min-height: auto; }
  .painel-nacional-lateral { border-top: 1px solid var(--line); border-left: 0; }
  .rede-lateral { border-top: 1px solid var(--line); border-left: 0; }
  .mapa-monitoramento-coluna { min-height: auto; }
  .mapa-leaflet { height: 520px; }
  .mapa-rede { height: 500px; }
  .mapa-leaflet-nacional { height: 480px; }
  .mapa-operacional-lateral { border-top: 1px solid var(--line); border-left: 0; }
  .painel-contexto, .painel-filtros { align-items: stretch; }
  .painel-filtros { flex: 1 1 100%; justify-content: flex-start; }
  .previsao-painel-grade { grid-template-columns: 1fr; }
  .previsao-16-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .uf-coverage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; padding-inline: .75rem; }
  .topbar-status { display: none; }
  .user-copy { display: none; }
  .topbar-user { padding-inline: .25rem; }
  .operational-kpis { grid-template-columns: 1fr; }
  .filter-panel .filter-note { flex-basis: 100%; margin-left: 0; }
  .metricas-painel-grade, .leituras-extras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metricas-meteorologia { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chuva-janelas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .painel-filtros > div { flex: 1 1 210px; }
  .painel-filtros .form-select { width: 100%; min-width: 0; }
  .previsao-16-filtros { justify-content: flex-start; }
}

@media (max-width: 575.98px) {
  .quality-kpis, .uf-coverage-grid { grid-template-columns: 1fr; }
  .auth-side { min-height: 260px; }
  .auth-card { padding: 1.25rem; border: 0; box-shadow: none; }
  .app-content { padding: .85rem; }
  .topbar .badge { display: none; }
  .topbar-contexto span { display: none; }
  .app-content { padding: .85rem .7rem 1.25rem; }
  .page-heading { align-items: flex-start; }
  .page-heading-meta { width: 100%; }
  .auth-side { min-height: 230px; }
  .auth-side ul { display: none; }
  .mapa-monitoramento-coluna { padding: .65rem; }
  .mapa-leaflet, .mapa-leaflet-nacional { height: 430px; }
  .mapa-operacional-lateral { padding: 1rem; }
  .mapa-legenda { right: .35rem; bottom: .35rem; gap: .4rem; padding: .35rem .45rem; font-size: .58rem; }
  .painel-nacional-cabecalho { align-items: stretch; }
  .painel-nacional-cabecalho > div, .painel-nacional-cabecalho .form-select { width: 100%; min-width: 0; }
  .painel-nacional-acoes { justify-content: flex-start; }
  .painel-nacional-acoes > .badge { width: auto; }
  .mapa-nacional-coluna { padding: .75rem; }
  .painel-nacional-lateral { padding: 1rem; }
  .metricas-faixa { grid-template-columns: 1fr; }
  .metricas-faixa > div { display: flex; align-items: center; justify-content: space-between; }
  .ranking-nacional-item { grid-template-columns: 1.8rem minmax(0, 1fr) auto; }
  .ranking-barra { display: none; }
  .cobertura-24h { gap: .18rem; }
  .comparacao-fonte-linha { grid-template-columns: minmax(0, 1fr) auto; }
  .comparacao-fonte-barra { display: none; }
  .painel-local { min-width: 0; }
  .painel-filtros, .painel-filtros > div, .painel-filtros .btn { width: 100%; }
  .metricas-painel-grade, .leituras-extras { grid-template-columns: 1fr; }
  .metricas-meteorologia { grid-template-columns: 1fr; }
  .chuva-janelas { grid-template-columns: 1fr; }
  .rede-cabecalho > div, .rede-cabecalho .form-select { width: 100%; min-width: 0; }
  .mapa-rede { height: 430px; }
  .rede-ranking { grid-template-columns: 1.6rem minmax(0, 1fr) auto; }
  .mapa-capitais-grade { grid-template-columns: 1fr; }
  .previsao-16-grade { grid-template-columns: 1fr; }
  .previsao-16-filtros, .previsao-16-filtros > div { width: 100%; max-width: none !important; flex-basis: 100% !important; }
  .metrica-painel-rotulo { min-height: 0; }
  .secao-painel-cabecalho > span { width: 100%; }
  .leitura-extra { grid-template-columns: minmax(0, 1fr) auto; }
  .leitura-extra .badge { grid-column: 1 / -1; justify-self: start; }
}

@media print {
  .sidebar, .topbar, .sidebar-backdrop { display: none !important; }
  .app-main { margin-left: 0; }
  .app-content { padding: 0; }
}
