/* CBMAM — Painel de Ocorrências. Design system "design-dash-uea" (PROPESP/UEA)
   com a cor de acento trocada para o vermelho do CBMAM. */
/* ==========================================================================
   design-dash-uea — tokens de design (genérico, sem nada específico de
   domínio). Copie este bloco inteiro para o topo do CSS de qualquer novo
   dashboard que deva seguir a mesma identidade visual "PROPESP/UEA".

   Fonte original: DASHBOARD PROSPECÇAO/docs/css/style.css (:root e blocos
   de tema escuro). Extraído em 2026-08-28.
   ========================================================================== */

:root {
  color-scheme: light;

  /* superfícies */
  --surface-page: #ffffff;
  --surface-panel: #ffffff;
  --surface-alt: #fbf7f6;
  --surface-hover: #fbefed;

  /* tinta / texto */
  --ink-primary: #7f1d1d;      /* vermelho CBMAM — títulos, valores em destaque */
  --ink-secondary: #3a3a3c;    /* cinza escuro — corpo de texto */
  --ink-muted: #857a79;        /* cinza médio — legendas, eixos, metadados */
  --ink-on-accent: #ffffff;

  /* bordas */
  --border-hairline: #f2d9d6;  /* rosado claro, fino — quase todo painel */
  --border-strong: #e3aaa3;    /* hover / estado ativo */

  /* acento interativo */
  --accent: #c0392b;
  --accent-strong: #9b2018;    /* hover de botão primário, links */
  --accent-wash: rgba(192, 57, 43, 0.08);  /* fundo de item selecionado */

  /* paleta categórica (séries / linhas em gráficos) — 8 cores, a 8ª é
     sempre reservada pro bucket "outras" */
  --cat-1: #2a78d6; /* azul */
  --cat-2: #eb6834; /* laranja */
  --cat-3: #1baf7a; /* água */
  --cat-4: #eda100; /* amarelo */
  --cat-5: #e87ba4; /* magenta */
  --cat-6: #008300; /* verde */
  --cat-7: #4a3aa7; /* violeta */
  --cat-8: #e34948; /* vermelho — reservado p/ bucket "Outras" */

  /* sequencial (mapas de calor / choropleth), 7 degradês do mesmo vermelho */
  --chart-seq-1: #fdeeec; --chart-seq-2: #f9cfc9; --chart-seq-3: #f2a69c;
  --chart-seq-4: #e7766a; --chart-seq-5: #d24a3d; --chart-seq-6: #a8291f;
  --chart-seq-7: #7a1a14;

  /* cromo neutro de mapas/gráficos (lido via JS, não entende var() em SVG) */
  --chart-map-fill: #fbf3f2;
  --chart-map-border: #9b2018; /* ALTO CONTRASTE com o fill — ver seção 8 do
                                   README-DESIGN.txt: nunca deixe fill×border
                                   quase iguais, some em projeção/datashow */
  --chart-node-neutral: #7f1d1d;

  /* geometria */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* sombra sutil, sempre tingida da tinta primária (nunca preto puro) */
  --shadow-sm: 0 1px 2px rgba(127, 29, 29, 0.05), 0 1px 1px rgba(127, 29, 29, 0.03);
  --shadow-md: 0 8px 24px rgba(127, 29, 29, 0.08);
  --shadow-lift: 0 12px 32px rgba(127, 29, 29, 0.14); /* tooltip, painel flutuante */

  /* motion — 1 única curva de easing usada em tudo, "estilo Apple" */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 160ms;  /* hover, toggle */
  --dur-mid: 280ms;   /* fill de barra/mapa, box-shadow */
  --dur-slow: 480ms;  /* entrada dos painéis ao carregar a página */

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --topbar-h: 10vh;
  --topbar-bg: rgba(255, 255, 255, 0.9);
}

/* ---------- tema escuro: mesmos tokens, alta legibilidade ----------
   Redefinido em DOIS lugares de propósito (ver seção 9 do
   README-DESIGN.txt): 1) media query, pra seguir o SO por padrão; 2)
   atributo [data-theme="dark"], pra permitir forçar via toggle + localStorage,
   escrevendo por cima da preferência do SO. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-page: #0f0b0b;
    --surface-panel: #171111;
    --surface-alt: #1f1716;
    --surface-hover: #2a1e1d;

    --ink-primary: #ff9f94;
    --ink-secondary: #ece7e6;
    --ink-muted: #a39594;
    --ink-on-accent: #1a0705;

    --border-hairline: #3a2624;
    --border-strong: #5a3a37;

    --accent: #f0675a;
    --accent-strong: #ff9f94;
    --accent-wash: rgba(240, 103, 90, 0.16);

    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
    --cat-5: #d55181; --cat-6: #14a814; --cat-7: #9085e9; --cat-8: #e66767;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
    --shadow-lift: 0 12px 36px rgba(0, 0, 0, 0.65);

    --chart-map-fill: #261c1b;
    --chart-map-border: #ff9f94; /* agora CLARO sobre fundo escuro */
    --chart-node-neutral: #ece7e6;
    --chart-seq-1: #2a1513; --chart-seq-2: #401a16; --chart-seq-3: #5c201a;
    --chart-seq-4: #7d281f; --chart-seq-5: #a33427; --chart-seq-6: #c84b3c;
    --chart-seq-7: #e8806f;

    --topbar-bg: rgba(15, 11, 11, 0.86);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-page: #0f0b0b;
  --surface-panel: #171111;
  --surface-alt: #1f1716;
  --surface-hover: #2a1e1d;

  --ink-primary: #ff9f94;
  --ink-secondary: #ece7e6;
  --ink-muted: #a39594;
  --ink-on-accent: #1a0705;

  --border-hairline: #3a2624;
  --border-strong: #5a3a37;

  --accent: #f0675a;
  --accent-strong: #ff9f94;
  --accent-wash: rgba(240, 103, 90, 0.16);

  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
  --cat-5: #d55181; --cat-6: #14a814; --cat-7: #9085e9; --cat-8: #e66767;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lift: 0 12px 36px rgba(0, 0, 0, 0.65);

  --chart-map-fill: #261c1b;
  --chart-map-border: #ff9f94;
  --chart-node-neutral: #ece7e6;
  --chart-seq-1: #2a1513; --chart-seq-2: #401a16; --chart-seq-3: #5c201a;
  --chart-seq-4: #7d281f; --chart-seq-5: #a33427; --chart-seq-6: #c84b3c;
  --chart-seq-7: #e8806f;

  --topbar-bg: rgba(15, 11, 11, 0.86);
}

/* ---------- reset mínimo + tipografia base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--surface-page);
  color: var(--ink-secondary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-wash); color: var(--ink-primary); }

h1, h2, h3 { color: var(--ink-primary); margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.text-xs { font-size: 10.5px; }
.text-sm { font-size: 12.5px; }
.text-md { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 26px; }
.muted { color: var(--ink-muted); }
.strong { color: var(--ink-primary); font-weight: 700; }

/* scrollbars finas, discretas — combina com a estética "clean" */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }
*::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   design-dash-uea — componentes base (genéricos, reaproveitáveis em
   qualquer dashboard novo). Depende dos tokens em design-tokens.css —
   carregue esse arquivo ANTES deste.

   Não inclui: Sankey, mapa/globo D3, flowmap, página de perfil — esses são
   específicos do dashboard de prospecção original. Peça o skill para
   adaptar esses gráficos sob demanda (ver SKILL.md, seção "Gráficos D3").
   ========================================================================== */

/* ==========================================================================
   Barra superior (topbar)
   ========================================================================== */
.topbar {
  height: var(--topbar-h);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-hairline);
  position: relative;
  z-index: 20;
}

.topbar__brand { display: flex; align-items: center; gap: 14px; }
.topbar__logo { height: calc(var(--topbar-h) * 0.6); max-height: 44px; width: auto; display: block; }
.topbar__title { display: flex; flex-direction: column; line-height: 1.15; }
.topbar__title strong { color: var(--ink-primary); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.topbar__title span { color: var(--ink-muted); font-size: 12px; font-weight: 500; }

.topbar__nav { display: flex; align-items: center; gap: 10px; }
.topbar__link {
  font-size: 13px; font-weight: 600; color: var(--ink-secondary);
  text-decoration: none; padding: 8px 16px; border-radius: var(--radius-pill);
  border: 1px solid transparent; transition: all var(--dur-fast) var(--ease);
}
.topbar__link:hover { background: var(--surface-hover); border-color: var(--border-hairline); }
.topbar__link.is-active { background: var(--ink-primary); color: var(--ink-on-accent); }

.topbar__back {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--ink-secondary);
  text-decoration: none; padding: 8px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline); margin-right: 8px;
  transition: all var(--dur-fast) var(--ease);
}
.topbar__back:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--ink-primary); }

/* segunda barra opcional, logo abaixo do topbar — cards de estatística.
   Centralizada por padrão (justify-content + text-align) — os KPIs de
   abertura são o resumo mais lido da página, centralizar chama mais
   atenção que alinhar à esquerda junto do restante do conteúdo. */
.statbar {
  display: flex; align-items: center; justify-content: center; gap: 32px;
  min-height: 40px;
  padding: 10px 28px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-hairline);
  position: relative; z-index: 19;
}
.topbar__stat { text-align: center; line-height: 1.1; }
.topbar__stat b { display: block; font-size: 15px; color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.topbar__stat small { font-size: 10.5px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* botão circular de tema (sol/lua) — ver theme-toggle.md pro HTML+JS */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none; margin-right: 2px;
  border-radius: 50%; border: 1px solid var(--border-hairline);
  background: var(--surface-alt); color: var(--ink-primary);
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.theme-toggle:hover { background: var(--surface-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* rodapé de crédito — SEMPRE no fluxo normal do documento (nunca
   position:fixed: um rodapé fixo no canto sobrepõe conteúdo real assim
   que a página ganha um footer/aviso de verdade). Duas pontas: a
   assinatura "Powered by ..." à esquerda, fonte/data de atualização dos
   dados à direita — troque os dois <span> pelo texto do projeto. */
.site-credit {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 28px 14px; font-size: 9.5px; font-weight: 500; color: var(--ink-muted);
  opacity: 0.55; letter-spacing: 0.01em; background: var(--surface-alt);
}

/* ==========================================================================
   Barra de filtros ativos — padrão a partir do dashboard de Mobilidade.
   Fica logo abaixo do .statbar, em TODAS as páginas do dashboard que
   compartilham a mesma fonte de dados (mesmo uma página de mapa/relatório
   sem os controles de filtro em si) — ver SKILL.md, seção "Filtros
   persistentes multi-página", pro padrão de estado em JS + sincronização
   via localStorage entre páginas. Só aparece quando há filtro ativo.
   ========================================================================== */
.filters-bar {
  display: none; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 0; max-height: 0; overflow: hidden; opacity: 0;
  border-bottom: 1px solid transparent; background: var(--surface-alt);
  transition: max-height var(--dur-mid) var(--ease), opacity var(--dur-mid) var(--ease), padding var(--dur-mid) var(--ease);
}
.filters-bar.is-visible {
  display: flex; max-height: 80px; opacity: 1; padding: 10px 28px;
  border-bottom-color: var(--border-hairline);
}
.filters-bar__label { font-size: 10.5px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; flex: none; }
.filters-bar__chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font); font-size: 11.5px; font-weight: 700; color: var(--accent-strong);
  background: var(--accent-wash); border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); padding: 5px 10px 5px 12px; cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.filter-chip:hover { background: var(--surface-hover); border-color: var(--ink-primary); }
.filter-chip__label { color: var(--ink-muted); font-weight: 600; }
.filter-chip svg { flex: none; opacity: 0.7; }
.filters-bar__clear { flex: none; padding: 7px 14px; }

/* ==========================================================================
   Layout de grid 3 colunas (página principal, "20fr 60fr 20fr" — ver
   README-DESIGN.txt seção 4 pras variações: 30fr 40fr 30fr numa página de
   perfil, 1 coluna full-bleed numa página de mapa/globo)
   ========================================================================== */
.layout {
  min-height: calc(100vh - var(--topbar-h));
  display: grid;
  grid-template-columns: 20fr 60fr 20fr;
  gap: 16px;
  padding: 16px;
  align-items: start;
}
.layout--profile { grid-template-columns: 30fr 40fr 30fr; }

.col { min-width: 0; display: flex; flex-direction: column; gap: 14px; overflow: visible; padding-right: 2px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Cartões / painéis — o átomo visual de todo o dashboard
   ========================================================================== */
.panel {
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  transition: box-shadow var(--dur-mid) var(--ease), transform var(--dur-mid) var(--ease), border-color var(--dur-mid) var(--ease);
}
.panel:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.panel--flush { padding: 0; overflow: hidden; }
.panel--grow { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.panel__header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.panel__title {
  font-size: 12px; font-weight: 700; color: var(--ink-primary);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.panel__hint { font-size: 10.5px; color: var(--ink-muted); }
.panel__body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}

.empty-hint { font-size: 12px; color: var(--ink-muted); padding: 14px 4px; text-align: center; }

/* animação de entrada em cascata — ver theme-toggle.md/SKILL.md pro padrão
   de delay escalonado por coluna/posição */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.panel, .topbar, .statbar { animation: rise-in var(--dur-slow) var(--ease) both; }

/* ==========================================================================
   Botões
   ========================================================================== */
.btn {
  font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: 0.01em;
  color: var(--ink-on-accent); background: var(--ink-primary);
  border: none; border-radius: var(--radius-pill); padding: 9px 16px;
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--accent-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--ink-secondary); border: 1px solid var(--border-hairline); }
.btn--ghost:hover { background: var(--surface-hover); color: var(--ink-primary); border-color: var(--border-strong); box-shadow: none; }

/* ==========================================================================
   Filtros / formulários
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px; font-weight: 700; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}

select.dropdown {
  appearance: none; -webkit-appearance: none;
  width: 100%; padding: 10px 34px 10px 12px;
  font-family: var(--font); font-size: 13.5px; font-weight: 600; color: var(--ink-primary);
  background: var(--surface-alt) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6"><path d="M0 0l5 6 5-6z" fill="%237f1d1d"/></svg>') no-repeat right 14px center;
  border: 1px solid var(--border-hairline); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
select.dropdown:hover { border-color: var(--border-strong); background-color: var(--surface-hover); }
select.dropdown:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

.checklist { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; }
.checkrow {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px;
  border-radius: var(--radius-sm); cursor: pointer; user-select: none;
  transition: background var(--dur-fast) var(--ease);
}
.checkrow:hover { background: var(--surface-hover); }
.checkrow input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.checkrow span { font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); }
.checkrow small { margin-left: auto; font-size: 10.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* listas selecionáveis (clique único-mas-múltiplo, com bolinha de cor) */
.picklist { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.pickrow {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent;
  transition: all var(--dur-fast) var(--ease);
}
.pickrow:hover { background: var(--surface-hover); }
.pickrow.is-active { background: var(--accent-wash); border-color: var(--border-strong); }
.pickrow .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--border-strong); }
.pickrow .label { font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickrow.is-active .label { color: var(--ink-primary); }
.pickrow .count { margin-left: auto; font-size: 10.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.rank { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease); cursor: pointer; }
.rank:hover { background: var(--surface-hover); }
.rank__pos { width: 18px; font-size: 11px; font-weight: 800; color: var(--ink-muted); text-align: right; }
.rank__name { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__val { font-size: 11px; font-weight: 700; color: var(--accent-strong); font-variant-numeric: tabular-nums; }

.search-box {
  display: flex; align-items: center; gap: 8px; flex: none;
  background: var(--surface-alt); border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px;
  transition: all var(--dur-fast) var(--ease);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.search-box input { border: none; outline: none; background: transparent; font-family: var(--font); font-size: 12.5px; color: var(--ink-primary); width: 100%; }
.search-box svg { flex: none; color: var(--ink-muted); }

/* ==========================================================================
   Badges, tags, avatar, stat tiles (usados em cards de perfil/detalhe)
   ========================================================================== */
.badge-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; color: var(--ink-secondary);
  background: var(--surface-alt); border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill); padding: 5px 11px;
}
.badge a { color: inherit; text-decoration: none; }
.badge--link { color: var(--accent-strong); border-color: var(--border-strong); cursor: pointer; }
.badge--link:hover { background: var(--accent-wash); }

.kw-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-tag {
  font-size: 10.5px; font-weight: 700; color: var(--accent-strong);
  background: var(--accent-wash); border-radius: var(--radius-pill); padding: 4px 10px;
}

.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
  flex: none;
}

.stat-row { display: flex; gap: 10px; }
.stat-tile {
  flex: 1; background: var(--surface-alt); border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm); padding: 10px 12px; text-align: center;
}
.stat-tile b { display: block; font-size: 20px; color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.stat-tile small { font-size: 10px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.info-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-hairline); font-size: 12.5px; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--ink-muted); font-weight: 600; }
.info-row span:last-child { color: var(--ink-secondary); font-weight: 600; text-align: right; max-width: 60%; }
.info-row a { color: var(--accent-strong); text-decoration: none; }
.info-row a:hover { text-decoration: underline; }

/* ==========================================================================
   Tooltip global (usado por qualquer gráfico/elemento com dados sob o mouse)
   ========================================================================== */
.viz-tooltip {
  position: fixed; pointer-events: none; z-index: 999;
  background: var(--ink-primary); color: #fff;
  font-family: var(--font); font-size: 12px; font-weight: 500;
  padding: 8px 11px; border-radius: 10px; box-shadow: var(--shadow-lift);
  opacity: 0; transform: translate(-50%, calc(-100% - 10px)) scale(0.96);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  max-width: 240px; line-height: 1.4;
}
.viz-tooltip.is-visible { opacity: 1; transform: translate(-50%, calc(-100% - 14px)) scale(1); }
.viz-tooltip b { color: #ffd2cc; }

/* tooltip de ajuda (hover parado por ~3s sobre [data-help]) — visual
   deliberadamente diferente do viz-tooltip pra não confundir "ajuda do
   card" com "dado do gráfico" */
.help-tooltip {
  position: fixed; pointer-events: none; z-index: 1000;
  max-width: 260px;
  background: var(--surface-panel); color: var(--ink-secondary);
  border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lift);
  padding: 10px 13px;
  font-family: var(--font); font-size: 12px; font-weight: 500; line-height: 1.45;
  opacity: 0; transform: translateY(4px) scale(0.98);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.help-tooltip.is-visible { opacity: 1; transform: translateY(0) scale(1); }

/* painel flutuante de detalhes (ex.: ao clicar um ponto/arco num mapa) */
.floating-detail {
  position: fixed; right: 24px; bottom: 24px; width: 320px;
  background: var(--surface-panel); border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
  padding: 18px; z-index: 30;
  opacity: 0; transform: translateY(16px) scale(0.98); pointer-events: none;
  transition: opacity var(--dur-mid) var(--ease), transform var(--dur-mid) var(--ease);
}
.floating-detail.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.floating-detail h3 { font-size: 15px; margin-bottom: 4px; }
.floating-detail .actions { display: flex; gap: 8px; }
.floating-detail .actions .btn { flex: 1; text-align: center; }

/* skeleton de loading (dados buscados ao vivo de API externa) */
.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface-hover) 37%, var(--surface-alt) 63%);
  background-size: 400% 100%; animation: skeleton-wave 1.4s ease infinite;
  border-radius: var(--radius-sm); height: 12px; margin: 6px 0;
}
@keyframes skeleton-wave { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==========================================================================
   Cromo genérico p/ gráficos D3 (mapas, barras) — classes que o JS liga a
   elementos SVG; as cores reais vêm de getComputedStyle nos tokens acima
   ========================================================================== */
.map-country { transition: fill var(--dur-mid) var(--ease); cursor: pointer; }
.map-sphere { fill: var(--surface-alt); }
.map-graticule { fill: none; stroke: var(--border-hairline); stroke-width: 0.5px; }
.map-pin { transition: r var(--dur-fast) var(--ease); cursor: pointer; }

.bar-track rect.bg { fill: var(--surface-alt); }
.bar-track rect.fg { transition: width var(--dur-mid) var(--ease); cursor: pointer; }
.bar-label { font-family: var(--font); font-size: 11px; font-weight: 600; fill: var(--ink-secondary); }
.bar-value { font-family: var(--font); font-size: 10.5px; font-weight: 700; fill: var(--ink-primary); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Específico do Painel CBMAM
   ========================================================================== */
.topbar__logo--dark { display: none; }
:root[data-theme="dark"] .topbar__logo--light { display: none; }
:root[data-theme="dark"] .topbar__logo--dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar__logo--light { display: none; }
  :root:not([data-theme="light"]) .topbar__logo--dark { display: block; }
}
.topbar__link.is-disabled { color: var(--ink-muted); opacity: 0.6; cursor: default; pointer-events: none; }
.topbar__link small { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-left: 4px; }

.topbar__stat.is-highlight b { color: var(--accent-strong); }
.topbar__stat.is-alert b { color: var(--accent); }
.topbar__stat b small { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--ink-muted); }
.statbar { flex-wrap: wrap; row-gap: 8px; }

.hint-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 1px solid var(--border-strong); color: var(--ink-muted);
  font-size: 10px; font-weight: 800; font-style: normal; line-height: 1;
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.hint-icon:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-wash); }

.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tile-grid--3 { grid-template-columns: repeat(3, 1fr); }
.stat-tile.is-clickable { cursor: pointer; transition: all var(--dur-fast) var(--ease); }
.stat-tile.is-clickable:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.stat-tile.is-active { background: var(--accent-wash); border-color: var(--accent); }
.stat-tile em { display: block; font-style: normal; font-size: 9.5px; color: var(--ink-muted); margin-top: 3px; }

.meter-row { display: flex; flex-direction: column; gap: 4px; padding: 7px 8px; margin: 0 -8px; border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease); }
.meter-row.is-clickable { cursor: pointer; }
.meter-row.is-clickable:hover { background: var(--surface-hover); }
.meter-row.is-active { background: var(--accent-wash); }
.meter-row__label { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.meter-row__label span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.meter-row__label b { color: var(--ink-primary); font-variant-numeric: tabular-nums; flex: none; }
.meter-row__label .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.meter-track { height: 7px; border-radius: var(--radius-pill); background: var(--surface-alt); overflow: hidden; }
.meter-track > span { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--accent); transition: width var(--dur-mid) var(--ease); }
.rank.is-active { background: var(--accent-wash); }
.rank.is-active .rank__name { color: var(--ink-primary); }
.rank__bar { flex: 0 0 24%; height: 6px; border-radius: var(--radius-pill); background: var(--surface-alt); overflow: hidden; }
.rank__bar span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); transition: width var(--dur-mid) var(--ease); }

/* mapa */
#map { height: 430px; border-radius: var(--radius-sm); border: 1px solid var(--border-hairline); background: var(--surface-alt); z-index: 1; }
.leaflet-container { font-family: var(--font); }
.leaflet-tooltip.map-tip { background: var(--ink-primary); color: #fff; border: none; border-radius: 10px; box-shadow: var(--shadow-lift); font-size: 12px; padding: 7px 10px; }
.leaflet-tooltip.map-tip::before { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11px; color: var(--ink-secondary); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* colunas por dia (empilhadas por turno) */
.cols { display: flex; align-items: flex-end; gap: 14px; height: 170px; padding: 6px 4px 0; }
.cols__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; cursor: pointer; border-radius: var(--radius-sm); padding: 4px 0; transition: background var(--dur-fast) var(--ease); }
.cols__item:hover { background: var(--surface-hover); }
.cols__item.is-active { background: var(--accent-wash); }
.cols__stack { flex: 1; width: 56%; max-width: 64px; display: flex; flex-direction: column-reverse; justify-content: flex-start; }
.cols__stack span { display: block; width: 100%; transition: height var(--dur-mid) var(--ease); }
.cols__stack span:first-child { border-radius: 0 0 6px 6px; }
.cols__stack span:last-child { border-radius: 6px 6px 0 0; }
.cols__stack span:only-child { border-radius: 6px; }
.cols__val { font-size: 11px; font-weight: 700; color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.cols__lbl { font-size: 10.5px; font-weight: 600; color: var(--ink-muted); }

/* dia × hora */
.heat { display: grid; grid-template-columns: 46px repeat(24, 1fr); gap: 2px; font-size: 9.5px; color: var(--ink-muted); }
.heat__cell { aspect-ratio: 1.25; border-radius: 3px; background: var(--surface-alt); }
.heat__rowlbl { display: flex; align-items: center; font-weight: 600; }
.heat__collbl { text-align: center; }
.heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10px; color: var(--ink-muted); }
.heat-legend span { width: 18px; height: 8px; }

.note { font-size: 10.5px; color: var(--ink-muted); line-height: 1.45; margin-top: 8px; }
.site-credit a { color: inherit; font-weight: 700; }
.panel--map { animation-delay: 60ms; }

@media (max-width: 980px) {
  .topbar { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .statbar { gap: 18px; padding: 10px 16px; }
  .layout { padding: 12px; }
  .site-credit { flex-direction: column; padding: 8px 16px 14px; }
}
#grupo-list { max-height: 330px; padding-right: 4px; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.6); }
}
