/*
 * Estilos do portal que não são classes do Tailwind (01-tailwind.css).
 * O Dash carrega os arquivos de assets/ em ordem alfabética.
 */

:root {
  --foreground-rgb: 15, 23, 42;
  --background-rgb: 248, 250, 252;
}

html {
  scroll-behavior: smooth;
}

body {
  color: rgb(var(--foreground-rgb));
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  background-image: linear-gradient(rgba(248, 250, 252, 0.2), rgba(248, 250, 252, 0.2)), url('img/fundo ufpr.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

/* Ícones (portal/ui/icones.py): o SVG vira máscara e a cor é a do texto */
.icone {
  display: inline-block;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: var(--icone) center / contain no-repeat;
  mask: var(--icone) center / contain no-repeat;
}

/* ------------------------------------------------------------------ */
/* Campos do Dash (dcc.Input): o Dash 4 envolve o <input> numa div.     */
/* A classe passada em className fica na div; o visual vai no <input>.  */
/* ------------------------------------------------------------------ */
.campo {
  display: block;
  position: relative;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: auto !important;
}
.campo .dash-input-stepper {
  display: none !important;
}
.campo .dash-input-element {
  width: 100%;
  font: inherit;
  color: inherit;
  outline: none;
  -moz-appearance: textfield;
}
.campo .dash-input-element::-webkit-outer-spin-button,
.campo .dash-input-element::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Campo de ano (YearRangeSlider) */
.campo-ano .dash-input-element {
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: #1e293b;
  background: #fff;
}

/* Busca da tabela e busca dentro do filtro de lista */
.campo-busca .dash-input-element {
  padding: 4px 8px 4px 28px;
  font-size: 12px;
  line-height: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  color: #1e293b;
}
.campo-busca .dash-input-element:focus {
  box-shadow: 0 0 0 2px #003865;
}
.campo-busca-lista .dash-input-element {
  padding: 6px 28px 6px 32px;
}

/* Controle deslizante duplo de anos */
.campo-faixa {
  position: absolute !important;
  inset: 0;
  pointer-events: none;
}
.campo-faixa .dash-input-element,
.year-range-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}
.campo-faixa .dash-input-element::-webkit-slider-runnable-track {
  background: transparent;
}
.campo-faixa .dash-input-element::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 0;
  background: #fff;
  border: 2px solid #1f5fa8;
  cursor: pointer;
}
.campo-faixa .dash-input-element::-moz-range-thumb {
  pointer-events: auto;
  width: 14px;
  height: 14px;
  border-radius: 0;
  background: #fff;
  border: 2px solid #1f5fa8;
  cursor: pointer;
}
.campo-faixa .dash-input-element::-moz-range-track {
  background: transparent;
}

/*
 * Grade de gráficos da primeira tela: os cartões mantêm proporção 4:3
 * (nunca esticam para a tela toda) e o conjunto fica centralizado na área.
 * --chart-max-h limita a altura para tudo caber na primeira tela.
 */
@media (min-width: 1024px) {
  .chart-grid {
    flex: 0 0 auto;
  }
  .chart-grid > section {
    aspect-ratio: 4 / 3;
    width: 100%;
    justify-self: stretch;
    height: auto;
    max-height: var(--chart-max-h);
  }
  /* Em duas linhas os cartões ficam mais largos que altos */
  .chart-rows-2 > section {
    aspect-ratio: 16 / 9;
  }
  .chart-rows-1 {
    --chart-max-h: calc(100vh - 215px);
  }
  .chart-rows-2 {
    --chart-max-h: calc((100vh - 235px) / 2);
  }
  /* Três gráficos: dois em cima e o terceiro na largura toda, embaixo */
  .chart-trio > section:last-child {
    grid-column: 1 / -1;
  }
  /* Cinco gráficos: três em cima (4:3) e dois embaixo (16:9) */
  .chart-cinco {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .chart-cinco > section {
    grid-column: span 3;
  }
  .chart-cinco > section:nth-child(-n + 3) {
    grid-column: span 2;
    aspect-ratio: 4 / 3;
  }
}

/* Cantos retos em cartões, botões, filtros, tooltips e controles */
.cantos-retos [class*='rounded'] {
  border-radius: 0 !important;
}

/* Coluna de filtros em painel único: os filtros viram seções separadas por linha */
.painel-filtros > div {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0 0 12px;
  border-bottom: 1px solid #e5e9f0;
}

/* Números alinhados em tabelas e eixos */
table td {
  font-variant-numeric: tabular-nums;
}

/* Abas dos painéis: a foto da UFPR fica bem suave para não competir com os dados */
.bg-ufpr-page {
  background-color: #f1f4f8;
  background-image: linear-gradient(rgba(241, 244, 248, 0.9), rgba(241, 244, 248, 0.9)), url('img/fundo ufpr.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

/* Gráficos Plotly ocupam todo o corpo do cartão */
.grafico,
.grafico .js-plotly-plot,
.grafico .plot-container {
  width: 100%;
  height: 100%;
}
/* Tooltip do Plotly com cantos retos e sombra suave (como no Recharts) */
.grafico .hoverlayer .hovertext path {
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, 0.12));
}

/* Enquanto o Dash atualiza um painel, nada de "piscar" */
._dash-loading {
  display: none;
}

/* ------------------------------------------------------------------ */
/* Métricas Globais (portal/paineis/metricas_globais.py): faixa com os   */
/* 8 indicadores, como na tela do Power BI. A foto fica mais visível    */
/* que nas abas, porque esta tela é de apresentação.                    */
/* ------------------------------------------------------------------ */
.metricas-globais {
  background-color: #eef2f7;
  background-image: linear-gradient(rgba(241, 245, 249, 0.35), rgba(241, 245, 249, 0.35)), url('img/fundo ufpr.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.mg-titulo-sub {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  letter-spacing: -0.01em;
}
.mg-corpo {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 0;
}
.mg-faixa {
  padding: 32px 16px;
  background: linear-gradient(180deg, rgba(0, 56, 101, 0.2), rgba(15, 23, 42, 0.26));
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}
.mg-grade {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}
.mg-metrica {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.55), 0 8px 20px rgba(15, 23, 42, 0.12);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.mg-azul {
  background: rgba(172, 199, 238, 0.92);
}
.mg-branco {
  background: rgba(255, 255, 255, 0.86);
}
.mg-rotulo {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 500;
  color: #334155;
}
.mg-valor {
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  color: #003865;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .mg-grade {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mg-titulo-sub {
    display: none;
  }
}
@media (max-width: 640px) {
  .mg-faixa {
    padding: 24px 16px;
  }
  .mg-grade {
    gap: 12px;
  }
  .mg-metrica {
    min-height: 120px;
    padding: 16px;
  }
  .mg-rotulo {
    font-size: 14px;
  }
  .mg-valor {
    font-size: 24px;
  }
}

/* ------------------------------------------------------------------ */
/* "Sobre os dados" de cada painel: botão do menu de abas (ui/menu.py), */
/* link no rodapé das abas (ui/layout.py) e da Métricas Globais, e a    */
/* página /documentacao/<painel> (portal/documentacao.py), que exibe o  */
/* Markdown de docs/metadados/<painel>.md com um sumário ao lado.       */
/* ------------------------------------------------------------------ */
/* Rodapé das abas (ui/layout.shell): Fonte/Elaboração no centro, "Sobre os dados" à
   esquerda e "Ver tabela de dados" à direita. No celular a tabela vem logo abaixo, então
   só "Sobre os dados" aparece, abaixo da fonte. */
.rodape-aba {
  font-size: 12px;
  padding: 4px 16px 10px;
}
.botao-rodape {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid #003865;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  color: #003865;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.15s;
}
.botao-rodape:hover {
  background: #e6f0fa;
}
.botao-rodape .icone {
  width: 16px;
  height: 16px;
}
.botao-rodape-dir {
  display: none;
}
@media (min-width: 1024px) {
  .botao-rodape {
    position: absolute;
    bottom: 10px;
    margin-top: 0;
  }
  .botao-rodape-esq {
    left: 16px;
  }
  .botao-rodape-dir {
    display: inline-flex;
    right: 16px;
  }
}
.doc-pagina {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 16px;
}
.doc-grade {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (min-width: 1024px) {
  .doc-grade {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 24px;
  }
}
.doc-sumario {
  background: #fff;
  border: 1px solid #d9d9d9;
  padding: 14px 16px;
}
@media (min-width: 1024px) {
  .doc-sumario {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
  }
}
.doc-sumario-titulo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}
.doc-sumario ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.doc-sumario a {
  display: block;
  padding: 5px 8px;
  border-left: 3px solid transparent;
  color: #003865;
  font-size: 13px;
  line-height: 1.35;
}
.doc-sumario a:hover {
  background: #e6f0fa;
  border-left-color: #1f5fa8;
}
.doc-cartao {
  background: #fff;
  border: 1px solid #d9d9d9;
  padding: 28px 32px;
}
@media (max-width: 640px) {
  .doc-cartao {
    padding: 20px 16px;
  }
}
/* Desconta o cabeçalho fixo (cerca de 80 px no computador e 130 px no celular) */
.doc-secao {
  scroll-margin-top: 96px;
}
@media (max-width: 639px) {
  .doc-secao {
    scroll-margin-top: 148px;
  }
}

.doc-md {
  color: #334155;
  font-size: 14.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.doc-md h1 {
  font-size: 24px;
  font-weight: 800;
  color: #003865;
  line-height: 1.25;
  margin: 0 0 12px;
}
.doc-md h2 {
  font-size: 18px;
  font-weight: 700;
  color: #003c71;
  margin: 32px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e8a317;
}
.doc-md h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: #0b2e55;
  margin: 24px 0 8px;
}
.doc-md h4 {
  font-size: 14.5px;
  font-weight: 600;
  color: #1e293b;
  margin: 18px 0 6px;
}
.doc-md p {
  margin: 0 0 10px;
}
.doc-md ul,
.doc-md ol {
  margin: 0 0 12px;
  padding-left: 22px;
}
.doc-md ul {
  list-style: disc;
}
.doc-md ol {
  list-style: decimal;
}
.doc-md li {
  margin: 3px 0;
}
.doc-md strong {
  color: #0f172a;
  font-weight: 600;
}
.doc-md a {
  color: #1f5fa8;
  text-decoration: underline;
}
.doc-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: #f1f5f9;
  color: #0b2e55;
  padding: 1px 5px;
}
.doc-md blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  background: #e6f0fa;
  border-left: 4px solid #1f5fa8;
  color: #003c71;
}
.doc-md blockquote p:last-child {
  margin-bottom: 0;
}
.doc-md hr {
  border: 0;
  border-top: 1px solid #d9d9d9;
  margin: 28px 0;
}
.doc-md table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 13.5px;
}
.doc-md th,
.doc-md td {
  border: 1px solid #d9d9d9;
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  /* No celular a tabela rola de lado em vez de partir as palavras no meio */
  overflow-wrap: normal;
  min-width: 7.5em;
}
.doc-md th {
  background: #e6f0fa;
  color: #003c71;
  font-weight: 600;
}
.doc-md tr:nth-child(even) td {
  background: #f8fafc;
}

/* ------------------------------------------------------------------ */
/* Cabeçalho azul (ui/layout.cabecalho): no celular, Voltar e "Última   */
/* atualização" ficam na primeira linha e o título desce para uma       */
/* linha inteira, quebrando em vez de ser cortado.                      */
/* ------------------------------------------------------------------ */
.cabecalho-titulo h1 {
  overflow-wrap: anywhere;
}
/* Página "Sobre os dados": o cabeçalho (com o Voltar) acompanha a rolagem */
.cabecalho-fixo {
  position: sticky;
  top: 0;
  z-index: 40;
}
@media (max-width: 639px) {
  .cabecalho-portal {
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .cabecalho-titulo {
    order: 3;
    flex-basis: 100%;
  }
  .cabecalho-titulo h1 {
    font-size: 1.375rem;
    line-height: 1.2;
  }
  .cabecalho-data {
    order: 2;
  }
  /* Métricas Globais: o subtítulo vai para a linha de baixo, sem o traço */
  .cabecalho-titulo .mg-titulo-sub {
    display: block;
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    font-size: 0.95rem;
  }
}

/* Página inicial: busca de painéis (portal/inicio.py e assets/paineis.js) */
.lista-busca {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid #d9d9d9;
}
.lista-busca .dash-input-element {
  font-size: 14px;
}
.lista-rotulo {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.lista-contagem {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.lista-vazio {
  margin: 0;
  padding: 28px 20px;
  font-size: 14px;
  text-align: center;
  color: #64748b;
}
.selo-restrito {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: 1px;
  color: #0b2e55;
  background: #fbeccb;
  border: 1px solid #e8a317;
}

/* Página inicial em cartões, agrupados por tema (portal/inicio.py) */
.inicio {
  width: 100%;
  max-width: 1212px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}
.inicio .lista-busca {
  position: sticky;
  top: 0;
  z-index: 20;
  border: 1px solid #d9d9d9;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}
.inicio .lista-vazio {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #d9d9d9;
}
/* Fundo claro para o título e os cartões ficarem legíveis sobre a foto */
.inicio-tema {
  margin-top: 16px;
  padding: 14px 16px 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(217, 217, 217, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.inicio-tema h2 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #003c71;
  border-bottom: 2px solid #e8a317;
}
.inicio-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}
.inicio-grade > div {
  min-width: 0;
}
.cartao-painel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
  padding: 14px;
  color: #1e293b;
  text-decoration: none;
  background: #fff;
  border: 1px solid #d9d9d9;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s, border-color 0.15s;
}
.cartao-painel:hover,
.cartao-painel:focus-visible {
  background: #e6f0fa;
  border-color: #003c71;
}
.cartao-painel:focus-visible {
  outline: 2px solid #003c71;
  outline-offset: 2px;
}
.cartao-painel-icone {
  flex-shrink: 0;
  padding: 6px;
  line-height: 0;
  background: #e6f0fa;
  border: 1px solid #003c71;
  border-radius: 50%;
}
.cartao-painel-texto {
  min-width: 0;
}
.cartao-painel-texto strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #003c71;
}
.cartao-painel-texto small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}
.cartao-painel-texto .selo-restrito {
  margin: 6px 0 0;
}

/* ------------------------------------------------------------------ */
/* Busca de Pesquisadores (portal/paineis/busca_pesquisadores.py)       */
/* ------------------------------------------------------------------ */

.bp-corpo {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  padding: 16px;
}
.bp-filtros {
  flex: 0 0 240px;
  width: 240px;
}
.bp-principal {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.bp-procura {
  padding: 14px 16px;
  border-top: 3px solid #e8a317;
}
.bp-procura-titulo {
  display: block;
  margin-bottom: 8px;
  color: #003865;
  font-size: 15px;
  font-weight: 700;
}
.bp-procura-dica {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}
.bp-campo .dash-input-element {
  height: 46px;
  padding-left: 40px;
  border: 1px solid #94a3b8;
  font-size: 15px;
}
.bp-campo .dash-input-element:focus {
  border-color: #003865;
  outline: 2px solid rgba(0, 56, 101, 0.2);
}
.bp-lista-topo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bp-lista-titulo {
  color: #0b2e55;
  font-size: 15px;
  font-weight: 700;
}
.bp-ordem label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 10px;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
}
.bp-ordem input {
  accent-color: #003865;
}
.bp-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bp-cartao {
  position: relative;
  padding: 14px 16px 12px 20px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.bp-cartao::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: #1f5fa8;
}
.bp-nome {
  color: #003865;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}
.bp-nome:hover {
  text-decoration: underline;
}
.bp-vinculo {
  margin-top: 2px;
  color: #475569;
  font-size: 12.5px;
}
.bp-etiquetas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.bp-etiqueta {
  padding: 2px 8px;
  background: #e6f0fa;
  color: #003865;
  font-size: 11px;
  font-weight: 600;
}
.bp-etiqueta-mais {
  background: #f1f5f9;
  color: #475569;
}
.bp-motivo {
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}
.bp-motivo strong {
  color: #334155;
  font-weight: 600;
}
.bp-resumo {
  margin-top: 6px;
  color: #475569;
  font-size: 12.5px;
  line-height: 1.45;
}
.bp-marca {
  padding: 0 1px;
  background: #fcecc4;
  color: inherit;
  font-weight: 600;
}
.bp-obras {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.bp-obra {
  display: flex;
  gap: 10px;
  color: #334155;
  font-size: 12.5px;
  line-height: 1.4;
}
.bp-obra-ano {
  flex: 0 0 34px;
  color: #1f5fa8;
  font-weight: 700;
}
.bp-obra-texto {
  min-width: 0;
  overflow-wrap: anywhere;
}
.bp-obra-texto small {
  display: block;
  color: #64748b;
  font-size: 11.5px;
}
.bp-obra-link {
  color: #0b2e55;
}
.bp-obra-link:hover {
  text-decoration: underline;
}
.bp-cartao-pe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.bp-contagens {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}
.bp-acoes {
  display: flex;
  gap: 6px;
}
.bp-botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  background: #fff;
  border: 1px solid #003865;
  color: #003865;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.15s;
}
.bp-botao:hover:not(:disabled) {
  background: #e6f0fa;
}
.bp-botao:disabled {
  opacity: 0.4;
}
.bp-botao-forte {
  background: #003865;
  color: #fff;
}
.bp-botao-forte:hover:not(:disabled) {
  background: #005696;
}
.bp-botao-largo {
  width: 100%;
  margin-top: 10px;
}
.bp-paginas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
}
.bp-vazio {
  padding: 28px 16px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: #475569;
  font-size: 13px;
  text-align: center;
}
.bp-vazio strong {
  color: #003865;
  font-size: 15px;
}
.bp-perfil {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
}
.bp-perfil-lado {
  display: flex;
  flex: 0 0 300px;
  flex-direction: column;
  gap: 12px;
  width: 300px;
}
.bp-perfil-centro {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.bp-bloco {
  padding: 12px 16px 14px;
}
.bp-bloco-titulo {
  margin-bottom: 8px;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
}
.bp-dados {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bp-dado dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}
.bp-dado dd {
  margin: 0;
  color: #1e293b;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.bp-subareas {
  margin-top: 8px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}
.bp-programa {
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
  font-size: 12.5px;
}
.bp-programa:first-of-type {
  padding-top: 0;
  border-top: 0;
}
.bp-programa strong {
  display: block;
  color: #003865;
  font-weight: 700;
}
.bp-programa small {
  color: #64748b;
  font-size: 11px;
}
.bp-programa ul {
  margin-top: 4px;
  padding-left: 14px;
  color: #334155;
  list-style: disc;
}
.bp-resumo-completo {
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
}
.bp-aviso {
  padding: 10px 14px;
  background: #fff8e6;
  border: 1px solid #f2d48a;
  color: #6b4e00;
  font-size: 12.5px;
}
.bp-graficos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bp-graficos > section {
  height: 270px;
}
.bp-tabela {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
}
.bp-obras-topo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bp-obras-campo {
  flex: 0 1 280px;
  min-width: 180px;
}
.bp-tipos {
  margin-top: 8px;
}
.bp-tipos label {
  margin-bottom: 2px;
}
.bp-obras-lista {
  gap: 9px;
}

/* Tabelas com textos longos: três linhas e o texto completo no tooltip */
.celula-longa {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  min-width: 180px;
  max-width: 340px;
  line-height: 1.35;
}

.celula-link {
  color: #1f5fa8;
  font-weight: 600;
}

.celula-link:hover {
  color: #003865;
  text-decoration: underline;
}

@media (max-width: 1023px) {
  .bp-corpo,
  .bp-perfil {
    flex-direction: column;
    align-items: stretch;
  }
  .bp-filtros,
  .bp-perfil-lado {
    flex: none;
    width: 100%;
  }
  .bp-corpo .bp-principal {
    order: -1;
  }
  .bp-graficos {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Na tabela de projetos do perfil, todas as colunas cabem sem rolar */
.bp-tabela .celula-longa {
  min-width: 110px;
  max-width: 230px;
}

/* ------------------------------------------------------------------ */
/* Navegação dos painéis (ui/layout.py): o cabeçalho azul tem duas      */
/* linhas, caminho e abas, com o filete dourado embaixo das abas. Só a  */
/* linha das abas segue no topo ao rolar. No computador a primeira tela */
/* cabe inteira: .tela-aba é a janela menos o cabeçalho (42 + 37 = 79). */
/* ------------------------------------------------------------------ */
.caminho {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  font-size: 12.5px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.9);
}
.cabecalho-com-caminho:not(.cabecalho-compacto) .caminho {
  margin-bottom: 6px;
}
.caminho-link {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}
.caminho-link:hover,
.caminho-link:focus-visible {
  color: #fff;
  text-decoration: underline;
}
.caminho-seta {
  color: rgba(255, 255, 255, 0.45);
}
.cabecalho-linha {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.cabecalho-compacto .cabecalho-portal {
  padding-top: 8px;
  padding-bottom: 2px;
}
.cabecalho-compacto .cabecalho-titulo {
  flex: 1 1 auto;
}
.cabecalho-compacto h1 {
  font-size: 1.2rem;
  line-height: 1.2;
}
.cabecalho-compacto .caminho {
  font-size: 13px;
}
/* Data em uma linha só, para o cabeçalho não crescer */
.cabecalho-compacto .cabecalho-data {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cabecalho-compacto .cabecalho-data span {
  margin-bottom: 0;
  font-size: 11px;
}
.cabecalho-compacto .cabecalho-data strong {
  font-size: 0.9rem;
}

.barra-abas {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #003865;
  border-bottom: 3px solid #e8a317;
}
.barra-abas-lista {
  display: flex;
  height: 34px;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.barra-abas-lista::-webkit-scrollbar {
  display: none;
}
.aba-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
a.aba-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
a.aba-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}
/* A aba aberta encosta no filete, como se saísse dele */
.aba-ativa {
  font-weight: 700;
  color: #003865;
  background: #e8a317;
}
/* Frase que explica a aba, no alto da coluna de filtros */
.painel-filtros > .aba-resumo,
.aba-resumo {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #475569;
}
.painel-filtros > .aba-resumo {
  padding: 0 2px 10px;
  border-bottom: 1px solid #e5e9f0;
}
/* As tabelas ficam abaixo: o link "Ver tabela de dados" não pode parar atrás da barra */
.pagina-aba #tabelas {
  scroll-margin-top: 48px;
}

@media (min-width: 1024px) {
  .tela-aba {
    height: calc(100vh - 79px);
  }
  .sem-abas .tela-aba {
    height: calc(100vh - 77px);
  }
  .cabecalho-compacto .cabecalho-portal {
    height: 42px;
  }
  .cabecalho-com-caminho:not(.cabecalho-compacto) .cabecalho-portal {
    height: 74px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .cabecalho-linha h1 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}
@media (max-width: 767px) {
  /* A barra rola para o lado: o fim esmaecido mostra que há mais abas */
  .barra-abas-lista {
    padding-right: 28px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
}
@media (max-width: 639px) {
  .cabecalho-com-caminho .cabecalho-titulo {
    order: 1;
  }
  .cabecalho-com-caminho .cabecalho-data {
    order: 2;
    flex-basis: 100%;
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-left: 0;
    text-align: left;
  }
  .cabecalho-com-caminho .cabecalho-data span {
    margin-bottom: 0;
  }
  .cabecalho-com-caminho .cabecalho-data strong {
    font-size: 0.875rem;
  }
  .cabecalho-compacto .cabecalho-portal {
    row-gap: 4px;
    padding-bottom: 6px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .aba-link {
    transition: none;
  }
}
