/* Calculadora de Fator de Impacto - VTCD
   Tema unico: escuro, azul-marinho profundo. Nao ha modo claro. */

:root {
  --fundo: #03060E;
  --fundo-alto: #060B16;
  --superficie: #070D1B;
  --superficie-alt: #0B1425;
  --superficie-hover: #111D33;

  --borda: #16223A;
  --borda-forte: #22334F;

  --texto: #E6EDF8;
  --texto-suave: #8B9DBB;
  --texto-fraco: #5F7191;

  --acento: #4D8DF6;
  --acento-hover: #74A6FF;
  --acento-fraco: #0E1E38;
  --acento-brilho: #8FC0FF;

  --sucesso: #34D399;
  --aviso: #FBBF24;
  --perigo: #F87171;

  --grade: #141F35;
  --zebra: #090F1D;

  --sombra: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 28px rgba(0, 0, 0, .38);
  --sombra-alta: 0 28px 70px rgba(0, 0, 0, .62);
  --raio: 12px;

  /* Cores das particulas do efeito gooey. */
  --gooey-1: #4D8DF6;
  --gooey-2: #8FC0FF;
  --gooey-3: #2563EB;
  --gooey-4: #B9DCFF;

  --suave: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
}

/* Cores das regioes, iguais a CORES_REGIOES de fi_tema.py */
.regiao-A { --cor-regiao: #64748B; }
.regiao-B { --cor-regiao: #84CC16; }
.regiao-C { --cor-regiao: #EAB308; }
.regiao-D { --cor-regiao: #F97316; }
.regiao-E { --cor-regiao: #EF4444; }
.regiao-F { --cor-regiao: #9F1239; }
.regiao-G { --cor-regiao: #F59E0B; }
.regiao-H { --cor-regiao: #14B8A6; }
.regiao-I { --cor-regiao: #10B981; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.conteudo { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 22px; }
main.conteudo { padding-top: 24px; padding-bottom: 28px; }

::selection { background: var(--acento); color: #fff; }
.oculto-visualmente { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* -- marca ---------------------------------------------------------------- */

.marca-logo { display: block; width: 40px; height: 40px; flex: none; }

/* -- barra superior -------------------------------------------------------- */

.cabecalho {
  background: linear-gradient(180deg, var(--fundo-alto), var(--superficie));
  border-bottom: 1px solid var(--borda);
  position: sticky; top: 0; z-index: 30;
}

.cabecalho-interno {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 68px;
}

.marca { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.marca strong { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.marca small { display: block; color: var(--texto-suave); font-size: 12.5px; }
.marca-logo { transition: transform .2s var(--suave), filter .2s; }
.marca:hover .marca-logo { transform: scale(1.06) rotate(-4deg); filter: drop-shadow(0 4px 14px rgba(37, 99, 235, .5)); }

.acoes-cabecalho { display: flex; align-items: center; gap: 14px; }
.sair { display: flex; align-items: center; gap: 11px; }

.usuario {
  color: var(--texto-suave); font-size: 13.5px;
  padding: 5px 12px; border-radius: 20px;
  background: var(--superficie-alt); border: 1px solid var(--borda);
}

.rodape {
  margin-top: auto; padding: 26px 0;
  color: var(--texto-fraco); font-size: 12.5px; text-align: center;
  border-top: 1px solid var(--borda);
}
.rodape-validade { text-align: center; margin-top: 20px; }

/* -- cartoes --------------------------------------------------------------- */

.cartao {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 24px;
  margin-bottom: 18px;
}

details.cartao > summary { cursor: pointer; list-style-position: inside; }
details.cartao > summary h2 { display: inline; }
details.cartao > summary::marker { color: var(--texto-suave); }
details.cartao[open] > summary { margin-bottom: 18px; }

h1 { font-size: 21px; margin: 0 0 8px; letter-spacing: -.015em; }
h2 { font-size: 16.5px; margin: 0 0 13px; letter-spacing: -.01em; }
h3 { font-size: 13px; margin: 24px 0 11px; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .07em; }

.apoio { color: var(--texto-suave); margin: 0 0 17px; font-size: 14.5px; }
.nota { color: var(--texto-fraco); font-size: 13px; margin: 11px 0 0; }
.duas-colunas { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.duas-colunas > .cartao { margin-bottom: 0; }

/* =============================================================================
   TELA DE LOGIN
   ========================================================================== */

body.tela-login { display: block; overflow: hidden; }

.palco-login {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
  background:
    radial-gradient(1100px 620px at 50% -10%, #0D2350 0%, transparent 62%),
    radial-gradient(760px 520px at 88% 108%, #0A1B3C 0%, transparent 58%),
    linear-gradient(170deg, #03060E 0%, #01040A 100%);
}

.threads-container { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .8; }
.threads-container canvas { display: block; width: 100%; height: 100%; }

.palco-login::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(680px 480px at 50% 50%, rgba(2, 5, 12, .86) 0%, rgba(2, 5, 12, .4) 55%, transparent 78%);
  pointer-events: none;
}

.cartao-login {
  position: relative; z-index: 2;
  width: 100%; max-width: 396px;
  padding: 38px 36px 34px;
  border-radius: 18px;
  border: 1px solid rgba(100, 150, 250, .17);
  background: linear-gradient(165deg, rgba(10, 20, 42, .86), rgba(4, 9, 20, .92));
  box-shadow: var(--sombra-alta), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  animation: surgir .7s var(--suave) both;
}

@keyframes surgir {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.marca-login { text-align: center; margin-bottom: 28px; }
.marca-login .marca-logo { width: 76px; height: 76px; margin: 0 auto 18px; filter: drop-shadow(0 8px 24px rgba(37, 99, 235, .4)); }
.marca-login h1 { font-size: 19.5px; margin: 0 0 5px; letter-spacing: -.02em; font-weight: 650; }
.marca-login p { margin: 0; font-size: 12px; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .14em; }

.cartao-login .campo > span:first-child { font-size: 12.5px; }
.cartao-login input[type="text"], .cartao-login input[type="password"] {
  background: rgba(2, 5, 12, .7); border-color: rgba(100, 150, 250, .2); padding: 12px 14px;
}
.cartao-login input::placeholder { color: var(--texto-fraco); }
.cartao-login .botao { width: 100%; margin-top: 24px; padding: 12px 20px; }

.rodape-login { position: relative; z-index: 2; margin-top: 24px; text-align: center; font-size: 12px; color: var(--texto-fraco); }

/* =============================================================================
   RESULTADO: painel lateral + conteudo
   ========================================================================== */

.area-resultado {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.painel-lateral {
  position: sticky; top: 88px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 14px;
}

.painel-titulo {
  margin: 2px 0 10px; padding: 0 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--texto-fraco);
}

.painel-lateral nav { display: flex; flex-direction: column; gap: 2px; }

.item-lateral {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--texto-suave); text-decoration: none;
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .16s, color .16s, transform .16s var(--suave);
}
.item-lateral:hover { background: var(--superficie-hover); color: var(--texto); transform: translateX(2px); }

.item-lateral.ativo {
  background: linear-gradient(100deg, var(--acento-fraco), rgba(14, 30, 56, .35));
  color: var(--acento-brilho);
  border-color: rgba(77, 141, 246, .28);
}

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

.painel-secao { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--borda); display: flex; flex-direction: column; gap: 7px; }
.painel-secao .botao { width: 100%; text-align: center; }

@media (max-width: 900px) {
  .area-resultado { grid-template-columns: 1fr; }
  .painel-lateral { position: static; padding: 10px; }
  .painel-lateral nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .painel-titulo { display: none; }
  .item-lateral { white-space: nowrap; }
  .item-lateral:hover { transform: none; }
  .painel-secao { flex-direction: row; flex-wrap: wrap; }
  .painel-secao .botao { width: auto; }
}

/* -- faixa do FI ----------------------------------------------------------- */

.faixa-resultado {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 22px; padding: 22px 26px; margin-bottom: 18px;
  border: 1px solid var(--borda-forte);
  border-radius: var(--raio);
  background:
    radial-gradient(620px 210px at 0% 0%, rgba(77, 141, 246, .15), transparent 70%),
    linear-gradient(135deg, var(--superficie-alt), var(--superficie));
  box-shadow: var(--sombra);
}

.rotulo { margin: 0; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; font-weight: 600; color: var(--texto-suave); }

.numero-grande {
  margin: 3px 0 0; font-size: 45px; font-weight: 660; line-height: 1.05;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--acento-brilho), var(--acento));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--acento);
}
.numero-grande span { font-size: 19px; font-weight: 500; }

.faixa-detalhes { text-align: right; }
.faixa-detalhes p { margin: 0 0 4px; font-size: 13px; color: var(--texto-suave); }
.faixa-detalhes p strong { color: var(--texto); font-size: 14.5px; }

/* -- indicadores ----------------------------------------------------------- */

.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }

.indicador {
  background: var(--superficie-alt);
  border: 1px solid var(--borda);
  border-radius: 10px; padding: 14px 16px;
  transition: border-color .18s, transform .18s var(--suave), box-shadow .18s;
}
.indicador:hover { border-color: var(--borda-forte); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.indicador-valor { margin: 0; font-size: 28px; font-weight: 660; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.indicador-rotulo { margin: 3px 0 0; font-size: 13.5px; font-weight: 600; }
.indicador-detalhe { margin: 2px 0 0; font-size: 11.5px; color: var(--texto-fraco); }
.tipos-eventos { margin: 17px 0 0; }

/* =============================================================================
   FORMULARIOS
   ========================================================================== */

label.campo { display: block; margin-bottom: 4px; }
label.campo > span:first-child { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--texto-suave); }
.campo-entrada { display: flex; align-items: center; gap: 9px; }
.campo-entrada em { color: var(--texto-fraco); font-size: 12.5px; font-style: normal; white-space: nowrap; }
.campo-largo { margin-top: 17px; }
.campo-limite { max-width: 330px; margin-top: 19px; }

input[type="text"], input[type="password"], input[type="number"],
input[type="search"], input[type="file"], textarea {
  padding: 10px 12px;
  border: 1px solid var(--borda-forte);
  border-radius: 8px;
  background: var(--fundo-alto);
  color: var(--texto);
  font: inherit; font-size: 14.5px; width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

input:hover, textarea:hover { border-color: #2E4470; }
input:focus, textarea:focus {
  border-color: var(--acento); background: var(--superficie-alt);
  box-shadow: 0 0 0 3px rgba(77, 141, 246, .18); outline: none;
}

input:focus-visible, textarea:focus-visible, button:focus-visible,
.botao:focus-visible, .item-lateral:focus-visible, th[tabindex]:focus-visible, a:focus-visible {
  outline: 2px solid var(--acento); outline-offset: 2px;
}

textarea { resize: vertical; }
.entrada-curta { max-width: 116px; }

input[type="file"] { padding: 9px 11px; cursor: pointer; }
input[type="file"]::file-selector-button {
  background: var(--acento-fraco); color: var(--acento-brilho);
  border: 1px solid var(--borda-forte); border-radius: 6px;
  padding: 6px 13px; margin-right: 12px; font: inherit; font-size: 13.5px;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
input[type="file"]::file-selector-button:hover { background: var(--superficie-hover); }

input[type="radio"], input[type="checkbox"] { accent-color: var(--acento); width: 16px; height: 16px; }

fieldset { border: 1px solid var(--borda); border-radius: 9px; padding: 11px 16px 14px; margin: 19px 0 0; }
legend { font-size: 13px; font-weight: 600; padding: 0 7px; color: var(--texto-suave); }

.opcao {
  display: flex; align-items: center; gap: 10px; margin: 4px 0;
  font-size: 14.5px; cursor: pointer; padding: 5px 8px; border-radius: 8px;
  transition: background .15s;
}
.opcao:hover { background: var(--superficie-alt); }
.opcao small { color: var(--texto-fraco); }
.opcoes-nivel { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 4px; }

.grade-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 15px; }
.grade-secoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 2px; }

.grade-pesos { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 9px; }
.campo-peso { display: flex; align-items: center; gap: 11px; }
.campo-peso input { max-width: 92px; }
.campo-peso em { color: var(--texto-fraco); font-size: 12.5px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.exemplos { margin: 15px 0 0; font-size: 13.5px; }
.acoes-finais { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

/* =============================================================================
   BOTOES
   ========================================================================== */

.botao {
  position: relative;
  display: inline-block; padding: 10px 20px;
  background: linear-gradient(145deg, var(--acento), #2361D8);
  color: #fff; border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 9px;
  font: inherit; font-weight: 600; font-size: 14.5px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 2px 10px rgba(37, 99, 235, .28);
  overflow: hidden;
  transition: transform .18s var(--suave), box-shadow .18s, filter .18s;
}

/* Brilho que atravessa o botao ao passar o mouse. */
.botao::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .26) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .55s var(--suave);
}
.botao:hover::before { transform: translateX(120%); }

.botao:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(37, 99, 235, .42); filter: brightness(1.07); }
.botao:active { transform: translateY(0) scale(.98); box-shadow: 0 2px 8px rgba(37, 99, 235, .3); transition-duration: .07s; }

.botao-pequeno { padding: 7px 14px; font-size: 13.5px; }

.botao-secundario {
  background: var(--superficie-alt); color: var(--acento-brilho);
  border-color: var(--borda-forte); box-shadow: none;
}
.botao-secundario:hover { background: var(--superficie-hover); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); filter: none; }

.botao-texto {
  background: none; border: none; color: var(--texto-suave); font: inherit;
  font-size: 13.5px; cursor: pointer; padding: 5px; transition: color .15s;
}
.botao-texto:hover { color: var(--acento-brilho); }

/* Estado de espera enquanto o servidor processa. */
.botao.processando { pointer-events: none; opacity: .85; }
.botao.processando::after {
  content: ""; display: inline-block; vertical-align: -2px;
  width: 14px; height: 14px; margin-left: 10px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  border-radius: 50%; animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* =============================================================================
   EFEITO GOOEY  (porte do GooeyNav, React Bits)
   ========================================================================== */

.gooey-envolve { position: relative; display: inline-block; }
.gooey-envolve > .botao { position: relative; z-index: 2; }

.gooey-camada {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  pointer-events: none; display: grid; place-items: center; z-index: 1;
  /* O par blur + contrast e o que funde as particulas em gotas. */
  filter: blur(7px) contrast(100) blur(0);
  mix-blend-mode: lighten;
}

.gooey-camada::before { content: ""; position: absolute; inset: -75px; z-index: -2; background: #000; }
.gooey-camada::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: #fff; border-radius: 100vw; transform: scale(0); opacity: 0;
}
.gooey-camada.ativa::after { animation: pilula .3s ease both; }

@keyframes pilula { to { transform: scale(1); opacity: 1; } }

.particula, .ponto {
  display: block; opacity: 0;
  width: 20px; height: 20px; border-radius: 100%;
  transform-origin: center;
}

.particula {
  --tempo: 5s;
  position: absolute; top: calc(50% - 8px); left: calc(50% - 8px);
  animation: particula calc(var(--tempo)) ease 1 -350ms;
}

.ponto { background: var(--cor); opacity: 1; animation: ponto calc(var(--tempo)) ease 1 -350ms; }

@keyframes particula {
  0% {
    transform: rotate(0deg) translate(calc(var(--inicio-x)), calc(var(--inicio-y)));
    opacity: 1; animation-timing-function: cubic-bezier(.55, 0, 1, .45);
  }
  70% {
    transform: rotate(calc(var(--rotacao) * .5)) translate(calc(var(--fim-x) * 1.2), calc(var(--fim-y) * 1.2));
    opacity: 1; animation-timing-function: ease;
  }
  85% {
    transform: rotate(calc(var(--rotacao) * .66)) translate(calc(var(--fim-x)), calc(var(--fim-y)));
    opacity: 1;
  }
  100% {
    transform: rotate(calc(var(--rotacao) * 1.2)) translate(calc(var(--fim-x) * .5), calc(var(--fim-y) * .5));
    opacity: 1;
  }
}

@keyframes ponto {
  0%   { transform: scale(0); opacity: 0; animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  25%  { transform: scale(calc(var(--escala) * .25)); }
  38%  { opacity: 1; }
  65%  { transform: scale(var(--escala)); opacity: 1; animation-timing-function: ease; }
  85%  { transform: scale(var(--escala)); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

/* =============================================================================
   ALERTAS E TABELAS
   ========================================================================== */

.alerta { padding: 12px 15px; border-radius: 9px; font-size: 14.5px; margin: 0 0 16px; border: 1px solid transparent; }
.alerta-erro { background: rgba(248, 113, 113, .1); color: #FCA5A5; border-color: rgba(248, 113, 113, .28); }
.alerta-aviso { background: rgba(251, 191, 36, .09); color: #FCD34D; border-color: rgba(251, 191, 36, .26); }
.alerta-sucesso { background: rgba(52, 211, 153, .09); color: #6EE7B7; border-color: rgba(52, 211, 153, .26); margin: 0; }

.etiqueta-aviso {
  background: rgba(251, 191, 36, .12); color: #FCD34D;
  border: 1px solid rgba(251, 191, 36, .28);
  border-radius: 20px; padding: 3px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}

.rolagem { overflow-x: auto; border-radius: 9px; border: 1px solid var(--borda); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }

th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--borda); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }

thead th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--texto-suave); background: var(--superficie-alt);
  position: sticky; top: 0; z-index: 1;
}
table.ordenavel thead th { cursor: pointer; user-select: none; transition: color .15s; }
table.ordenavel thead th:hover { color: var(--acento-brilho); }
table.ordenavel thead th[data-ordem="crescente"]::after { content: " ▲"; font-size: 9px; color: var(--acento); }
table.ordenavel thead th[data-ordem="decrescente"]::after { content: " ▼"; font-size: 9px; color: var(--acento); }

tbody tr { transition: background .12s; }
tbody tr:nth-child(even) { background: var(--zebra); }
tbody tr:hover { background: var(--superficie-hover); }
tfoot th { border-bottom: none; border-top: 2px solid var(--borda-forte); background: var(--superficie-alt); position: static; }

.direita { text-align: right; }
.monoespacada { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
tr.vazia td { color: var(--texto-fraco); }
.descricao-regiao { white-space: normal; color: var(--texto-suave); font-size: 12.5px; }
.destaque-fi { color: var(--acento-brilho); font-size: 15px; }

.cabecalho-tabela { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.cabecalho-tabela h2, .cabecalho-tabela h3 { margin: 0; text-transform: none; letter-spacing: normal; color: var(--texto); font-size: 16.5px; }
.ferramentas-tabela { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.ferramentas-tabela .filtro { width: 210px; }
.contador { color: var(--texto-fraco); font-size: 12.5px; white-space: nowrap; }

/* -- composicao do FI ------------------------------------------------------ */

.tabela-composicao .participacao { width: 215px; white-space: nowrap; }
.tabela-composicao .participacao em { font-style: normal; font-size: 12.5px; color: var(--texto-suave); }

.barra { display: inline-block; width: 132px; height: 8px; border-radius: 4px; background: var(--grade); overflow: hidden; vertical-align: middle; margin-right: 9px; }
.barra-preenchida { display: block; height: 100%; background: var(--cor-regiao, var(--acento)); border-radius: 4px; animation: encher .8s var(--suave) both; }

@keyframes encher { from { width: 0; } }

.regiao {
  display: inline-block; min-width: 25px; padding: 2px 8px; border-radius: 6px;
  background: var(--cor-regiao, var(--acento)); color: #05080F;
  font-weight: 700; font-size: 12.5px; text-align: center;
}

/* -- listas e graficos ----------------------------------------------------- */

.lista-arquivos { list-style: none; padding: 0; margin: 0 0 15px; }
.lista-arquivos li { padding: 9px 0; border-bottom: 1px solid var(--borda); }
.lista-arquivos li:last-child { border-bottom: none; }
.lista-arquivos span { display: block; color: var(--texto-fraco); font-size: 12.5px; }

.lista-chave-valor { margin: 0; }
.lista-chave-valor > div { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 8px 0; border-bottom: 1px solid var(--borda); }
.lista-chave-valor > div:last-child { border-bottom: none; }
.lista-chave-valor dt { color: var(--texto-suave); font-size: 13.5px; }
.lista-chave-valor dd { margin: 0; font-weight: 600; font-size: 13.5px; text-align: right; }

.grafico { margin: 0; }
.grafico img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--borda); border-radius: 9px; background: var(--superficie);
  transition: border-color .18s;
}
.grafico img:hover { border-color: var(--borda-forte); }
.grafico-estreito img { max-width: 470px; margin: 0 auto; }
.grafico figcaption { margin-top: 9px; font-size: 12.5px; text-align: right; }

a { color: var(--acento-brilho); text-decoration-color: rgba(143, 192, 255, .3); }
a:hover { text-decoration-color: currentColor; }

code { background: var(--fundo-alto); border: 1px solid var(--borda); border-radius: 5px; padding: 1px 6px; font-size: .88em; color: var(--acento-brilho); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--fundo); }
::-webkit-scrollbar-thumb { background: #1B2A46; border-radius: 6px; border: 2px solid var(--fundo); }
::-webkit-scrollbar-thumb:hover { background: #26395C; }

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

/* Botao principal da tela de configuracao. */
.botao-grande { padding: 13px 30px; font-size: 15.5px; border-radius: 10px; }

/* =============================================================================
   PAINEL INICIAL
   ========================================================================== */

.abertura {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 26px; align-items: center;
  padding: 30px 30px 32px; margin-bottom: 20px;
  border: 1px solid var(--borda-forte); border-radius: 16px;
  background:
    radial-gradient(700px 300px at 8% 0%, rgba(77, 141, 246, .16), transparent 68%),
    linear-gradient(140deg, var(--superficie-alt), var(--superficie));
  box-shadow: var(--sombra);
}

.abertura h1 { font-size: 27px; margin: 6px 0 10px; letter-spacing: -.02em; line-height: 1.2; }
.abertura .apoio { max-width: 52ch; }
.abertura .botao { margin-top: 4px; }

.abertura-numeros { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.abertura-numeros > div {
  background: rgba(3, 6, 14, .5); border: 1px solid var(--borda);
  border-radius: 11px; padding: 14px 16px;
}
.abertura-numeros dt { font-size: 12px; color: var(--texto-suave); }
.abertura-numeros dd { margin: 4px 0 0; font-size: 25px; font-weight: 660; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .abertura { grid-template-columns: 1fr; padding: 24px; }
}

/* -- lista de analises ----------------------------------------------------- */

.lista-analises { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

.analise {
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--borda); border-radius: 12px;
  background: var(--superficie-alt);
  transition: border-color .18s, transform .18s var(--suave), box-shadow .18s;
}
.analise:hover { border-color: var(--borda-forte); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, .4); }
.analise-temporaria { border-style: dashed; }

.analise-corpo { display: flex; gap: 15px; padding: 16px 17px 12px; text-decoration: none; color: inherit; }

.analise-fi {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 74px; padding: 9px 6px; border-radius: 10px;
  background: var(--acento-fraco); border: 1px solid rgba(77, 141, 246, .28);
}
.analise-fi-valor { font-size: 20px; font-weight: 680; color: var(--acento-brilho); font-variant-numeric: tabular-nums; line-height: 1.1; }
.analise-fi-unidade { font-size: 11px; color: var(--texto-suave); }

.analise-texto { min-width: 0; }
.analise-texto h3 {
  margin: 0 0 4px; font-size: 15px; font-weight: 620; color: var(--texto);
  text-transform: none; letter-spacing: normal;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.analise-detalhes { margin: 0 0 3px; font-size: 12.5px; color: var(--texto-suave); }
.analise-data { margin: 0; font-size: 12px; color: var(--texto-fraco); }
.expira { color: var(--aviso); }

.analise-acoes { padding: 0 17px 14px; display: flex; gap: 10px; align-items: center; }

/* -- estado vazio ---------------------------------------------------------- */

.vazio { text-align: center; padding: 34px 20px 30px; border: 1px dashed var(--borda-forte); border-radius: 12px; }
.vazio-titulo { margin: 0 0 6px; font-size: 15.5px; font-weight: 620; }
.vazio .apoio { max-width: 46ch; margin: 0 auto 18px; }

.passos { margin: 0; padding-left: 20px; color: var(--texto-suave); font-size: 14px; }
.passos li { margin-bottom: 9px; }
.passos strong { color: var(--texto); }

.volta { margin: 0 0 14px; font-size: 13.5px; }

/* -- painel lateral: salvar ------------------------------------------------ */

.formulario-salvar .campo { margin-bottom: 9px; }
.formulario-salvar input { font-size: 13.5px; padding: 8px 10px; }
.formulario-salvar .botao { width: 100%; }

.marca-salva {
  display: flex; align-items: center; gap: 7px; margin: 0 0 3px;
  font-size: 13px; font-weight: 620; color: var(--sucesso);
}
.marca-salva .item-icone { stroke: var(--sucesso); width: 15px; height: 15px; }
.titulo-salvo { margin: 0 0 8px; font-size: 12.5px; color: var(--texto-suave); word-break: break-word; }
.botao-perigo { color: var(--perigo); }
.botao-perigo:hover { color: #FCA5A5; }

/* =============================================================================
   COMENTARIOS NO GRAFICO
   ========================================================================== */

.tela-grafico { position: relative; line-height: 0; }
.tela-grafico img { width: 100%; height: auto; display: block; border: 1px solid var(--borda); border-radius: 9px; }

.marcadores { position: absolute; inset: 0; pointer-events: none; }

.marcador { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }

.marcador-alvo {
  display: grid; place-items: center;
  width: 30px; height: 30px; padding: 0;
  background: none; border: none; cursor: pointer;
}

.marcador-ponto {
  display: block; width: 11px; height: 11px; border-radius: 50%;
  background: rgba(143, 192, 255, .22);
  border: 1.5px solid rgba(143, 192, 255, .55);
  transition: transform .18s var(--suave), background .18s, border-color .18s, box-shadow .18s;
}

.marcador-alvo:hover .marcador-ponto,
.marcador-alvo:focus-visible .marcador-ponto {
  transform: scale(1.5);
  background: var(--acento); border-color: #fff;
  box-shadow: 0 0 0 4px rgba(77, 141, 246, .22);
}

/* Evento que ja tem comentario: ponto solido e pulso discreto. */
.marcador.com-nota .marcador-ponto {
  background: var(--aviso); border-color: #FDE68A;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .18);
}
.marcador.com-nota .marcador-alvo::after {
  content: ""; position: absolute;
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid var(--aviso);
  animation: pulso 2.4s ease-out infinite;
}

@keyframes pulso {
  0%   { transform: scale(1); opacity: .8; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

.marcador.aberto .marcador-ponto { transform: scale(1.6); background: var(--acento); border-color: #fff; }

/* -- balao ----------------------------------------------------------------- */

.balao {
  position: absolute; left: 50%; top: calc(100% + 12px);
  transform: translateX(-50%) scale(.96);
  width: 310px; padding: 14px;
  background: linear-gradient(165deg, #0C1729, #070D1B);
  border: 1px solid var(--borda-forte); border-radius: 12px;
  box-shadow: var(--sombra-alta);
  line-height: 1.5; text-align: left;
  opacity: 0; visibility: hidden; z-index: 12;
  transition: opacity .18s, transform .18s var(--suave), visibility .18s;
}

.marcador.aberto .balao { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); }
.marcador.balao-a-esquerda .balao { left: auto; right: -8px; transform: translateX(0) scale(.96); }
.marcador.balao-a-esquerda.aberto .balao { transform: translateX(0) scale(1); }
.marcador.balao-acima .balao { top: auto; bottom: calc(100% + 12px); }

.balao-topo { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 11px; }
.balao-identificacao { min-width: 0; flex: 1; }
.balao-instante { margin: 0; font-size: 13px; font-weight: 620; font-variant-numeric: tabular-nums; }
.balao-dados { margin: 2px 0 0; font-size: 11.5px; color: var(--texto-suave); }
.regiao-fora { background: #3A4761; color: var(--texto-suave); }

.balao-fechar {
  background: none; border: none; color: var(--texto-fraco);
  font-size: 19px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.balao-fechar:hover { color: var(--texto); }

.balao textarea { font-size: 13.5px; padding: 9px 10px; }
.balao-acoes { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

@media (max-width: 620px) {
  .balao { width: 260px; }
}
