/* ==========================================================================
   TaxGold DeRE — folha de estilo das telas do sistema.

   Identidade "Precisão institucional", a mesma das telas de acesso
   (acesso.css) e do eSocial: marinho #102541 para texto forte, dourado
   metálico do logotipo (#E8C46E → #B8862B → #8B5E12) como acento. Movimento
   curto (120–220 ms) em hover e foco; a entrada da página acontece uma vez e
   some com prefers-reduced-motion.

   Não há CSS inline em lugar nenhum: a Content-Security-Policy do projeto
   bloqueia <style> e style="" para reduzir a superfície de XSS. Tudo que for
   visual entra aqui, como classe.
   ========================================================================== */

/* Fontes servidas pelo próprio sistema (a CSP não aceita fonte externa).
   Inter e Instrument Serif, licença SIL OFL 1.1 (static/fonts/OFL-*.txt). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.8e433c0592f7.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-latin-400-italic.8374bac40447.woff2") format("woff2");
}

:root {
  /* Marca */
  --navy-900: #0a172a;
  --navy-800: #102541;
  --navy-700: #1a3a64;
  --navy-600: #24497a;
  --gold-700: #8b5e12;
  --gold-600: #b8862b;
  --gold-500: #c99a3e;
  --gold-400: #e8c46e;
  --gold-100: #fbf5e6;
  --ouro-tinta: #7f560f;
  --ouro-grad: linear-gradient(135deg, #eed39a 0%, #d9ae57 48%, #bf8e32 100%);

  /* Superfícies */
  --fundo: #f4f6f9;
  --superficie: #ffffff;
  --superficie-2: #f8fafc;
  --borda: #e3e8ef;
  --borda-forte: #cfd6e0;

  /* Texto */
  --texto: #1c2738;
  --texto-2: #5a6880;
  --texto-3: #6b778c;
  --texto-claro: #ffffff;

  /* Semânticas */
  --ok: #12734f;
  --ok-fundo: #e8f5ee;
  --ok-borda: #bfe3cf;
  --erro: #b42335;
  --erro-fundo: #fdecee;
  --erro-borda: #f3c4ca;
  --aviso: #8f5a07;
  --aviso-fundo: #fff5df;
  --aviso-borda: #f1d79c;
  --info: #1f5aa0;
  --info-fundo: #ebf2fa;
  --info-borda: #c6d8ee;

  /* Tipografia */
  --fonte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", ui-monospace, monospace;

  /* Métrica */
  --raio: 10px;
  --raio-g: 16px;
  --sombra: 0 0 0 1px rgba(16, 37, 65, .06), 0 1px 2px rgba(16, 37, 65, .05), 0 8px 24px -16px rgba(16, 37, 65, .2);
  --sombra-hover: 0 0 0 1px rgba(16, 37, 65, .1), 0 2px 4px rgba(16, 37, 65, .06), 0 16px 32px -18px rgba(16, 37, 65, .34);
  --sombra-g: 0 24px 60px -24px rgba(10, 23, 42, .4), 0 2px 8px rgba(10, 23, 42, .08);
  --foco: 0 0 0 4px rgba(201, 154, 62, .26);
  --largura: 1180px;
  --curva: cubic-bezier(.2, .7, .2, 1);
  --transicao: 160ms var(--curva);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; color: var(--navy-800); }
h1 { font-size: 1.85rem; letter-spacing: -.03em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; letter-spacing: -.012em; }
p { margin: 0 0 1rem; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: rgba(184, 134, 43, .6); text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: .9em; }
::selection { background: rgba(232, 196, 110, .35); }

/* Ícones do sprite (static/img/icones.svg, via {% icone %}) */
.ic {
  display: inline-block;
  flex: none;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -.18em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container { width: 100%; max-width: var(--largura); margin: 0 auto; padding: 0 20px; }
.container--estreito { max-width: 760px; }

/* ==========================================================================
   Topo e rodapé das páginas públicas (termos, privacidade e erros)
   ========================================================================== */
.topo {
  position: sticky; top: 0; z-index: 40;
  background: rgba(10, 23, 42, .9);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.topo__inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.topo__nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.topo__nav a { color: rgba(255, 255, 255, .78); font-size: .92rem; font-weight: 500; }
.topo__nav a:hover { color: #fff; text-decoration: none; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: #fff; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo__imagem { display: block; width: auto; height: 32px; }
.logo__marca { color: var(--gold-400); }
.logo__produto {
  padding: .18rem .6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  color: #dfe6ef;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .02em;
}
.logo__selo {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--ouro-grad);
  color: var(--navy-900); font-weight: 800; font-size: .82rem;
}

.rodape { background: var(--navy-900); color: rgba(255, 255, 255, .62); padding: 46px 0 30px; font-size: .9rem; }
.rodape__grid { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-start; }
.rodape a { color: rgba(255, 255, 255, .74); }
.rodape a:hover { color: #fff; }
.rodape__links { display: flex; gap: 22px; flex-wrap: wrap; }
.rodape__base { margin-top: 30px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .84rem; color: rgba(255, 255, 255, .5); }

/* Páginas de texto (termos e privacidade) e de erro */
.secao { padding: 64px 0; }
.secao h1 { margin-bottom: .4rem; }
.secao h2 { margin-top: 2rem; font-size: 1.15rem; }

/* ==========================================================================
   Botões
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 18px; border-radius: var(--raio);
  font-family: inherit; font-size: .92rem; font-weight: 650; letter-spacing: .005em; line-height: 1.3;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background-color var(--transicao), border-color var(--transicao), color var(--transicao),
              box-shadow var(--transicao), transform var(--transicao), filter var(--transicao);
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--foco); }
.btn[disabled], .btn--desabilitado { opacity: .55; pointer-events: none; }

/* Dourado do logotipo: a ação principal da tela */
.btn--primario {
  color: #1d1404;
  border-color: #bf8e32;
  background-color: #d9ae57;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 55%), var(--ouro-grad);
  box-shadow: 0 1px 2px rgba(91, 60, 8, .22), 0 10px 20px -12px rgba(184, 134, 43, .8), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn--primario:hover {
  color: #1d1404;
  filter: brightness(1.04) saturate(1.06);
  box-shadow: 0 1px 2px rgba(91, 60, 8, .22), 0 14px 24px -12px rgba(184, 134, 43, .95), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.btn--primario:focus-visible { box-shadow: var(--foco), 0 10px 20px -12px rgba(184, 134, 43, .8); }
.btn--escuro {
  color: #fff;
  border-color: var(--navy-900);
  background: linear-gradient(180deg, var(--navy-700), var(--navy-800));
  box-shadow: 0 1px 2px rgba(10, 23, 42, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn--escuro:hover { color: #fff; background: linear-gradient(180deg, var(--navy-600), var(--navy-700)); }
.btn--contorno {
  color: var(--navy-800);
  border-color: var(--borda-forte);
  background: var(--superficie);
  box-shadow: 0 1px 2px rgba(16, 37, 65, .05);
}
.btn--contorno:hover { color: var(--navy-800); border-color: #b3bfce; background: #f6f8fb; }
.btn--claro { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn--claro:hover { color: #fff; background: rgba(255, 255, 255, .17); border-color: rgba(232, 196, 110, .5); }
.btn--perigo { background: var(--erro); color: #fff; border-color: #8f1b2a; box-shadow: 0 1px 2px rgba(143, 27, 42, .25); }
.btn--perigo:hover { color: #fff; background: #9a1d2d; }
.btn--perigo:focus-visible { box-shadow: 0 0 0 4px rgba(180, 35, 53, .2); }
.btn--pequeno { min-height: 32px; padding: 5px 12px; font-size: .84rem; border-radius: 9px; }
.btn--pequeno .ic { width: 15px; height: 15px; }
.btn--bloco { width: 100%; }
/* envio em andamento (app.js marca aria-busy): o botão fica legível e gira */
.btn[aria-busy="true"] { opacity: .88; cursor: progress; }
.btn[aria-busy="true"]::after {
  content: ""; width: 14px; height: 14px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: girar .7s linear infinite;
}

/* ==========================================================================
   Aplicação — menu lateral, barra superior e conteúdo
   ========================================================================== */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }

.lateral {
  position: sticky; top: 0;
  display: flex; flex-direction: column;
  height: 100vh; min-width: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .72);
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(232, 196, 110, .12) 0%, rgba(232, 196, 110, 0) 62%),
    linear-gradient(180deg, #11284a 0%, var(--navy-800) 38%, var(--navy-900) 100%);
  isolation: isolate;
}
/* min-width: 0 — no celular o menu vira faixa com rolagem; sem isto ele esticava a página. */
/* os arcos do "G" do logotipo, quase apagados, no pé do menu */
.lateral__arcos {
  position: absolute; left: -150px; bottom: -210px; z-index: -1;
  width: 420px; height: 420px; pointer-events: none; opacity: .22;
}
.lateral__arcos circle { fill: none; stroke: url(#lateralOuro); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 22; }
.lateral__topo { padding: 22px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.lateral__logo { display: inline-block; }
.lateral__logo:hover { text-decoration: none; }
.lateral__logo img { display: block; width: auto; height: 30px; }
.lateral__plataforma {
  display: flex; align-items: center; gap: 8px;
  margin: 12px 0 0;
  color: var(--gold-400);
  font-size: .66rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
}
.lateral__plataforma::before { content: ""; width: 16px; height: 2px; border-radius: 2px; background: var(--ouro-grad); }
.lateral__nav {
  flex: 1; min-height: 0; padding: 16px 12px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent;
}
.lateral__grupo { margin-bottom: 18px; }
.lateral__rotulo { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; color: rgba(255, 255, 255, .42); padding: 0 12px; margin-bottom: 6px; }
.lateral__item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 10px; margin-bottom: 2px;
  color: rgba(255, 255, 255, .74); font-size: .9rem; font-weight: 500;
  transition: background-color var(--transicao), color var(--transicao), box-shadow var(--transicao);
}
.lateral__item:hover { background: rgba(255, 255, 255, .065); color: #fff; text-decoration: none; }
.lateral__item:focus-visible { outline: 2px solid var(--gold-400); outline-offset: -2px; }
.lateral__item--ativo,
.lateral__item--ativo:hover {
  background: linear-gradient(90deg, rgba(232, 196, 110, .17), rgba(232, 196, 110, .04));
  color: #f3dfae;
  box-shadow: inset 0 0 0 1px rgba(232, 196, 110, .18);
}
.lateral__item--ativo::before {
  content: "";
  position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--ouro-grad);
}
.lateral__icone {
  display: grid; place-items: center; flex: none;
  width: 20px; height: 20px;
  color: rgba(255, 255, 255, .5);
  transition: color var(--transicao), transform var(--transicao);
}
.lateral__icone .ic { width: 18px; height: 18px; }
.lateral__item:hover .lateral__icone { color: rgba(255, 255, 255, .9); transform: translateX(1px); }
.lateral__item--ativo .lateral__icone,
.lateral__item--ativo:hover .lateral__icone { color: var(--gold-400); }
.lateral__item--topo { font-weight: 600; color: rgba(255, 255, 255, .86); }
.lateral__contagem { margin-left: auto; background: rgba(255, 255, 255, .13); border-radius: 999px; padding: 1px 8px; font-size: .74rem; }
.lateral__rodape { display: grid; gap: 10px; padding: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.lateral__suporte {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  color: rgba(255, 255, 255, .72); font-size: .8rem; line-height: 1.25;
  transition: background-color var(--transicao), color var(--transicao);
}
.lateral__suporte:hover { background: rgba(37, 211, 102, .1); color: #fff; text-decoration: none; }
.lateral__suporte .ic { width: 28px; height: 28px; padding: 6px; border-radius: 50%; background: #25d366; color: #fff; }
.lateral__suporte b { display: block; color: #fff; font-size: .84rem; font-variant-numeric: tabular-nums; }

.conteudo { display: flex; flex-direction: column; min-width: 0; }
.barra {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 28px;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--borda);
}
.barra__titulo { margin: 0; color: var(--navy-800); font-size: 1.02rem; font-weight: 700; letter-spacing: -.012em; }
.barra__acoes { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.usuario {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px; border: 1px solid transparent; border-radius: 999px;
  color: var(--texto); line-height: 1.2;
  transition: background-color var(--transicao), border-color var(--transicao);
}
.usuario:hover { text-decoration: none; background: var(--superficie-2); border-color: var(--borda); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--gold-400);
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(201, 154, 62, .5);
}
.usuario__nome { font-size: .86rem; font-weight: 650; color: var(--navy-800); }
.usuario__email { font-size: .75rem; color: var(--texto-3); }

.pagina { padding: 28px; flex: 1; }
.pagina__cabecalho { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.pagina__cabecalho h2 { font-size: 1.4rem; letter-spacing: -.025em; }
.pagina__cabecalho p { color: var(--texto-2); margin: .2rem 0 0; }
.pagina__acoes { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Painéis, métricas, listas e tabelas
   ========================================================================== */
.painel {
  background: var(--superficie);
  border: 1px solid transparent;
  border-radius: var(--raio-g);
  box-shadow: var(--sombra);
  margin-bottom: 22px;
}
.painel__cabecalho {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 22px; border-bottom: 1px solid var(--borda);
}
.painel__cabecalho h2, .painel__cabecalho h3 { margin: 0; font-size: .98rem; letter-spacing: -.01em; }
.painel__acoes { margin-left: auto; display: flex; gap: 8px; }
.painel__corpo { padding: 22px; }
.painel__corpo--liso { padding: 0; }

.metricas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.metrica {
  position: relative; overflow: hidden;
  background: var(--superficie);
  border: 1px solid transparent;
  border-radius: var(--raio-g);
  box-shadow: var(--sombra);
  padding: 18px 20px;
}
.metrica::after {
  content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 2px; border-radius: 0 0 2px 2px;
  background: var(--ouro-grad); opacity: 0; transition: opacity var(--transicao);
}
.metrica__rotulo { font-size: .8rem; color: var(--texto-2); font-weight: 600; }
.metrica__valor { font-size: 1.9rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.metrica__nota { font-size: .8rem; color: var(--texto-3); }
.metrica--alerta { background: linear-gradient(180deg, #fff6f7, var(--superficie) 70%); box-shadow: 0 0 0 1px var(--erro-borda), 0 8px 24px -16px rgba(180, 35, 53, .25); }
.metrica--alerta .metrica__valor { color: var(--erro); }

.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th {
  text-align: left; padding: 10px 22px;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--texto-3); font-weight: 700;
  border-bottom: 1px solid var(--borda); background: var(--superficie-2);
}
.tabela td { padding: 13px 22px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr { transition: background-color var(--transicao); }
.tabela tbody tr:hover { background: #f9fafc; }
.tabela tbody tr:hover > td:first-child { box-shadow: inset 2px 0 0 var(--gold-500); }
.tabela__acoes { text-align: right; white-space: nowrap; }
.tabela--compacta td, .tabela--compacta th { padding: 9px 16px; }
.tabela-rolagem { overflow-x: auto; }

.principal { font-weight: 650; color: var(--navy-800); }
a.principal:hover { color: var(--navy-700); }
.secundario { color: var(--texto-3); font-size: .83rem; }

/* Etiquetas de situação */
.selo {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 650; white-space: nowrap;
  box-shadow: inset 0 0 0 1px currentColor;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
}
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.selo--ok { background: var(--ok-fundo); color: var(--ok); }
.selo--erro { background: var(--erro-fundo); color: var(--erro); }
.selo--aviso { background: var(--aviso-fundo); color: var(--aviso); }
.selo--info { background: var(--info-fundo); color: var(--info); }
.selo--neutro { background: #eef1f5; color: var(--texto-2); }
.selo--ouro { background: var(--gold-100); color: var(--ouro-tinta); }

/* ==========================================================================
   Formulários
   ========================================================================== */
.formulario { display: grid; gap: 18px; }
.formulario--duas { grid-template-columns: 1fr 1fr; }
.campo-grupo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo-grupo--largo { grid-column: 1 / -1; }

.rotulo { font-size: .84rem; font-weight: 600; color: #2b3a52; }
.rotulo__obrigatorio { color: var(--erro); margin-left: 2px; }

.campo {
  width: 100%; min-height: 42px; padding: 9px 13px;
  font-family: inherit; font-size: .94rem; color: var(--texto);
  background: var(--superficie);
  border: 1px solid var(--borda-forte); border-radius: var(--raio);
  box-shadow: 0 1px 2px rgba(16, 37, 65, .04);
  transition: border-color var(--transicao), box-shadow var(--transicao), background-color var(--transicao);
}
.campo::placeholder { color: #98a3b3; }
.campo:hover:not(:focus):not(:disabled) { border-color: #b3bfce; }
.campo:focus { outline: none; border-color: var(--gold-500); box-shadow: var(--foco); }
.campo:disabled { background: var(--superficie-2); color: var(--texto-3); }
.campo--codigo {
  font-family: var(--mono);
  font-size: 1.5rem; letter-spacing: .4em; text-align: center; padding: 14px;
}
textarea.campo { min-height: 90px; resize: vertical; }
select.campo { cursor: pointer; }
input[type="file"].campo { padding: 7px 10px; }
input[type="file"].campo::file-selector-button {
  margin-right: 12px; padding: 6px 12px;
  border: 1px solid var(--borda-forte); border-radius: 8px;
  background: var(--superficie-2); color: var(--navy-800);
  font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}

.ajuda { font-size: .8rem; color: var(--texto-3); }
.erro-campo { font-size: .83rem; color: var(--erro); font-weight: 500; }
.campo-grupo--erro .campo { border-color: #e3a1ab; background: #fffbfb; }

.caixa-marcar { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; cursor: pointer; }
.caixa-marcar input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--navy-800); flex: none; cursor: pointer; }

.formulario__acoes {
  display: flex; gap: 10px; align-items: center;
  padding-top: 6px; grid-column: 1 / -1;
}
.formulario__acoes--fim { justify-content: flex-end; }

/* ==========================================================================
   Mensagens e avisos
   ========================================================================== */
.mensagens { display: grid; gap: 10px; margin-bottom: 20px; }
.aviso {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-radius: 12px;
  border: 1px solid transparent; font-size: .92rem; line-height: 1.55;
}
.aviso__icone {
  display: grid; place-items: center; flex: none;
  width: 20px; height: 20px; margin-top: 1px;
  font-weight: 800; line-height: 1;
}
.aviso__icone .ic { width: 20px; height: 20px; }
.aviso--ok .aviso__icone { color: var(--ok); }
.aviso--erro .aviso__icone { color: var(--erro); }
.aviso--aviso .aviso__icone { color: #b06d08; }
.aviso--info .aviso__icone { color: #2f5f98; }
.aviso__corpo { min-width: 0; }
.aviso__corpo p:last-child { margin-bottom: 0; }
.aviso a { color: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.aviso--ok { background: var(--ok-fundo); border-color: var(--ok-borda); color: #0b5a3d; }
.aviso--erro { background: var(--erro-fundo); border-color: var(--erro-borda); color: #8f1b2a; }
.aviso--aviso { background: var(--aviso-fundo); border-color: var(--aviso-borda); color: #6f4405; }
.aviso--info { background: var(--info-fundo); border-color: var(--info-borda); color: #1f4673; }
.aviso--bloqueio { background: #eef2f8; border-color: #c9d4e4; color: var(--navy-800); }
.aviso--bloqueio .aviso__icone { color: var(--gold-600); }
.aviso--destaque { border-left-width: 3px; }
.aviso--ok.aviso--destaque { border-left-color: var(--ok); }
.aviso--erro.aviso--destaque { border-left-color: var(--erro); }
.aviso--aviso.aviso--destaque { border-left-color: #c27c0e; }
.aviso--info.aviso--destaque { border-left-color: #2f5f98; }
.aviso--bloqueio.aviso--destaque { border-left-color: var(--navy-800); }

.vazio { text-align: center; padding: 56px 24px; color: var(--texto-2); }
.vazio__icone {
  display: grid; place-items: center;
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--gold-100); color: var(--gold-600);
  box-shadow: inset 0 0 0 1px rgba(201, 154, 62, .28);
  font-size: 1.5rem;
}
.vazio__icone .ic { width: 26px; height: 26px; }
.vazio h3 { margin-bottom: .4rem; }
.vazio p { max-width: 30rem; margin: 0 auto 1.3rem; }
.vazio .linha-acoes, .linha-acoes.texto-centro { justify-content: center; }

/* Checklist de implantação */
.passos { list-style: none; padding: 0; margin: 0; }
.passo {
  display: flex; gap: 14px; align-items: center;
  padding: 15px 22px; border-bottom: 1px solid #edf0f4;
  transition: background-color var(--transicao);
}
.passo:hover { background: #fafbfd; }
.passo:last-child { border-bottom: 0; }
.passo__marca {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: #eef1f5; color: var(--texto-2);
  box-shadow: inset 0 0 0 1px var(--borda-forte);
}
.passo--pronto .passo__marca { background: var(--ok-fundo); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-borda); }
.passo--proximo .passo__marca { background: var(--navy-800); color: var(--gold-400); box-shadow: 0 0 0 4px rgba(232, 196, 110, .25); }
.passo__corpo { flex: 1; min-width: 0; }
.passo__titulo { font-weight: 650; color: var(--navy-800); }
.passo__desc { font-size: .86rem; color: var(--texto-2); }
.passo--pronto .passo__titulo { color: var(--texto-3); text-decoration: line-through; text-decoration-color: rgba(18, 115, 79, .5); }

/* Códigos de recuperação 2FA */
.codigos {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  background: var(--superficie-2); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 18px; margin-bottom: 18px;
}
.codigos li {
  font-family: var(--mono); font-size: 1rem;
  letter-spacing: .06em; list-style: none; padding: 5px 0;
}
.qrcode { display: grid; place-items: center; padding: 18px; background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); }
.qrcode svg { width: 208px; height: 208px; }
.segredo-manual {
  font-family: var(--mono);
  background: var(--superficie-2); border: 1px dashed var(--borda-forte);
  border-radius: var(--raio); padding: 11px 14px;
  word-break: break-all; font-size: .92rem;
}

/* Blocos de XML e dados brutos */
.bloco-codigo {
  background: var(--navy-900); color: #d6e0f0;
  border-radius: var(--raio); padding: 16px;
  font-family: var(--mono); font-size: .82rem;
  overflow-x: auto; white-space: pre; max-height: 380px;
}

.definicoes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 28px; margin: 0; }
.definicoes > div { min-width: 0; }
.definicoes dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-3); font-weight: 700; }
.definicoes dd { margin: 3px 0 0; font-weight: 550; color: var(--navy-800); word-break: break-word; }

.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filtros .campo-grupo { min-width: 190px; }

/* Utilitários pontuais */
.texto-centro { text-align: center; }
.texto-suave { color: var(--texto-2); }
.texto-erro { color: var(--erro); }
.texto-ok { color: var(--ok); }
.sem-margem { margin: 0; }
.espaco-cima { margin-top: 18px; }
.espaco-baixo { margin-bottom: 18px; }
.linha-acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pilha { display: grid; gap: 14px; }
.duas-colunas { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.oculto { display: none; }
.pular-para-conteudo {
  position: absolute; left: -9999px;
  background: var(--gold-400); color: var(--navy-900); font-weight: 650;
  padding: 10px 16px; border-radius: 0 0 var(--raio) 0; z-index: 100;
}
.pular-para-conteudo:focus { left: 0; top: 0; }

/* Listas com marcador dourado e perguntas frequentes (ajuda e apuração) */
.lista-marcada { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.lista-marcada li {
  position: relative; padding-left: 22px;
  font-size: .94rem; color: var(--texto-2);
}
.lista-marcada li::before {
  content: ""; position: absolute; left: 4px; top: .62em;
  width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg);
  background: var(--ouro-grad);
}

/* FAQ em <details>: abre e fecha sem uma linha de JavaScript. */
.faq { display: grid; gap: 10px; }
.faq__item {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow var(--transicao), border-color var(--transicao);
}
.faq__item[open] { border-color: var(--borda-forte); box-shadow: var(--sombra); }
.faq__pergunta {
  padding: 15px 48px 15px 20px;
  font-weight: 650; font-size: .98rem; color: var(--navy-800); cursor: pointer;
  position: relative; list-style: none;
  transition: background-color var(--transicao);
}
.faq__pergunta::-webkit-details-marker { display: none; }
.faq__pergunta:hover { background: var(--superficie-2); }
.faq__pergunta:focus-visible { outline: 3px solid var(--gold-400); outline-offset: -3px; }
.faq__pergunta::after {
  content: "+";
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 400; color: var(--gold-600); line-height: 1;
  transition: transform var(--transicao);
}
.faq__item[open] .faq__pergunta::after { transform: translateY(-50%) rotate(45deg); }
.faq__resposta { padding: 0 20px 18px; }
.faq__resposta p { color: var(--texto-2); font-size: .95rem; line-height: 1.7; }
.faq__resposta p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Entrada da página: os blocos sobem em sequência, uma vez só.
   Só "backwards": terminada a animação, nenhum transform fica no elemento
   (um transform remanescente quebraria o véu e o diálogo, que são fixed).
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .pagina > :is(.pagina__cabecalho, .boas-vindas, .mensagens, .aviso, .metricas, .kpis, .painel,
                .duas-colunas, .cartoes-relatorio, .legenda-natureza, .abas, .pilares, .atalhos) {
    animation: surgir .48s var(--curva) backwards;
  }
  .pagina > :nth-child(2) { animation-delay: .05s; }
  .pagina > :nth-child(3) { animation-delay: .1s; }
  .pagina > :nth-child(4) { animation-delay: .15s; }
  .pagina > :nth-child(5) { animation-delay: .2s; }
  .pagina > :nth-child(n + 6) { animation-delay: .25s; }
  .lateral__item--ativo::before { animation: marcar .5s var(--curva) backwards .15s; }
  .metrica--link:hover, a.metrica:hover { transform: translateY(-2px); }
}
@keyframes surgir { from { opacity: 0; transform: translateY(10px); } }
@keyframes marcar { from { transform: scaleY(0); } }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 1080px) {
  .metricas { grid-template-columns: repeat(2, 1fr); }
  .duas-colunas { grid-template-columns: 1fr; }
}

/* No celular o menu vira uma faixa marinho com rolagem horizontal. */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; overflow: visible; }
  .lateral__arcos, .lateral__plataforma { display: none; }
  .lateral__topo { display: flex; align-items: center; padding: 14px 18px; }
  .lateral__logo img { height: 26px; }
  .lateral__nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px; }
  .lateral__grupo { margin-bottom: 0; display: flex; gap: 6px; }
  .lateral__rotulo { display: none; }
  .lateral__item { white-space: nowrap; }
  .lateral__item--ativo::before { left: 12px; right: 12px; top: auto; bottom: 2px; width: auto; height: 2px; border-radius: 2px; }
  .lateral__rodape { display: none; }
  .formulario--duas { grid-template-columns: 1fr; }
  .definicoes { grid-template-columns: 1fr; }
  .codigos { grid-template-columns: 1fr; }
  .pagina, .barra { padding-inline: 18px; }
  /* título e ações não cabem numa linha só no celular: a barra quebra */
  .barra { flex-wrap: wrap; height: auto; min-height: 60px; padding-block: 10px; row-gap: 8px; }
  .barra__acoes { flex-wrap: wrap; justify-content: flex-end; }
  .secao { padding: 44px 0; }
}

@media (max-width: 560px) {
  .metricas { grid-template-columns: 1fr; }
  .topo__nav { gap: 14px; }
  .topo__nav .btn { padding: 8px 14px; }
  .usuario { padding-right: 4px; }
  .usuario__nome, .usuario__email { display: none; }
}

/* ==========================================================================
   Transmissão — barra de ferramentas, seleção, progresso e resultado
   ========================================================================== */
.painel__cabecalho--filtros { flex-wrap: wrap; align-items: flex-end; }
.painel__cabecalho--filtros h3 { margin-right: auto; align-self: center; }
.painel__corpo--separado { border-top: 1px solid var(--borda); }
.campo-grupo--curto { max-width: 170px; }
.campo-grupo--acoes { flex-direction: row; gap: 8px; }
.filtros .campo-grupo--acoes { min-width: 0; }

.barra-ferramentas {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding: 12px 22px; border-bottom: 1px solid var(--borda);
  background: var(--superficie-2);
}
.barra-ferramentas__grupo { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.barra-ferramentas__rotulo {
  font-size: .69rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--texto-3); margin-right: 2px;
}
.barra-ferramentas__contador { margin-left: auto; font-size: .84rem; color: var(--texto-2); font-weight: 500; }

.tabela--selecao .tabela__marca { width: 44px; text-align: center; padding-inline: 12px; }
.tabela--selecao input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold-600); cursor: pointer; }
.tabela tbody tr.linha--erro td { background: #fff7f7; }
.tabela tbody tr.linha--erro:hover td { background: #fdeeee; }

.paginacao {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 22px; border-top: 1px solid var(--borda);
}
.paginacao__links { display: flex; align-items: center; gap: 10px; }

.metrica--link { color: inherit; display: block; transition: box-shadow var(--transicao), transform var(--transicao); }
.metrica--link:hover { text-decoration: none; box-shadow: var(--sombra-hover); }
.metrica--link:focus-visible { outline: none; box-shadow: var(--foco), var(--sombra); }
.metrica--link:hover::after, .metrica--ativa::after { opacity: 1; }
.metrica--ativa { box-shadow: 0 0 0 2px var(--gold-500), 0 10px 24px -14px rgba(184, 134, 43, .55); }

/* Menu suspenso ("Novo evento") */
.menu-suspenso { position: relative; }
.menu-suspenso__lista {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 300px; padding: 6px;
  background: var(--superficie); border: 1px solid var(--borda);
  border-radius: 12px; box-shadow: var(--sombra-g);
  transform-origin: top right;
  animation: menu-abre .16s var(--curva);
}
@keyframes menu-abre { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-suspenso__lista a {
  display: block; padding: 10px 12px; border-radius: 8px;
  color: var(--texto); font-size: .9rem; line-height: 1.35;
}
.menu-suspenso__lista a:hover { background: var(--superficie-2); text-decoration: none; }
.menu-suspenso__lista strong { color: var(--gold-600); margin-right: 6px; }
.menu-suspenso__lista span { display: block; font-size: .78rem; color: var(--texto-3); }

/* Véu de progresso: a página some atrás de um fundo navy desfocado e o que
   está acontecendo fica sozinho no centro. */
.com-sobreposicao { overflow: hidden; }
.sobreposicao, .dialogo {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(10, 22, 40, .55);
  backdrop-filter: blur(8px) saturate(115%);
}
.sobreposicao[hidden], .dialogo[hidden] { display: none; }
.sobreposicao__cartao, .dialogo__cartao {
  position: relative; overflow: hidden;
  background: var(--superficie); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(10, 22, 40, .3), 0 2px 8px rgba(10, 22, 40, .12);
  animation: entrada .28s cubic-bezier(.2, .8, .3, 1) both;
}
.sobreposicao__cartao::before, .dialogo__cartao::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400), var(--gold-100), var(--gold-400));
}
.sobreposicao__cartao { width: 100%; max-width: 440px; padding: 36px 32px 30px; text-align: center; }
.logo__selo--grande { width: 48px; height: 48px; font-size: 1.1rem; border-radius: 13px; margin: 0 auto; }
.anel {
  width: 54px; height: 54px; margin: 22px auto 6px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--gold-100) 90deg, var(--gold-500) 250deg, var(--gold-600) 340deg, transparent 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
  animation: girar 1.05s linear infinite;
}
.sobreposicao__texto { margin: 16px 0 0; font-size: 1.02rem; font-weight: 600; color: var(--navy-800); line-height: 1.4; }
.sobreposicao__nota { margin: 4px 0 0; font-size: .8rem; color: var(--texto-3); }
.sobreposicao__progresso { margin-top: 22px; }
.sobreposicao__percentual {
  display: block; font-size: 2rem; font-weight: 700; line-height: 1;
  color: var(--navy-800); font-variant-numeric: tabular-nums; margin-bottom: 10px;
}
.progresso { height: 7px; border-radius: 99px; background: #eceff4; overflow: hidden; }
.progresso__barra {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400));
  transition: width .35s ease;
}
.sobreposicao__detalhe { margin: 12px 0 0; min-height: 1.25rem; font-size: .82rem; color: var(--texto-2); }

.dialogo__cartao { width: 100%; max-width: 860px; max-height: 90vh; display: flex; flex-direction: column; padding: 26px 28px 22px; }
.dialogo__cabecalho { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dialogo__cabecalho h3 { margin: 0; }
.dialogo__mensagem { color: var(--texto-2); margin-bottom: 14px; }
.dialogo__tabela { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--borda); border-radius: var(--raio); }
.dialogo__acoes { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; }

@keyframes entrada { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes girar { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .sobreposicao__cartao, .dialogo__cartao, .menu-suspenso__lista { animation: none; }
  .anel { animation-duration: 2.4s; }
  .progresso__barra { transition: none; }
}

/* Formulários de evento e cadastro */
.detalhes { border: 1px solid var(--borda); border-radius: var(--raio); background: var(--superficie-2); }
.detalhes > summary { padding: 11px 14px; font-weight: 600; font-size: .92rem; cursor: pointer; list-style: none; }
.detalhes > summary::-webkit-details-marker { display: none; }
.detalhes > summary::before { content: "+"; display: inline-block; width: 18px; color: var(--gold-600); font-weight: 700; }
.detalhes[open] > summary::before { content: "−"; }
.detalhes > summary:focus-visible { outline: 3px solid var(--gold-400); outline-offset: -3px; }
.detalhes > .formulario { padding: 0 14px 14px; }
.opcoes-marcar { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 4px 0; }
.formulario--linha { grid-template-columns: 200px 1fr auto; align-items: end; }
.formulario--linha .formulario__acoes { padding-top: 0; grid-column: auto; }
.passos--compacto .passo { padding: 12px 0; }
.secao-titulo { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); margin: 18px 0 8px; }

/* Rejeição da Receita: resposta bruta e painel destacado */
.resposta-bruta {
  white-space: pre-wrap; word-break: break-word; margin: 0;
  font-family: var(--mono); font-size: .8rem;
  background: var(--superficie-2); border: 1px solid var(--borda); border-radius: var(--raio);
  padding: 12px 14px; max-height: 320px; overflow: auto;
}
.detalhes > .resposta-bruta { margin: 0 14px 14px; border: 0; }
.painel--recusa { border-left: 4px solid var(--erro); }
[hidden] { display: none !important; }

@media (max-width: 1080px) {
  .formulario--linha { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .barra-ferramentas__contador { margin-left: 0; width: 100%; }
  .campo-grupo--curto { max-width: none; }
  .sobreposicao, .dialogo { padding: 12px; }
  .dialogo__cartao { padding: 20px 16px 16px; }
}

@media print {
  .lateral, .barra, .pagina__acoes, .btn { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; }
}

/* ==========================================================================
   Apuração Assistida
   Três naturezas de valor, sempre com selo: oficial (Receita), calculado
   (TaxGold) e indisponível. As cores das séries do gráfico passaram pelo
   validador de paleta (contraste e separação para daltonismo).
   ========================================================================== */
:root {
  --serie-debitos: #2a78d6;
  --serie-creditos: #eb6834;
  --grade: #edf0f4;
}

.logo__marca--plataforma { font-weight: 600; font-size: .92rem; }
.lateral__item--topo { font-weight: 600; color: rgba(255, 255, 255, .86); }

/* Selos de natureza */
.natureza {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 650;
  letter-spacing: .01em; border: 1px solid transparent;
}
.natureza::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.natureza--oficial { background: var(--gold-100); color: #7a5a0e; border-color: #efdcae; }
.natureza--calculado { background: var(--info-fundo); color: var(--info); border-color: #c8ddf5; }
.natureza--local { background: #eef0f4; color: var(--texto-2); border-color: var(--borda); }
.natureza--indisponivel { background: transparent; color: var(--texto-3); border: 1px dashed var(--borda-forte); }
.natureza--indisponivel::before { background: transparent; border: 1px solid currentColor; }

.legenda-natureza {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 14px; margin-bottom: 18px; font-size: .84rem; color: var(--texto-2);
  background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio);
}
.legenda-natureza > span:not(.natureza) { margin-right: 10px; }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi {
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  padding: 18px 20px; background: var(--superficie); color: var(--texto);
  border: 1px solid transparent; border-radius: var(--raio-g); box-shadow: var(--sombra);
  transition: box-shadow var(--transicao), transform var(--transicao), border-color var(--transicao);
  animation: kpi-entrada 360ms var(--curva) both;
}
a.kpi:hover { text-decoration: none; box-shadow: var(--sombra-hover); transform: translateY(-2px); }
a.kpi:focus-visible { outline: none; box-shadow: var(--foco), var(--sombra); }
.kpi__valor { color: var(--navy-800); }
.kpi--oficial { border-top: 3px solid var(--gold-500); }
.kpi--calculado { border-top: 3px solid var(--info); background: linear-gradient(180deg, #f7fbff, var(--superficie) 60%); }
.kpi__topo { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
.kpi__rotulo { font-size: .82rem; font-weight: 600; color: var(--texto-2); }
.kpi__valor { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2;
              font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi__nota { font-size: .78rem; color: var(--texto-3); line-height: 1.4; }
.kpi--carregando { animation: none; }
@keyframes kpi-entrada { from { transform: translateY(6px); } to { transform: none; } }

/* Esqueletos (carregamento) */
.esqueleto {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, #eef1f5 0%, #f7f9fb 40%, #eef1f5 80%);
  background-size: 200% 100%; animation: esqueleto 1.3s ease-in-out infinite;
}
.esqueleto--linha { height: 12px; width: 70%; }
.esqueleto--curta { width: 45%; }
.esqueleto--valor { height: 28px; width: 85%; margin: 4px 0; }
.esqueleto--mini { display: inline-block; height: 12px; width: 48px; vertical-align: middle; }
.esqueleto--grafico { height: 240px; width: 100%; border-radius: var(--raio); }
@keyframes esqueleto { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Gráfico */
.grafico { position: relative; min-height: 240px; }
.grafico__svg { display: block; overflow: visible; }
.grafico__grade { stroke: var(--grade); stroke-width: 1; }
.grafico__base { stroke: var(--borda-forte); stroke-width: 1; }
.grafico__eixo { fill: var(--texto-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.grafico__barra--debitos { fill: var(--serie-debitos); }
.grafico__barra--creditos { fill: var(--serie-creditos); }
.grafico__alvo { fill: transparent; cursor: crosshair; }
.grafico__alvo--ativo { fill: rgba(15, 31, 56, .045); }
.grafico__vazio { color: var(--texto-2); text-align: center; padding: 80px 12px; margin: 0; }
.grafico__foco { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.grafico-legenda { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0 0 10px; font-size: .84rem; color: var(--texto-2); }
.grafico-legenda li { display: inline-flex; align-items: center; gap: 7px; }
.grafico-legenda__marca { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.grafico-legenda__marca--debitos { background: var(--serie-debitos); }
.grafico-legenda__marca--creditos { background: var(--serie-creditos); }
.grafico-dica {
  position: absolute; z-index: 5; min-width: 220px; pointer-events: none;
  padding: 10px 12px; font-size: .82rem; line-height: 1.5;
  background: var(--navy-900); color: #fff; border-radius: var(--raio); box-shadow: var(--sombra-g);
}
.grafico-dica strong { display: block; margin-bottom: 4px; }
.grafico-dica__linha { display: flex; justify-content: space-between; gap: 16px; }
.grafico-dica__linha span:first-child { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .75); }
.painel__corpo { position: relative; }

/* Tabelas numéricas e listas */
.numero, .tabela--numeros td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabela--numeros th:not(:first-child) { text-align: right; }
.lista-indisponivel { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.lista-indisponivel li { display: grid; gap: 2px; font-size: .9rem; }
.definicoes__largo { grid-column: 1 / -1; }

/* Fila ao vivo */
.fila-viva { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.fila-viva__item { display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.fila-viva__item .selo { margin-left: auto; }
.fila-viva__fim { font-size: .84rem; color: var(--texto-3); }
.girador {
  width: 12px; height: 12px; flex: none; border-radius: 50%;
  border: 2px solid var(--borda-forte); border-top-color: var(--gold-600);
  animation: girar 900ms linear infinite;
}

/* Cota diária */
.cota__rotulo { display: flex; justify-content: space-between; font-size: .86rem; margin-bottom: 4px; }
.cota__barra { width: 100%; height: 7px; border: 0; border-radius: 99px; overflow: hidden; background: #eceff4; appearance: none; }
.cota__barra::-webkit-progress-bar { background: #eceff4; border-radius: 99px; }
.cota__barra::-webkit-progress-value { background: var(--gold-500); border-radius: 99px; }
.cota__barra::-moz-progress-bar { background: var(--gold-500); border-radius: 99px; }

/* Abas, grades de cartões e rastreabilidade */
.abas { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--borda); margin-bottom: 18px; }
.abas__item { padding: 9px 14px; font-size: .9rem; font-weight: 600; color: var(--texto-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.abas__item:hover { color: var(--texto); text-decoration: none; }
.abas__item--ativo { color: var(--navy-800); border-bottom-color: var(--gold-500); }
.cartoes-relatorio { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.grupos-divergencia { display: flex; flex-wrap: wrap; gap: 8px; }
.grupos-divergencia a { display: inline-flex; align-items: center; gap: 8px; }
.rastro { font-size: .8rem; color: var(--texto-3); word-break: break-all; margin: 6px 0 0; }
.rastro dt { font-weight: 650; color: var(--texto-2); }
.rastro dd { margin: 0 0 6px; }
.form-tratar { display: grid; gap: 8px; margin-top: 8px; }
.somatorio { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .9rem; margin-bottom: 14px; }
.somatorio strong { font-variant-numeric: tabular-nums; }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .legenda-natureza > span:not(.natureza) { margin-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi, .esqueleto, .girador { animation: none; }
  a.kpi:hover { transform: none; }
}

/* ==========================================================================
   Dashboard Geral · "Centro de comando"
   Faixa marinho com a saudação e os dois módulos; números, passos, atividade
   e atalhos abaixo. Mesma família da entrada (acesso.css).
   ========================================================================== */
.boas-vindas {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  align-items: center;
  gap: 1.5rem 2.5rem;
  margin-bottom: 22px;
  padding: 30px 32px;
  overflow: hidden;
  border-radius: 20px;
  color: #eef2f7;
  background:
    radial-gradient(55% 120% at 92% 0%, rgba(232, 196, 110, .2) 0%, rgba(232, 196, 110, 0) 62%),
    radial-gradient(130% 150% at 100% 0%, #1d3a63 0%, var(--navy-800) 48%, var(--navy-900) 100%);
  box-shadow: 0 24px 48px -32px rgba(11, 27, 48, .7);
  isolation: isolate;
}
.boas-vindas::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 90% at 20% 30%, #000 10%, transparent 75%);
  mask-image: radial-gradient(70% 90% at 20% 30%, #000 10%, transparent 75%);
}
.boas-vindas__arcos { position: absolute; right: -130px; top: -170px; z-index: -1; width: 540px; height: 540px; pointer-events: none; opacity: .5; }
.boas-vindas__arcos circle { fill: none; stroke: url(#bvOuro); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 18; }
.boas-vindas__arcos .a1 { stroke-width: 2; }
.boas-vindas__arcos .a2 { stroke-width: 1.5; opacity: .6; }
.boas-vindas__arcos .a3 { stroke-width: 1.2; opacity: .35; }
.boas-vindas__data {
  display: inline-flex; align-items: center; gap: .55rem; margin: 0;
  color: var(--gold-400);
  font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.boas-vindas__data::before { content: ""; width: 20px; height: 2px; border-radius: 2px; background: var(--ouro-grad); }
.boas-vindas h2 {
  margin: .5rem 0 .45rem;
  color: #fff;
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem);
  line-height: 1.12; letter-spacing: -.03em;
}
.boas-vindas h2 em {
  font-family: var(--serif); font-size: 1.12em; font-style: italic; font-weight: 400; letter-spacing: -.01em;
  background: linear-gradient(100deg, #f5e3b5 0%, #e5c272 45%, #c99a3e 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.boas-vindas__resumo { max-width: 52ch; margin: 0 0 .9rem; color: #b7c3d4; }
.boas-vindas__contexto { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin: 0; padding: 0; list-style: none; }
.boas-vindas__contexto li {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .7rem; border-radius: 999px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  color: #c9d3e0; font-size: .78rem;
}
.boas-vindas__contexto .ic { color: var(--gold-400); width: 14px; height: 14px; }

/* os dois módulos */
.pilares { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.pilar {
  position: relative;
  display: flex; flex-direction: column; gap: .2rem;
  min-height: 150px; padding: 1rem 1.05rem;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  color: #c9d3e0;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .2s var(--curva), border-color .2s var(--curva), background-color .2s var(--curva), box-shadow .2s var(--curva);
}
.pilar:hover {
  text-decoration: none; color: #dfe6ef;
  border-color: rgba(232, 196, 110, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 18px 34px -22px rgba(0, 0, 0, .8);
  transform: translateY(-2px);
}
.pilar:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 3px; }
.pilar__icone {
  display: grid; place-items: center;
  width: 36px; height: 36px; margin-bottom: .45rem;
  border-radius: 11px;
  background: var(--ouro-grad); color: #1d1404;
  box-shadow: 0 8px 18px -10px rgba(232, 196, 110, .8);
}
.pilar__icone .ic { width: 18px; height: 18px; }
.pilar__rotulo { color: var(--gold-400); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.pilar__titulo { color: #fff; font-size: 1.08rem; font-weight: 700; letter-spacing: -.015em; }
.pilar__estado { font-size: .82rem; line-height: 1.4; }
.pilar__ir { display: inline-flex; align-items: center; gap: .35rem; margin-top: auto; padding-top: .6rem; color: #f3dfae; font-size: .8rem; font-weight: 650; }
.pilar__ir .ic { width: 14px; height: 14px; transition: transform .2s var(--curva); }
.pilar:hover .pilar__ir .ic { transform: translateX(3px); }

/* ícone das métricas */
.metrica__icone {
  position: absolute; top: 16px; right: 16px;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--gold-100); color: var(--gold-600);
  box-shadow: inset 0 0 0 1px rgba(201, 154, 62, .25);
}
.metrica__icone .ic { width: 17px; height: 17px; }
.metrica--alerta .metrica__icone { background: var(--erro-fundo); color: var(--erro); box-shadow: inset 0 0 0 1px var(--erro-borda); }

/* passos: quantos faltam */
.progresso-passos { align-items: center; gap: 10px; color: var(--texto-2); font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.progresso-passos .cota__barra { width: 110px; }

/* atividade recente em linha do tempo */
.linha-tempo { position: relative; display: grid; gap: 14px; margin: 0; padding: 0 0 0 20px; list-style: none; }
.linha-tempo::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1.5px; background: linear-gradient(180deg, var(--gold-500), var(--borda) 85%); }
.linha-tempo li { position: relative; display: grid; gap: 1px; line-height: 1.35; }
.linha-tempo li::before {
  content: ""; position: absolute; left: -20px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--superficie); box-shadow: inset 0 0 0 2px var(--gold-500);
}
.linha-tempo li:first-child::before { background: var(--gold-500); box-shadow: 0 0 0 4px rgba(232, 196, 110, .25); }
.linha-tempo .principal { font-size: .88rem; }

/* atalhos em ladrilhos */
.atalhos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.atalhos a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--borda);
  color: var(--navy-800); font-size: .84rem; font-weight: 600; line-height: 1.3;
  transition: border-color var(--transicao), background-color var(--transicao), transform var(--transicao), box-shadow var(--transicao);
}
.atalhos a .ic {
  width: 30px; height: 30px; padding: 7px; border-radius: 9px;
  background: var(--superficie-2); color: var(--gold-600); box-shadow: inset 0 0 0 1px var(--borda);
  transition: background-color var(--transicao), color var(--transicao);
}
.atalhos a:hover { text-decoration: none; border-color: rgba(201, 154, 62, .45); background: #fffdf8; box-shadow: var(--sombra); transform: translateY(-1px); }
.atalhos a:hover .ic { background: var(--gold-100); color: var(--ouro-tinta); }
.atalhos a:focus-visible { outline: none; box-shadow: var(--foco); }

@media (prefers-reduced-motion: no-preference) {
  .boas-vindas__arcos circle { animation: desenhar 1.8s var(--curva) backwards; }
  .boas-vindas__arcos .a2 { animation-delay: .15s; }
  .boas-vindas__arcos .a3 { animation-delay: .3s; }
  .pilar { animation: surgir .5s var(--curva) backwards .18s; }
  .pilar + .pilar { animation-delay: .26s; }
}
@keyframes desenhar { from { stroke-dashoffset: 100; } }
@media (prefers-reduced-motion: reduce) {
  .pilar:hover, .atalhos a:hover { transform: none; }
}
@media (max-width: 1180px) {
  .boas-vindas { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .boas-vindas { padding: 22px 20px; border-radius: 16px; }
  .atalhos { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   Assinatura, administração dos assinantes (/gestao/) e acesso de suporte
   ========================================================================== */
.selo--link { transition: filter var(--transicao), box-shadow var(--transicao); }
.selo--link:hover { text-decoration: none; filter: brightness(.95); }
.selo--link:focus-visible { outline: none; box-shadow: var(--foco); }

/* Acesso de suporte: faixa no topo de toda tela e risco na barra fixa. A cor
   foge de propósito do marinho e do ouro do sistema, para o superusuário não
   confundir o ambiente do cliente com o dele. */
.faixa-suporte {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  padding: 10px 28px;
  background: linear-gradient(90deg, #5c1a24, #8f1b2a);
  color: #fff; font-size: .88rem; line-height: 1.45;
}
.faixa-suporte__icone {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .14);
}
.faixa-suporte__texto { margin: 0; flex: 1 1 320px; }
.faixa-suporte__texto b { color: var(--gold-400); font-weight: 700; }
.faixa-suporte form { margin: 0; }
.em-suporte .barra { border-bottom: 2px solid #8f1b2a; }

/* Vários formulários de um botão só, lado a lado numa célula de tabela. */
.acoes-rapidas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.acoes-rapidas form { margin: 0; }
.detalhes + .detalhes { margin-top: 10px; }
.detalhes > .formulario > .ajuda { margin: 0; }

@media (max-width: 880px) {
  .faixa-suporte { padding-inline: 18px; }
  .acoes-rapidas { justify-content: flex-start; }
}

/* ==========================================================================
   Cockpit · efeitos das telas internas ("futurismo sóbrio")
   Vidro, luz dourada e dados que acendem, sem atrapalhar quem trabalha:
   - fundo vivo (auroras e grade de pontos) atrás do conteúdo;
   - barra de luz no topo ao trocar de tela e paleta de comandos (Ctrl+K);
   - realce que desliza no menu; luz que segue o ponteiro nos cartões;
   - números que contam, painéis que aparecem ao rolar, linhas que entram
     em sequência e o selo "ao vivo" de quem aguarda a Receita.
   O comportamento está em static/js/sistema.js. Com "reduzir movimento",
   nada se mexe; a paleta continua.
   ========================================================================== */

/* intensidade da luz dos cartões: registrada para poder ter transição */
@property --luz { syntax: "<number>"; inherits: false; initial-value: 0; }
@property --angulo { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ── Fundo vivo ──────────────────────────────────────────────────────────── */
.ambiente { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.ambiente::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(16, 37, 65, .075) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 30%, transparent 62%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 30%, transparent 62%);
}
.ambiente__aurora { position: absolute; width: 64vmax; height: 64vmax; border-radius: 50%; will-change: transform; }
.ambiente__aurora--ouro {
  top: -30vmax; right: -16vmax;
  background: radial-gradient(closest-side, rgba(232, 196, 110, .24), rgba(232, 196, 110, 0));
}
.ambiente__aurora--azul {
  bottom: -36vmax; left: 8vw;
  background: radial-gradient(closest-side, rgba(70, 128, 214, .13), rgba(70, 128, 214, 0));
}
.app { position: relative; z-index: 1; }

/* ── Barra de luz ao trocar de tela ──────────────────────────────────────── */
.navegacao-luz {
  position: fixed; top: 0; left: 0; right: 0; z-index: 120;
  height: 2px; pointer-events: none;
  transform: scaleX(0); transform-origin: left; opacity: 0;
  background: linear-gradient(90deg, rgba(232, 196, 110, 0), #e8c46e 30%, #fff1c9 55%, #c99a3e 85%);
  box-shadow: 0 0 14px rgba(232, 196, 110, .75), 0 0 2px rgba(232, 196, 110, .9);
}
.navegando .navegacao-luz { opacity: 1; transform: scaleX(.6); }
.navegando, .navegando a { cursor: progress; }

/* ── Barra superior: módulo acima do título e atalho da paleta ──────────── */
.barra::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(201, 154, 62, 0), rgba(201, 154, 62, .55) 30%, rgba(201, 154, 62, 0) 75%);
}
.barra__cabeca { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.barra__modulo {
  display: flex; align-items: center; gap: 7px; margin: 0 0 1px;
  color: var(--ouro-tinta);
  font-size: .63rem; font-weight: 700; letter-spacing: .15em; line-height: 1.2; text-transform: uppercase;
}
.barra__modulo::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: var(--ouro-grad); }
.barra__titulo { line-height: 1.25; }

kbd {
  display: inline-grid; place-items: center; min-width: 20px; padding: 1px 6px;
  border: 1px solid var(--borda-forte); border-bottom-width: 2px; border-radius: 6px;
  background: #fff; color: var(--texto-2);
  font-family: var(--fonte); font-size: .7rem; font-weight: 650; line-height: 1.5;
}
.comando-gatilho {
  display: inline-flex; align-items: center; gap: 10px;
  min-width: 250px; height: 38px; margin-left: 22px; padding: 0 7px 0 12px;
  border: 1px solid var(--borda); border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(16, 37, 65, .04);
  color: var(--texto-3); font: inherit; font-size: .86rem; cursor: pointer;
  transition: border-color var(--transicao), box-shadow var(--transicao), color var(--transicao), background-color var(--transicao);
}
.comando-gatilho .ic { width: 17px; height: 17px; color: var(--gold-600); }
.comando-gatilho kbd { margin-left: auto; }
.comando-gatilho:hover { color: var(--navy-800); border-color: rgba(201, 154, 62, .5); background: #fff; box-shadow: 0 0 0 4px rgba(232, 196, 110, .14), 0 8px 18px -12px rgba(184, 134, 43, .6); }
.comando-gatilho:focus-visible { outline: none; box-shadow: var(--foco); }

/* ── Paleta de comandos ──────────────────────────────────────────────────── */
.comando {
  width: min(640px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  margin: 12vh auto auto; padding: 0;
  border: 1px solid rgba(255, 255, 255, .7); border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 40px 90px -30px rgba(10, 23, 42, .6), 0 0 0 1px rgba(16, 37, 65, .07), inset 0 1px 0 #fff;
  color: var(--texto);
  overflow: hidden;
}
.comando[open] { display: flex; flex-direction: column; }
.comando::backdrop { background: rgba(10, 23, 42, .42); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.comando::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, rgba(232, 196, 110, 0), #e8c46e 40%, rgba(232, 196, 110, 0));
}
.comando__busca { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--borda); }
.comando__busca > .ic { width: 20px; height: 20px; color: var(--gold-600); }
.comando__campo { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--navy-800); font: inherit; font-size: 1.05rem; }
.comando__campo::placeholder { color: #98a3b3; }
.comando__lista { flex: 1; min-height: 0; margin: 0; padding: 8px; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.comando__grupo { padding: 10px 10px 4px; color: var(--texto-3); font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.comando__item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 12px;
  color: var(--navy-800); font-weight: 600; cursor: pointer;
  transition: background-color .12s var(--curva);
}
.comando__item .ic {
  width: 32px; height: 32px; padding: 7px; border-radius: 9px;
  background: var(--superficie-2); color: var(--gold-600); box-shadow: inset 0 0 0 1px var(--borda);
  transition: background-color .12s var(--curva), color .12s var(--curva);
}
.comando__item[aria-selected="true"] { background: linear-gradient(90deg, rgba(232, 196, 110, .2), rgba(232, 196, 110, .04)); box-shadow: inset 0 0 0 1px rgba(201, 154, 62, .32); }
.comando__item[aria-selected="true"] .ic { background-color: #d9ae57; background-image: var(--ouro-grad); color: #1d1404; box-shadow: none; }
.comando__dica { margin-left: auto; color: var(--texto-3); font-size: .76rem; font-weight: 500; white-space: nowrap; }
.comando__vazio { margin: 0; padding: 28px; color: var(--texto-2); text-align: center; }
.comando__rodape {
  display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 16px;
  border-top: 1px solid var(--borda); background: rgba(248, 250, 252, .75);
  color: var(--texto-3); font-size: .74rem;
}
.comando__rodape kbd { margin-right: 3px; }

/* ── Menu: realce que desliza e item ativo aceso ─────────────────────────── */
.lateral__nav { position: relative; }
.lateral__luz {
  position: absolute; left: 12px; right: 12px; top: 0; z-index: 0;
  height: var(--h, 38px); transform: translateY(var(--y, 0));
  border-radius: 10px; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .28s var(--curva), height .28s var(--curva), opacity .2s var(--curva);
}
.lateral__luz.is-visivel { opacity: 1; }
.tem-luz .lateral__item:not(.lateral__item--ativo):hover { background: transparent; }
.lateral__item--ativo,
.lateral__item--ativo:hover { box-shadow: inset 0 0 0 1px rgba(232, 196, 110, .2), 0 10px 26px -14px rgba(232, 196, 110, .45); }
.lateral__item--ativo::before { box-shadow: 0 0 12px rgba(232, 196, 110, .85); }

/* ── Cartões: luz que segue o ponteiro e borda que acende ────────────────── */
.metrica, .kpi, .atalhos a {
  --luz-fundo: linear-gradient(var(--superficie), var(--superficie));
  --luz-borda: linear-gradient(transparent, transparent);
  border: 1px solid transparent;
  background:
    radial-gradient(260px circle at var(--mx, -500px) var(--my, -500px), rgba(232, 196, 110, calc(.16 * var(--luz))), rgba(232, 196, 110, 0) 65%) padding-box,
    var(--luz-fundo) padding-box,
    radial-gradient(190px circle at var(--mx, -500px) var(--my, -500px), rgba(201, 154, 62, calc(.95 * var(--luz))), rgba(201, 154, 62, 0) 70%) border-box,
    var(--luz-borda) border-box;
  transition: --luz .35s var(--curva), box-shadow var(--transicao), transform var(--transicao), border-color var(--transicao);
}
.metrica:hover, .kpi:hover, .atalhos a:hover { --luz: 1; }
.metrica--alerta { --luz-fundo: linear-gradient(180deg, #fff6f7, var(--superficie) 70%); }
.kpi--calculado { --luz-fundo: linear-gradient(180deg, #f7fbff, var(--superficie) 60%); }
.kpi--oficial { border-top: 3px solid var(--gold-500); }
.kpi--calculado { border-top: 3px solid var(--info); }
.atalhos a { --luz-borda: linear-gradient(var(--borda), var(--borda)); }
.atalhos a:hover { --luz-fundo: linear-gradient(#fffdf8, #fffdf8); --luz-borda: linear-gradient(rgba(201, 154, 62, .35), rgba(201, 154, 62, .35)); }
.painel {
  background:
    linear-gradient(var(--superficie), var(--superficie)) padding-box,
    radial-gradient(340px circle at var(--mx, -700px) var(--my, -700px), rgba(201, 154, 62, calc(.6 * var(--luz))), rgba(201, 154, 62, 0) 70%) border-box;
  transition: --luz .45s var(--curva), box-shadow var(--transicao);
}
.painel:hover { --luz: 1; }
.pilar {
  background:
    radial-gradient(220px circle at var(--mx, -500px) var(--my, -500px), rgba(232, 196, 110, calc(.18 * var(--luz))), rgba(232, 196, 110, 0) 65%),
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
  transition: --luz .35s var(--curva), transform .2s var(--curva), border-color .2s var(--curva), box-shadow .2s var(--curva);
}
.pilar:hover { --luz: 1; }
/* vidro: métricas sobre o fundo vivo */
.metrica { --luz-fundo: linear-gradient(rgba(255, 255, 255, .9), rgba(255, 255, 255, .9)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.metrica--alerta { --luz-fundo: linear-gradient(180deg, rgba(255, 246, 247, .95), rgba(255, 255, 255, .9) 70%); }
.metrica__valor.contando { color: var(--navy-700); }

/* ── Botões ──────────────────────────────────────────────────────────────── */
.btn--primario { overflow: hidden; }
.btn--primario::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 48%, transparent 66%);
  transform: translateX(-120%);
}
.btn--escuro { box-shadow: 0 1px 2px rgba(10, 23, 42, .25), inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 18px -12px rgba(16, 37, 65, .7); }

/* ── Campos: seta própria nos selects e foco que acende ──────────────────── */
select.campo:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8862b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.campo:focus { box-shadow: var(--foco), 0 6px 20px -10px rgba(232, 196, 110, .7); }
.busca-campo { position: relative; }
.busca-campo > .ic { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--texto-3); pointer-events: none; }
.busca-campo > .campo { padding-left: 38px; }
.busca-campo:focus-within > .ic { color: var(--gold-600); }

/* ── Tabelas ─────────────────────────────────────────────────────────────── */
.tabela thead th { background: linear-gradient(180deg, #fbfcfd, #f5f7fa); }
.tabela-rolagem { scrollbar-width: thin; scrollbar-color: #cfd6e0 transparent; }
/* CNPJ, protocolo e período não quebram no meio */
.tabela .mono { white-space: nowrap; }

/* grupos de opções (Apuração: consultas da sincronização e da configuração) */
fieldset.campo-grupo { margin: 0; padding: 12px 14px 14px; border: 1px solid var(--borda); border-radius: 12px; background: var(--superficie-2); }
fieldset.campo-grupo > legend { padding: 0 6px; margin-left: -4px; color: #2b3a52; font-size: .84rem; font-weight: 650; }

/* monograma das empresas */
.empresa-celula { display: flex; align-items: center; gap: 12px; min-width: 0; }
.monograma {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--gold-400); font-size: .76rem; font-weight: 750; letter-spacing: .03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 14px -8px rgba(10, 23, 42, .7);
  transition: background-color var(--transicao), color var(--transicao), box-shadow var(--transicao);
}
.tabela tbody tr:hover .monograma { background: linear-gradient(135deg, #eed39a, #bf8e32); color: #1d1404; box-shadow: 0 6px 16px -8px rgba(184, 134, 43, .8); }

/* selo "ao vivo": evento transmitido aguardando a Receita */
.selo--vivo::before { opacity: 1; }

/* ── Estado vazio: radar em volta do ícone ───────────────────────────────── */
.vazio__icone { position: relative; isolation: isolate; }
.vazio__icone::before {
  content: ""; position: absolute; inset: -9px; z-index: -1; border-radius: 22px; padding: 1.5px;
  background: conic-gradient(from var(--angulo), rgba(232, 196, 110, 0) 0 62%, rgba(232, 196, 110, .75) 86%, rgba(232, 196, 110, 0) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.vazio__icone::after {
  content: ""; position: absolute; inset: -9px; z-index: -2; border-radius: 22px;
  box-shadow: inset 0 0 0 1px rgba(201, 154, 62, .18), 0 14px 32px -16px rgba(184, 134, 43, .55);
}

/* ── Véu de progresso da Transmissão: o "G" dentro do anel ───────────────── */
.sobreposicao__orbita { position: relative; width: 88px; height: 88px; margin: 0 auto; }
.sobreposicao__orbita .anel { position: absolute; inset: 0; width: auto; height: auto; margin: 0; }
.sobreposicao__marca { position: absolute; left: 50%; top: 50%; width: 42px; height: auto; transform: translate(-50%, -52%); }
.sobreposicao__cartao { background: radial-gradient(120% 60% at 50% 0%, rgba(232, 196, 110, .14), rgba(232, 196, 110, 0) 70%), var(--superficie); }
.sobreposicao__orbita + .sobreposicao__texto { margin-top: 20px; }

/* ── Painéis que aparecem ao rolar (o sistema.js põe e tira as classes) ─── */
.revelar { opacity: 0; transform: translateY(18px); }
.revelar.revelado { opacity: 1; transform: none; transition: opacity .6s var(--curva), transform .6s var(--curva); }

/* ── Movimento (só sem "reduzir movimento") ──────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .ambiente__aurora--ouro { animation: aurora-a 38s ease-in-out infinite alternate; }
  .ambiente__aurora--azul { animation: aurora-b 46s ease-in-out infinite alternate; }
  .navegando .navegacao-luz { animation: luz-navega 2.6s var(--curva) forwards; }
  .btn--primario:hover::before { transform: translateX(120%); transition: transform .8s var(--curva); }
  .selo--vivo::before { animation: pulso-vivo 1.8s var(--curva) infinite; }
  .vazio__icone::before { animation: radar 3.6s linear infinite; }
  .comando[open] { animation: comando-abre .22s var(--curva); }
  .comando[open]::backdrop { animation: comando-veu .22s ease; }
  .comando__lista .comando__item { animation: comando-item .26s var(--curva) backwards; }
  .tabela tbody tr { animation: linha-entra .42s var(--curva) backwards; }
  .tabela tbody tr:nth-child(2) { animation-delay: .03s; }
  .tabela tbody tr:nth-child(3) { animation-delay: .06s; }
  .tabela tbody tr:nth-child(4) { animation-delay: .09s; }
  .tabela tbody tr:nth-child(5) { animation-delay: .12s; }
  .tabela tbody tr:nth-child(6) { animation-delay: .15s; }
  .tabela tbody tr:nth-child(7) { animation-delay: .18s; }
  .tabela tbody tr:nth-child(8) { animation-delay: .21s; }
  .tabela tbody tr:nth-child(9) { animation-delay: .24s; }
  .tabela tbody tr:nth-child(10) { animation-delay: .27s; }
  .tabela tbody tr:nth-child(n + 11) { animation-delay: .3s; }
  .lateral__item--ativo::before { animation: marcar .5s var(--curva) backwards .15s, brilho-ativo 3.2s ease-in-out infinite 1s; }
  .barra__modulo::before { animation: modulo-traco .7s var(--curva) backwards .1s; transform-origin: left; }
}
@keyframes aurora-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-9vmax, 7vmax, 0) scale(1.12); } }
@keyframes aurora-b { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(12vmax, -8vmax, 0) scale(1.08); } }
@keyframes luz-navega { 0% { transform: scaleX(0); } 55% { transform: scaleX(.72); } 100% { transform: scaleX(.94); } }
@keyframes pulso-vivo {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70%, 100% { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0); }
}
@keyframes radar { to { --angulo: 360deg; } }
@keyframes comando-abre { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
@keyframes comando-veu { from { opacity: 0; } }
@keyframes comando-item { from { opacity: 0; transform: translateY(4px); } }
@keyframes linha-entra { from { opacity: 0; transform: translateX(-6px); } }
@keyframes brilho-ativo { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes modulo-traco { from { transform: scaleX(0); } }

@media (max-width: 1080px) {
  .comando-gatilho { min-width: 0; }
  .comando-gatilho__texto { display: none; }
}
@media (max-width: 880px) {
  .lateral__luz { display: none; }
  .comando-gatilho { margin-left: auto; height: 36px; }
  .comando-gatilho kbd { display: none; }
  .barra__modulo { font-size: .6rem; }
  .comando { margin-top: 8vh; }
}
@media print {
  .ambiente, .navegacao-luz, .comando-gatilho, .comando { display: none !important; }
}
