/* ==========================================================================
   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: #f6faf8;
  --surface-hover: #eef8f2;

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

  /* bordas */
  --border-hairline: #cdeedd;  /* verde claro, fino — quase todo painel */
  --border-strong: #9fd9bb;    /* hover / estado ativo */

  /* acento interativo */
  --accent: #1f8a5f;
  --accent-strong: #0b6b45;    /* hover de botão primário, links */
  --accent-wash: rgba(31, 138, 95, 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 verde */
  --chart-seq-1: #eaf7f0; --chart-seq-2: #c7ecda; --chart-seq-3: #96dab9;
  --chart-seq-4: #5fc192; --chart-seq-5: #2e9e6c; --chart-seq-6: #0f7a4d;
  --chart-seq-7: #0b5c3a;

  /* cromo neutro de mapas/gráficos (lido via JS, não entende var() em SVG) */
  --chart-map-fill: #eef5f1;
  --chart-map-border: #0b6b45; /* 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: #0b3d2b;

  /* 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(11, 61, 43, 0.05), 0 1px 1px rgba(11, 61, 43, 0.03);
  --shadow-md: 0 8px 24px rgba(11, 61, 43, 0.08);
  --shadow-lift: 0 12px 32px rgba(11, 61, 43, 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: #0a100c;
    --surface-panel: #101712;
    --surface-alt: #171f1a;
    --surface-hover: #1e2921;

    --ink-primary: #7fe8ab;
    --ink-secondary: #e7ebe8;
    --ink-muted: #93a196;
    --ink-on-accent: #06120a;

    --border-hairline: #24352b;
    --border-strong: #3a5a45;

    --accent: #34d399;
    --accent-strong: #6ee7b8;
    --accent-wash: rgba(52, 211, 153, 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: #1c2620;
    --chart-map-border: #6ee7b8; /* agora CLARO sobre fundo escuro */
    --chart-node-neutral: #e7ebe8;
    --chart-seq-1: #142a20; --chart-seq-2: #164028; --chart-seq-3: #185c34;
    --chart-seq-4: #1c7d40; --chart-seq-5: #26a352; --chart-seq-6: #4bc873;
    --chart-seq-7: #8de6a5;

    --topbar-bg: rgba(10, 16, 12, 0.86);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-page: #0a100c;
  --surface-panel: #101712;
  --surface-alt: #171f1a;
  --surface-hover: #1e2921;

  --ink-primary: #7fe8ab;
  --ink-secondary: #e7ebe8;
  --ink-muted: #93a196;
  --ink-on-accent: #06120a;

  --border-hairline: #24352b;
  --border-strong: #3a5a45;

  --accent: #34d399;
  --accent-strong: #6ee7b8;
  --accent-wash: rgba(52, 211, 153, 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: #1c2620;
  --chart-map-border: #6ee7b8;
  --chart-node-neutral: #e7ebe8;
  --chart-seq-1: #142a20; --chart-seq-2: #164028; --chart-seq-3: #185c34;
  --chart-seq-4: #1c7d40; --chart-seq-5: #26a352; --chart-seq-6: #4bc873;
  --chart-seq-7: #8de6a5;

  --topbar-bg: rgba(10, 16, 12, 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 */
.statbar {
  display: flex; align-items: 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: left; 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; }

.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);
}

/* ==========================================================================
   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="%230b3d2b"/></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), border-color var(--dur-fast) var(--ease); cursor: pointer; border: 1px solid transparent; }
.rank:hover { background: var(--surface-hover); }
.rank.is-active { background: var(--accent-wash); border-color: var(--border-strong); }
.rank.is-active .rank__name { color: var(--ink-primary); }
.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; font-family: var(--font); }
.badge--link:hover { background: var(--accent-wash); }
.badge--link.is-active { background: var(--accent-wash); border-color: var(--accent); color: var(--ink-primary); }

/* ícone "!" de ajuda — substitui texto explicativo nos cabeçalhos de painel;
   clique abre/fecha o popup (ver initHelpTooltips) */
.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); }

.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;
  transition: all var(--dur-fast) var(--ease);
}
.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; }
.stat-tile[data-key] { cursor: pointer; }
.stat-tile[data-key]:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.stat-tile.is-active { background: var(--accent-wash); border-color: var(--accent); }
.stat-tile.is-active small { color: var(--accent-strong); }

/* mini-cards em linha (Fluxo & Tipo de Mobilidade) */
.mini-tiles { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.mini-tiles .stat-tile { flex: 1 1 90px; padding: 8px 10px; }
.mini-tiles .stat-tile b { font-size: 17px; }
.subgroup-label {
  font-size: 10px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase;
  letter-spacing: 0.05em; margin: 10px 0 6px;
}
.subgroup-label:first-child { margin-top: 0; }

/* infográfico de gênero — barra dividida + legenda */
.split-bar { display: flex; height: 14px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-alt); margin-bottom: 10px; }
.split-bar__seg { transition: width var(--dur-mid) var(--ease), opacity var(--dur-fast) var(--ease); }
.split-legend { display: flex; flex-direction: column; gap: 2px; }
.split-legend__row {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; margin: 0 -8px;
  border-radius: var(--radius-sm); cursor: pointer; transition: background var(--dur-fast) var(--ease);
}
.split-legend__row:hover { background: var(--surface-hover); }
.split-legend__row.is-active { background: var(--accent-wash); }
.split-legend__dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.split-legend__label { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--ink-secondary); }
.split-legend__row.is-active .split-legend__label { color: var(--ink-primary); }
.split-legend__val { font-size: 11.5px; font-weight: 700; color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.split-legend__pct { font-size: 10.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

.info-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-bottom: 1px solid var(--border-hairline); font-size: 12.5px; border-radius: var(--radius-sm); transition: background var(--dur-fast) var(--ease); }
.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; }
.info-row[data-programa]:hover { background: var(--surface-hover); }
.info-row.is-active { background: var(--accent-wash); }
.info-row.is-active span:first-child { color: var(--ink-primary); }

/* ==========================================================================
   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: #bdf0d6; }

/* tooltip de ajuda — clique no ícone "!" (ou hover parado ~3s nos cartões
   de KPI do topo) — 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 — Dashboard Mobilidade Acadêmica UEA
   ========================================================================== */

/* KPI grande no statbar com % ou variação secundária */
.topbar__stat.is-highlight b { color: var(--accent-strong); }

/* cartões do statbar centralizados (valor + rótulo), barra também centralizada */
.statbar { justify-content: center; }
.topbar__stat { text-align: center; }

/* botão "Gerar relatório" no topbar__nav */
#report-btn { padding: 8px 16px; font-size: 12px; }
/* .btn às vezes é usado em <a> (link estilizado como botão) — sem sublinhado */
a.btn { text-decoration: none; display: inline-block; }

/* grade de stat-tiles por nível acadêmico / situação */
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile-grid .stat-tile b { font-size: 22px; }

/* linha de progresso (situação da participação, qualidade do dado) */
.meter-row { display: flex; flex-direction: column; gap: 4px; padding: 8px; margin: 0 -8px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.meter-row:hover { background: var(--surface-hover); }
.meter-row.is-active { background: var(--accent-wash); }
.meter-row.is-active .meter-row__label span { color: var(--ink-primary); }
.meter-row__label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.meter-row__label b { color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.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); }

/* legenda do mapa coroplético */
.map-legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10px; color: var(--ink-muted); }
.map-legend__swatches { display: flex; }
.map-legend__swatches span { width: 20px; height: 8px; }
.map-legend__swatches span:first-child { border-radius: 4px 0 0 4px; }
.map-legend__swatches span:last-child { border-radius: 0 4px 4px 0; }

/* aviso de privacidade — barra horizontal de largura total, no rodapé */
.footer-notice {
  display: flex; gap: 10px; align-items: center;
  background: var(--surface-alt); border-top: 1px solid var(--border-hairline);
  padding: 14px 28px; font-size: 11.5px; color: var(--ink-secondary); line-height: 1.5;
}
.footer-notice svg { flex: none; color: var(--accent-strong); }

/* barra de filtros ativos — só aparece quando há pelo menos 1 filtro */
.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; }

@media (max-width: 720px) {
  .statbar { flex-wrap: wrap; gap: 16px 24px; }
  .filters-bar.is-visible { padding: 10px 16px; }
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   Página — Mapa de Fluxo (flowmap.html)
   ========================================================================== */
.flow-page { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.flow-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 0 4px; flex-wrap: wrap; }
.flow-hero h1 { font-size: 22px; }
.flow-hero p { margin: 4px 0 0; font-size: 13px; color: var(--ink-muted); max-width: 640px; }
.flow-map-wrap { height: 72vh; min-height: 480px; }
#flow-chart { width: 100%; height: 100%; }

.flow-legend { display: flex; align-items: center; gap: 18px; padding: 10px 16px; flex-wrap: wrap; flex: none; }
.flow-legend__item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-secondary); font-weight: 600; }
.flow-legend__swatch { width: 18px; height: 2px; border-radius: 2px; flex: none; }
.flow-legend__swatch--in { background: var(--accent); }
.flow-legend__swatch--out { background: var(--cat-2); }

/* item de legenda clicável (filtro) — ex.: Mestrado/Doutorado/Graduação em Evolução por edição */
.flow-legend__item--btn {
  font-family: var(--font); background: none; border: 1px solid transparent; border-radius: var(--radius-pill);
  padding: 4px 9px 4px 7px; margin: -4px -9px -4px -7px; cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.flow-legend__item--btn:hover { background: var(--surface-hover); }
.flow-legend__item--btn.is-active { background: var(--accent-wash); border-color: var(--border-strong); color: var(--ink-primary); }

/* botão pequeno de alternância (ex.: ocultar barras e grades) */
.chart-toggle-btn {
  font-family: var(--font); font-size: 10.5px; font-weight: 700; color: var(--ink-muted);
  background: var(--surface-alt); border: 1px solid var(--border-hairline); border-radius: var(--radius-pill);
  padding: 4px 10px; cursor: pointer; transition: all var(--dur-fast) var(--ease); white-space: nowrap;
}
.chart-toggle-btn:hover { color: var(--ink-primary); border-color: var(--border-strong); background: var(--surface-hover); }
.chart-toggle-btn.is-active { background: var(--accent-wash); border-color: var(--accent); color: var(--ink-primary); }

.flow-line { fill: none; cursor: pointer; transition: opacity var(--dur-fast) var(--ease), stroke-width var(--dur-fast) var(--ease); }
.flow-line.is-dim { opacity: 0.12; }
.flow-line--in { stroke: var(--accent); }
.flow-line--out { stroke: var(--cat-2); }
@keyframes flow-dash { to { stroke-dashoffset: -16; } }
.flow-line__anim { animation: flow-dash 900ms linear infinite; }

.flow-dot-manaus { fill: var(--ink-primary); stroke: var(--surface-page); stroke-width: 2px; }
.flow-dot-manaus__pulse { fill: none; stroke: var(--ink-primary); stroke-width: 1.4px; opacity: 0.5; }
@keyframes flow-pulse {
  from { r: 6; opacity: 0.55; }
  to { r: 22; opacity: 0; }
}
.flow-dot-manaus__pulse { animation: flow-pulse 2.2s ease-out infinite; }
.flow-dot-country { cursor: pointer; transition: r var(--dur-fast) var(--ease); }
.flow-country-label { font-family: var(--font); font-size: 10px; font-weight: 700; fill: var(--ink-secondary); pointer-events: none; }
.flow-manaus-label { font-family: var(--font); font-size: 11px; font-weight: 800; fill: var(--ink-primary); pointer-events: none; }

/* rótulo escrito dentro de uma barra colorida (ranking de países) —
   precisa de uma classe própria porque .bar-label já fixa --ink-secondary */
.bar-label-onfill { font-family: var(--font); font-size: 11px; font-weight: 700; fill: var(--ink-on-accent); }

/* botões coloridos do painel "Programa de mobilidade" — uma cor fixa por
   programa, para reconhecimento rápido independente do tema */
.mobilidade-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; border: none; border-radius: var(--radius-sm);
  padding: 11px 14px; margin-bottom: 8px;
  font-family: var(--font); font-size: 12.5px; font-weight: 700; color: #fff;
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.mobilidade-btn:last-child { margin-bottom: 0; }
.mobilidade-btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.mobilidade-btn.is-active { outline: 2px solid var(--ink-primary); outline-offset: 2px; }
.mobilidade-btn span:last-child { opacity: 0.85; font-variant-numeric: tabular-nums; white-space: nowrap; }

.mobilidade-btn[data-programa="GCUB-MOB"] { background: #0b3d2b; }
.mobilidade-btn[data-programa="ERASMUS+"] { background: #4169e1; }
.mobilidade-btn[data-programa="MOVE LA AMÉRICA"] { background: #dc2626; }
.mobilidade-btn[data-programa="PROAFRI"] { background: #eab308; color: #3a2c00; }

/* ==========================================================================
   Relatório (relatorio.html) — documento de uma coluna, pensado pra tela
   e impressão/exportação em PDF (window.print())
   ========================================================================== */
.report-page { max-width: 880px; margin: 0 auto; padding: 28px 28px 80px; }

.report-header { padding-bottom: 18px; margin-bottom: 20px; border-bottom: 1px solid var(--border-hairline); }
.report-header h1 { font-size: 22px; margin-bottom: 4px; }
.report-header .meta { font-size: 12px; color: var(--ink-muted); line-height: 1.6; }
.report-header .meta strong { color: var(--ink-secondary); }

.report-actions { display: flex; gap: 10px; margin-bottom: 24px; }

.report-section { margin-bottom: 30px; }
.report-section h2 {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-primary); border-bottom: 1px solid var(--border-hairline);
  padding-bottom: 8px; margin-bottom: 14px;
}

.report-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 640px) { .report-kpis { grid-template-columns: repeat(6, 1fr); } }

.report-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.report-table th {
  text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-muted); padding: 7px 10px; border-bottom: 1px solid var(--border-strong);
}
.report-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-hairline); color: var(--ink-secondary); }
.report-table tr:last-child td { border-bottom: none; }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table tbody tr:nth-child(odd) { background: var(--surface-alt); }

@media print {
  .report-actions, #theme-toggle, .topbar__link, .footer-notice, .site-credit { display: none !important; }
  :root, :root[data-theme="dark"] {
    --surface-page: #ffffff; --surface-panel: #ffffff; --surface-alt: #f6faf8; --surface-hover: #eef8f2;
    --ink-primary: #0b3d2b; --ink-secondary: #3a3a3c; --ink-muted: #7a8580; --ink-on-accent: #ffffff;
    --border-hairline: #cdeedd; --border-strong: #9fd9bb;
  }
  body { background: #fff; }
  .panel, .topbar, .statbar { animation: none !important; box-shadow: none !important; }
  .report-section { break-inside: avoid; }
  .report-table tr { break-inside: avoid; }
}
