/* ==========================================================================
   Observatório Municipal de Porto Velho — estilos
   --------------------------------------------------------------------------
   Estrutura baseada no "modelo observatório" (menu lateral com dropdowns +
   painel ao lado) e linguagem visual do "UI.png" (vidro fosco, cantos
   generosos, botões em pílula e trilho flutuante de ícones).
   Sumário:
     1. Fonte            6. Menu lateral          11. Página 404
     2. Tokens           7. Menu recolhido        12. Elementos flutuantes
     3. Base             8. Barra superior        13. Responsivo
     4. Utilidades       9. Página inicial        14. Acessibilidade e
     5. Estrutura       10. Área do painel            preferências
   ========================================================================== */

/* 1. Fonte (Inter, hospedada no próprio site: rápida e sem rastreadores) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations"),
       url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Tokens de design ===================================================== */
:root {
  /* Marca */
  --azul-950: #04032c;        /* azul do logo — usado como texto sobre âmbar */
  --ambar-400: #f0a02a;       /* preenchimento de destaque */
  --ambar-300: #ffbd60;       /* destaque sob o ponteiro */
  --ambar-texto: #8a5306;     /* âmbar legível como texto sobre fundo claro */

  /* Superfícies claras (soft UI em luz): gelo, branco e sombra suave */
  --fundo: #e9edf4;           /* fundo da página (gelo) */
  --janela: #f3f6fb;          /* menu lateral e janela principal */
  --janela-topo: #f9fbfd;
  --superficie: #ffffff;      /* cartões */
  --superficie-2: #f4f7fd;    /* cartão sob o ponteiro */
  --poco: #e7ecf5;            /* campos, trilhos e ícones afundados */
  --pilula: #ffffff;
  --linha: rgba(20, 26, 60, 0.09);

  /* Texto */
  --texto: #1c2244;           /* corrente */
  --texto-forte: #0e1330;     /* títulos e realces */
  --texto-2: #4a5273;         /* secundário */
  --texto-3: #69718f;         /* apoio (contraste AA em branco e em gelo) */

  /* Sombras: luz no canto superior esquerdo, sombra no inferior direito */
  --relevo-alto: 18px 18px 40px rgba(24, 32, 72, 0.13), -12px -12px 30px rgba(255, 255, 255, 0.95);
  --relevo: 10px 10px 24px rgba(24, 32, 72, 0.10), -8px -8px 20px rgba(255, 255, 255, 0.92);
  --relevo-leve: 5px 5px 14px rgba(24, 32, 72, 0.08), -4px -4px 10px rgba(255, 255, 255, 0.88);
  --afundado: inset 5px 5px 12px rgba(24, 32, 72, 0.10), inset -4px -4px 10px rgba(255, 255, 255, 0.95);
  --afundado-leve: inset 3px 3px 8px rgba(24, 32, 72, 0.08), inset -2px -2px 6px rgba(255, 255, 255, 0.9);
  --sombra-janela: var(--relevo-alto);
  --sombra-flutuante: 0 18px 44px -14px rgba(24, 32, 72, 0.3);

  /* Cores dos anéis (foscas, legíveis sobre branco) */
  --anel-1: #dd9220;
  --anel-2: #5560b8;
  --anel-3: #2f8a7b;

  /* ---- Encaixe do painel do Power BI -----------------------------------
     O Power BI desenha o relatório no modo "ajustar à página": ele mantém a
     proporção original e preenche o resto de branco. Para não aparecer faixa
     branca, a moldura do painel é recortada na MESMA proporção do relatório
     (nada é esticado; o que sobra fica com o fundo da janela).

     --razao-painel   = largura ÷ altura da página do relatório.
                        Medido nos painéis da Prefeitura: 1600 × 873 = 1.8326.
                        16:9 = 1.7778 · 16:10 = 1.6 · 4:3 = 1.3333.
                        Cada painel pode ter o seu valor: veja "proporcao"
                        em assets/js/catalogo.js.
     --barra-powerbi  = altura da barra inferior do Power BI (logo, páginas
                        e zoom), que não faz parte do relatório.
     Se ainda sobrar faixa branca DOS LADOS, aumente --razao-painel;
     se sobrar EM CIMA e EMBAIXO, diminua.                                  */
  --razao-painel: 1.8326;
  --barra-powerbi: 60px;

  /* Forma e espaço */
  --raio-janela: 28px;
  --raio-cartao: 22px;
  --raio-controle: 14px;
  --espaco: 12px;
  --largura-lateral: 316px;
  --largura-trilho: 84px;

  /* Tipografia */
  --fonte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Movimento */
  --suave: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;
}

/* 3. Base ================================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--fundo);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden; /* a rolagem acontece dentro das janelas */
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01"; /* Inter: dígitos e "a" mais legíveis */
  background:
    radial-gradient(90vmax 70vmax at 12% -10%, rgba(255, 255, 255, 0.9), transparent 62%),
    linear-gradient(160deg, #f2f5fb 0%, var(--fundo) 55%, #dfe5f0 100%);
}

/* Painéis de parede sutis, como o fundo do UI.png */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(20, 26, 60, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 26, 60, 0.05) 1px, transparent 1px);
  background-size: 128px 128px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 0%, rgba(0, 0, 0, 0.3) 55%, transparent 80%);
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 0%, rgba(0, 0, 0, 0.3) 55%, transparent 80%);
}

img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; }

::selection { background: rgba(240, 160, 42, 0.35); color: var(--texto-forte); }

:focus-visible {
  outline: 2px solid var(--ambar-texto);
  outline-offset: 2px;
}
[tabindex="-1"]:focus { outline: none; }

/* 4. Utilidades =========================================================== */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icone {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pular-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ambar-400);
  color: var(--azul-950);
  box-shadow: var(--sombra-flutuante);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s var(--suave);
}
.pular-link:focus { transform: none; }

.vidro {
  background: linear-gradient(165deg, var(--janela-topo) 0%, var(--janela) 60%, #eef2f9 100%);
  border: 0;
  border-radius: var(--raio-janela);
  box-shadow: var(--relevo-alto);
}

.botao-icone {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pilula);
  box-shadow: var(--relevo-leve);
  color: var(--texto);
  transition: box-shadow 0.2s, color 0.2s;
}
.botao-icone:hover { color: var(--texto-forte); box-shadow: var(--relevo); }
.botao-icone:active { box-shadow: var(--afundado-leve); }

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--pilula);
  box-shadow: var(--relevo);
  color: var(--texto);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.2s var(--suave), box-shadow 0.2s;
}
.botao:hover { box-shadow: var(--relevo-alto); }
.botao:active { transform: scale(0.98); box-shadow: var(--afundado-leve); }
.botao .icone { width: 18px; height: 18px; }

.botao--destaque {
  background: var(--ambar-400);
  color: #24190a;
  box-shadow: 8px 8px 20px rgba(184, 120, 20, 0.28), -5px -5px 14px rgba(255, 255, 255, 0.9);
}
.botao--destaque:hover { background: var(--ambar-300); }

mark {
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(240, 160, 42, 0.32);
  color: var(--texto-forte);
}

/* 5. Estrutura ============================================================ */
.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--largura-lateral) minmax(0, 1fr);
  gap: var(--espaco);
  height: 100vh;
  height: 100dvh;
  padding: var(--espaco);
  transition: grid-template-columns 0.35s var(--suave);
}
.app[data-menu="recolhido"] { grid-template-columns: var(--largura-trilho) minmax(0, 1fr); }

.corpo {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.principal {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(28, 34, 68, 0.22) transparent;
  outline: none;
}
.app[data-vista="painel"] .principal { overflow: hidden; padding: 10px; }

/* 6. Menu lateral ========================================================= */
.lateral {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: border-radius 0.35s var(--suave);
}

.lateral__marca {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 18px;
}

.marca {
  display: block;
  border-radius: 12px;
  transition: opacity 0.2s;
}
.marca:hover { opacity: 0.88; }
.marca__logo { width: 236px; height: auto; }
.marca__simbolo { display: none; width: 50px; height: auto; }

.lateral__fechar { display: none; position: absolute; top: 16px; right: 16px; }

/* Busca */
.busca { position: relative; margin: 0 16px 10px; }
.busca__icone {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--texto-3);
  transform: translateY(-50%);
  pointer-events: none;
}
.busca__campo {
  width: 100%;
  height: 46px;
  padding: 0 40px;
  border: 0;
  border-radius: 14px;
  background: var(--poco);
  box-shadow: var(--afundado);
  font-size: 14px;
  transition: box-shadow 0.2s, background-color 0.2s;
}
.busca__campo::placeholder { color: var(--texto-3); opacity: 1; }
.busca__campo:focus {
  outline: none;
  box-shadow: var(--afundado), 0 0 0 2px rgba(224, 160, 68, 0.55);
}
.busca__atalho {
  position: absolute;
  top: 50%;
  right: 12px;
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  background: var(--pilula);
  box-shadow: var(--relevo-leve);
  color: var(--texto-3);
  font: 600 11px/1 var(--fonte);
  transform: translateY(-50%);
  pointer-events: none;
  transition: opacity 0.15s;
}
.busca__campo:focus ~ .busca__atalho,
.busca__campo:not(:placeholder-shown) ~ .busca__atalho { opacity: 0; }
.busca__trilho { display: none; }

/* Navegação */
.lateral__nav {
  flex: 1;
  min-height: 0;
  padding: 6px 12px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(28, 34, 68, 0.2) transparent;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__grupo {
  margin: 18px 10px 10px;
  color: var(--texto-3);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.lateral__nav.is-buscando .nav--fixo,
.lateral__nav.is-buscando .nav__grupo { display: none; }

.nav__secao {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 6px 12px 6px 6px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--texto-2);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.nav__secao:hover { background: var(--superficie); box-shadow: var(--relevo-leve); color: var(--texto-forte); }
.nav__secao[aria-expanded="true"] { background: var(--superficie); color: var(--texto-forte); }
.nav__secao[aria-current="page"] {
  background: var(--superficie);
  box-shadow: var(--relevo);
  color: var(--texto-forte);
  font-weight: 600;
}

.nav__icone {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--poco);
  box-shadow: var(--afundado-leve);
  color: var(--texto-2);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.nav__icone .icone { width: 18px; height: 18px; }
.nav__item.is-ativo > .nav__secao .nav__icone {
  background: var(--ambar-400);
  color: #24190a;
  box-shadow: 4px 4px 10px rgba(184, 120, 20, 0.35), inset -2px -2px 6px rgba(160, 100, 10, 0.25);
}

.nav__rotulo {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav__contagem {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--poco);
  box-shadow: var(--afundado-leve);
  color: var(--texto-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.nav__seta {
  width: 16px;
  height: 16px;
  color: var(--texto-3);
  transition: transform 0.25s var(--suave);
}
.nav__secao[aria-expanded="true"] .nav__seta { transform: rotate(180deg); }

/* Dropdown com animação de altura (grid 0fr → 1fr) */
.nav__painel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.28s var(--suave), visibility 0s linear 0.28s;
}
.nav__secao[aria-expanded="true"] + .nav__painel {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.28s var(--suave), visibility 0s;
}
.nav__painel-interno { min-height: 0; overflow: hidden; }

.nav__sub {
  position: relative;
  margin: 0;
  padding: 6px 0 8px;
  list-style: none;
}
.nav__sub::before { /* linha-guia, como a linha de conversa do UI.png */
  content: "";
  position: absolute;
  top: 4px;
  bottom: 14px;
  left: 24px;
  width: 1px;
  background: linear-gradient(rgba(28, 34, 68, 0.16), rgba(28, 34, 68, 0.04));
}

.nav__link {
  position: relative;
  display: block;
  margin-left: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--texto-2);
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.nav__link::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -15.5px;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(28, 34, 68, 0.18);
  border-radius: 50%;
  background: var(--poco);
  transform: translate(-50%, -50%);
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.nav__link:hover { background: var(--superficie); color: var(--texto-forte); }
.nav__link[aria-current="page"] {
  background: var(--superficie);
  box-shadow: var(--relevo-leve);
  color: var(--texto-forte);
  font-weight: 600;
}
.nav__link[aria-current="page"]::before {
  border-color: var(--ambar-400);
  background: var(--ambar-400);
  box-shadow: 0 0 0 4px rgba(240, 160, 42, 0.22);
}

.nav__vazio { margin: 14px 10px; color: var(--texto-3); font-size: 14px; }

.lateral__rodape { padding: 10px 12px 14px; border-top: 1px solid var(--linha); }

.botao-recolher {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 6px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--texto-2);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}
.botao-recolher:hover { background: var(--superficie); box-shadow: var(--relevo-leve); color: var(--texto-forte); }
.botao-recolher .icone { transition: transform 0.3s var(--suave); }

/* 7. Menu recolhido: trilho flutuante de ícones (desktop) ================= */
.app[data-menu="recolhido"] .lateral { border-radius: 42px; }
.app[data-menu="recolhido"] .lateral__marca { padding: 20px 8px 12px; }
.app[data-menu="recolhido"] .marca__logo { display: none; }
.app[data-menu="recolhido"] .marca__simbolo { display: block; }

.app[data-menu="recolhido"] .busca { display: flex; justify-content: center; margin: 0 0 6px; }
.app[data-menu="recolhido"] .busca__campo,
.app[data-menu="recolhido"] .busca__icone,
.app[data-menu="recolhido"] .busca__atalho { display: none; }
.app[data-menu="recolhido"] .busca__trilho {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--poco);
  box-shadow: var(--afundado-leve);
  color: var(--texto-2);
  transition: box-shadow 0.2s, color 0.2s;
}
.app[data-menu="recolhido"] .busca__trilho:hover { box-shadow: var(--relevo-leve); color: var(--texto-forte); background: var(--superficie); }

.app[data-menu="recolhido"] .lateral__nav { padding: 4px 0 12px; scrollbar-width: none; }
.app[data-menu="recolhido"] .lateral__nav::-webkit-scrollbar { display: none; }
.app[data-menu="recolhido"] .nav { align-items: center; gap: 4px; }
.app[data-menu="recolhido"] .nav__secao {
  justify-content: center;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border-color: transparent;
  border-radius: 50%;
  background: transparent;
}
.app[data-menu="recolhido"] .nav__secao:hover,
.app[data-menu="recolhido"] .nav__secao[aria-current="page"] { background: var(--superficie-2); box-shadow: var(--relevo-leve); }
.app[data-menu="recolhido"] .nav__rotulo {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.app[data-menu="recolhido"] .nav__contagem,
.app[data-menu="recolhido"] .nav__seta,
.app[data-menu="recolhido"] .nav__painel { display: none; }
.app[data-menu="recolhido"] .nav__grupo {
  width: 28px;
  height: 1px;
  margin: 10px auto;
  overflow: hidden;
  background: rgba(28, 34, 68, 0.14);
  color: transparent;
}
.app[data-menu="recolhido"] .lateral__rodape { border-top-color: transparent; }
.app[data-menu="recolhido"] .botao-recolher {
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  padding: 0;
  border-radius: 50%;
}
.app[data-menu="recolhido"] .botao-recolher .icone { transform: scaleX(-1); }
.app[data-menu="recolhido"] .botao-recolher__texto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* 8. Barra superior ======================================================= */
.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px 8px 20px;
  border-bottom: 1px solid var(--linha);
}
.app[data-vista="inicio"] .topo { display: none; }
.topo__menu { display: none; }

.topo__titulos { flex: 1; min-width: 0; }

.migalhas ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--texto-3);
  font-size: 11.5px;
  font-weight: 500;
  list-style: none;
}
.migalhas__item + .migalhas__item::before { content: "›"; margin-right: 6px; }
.migalhas a { color: var(--texto-2); text-decoration: none; }
.migalhas a:hover { color: var(--texto-forte); text-decoration: underline; text-underline-offset: 3px; }

.topo__titulo {
  margin: 1px 0 0;
  overflow: hidden;
  font-size: clamp(17px, 1.3vw, 20px);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acoes { display: flex; flex: none; align-items: center; gap: 8px; margin-left: auto; }

.acao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--pilula);
  box-shadow: var(--relevo-leve);
  color: var(--texto-2);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 0.2s, color 0.2s, transform 0.2s var(--suave);
}
.acao:hover { box-shadow: var(--relevo); color: var(--texto-forte); }
.acao:active { transform: scale(0.97); box-shadow: var(--afundado-leve); }
.acao .icone { width: 18px; height: 18px; }
.acao--destaque {
  background: var(--ambar-400);
  color: #24190a;
  font-weight: 600;
  box-shadow: 6px 6px 16px rgba(184, 120, 20, 0.3), -4px -4px 12px rgba(255, 255, 255, 0.9);
}
.acao--destaque:hover { background: var(--ambar-300); color: #24190a; }

/* 9. Página inicial ======================================================
   Linguagem do "inicio.png" (soft UI): superfícies foscas, sombra dupla
   (luz em cima à esquerda, sombra embaixo à direita), poços afundados para
   campos, ícones e trilhos, e anéis de progresso. Sem vidro e sem brilho.
   ========================================================================= */
.vista--inicio {
  container-type: inline-size;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(22px, 2.4vw, 40px) clamp(20px, 2.4vw, 40px) 28px;
}

/* Cartão em relevo — base de toda a página */
.resumo__item,
.cartao,
.bloco {
  border-radius: 26px;
  background: var(--superficie);
  box-shadow: var(--relevo);
}

/* Poço: usado em ícones, molduras e trilhos */
.poco {
  background: var(--poco);
  box-shadow: var(--afundado);
}

/* ---- Abertura ---- */
.abertura {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: clamp(22px, 2.4vw, 34px);
}
.abertura__local {
  margin: 0 0 10px;
  color: var(--ambar-texto);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.abertura__titulo {
  margin: 0;
  font-size: clamp(25px, 2.7vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.abertura__descricao {
  max-width: 62ch;
  margin: 12px 0 0;
  color: var(--texto-2);
  font-size: 14.5px;
  line-height: 1.65;
  text-wrap: pretty;
}
/* moldura afundada da marca ("imagem funda") */
.abertura__moldura {
  display: grid;
  place-items: center;
  flex: none;
  padding: 22px 26px;
  border-radius: 24px;
  background: var(--poco);
  box-shadow: var(--afundado);
}
.abertura__logo { width: 196px; height: auto; opacity: 0.9; }

/* ---- Três números do topo ---- */
.resumo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.resumo__item { padding: 22px 24px 20px; }
.resumo__item--atalho { padding: 0; transition: box-shadow 0.25s var(--suave), transform 0.25s var(--suave); }
.resumo__item--atalho:hover { transform: translateY(-2px); box-shadow: var(--relevo-alto); }
.resumo__link {
  display: block;
  padding: 22px 24px 20px;
  border-radius: inherit;
  text-decoration: none;
}
.resumo__icone {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--poco);
  box-shadow: var(--afundado-leve);
  color: var(--ambar-texto);
}
.resumo__icone .icone { width: 18px; height: 18px; }
.resumo__item--atalho .resumo__icone { color: var(--anel-2); }
.resumo__rotulo {
  display: block;
  margin: 0;
  color: var(--texto-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.resumo__valor {
  display: block;
  margin: 4px 0 0;
  color: var(--texto-forte);
  font-size: clamp(30px, 3.1vw, 40px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.resumo__item--atalho .resumo__valor { font-size: clamp(23px, 2.2vw, 30px); }
.resumo__nota { display: block; margin: 8px 0 0; color: var(--texto-3); font-size: 12.5px; }

/* ---- Duas colunas ---- */
.colunas {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  align-items: start;
  gap: 18px;
}
@container (max-width: 1000px) {
  .colunas { grid-template-columns: minmax(0, 1fr); }
}

.cabecalho-secao {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 8px 4px 16px;
}
.cabecalho-secao__titulo {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.01em;
  scroll-margin-top: 20px;
}
.cabecalho-secao__nota { margin: 0; color: var(--texto-3); font-size: 12.5px; }
.cabecalho-secao__nota::before { content: "·"; margin-right: 10px; color: var(--texto-3); }

/* ---- Cartões de tema ---- */
.grade-temas {
  columns: 300px 2;      /* empacota os cartões sem deixar buracos */
  column-gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.grade-temas > .cartao {
  break-inside: avoid;
  margin-bottom: 18px;
  padding: 20px 20px 16px;
  transition: box-shadow 0.25s var(--suave), transform 0.25s var(--suave);
}
.cartao:hover { transform: translateY(-2px); box-shadow: var(--relevo-alto); }
.cartao.is-destacado { box-shadow: var(--relevo-alto), 0 0 0 2px var(--ambar-400); }

.cartao__topo {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.cartao__icone {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--poco);
  box-shadow: var(--afundado-leve);
  color: var(--cor-anel, var(--ambar-texto));
}
.cartao__icone .icone { width: 19px; height: 19px; }
.cartao__titulo { margin: 0; font-size: 15.5px; font-weight: 650; letter-spacing: -0.005em; }
.cartao__meta { margin: 3px 0 0; color: var(--texto-3); font-size: 12px; }

/* anel de proporção (quantos painéis o tema tem, comparado ao maior) */
.anel { position: relative; width: 52px; height: 52px; flex: none; }
.anel__grafico { width: 100%; height: 100%; transform: rotate(-90deg); }
.anel__trilho { fill: none; stroke: rgba(28, 34, 68, 0.12); stroke-width: 6; }
.anel__valor {
  fill: none;
  stroke: var(--cor-anel, var(--ambar-400));
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--suave);
}
.anel__numero {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--texto-forte);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cartao__lista { margin: 0; padding: 0; list-style: none; }
.cartao__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--texto-2);
  font-size: 13.5px;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.cartao__link .icone {
  width: 15px;
  height: 15px;
  color: var(--cor-anel, var(--ambar-400));
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.cartao__link:hover,
.cartao__link:focus-visible {
  background: var(--superficie-2);
  box-shadow: var(--relevo-leve);
  color: var(--texto-forte);
}
.cartao__link:hover .icone,
.cartao__link:focus-visible .icone { opacity: 1; transform: none; }

.cartao__mais {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--poco);
  box-shadow: var(--afundado-leve);
  color: var(--texto-2);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  transition: color 0.2s, box-shadow 0.2s;
}
.cartao__mais:hover { color: var(--texto-forte); box-shadow: var(--relevo-leve); background: var(--superficie-2); }

/* ---- Coluna lateral ---- */
.coluna-lateral { display: grid; gap: 18px; }
.bloco { padding: 22px 22px 20px; }
.bloco__titulo {
  margin: 0 0 18px;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.barras { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.barra__botao {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  width: 100%;
  padding: 6px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--texto-2);
  font-size: 12.5px;
  text-align: left;
  transition: color 0.2s;
}
.barra__botao:hover { color: var(--texto-forte); }
.barra__nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra__valor { color: var(--texto-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.barra__trilho {
  grid-column: 1 / -1;
  height: 8px;
  border-radius: 999px;
  background: var(--poco);
  box-shadow: var(--afundado-leve);
  overflow: hidden;
}
.barra__preenchimento {
  display: block;
  width: var(--proporcao, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cor-anel, var(--ambar-400)), color-mix(in srgb, var(--cor-anel, var(--ambar-400)) 70%, #fff));
}

.passos {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}
.passos li {
  position: relative;
  padding-left: 38px;
  color: var(--texto-2);
  font-size: 13px;
  line-height: 1.6;
}
.passos li::before {
  counter-increment: passo;
  content: counter(passo);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--poco);
  box-shadow: var(--afundado-leve);
  color: var(--ambar-texto);
  font-size: 12px;
  font-weight: 700;
}
.passos strong { color: var(--texto-forte); font-weight: 600; }

/* ---- Rodapé ---- */
.rodape {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 32px;
  padding: 20px 58px 0 4px;
  border-top: 1px solid var(--linha);
  color: var(--texto-3);
  font-size: 12px;
}
.rodape p { margin: 0; }
.rodape__marcas { display: flex; align-items: center; gap: 16px; flex: none; }
.rodape__marca { width: 36px; height: auto; opacity: 0.85; }
.rodape__marca + .rodape__semec { padding-left: 16px; border-left: 1px solid var(--linha); }
.rodape__semec { width: auto; height: 38px; }
.rodape__texto { line-height: 1.5; }
.rodape__orgao { display: block; color: var(--texto-2); font-weight: 600; }
.rodape__orgao + .rodape__orgao { font-weight: 500; }
.rodape p.rodape__nota { margin-left: auto; }

@container (max-width: 560px) {
  .rodape p.rodape__nota { margin-left: 0; }
}

@container (max-width: 700px) {
  .abertura__moldura { display: none; }
}

/* 10. Área do painel ====================================================== */
.vista--painel { height: 100%; }

.palco-moldura {
  position: relative;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  border-radius: 18px;
  background: transparent; /* sem fundo branco: o que sobra é o fundo da janela */
}
.palco-moldura:fullscreen { border-radius: 0; background: var(--fundo); padding: 0; }
.palco-moldura::backdrop { background: var(--fundo); }

.palco { position: absolute; inset: 0; }

/* O relatório e o esqueleto de carregamento ocupam a mesma caixa, centralizada.
   Sem suporte a container queries, tudo volta a preencher a área inteira. */
.palco__iframe,
.carregando {
  position: absolute;
  inset: 0 0 auto 0;
  margin: 0 auto; /* encosta no topo e centraliza na horizontal */
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--relevo-alto);
}

@supports (container-type: size) {
  .palco { container-type: size; }

  /* Recorta a moldura na proporção do relatório:
     - limitada pela largura  → altura = largura ÷ razão + barra do Power BI
     - limitada pela altura   → largura = (altura − barra) × razão            */
  .palco__iframe,
  .carregando {
    width: min(100cqw, calc((100cqh - var(--barra-powerbi)) * var(--razao-painel)));
    height: min(100cqh, calc(100cqw / var(--razao-painel) + var(--barra-powerbi)));
  }
}

.palco__iframe {
  background: #fff;
  visibility: hidden;
}
.palco__iframe.is-ativo { visibility: visible; }

.carregando {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px;
  background: #f4f5fa;
  color: #2b2e5c;
}
.carregando__texto {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.carregando__texto::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(20, 20, 60, 0.18);
  border-top-color: var(--ambar-500);
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
}

.esqueleto { display: grid; gap: 14px; width: min(88%, 1000px); }
.esqueleto__linha { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.esqueleto__linha--grande { grid-template-columns: 2fr 1fr; }
.esqueleto__barra,
.esqueleto__bloco {
  display: block;
  border-radius: 12px;
  background: linear-gradient(90deg, #e5e7f1 0%, #f2f3f8 40%, #e5e7f1 80%);
  background-size: 200% 100%;
  animation: brilho 1.4s ease-in-out infinite;
}
.esqueleto__barra { width: 40%; height: 28px; border-radius: 8px; }
.esqueleto__bloco { height: 84px; }
.esqueleto__linha--grande .esqueleto__bloco { height: clamp(120px, 32vh, 340px); }

.aviso {
  position: absolute;
  bottom: 24px;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 18px;
  width: min(92%, 560px);
  padding: 18px 20px;
  border: 0;
  border-radius: 20px;
  background: var(--superficie);
  box-shadow: var(--relevo-alto);
  color: var(--texto-2);
  font-size: 14px;
  text-align: center;
  transform: translateX(-50%);
  animation: surgir 0.3s var(--suave);
}
.aviso p { margin: 0; }
.aviso strong { color: var(--texto-forte); }

/* 11. Página 404 ========================================================== */
.vista--vazia { display: grid; place-items: center; min-height: 100%; padding: 32px 20px; }
.estado-vazio { max-width: 460px; text-align: center; }
.estado-vazio__codigo {
  margin: 0;
  background: linear-gradient(180deg, var(--texto-forte), rgba(28, 34, 68, 0.35));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 84px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.estado-vazio h1 { margin: 10px 0 8px; font-size: 24px; }
.estado-vazio p { margin: 0 0 24px; color: var(--texto-2); }

/* 12. Elementos flutuantes ================================================ */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 26, 60, 0.42);
  animation: aparecer 0.25s ease-out;
}

.dica-flutuante {
  position: fixed;
  z-index: 90;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--texto-forte);
  box-shadow: var(--sombra-flutuante);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-50%);
  animation: aparecer 0.15s ease-out;
}

.voltar-topo {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--superficie);
  box-shadow: var(--relevo);
  color: var(--texto-2);
  animation: surgir 0.25s var(--suave);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.voltar-topo:hover { background: var(--ambar-400); color: #24190a; box-shadow: var(--relevo-alto); }

.sem-js {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 300;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--superficie);
  box-shadow: var(--sombra-flutuante);
  color: var(--texto);
}

@keyframes girar { to { transform: rotate(360deg); } }
@keyframes brilho { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes aparecer { from { opacity: 0; } }
@keyframes surgir { from { opacity: 0; transform: translate(var(--surgir-x, 0), 10px); } }
.aviso { --surgir-x: -50%; }

/* 13. Responsivo ========================================================== */

/* Tablets e celulares: menu vira gaveta */
@media (max-width: 1023.98px) {
  :root { --raio-janela: 22px; }

  .app,
  .app[data-menu="recolhido"] {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .lateral {
    position: fixed;
    top: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 50;
    width: min(340px, calc(100vw - 48px));
    background: linear-gradient(165deg, var(--janela-topo), var(--janela));
    transform: translateX(calc(-100% - 24px));
    visibility: hidden;
    transition: transform 0.32s var(--suave), visibility 0s linear 0.32s;
  }
  .app.gaveta-aberta .lateral {
    transform: none;
    visibility: visible;
    transition: transform 0.32s var(--suave), visibility 0s;
  }
  .lateral__marca { justify-content: flex-start; padding: 20px 72px 16px 20px; }
  .marca__logo { width: 210px; }
  .lateral__fechar { display: grid; }
  .lateral__rodape,
  .busca__atalho { display: none; }

  .topo { min-height: 52px; padding: 6px 10px; gap: 8px; }
  .app[data-vista="inicio"] .topo { display: flex; }
  .topo__menu { display: grid; }

  .app[data-vista="painel"] .principal { padding: 6px; }
  .palco-moldura { border-radius: 14px; }
  .palco__iframe,
  .carregando { border-radius: 12px; }
}

/* Em telas estreitas a barra do Power BI quebra em duas linhas */
@media (max-width: 900px) {
  :root { --barra-powerbi: 84px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .acoes { gap: 6px; }
  .acao,
  .acao--destaque { width: 40px; padding: 0; }
  .acao .acao__texto {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .vista--inicio { padding: 20px 16px 24px; }
  .abertura { flex-direction: column; align-items: flex-start; gap: 18px; }
  .abertura__logo { width: 170px; }
  .resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .resumo__item--atalho { grid-column: 1 / -1; }
  .resumo__item { padding: 18px 18px 16px; }
  .resumo__link { padding: 18px 18px 16px; }
  .resumo__icone { width: 34px; height: 34px; margin-bottom: 12px; }
  .resumo__valor { font-size: 27px; }
  .bloco { padding: 20px 18px 18px; }
  .grade-temas > .cartao { padding: 18px 16px 14px; }
  .rodape { padding-right: 4px; }
  .esqueleto__linha { grid-template-columns: repeat(2, 1fr); }
  .esqueleto__linha--grande { grid-template-columns: 1fr; }
  .voltar-topo { right: 14px; bottom: 14px; }
}

/* 14. Acessibilidade e preferências ======================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Alto contraste do Windows */
@media (forced-colors: active) {
  .nav__secao,
  .nav__link,
  .acao,
  .botao,
  .cartao,
  .cartao__link,
  .busca__campo { border: 1px solid CanvasText; }
  .nav__secao[aria-current="page"],
  .nav__link[aria-current="page"] { outline: 2px solid Highlight; }
  .marca__logo,
  .marca__simbolo,
  .abertura__logo { forced-color-adjust: none; }
  .resumo__item,
  .cartao,
  .bloco,
  .vidro { border: 1px solid CanvasText; }
}

@media print {
  body { overflow: visible; background: #fff; color: #000; }
  body::before,
  .lateral,
  .topo__menu,
  .acoes,
  .voltar-topo,
  .scrim { display: none !important; }
  .app { display: block; height: auto; padding: 0; }
  .vidro { background: none; border: 0; box-shadow: none; }
}

/* Com o aviso de lentidão aberto, o texto "Carregando" some para não sobrepor */
.palco:has(.aviso:not([hidden])) .carregando__texto { visibility: hidden; }
