/* Identidade visual JLX (docs/convencoes.md, "Identidade visual").
   Tokens: claro por padrão; escuro automático (prefers-color-scheme) ou forçado por data-tema em <html>.
   Os nomes das variáveis são contrato com os CSS de módulo (web/css): muda-se o valor, nunca o nome. */
:root {
  color-scheme: light;
  /* marca */
  --noite: #0a1020; --ciano: #38c6f4; --azul-jlx: #1e5bff;
  --degrade: linear-gradient(135deg, #38c6f4, #1e5bff 55%, #2fb4f0); /* corte em X (marcador do menu, título, login) e indicador das abas */
  /* superfícies e texto */
  --fundo: #f4f6fb; --painel: #ffffff; --borda: #e1e6ef; --borda-campo: #7a869b; --texto: #0f1b33; --suave: #515d75;
  --marinho: #0f1b33; --lateral-texto: #c3cee2; --lateral-suave: #8f9bb3; --lateral-hover: #141d31; --lateral-ativo: #1a2742; --lateral-linha: rgba(255, 255, 255, .08);
  --azul: #1e5bff; --azul-hover: #1747d6; --azul-ativo: #1238b0; --azul-suave: rgba(30, 91, 255, .09); --link: #1a4fd6; --azul-claro: #38c6f4;
  --foco: #1e5bff; /* anel de foco: 5,3:1 sobre o branco e 4,9:1 sobre o fundo (WCAG 1.4.11 pede 3:1) */
  --verde: #0f7b45; --verde-bg: #e3f6ea; --vermelho: #b42318; --vermelho-bg: #fde8e6; --ambar: #8a5a00; --ambar-bg: #fdf0d2;
  --serie-e: #2563eb; --serie-s: #d97706; --trilho: #eef1f7; --sombra: rgba(15, 27, 51, .32); --raio: 12px;
  --cab-tabela: #f7f9fc; --hover-linha: #f3f6fb;
  --sombra-cartao: 0 1px 2px rgba(15, 27, 51, .05), 0 2px 8px -2px rgba(15, 27, 51, .06);
  --sombra-menu: 0 12px 32px -8px rgba(15, 27, 51, .22), 0 2px 6px rgba(15, 27, 51, .06);
  --perigo-solido: #b42318; /* fundo do botão de ação irreversível, texto branco: 6,5:1 nos dois temas (o vermelho claro do tema escuro dava 2,8:1) */
  --seta-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23515d75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  /* lateral e barra superior: seguem o tema (clara no claro, Noite no escuro) */
  --lat-fundo: #ffffff; --lat-borda: #e1e6ef; --lat-texto: #2a3650; --lat-suave: #5f6b82; --lat-icone: #66738c; --lat-hover: #f1f4fa;
  --lat-ativo: #ebf0ff; --lat-ativo-texto: #1238b0; --lat-ativo-icone: #1e5bff; --lat-foco: #1e5bff; --lat-logo: #0f1b33;
  --lat-contador: #e6eaf2; --lat-contador-texto: #2a3650; --lat-atrasado: #fde8e6; --lat-atrasado-texto: #b42318;
  --barra-fundo: rgba(255, 255, 255, .86); --dica-fundo: #0f1b33; --dica-texto: #ffffff;
  /* tipografia (sem fonte baixada: a CSP não aceita fonte externa e o uso é sem internet) */
  --fonte: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fonte-titulo: "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  /* movimento: só vale com prefers-reduced-motion: no-preference (bloco no fim) */
  --mov: 120ms; --mov-gaveta: 220ms; --curva: cubic-bezier(.2, .7, .2, 1);
  --lateral-largura: 244px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    color-scheme: dark;
    --fundo: #0b1220; --painel: #111a2c; --borda: #223049; --borda-campo: #7d8ca6; --texto: #e7ecf6; --suave: #a3b0c6;
    --marinho: #0a1020; --azul-hover: #1747d6; --azul-ativo: #1238b0; --azul-suave: rgba(56, 198, 244, .12); --link: #86b4ff; --foco: #38c6f4;
    --verde: #4ade80; --verde-bg: #12301f; --vermelho: #f87171; --vermelho-bg: #3a1a1a; --ambar: #fbbf24; --ambar-bg: #352a0c;
    --serie-e: #60a5fa; --serie-s: #fb923c; --trilho: #1a2539; --sombra: rgba(0, 0, 0, .6);
    --cab-tabela: #0f1828; --hover-linha: #162238;
    --sombra-cartao: 0 1px 2px rgba(0, 0, 0, .3); --sombra-menu: 0 16px 40px -8px rgba(0, 0, 0, .6);
    --seta-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3b0c6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    --lat-fundo: #0a1020; --lat-borda: rgba(255, 255, 255, .06); --lat-texto: #c3cee2; --lat-suave: #8f9bb3; --lat-icone: #8f9bb3; --lat-hover: #141d31;
    --lat-ativo: #1a2742; --lat-ativo-texto: #ffffff; --lat-ativo-icone: #38c6f4; --lat-foco: #38c6f4; --lat-logo: #ffffff;
    --lat-contador: rgba(255, 255, 255, .14); --lat-contador-texto: #ffffff; --lat-atrasado: #f87171; --lat-atrasado-texto: #3a0d0d;
    --barra-fundo: rgba(17, 26, 44, .88); --dica-fundo: #e7ecf6; --dica-texto: #0a1020;
  }
}
:root[data-tema="escuro"] {
  color-scheme: dark;
  --fundo: #0b1220; --painel: #111a2c; --borda: #223049; --borda-campo: #7d8ca6; --texto: #e7ecf6; --suave: #a3b0c6;
  --marinho: #0a1020; --azul-hover: #1747d6; --azul-ativo: #1238b0; --azul-suave: rgba(56, 198, 244, .12); --link: #86b4ff; --foco: #38c6f4;
  --verde: #4ade80; --verde-bg: #12301f; --vermelho: #f87171; --vermelho-bg: #3a1a1a; --ambar: #fbbf24; --ambar-bg: #352a0c;
  --serie-e: #60a5fa; --serie-s: #fb923c; --trilho: #1a2539; --sombra: rgba(0, 0, 0, .6);
  --cab-tabela: #0f1828; --hover-linha: #162238;
  --sombra-cartao: 0 1px 2px rgba(0, 0, 0, .3); --sombra-menu: 0 16px 40px -8px rgba(0, 0, 0, .6);
  --seta-select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3b0c6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --lat-fundo: #0a1020; --lat-borda: rgba(255, 255, 255, .06); --lat-texto: #c3cee2; --lat-suave: #8f9bb3; --lat-icone: #8f9bb3; --lat-hover: #141d31;
  --lat-ativo: #1a2742; --lat-ativo-texto: #ffffff; --lat-ativo-icone: #38c6f4; --lat-foco: #38c6f4; --lat-logo: #ffffff;
  --lat-contador: rgba(255, 255, 255, .14); --lat-contador-texto: #ffffff; --lat-atrasado: #f87171; --lat-atrasado-texto: #3a0d0d;
  --barra-fundo: rgba(17, 26, 44, .88); --dica-fundo: #e7ecf6; --dica-texto: #0a1020;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 4.5rem; }
body { margin: 0; font: 15px/1.5 var(--fonte); background: var(--fundo); color: var(--texto); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1 { font-family: var(--fonte-titulo); font-size: 1.6rem; font-weight: 600; line-height: 1.2; letter-spacing: -.005em; margin: 0; }
h2 { font-family: var(--fonte-titulo); font-size: 1.08rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-family: var(--fonte-titulo); font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
small { color: var(--suave); }
::placeholder { color: var(--suave); opacity: 1; } /* o cinza padrão do navegador dava 3,5:1 no tema escuro */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pos { color: var(--verde); } .neg { color: var(--vermelho); }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; } .sem-margem { margin: 0; } .m-direita-auto { margin-right: auto; }
.topo-secao { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 .6rem; }
.topo-secao h2 { margin: 0; }

/* sprite de ícones e marca: fora da tela, mas não display:none (o degradê do X precisa dele pintável) */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* ícone de traço 24×24: o traço vem daqui (a raiz do sprite não passa fill/stroke ao <use>) */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
.lateral :focus-visible { outline-color: var(--lat-foco); } /* a lateral segue o tema: azul JLX sobre o branco, ciano sobre Noite */
.pular { position: absolute; left: .5rem; top: -4rem; z-index: 40; background: var(--painel); color: var(--texto); border: 2px solid var(--azul); border-radius: 8px; padding: .5rem .9rem; }
.pular:focus { top: .5rem; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: var(--lateral-largura) 1fr; min-height: 100vh; }
.lateral {
  background: var(--lat-fundo); color: var(--lat-texto); border-right: 1px solid var(--lat-borda); padding: .9rem .7rem .8rem 14px;
  display: flex; flex-direction: column; gap: .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--lat-borda) transparent;
}
.lateral > * { flex-shrink: 0; } /* a lateral rola inteira; sem isto os blocos encolhiam e se sobrepunham em tela baixa */
.lateral-topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem 0 .35rem .45rem; min-height: 40px; }
.marca { display: flex; align-items: center; gap: .6rem; color: var(--lat-logo); text-decoration: none; }
.marca .logo { width: 72px; height: 22px; display: block; color: var(--lat-logo); }
.marca .logo-trilho { display: none; width: 30px; height: 23px; color: var(--lat-logo); }
.marca-nome { font-family: var(--fonte-titulo); font-size: .7rem; font-weight: 400; text-transform: uppercase; letter-spacing: .32em; color: var(--lat-suave); padding-top: .1rem; }
.so-celular { display: none !important; }

/* botão só de ícone (lateral, barra superior): rótulo acessível em aria-label ou .sr */
.btn-icone { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--suave); cursor: pointer; padding: 0; text-decoration: none; }
.btn-icone:hover { background: var(--trilho); color: var(--texto); }
.btn-icone:active { background: var(--borda); }
.lateral .btn-icone { color: var(--lat-icone); }
.lateral .btn-icone:hover { background: var(--lat-hover); color: var(--lat-texto); }

/* menu: ícone de traço + rótulo; grupos recolhíveis com título pequeno espaçado (como o "TECH" da logo) */
.lateral nav { display: flex; flex-direction: column; gap: 2px; position: relative; }
.lateral nav a {
  color: var(--lat-texto); text-decoration: none; padding: .35rem .6rem .35rem .75rem; border-radius: 8px; min-height: 36px;
  display: flex; align-items: center; gap: .7rem; position: relative; font-size: .94rem;
}
.lateral nav a:focus-visible { outline-offset: -2px; } /* dentro do grupo (que recorta ao recolher) o anel fica para dentro */
.lateral nav a .ico { color: var(--lat-icone); }
.lateral nav a:hover { background: var(--lat-hover); color: var(--lat-texto); }
.lateral nav a:hover .ico { color: var(--lat-ativo-icone); }
.lateral nav a[aria-current="page"] { background: var(--lat-ativo); color: var(--lat-ativo-texto); font-weight: 600; }
.lateral nav a[aria-current="page"] .ico { color: var(--lat-ativo-icone); }
.menu-rotulo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-grupo {
  display: flex; align-items: center; gap: .5rem; width: 100%; margin: .75rem 0 .15rem; padding: .3rem .6rem .3rem .75rem; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font-family: var(--fonte-titulo); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .2em; color: var(--lat-suave); text-align: left;
}
.menu-grupo:hover { color: var(--lat-texto); background: var(--lat-hover); }
.menu-grupo:focus-visible { outline-offset: -2px; }
.menu-grupo .ico { width: 14px; height: 14px; stroke-width: 2; }
.menu-grupo .menu-seta { margin-left: auto; width: 14px; height: 14px; }
.menu-grupo[aria-expanded="false"] .menu-seta { transform: rotate(-90deg); }
.menu-itens { display: grid; grid-template-rows: 1fr; }
.menu-itens > div { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.menu-itens.fechado { grid-template-rows: 0fr; }
.menu-itens.fechado > div { visibility: hidden; } /* fechado: fora da ordem do Tab e da leitura */
.menu-contador { margin-left: auto; min-width: 1.5rem; padding: 0 .45rem; border-radius: 999px; text-align: center; font-size: .72rem; font-weight: 700; line-height: 1.3rem; background: var(--lat-contador); color: var(--lat-contador-texto); font-variant-numeric: tabular-nums; }
.menu-contador.atrasado { background: var(--lat-atrasado); color: var(--lat-atrasado-texto); }
/* o "corte em X": faixa diagonal com o degradê, na inclinação das hastes do X (0,94 de avanço por 1 de altura). Desliza até o item ativo. */
.menu-marcador {
  position: absolute; left: -12px; top: 0; width: 20px; height: 16px; background: var(--degrade); pointer-events: none;
  clip-path: polygon(15px 0, 20px 0, 5px 16px, 0 16px); opacity: 0;
}
.menu-marcador.on { opacity: 1; }

.lateral-rodape { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--lat-borda); }
.btn-lateral { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 36px; padding: .35rem .6rem .35rem .75rem; border: 0; border-radius: 8px; background: none; color: var(--lat-suave); cursor: pointer; font-size: .88rem; text-align: left; }
.btn-lateral:hover { background: var(--lat-hover); color: var(--lat-texto); }
.btn-lateral:focus-visible { outline-offset: -2px; }
.lateral a.link { text-decoration: underline; }
.link { background: none; border: 0; padding: .35rem 0; color: inherit; cursor: pointer; text-decoration: underline; min-height: 28px; }

/* dica do trilho (lateral recolhida): nome do item ao passar o mouse e no foco */
.dica-trilho { position: fixed; z-index: 45; transform: translateY(-50%); padding: .3rem .65rem; border-radius: 8px; background: var(--dica-fundo); color: var(--dica-texto); font-size: .82rem; font-weight: 500; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px -4px rgba(0, 0, 0, .35); }

/* lateral recolhida (só no computador): trilho de ícones; os rótulos continuam no DOM como nome acessível */
@media (min-width: 861px) {
  .app.recolhida { grid-template-columns: 72px 1fr; }
  .recolhida .lateral { padding: .9rem 10px .8rem; align-items: stretch; }
  .recolhida .lateral-topo { justify-content: center; padding: .25rem 0 .35rem; }
  .recolhida .marca .logo, .recolhida .marca-nome { display: none; }
  .recolhida .marca .logo-trilho { display: block; }
  .recolhida .menu-rotulo, .recolhida .rotulo-lateral {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .recolhida .lateral nav a, .recolhida .btn-lateral { justify-content: center; padding: .35rem 0; }
  .recolhida .menu-grupo { display: none; }
  .recolhida .menu-bloco { border-top: 1px solid var(--lat-borda); margin-top: .5rem; padding-top: .5rem; }
  .recolhida .menu-itens.fechado { grid-template-rows: 1fr; }
  .recolhida .menu-itens.fechado > div { visibility: visible; } /* no trilho todos os ícones aparecem */
  .recolhida .menu-contador { position: absolute; top: 1px; right: 3px; min-width: 1.1rem; padding: 0 .25rem; font-size: .62rem; line-height: 1.1rem; }
  .recolhida .menu-marcador { left: -10px; }
  .recolhida #botao-recolher .ico { transform: scaleX(-1); }
}

/* ---------- barra superior (fixa): busca, tema e menu do usuário; no celular também o botão do menu e a logo ---------- */
.coluna-principal { min-width: 0; display: flex; flex-direction: column; }
.barra-topo {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: .4rem; height: 58px; padding: 0 1.25rem 0 2.25rem;
  background: var(--barra-fundo); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--borda);
}
.busca-topo {
  margin-left: auto; display: flex; align-items: center; gap: .55rem; width: min(380px, 42vw); min-height: 38px; padding: 0 .55rem 0 .75rem;
  border: 1px solid var(--borda); border-radius: 10px; background: var(--fundo); color: var(--suave); cursor: pointer; text-align: left;
}
.busca-topo:hover { border-color: var(--borda-campo); color: var(--texto); }
.busca-topo .ico { width: 18px; height: 18px; }
.busca-topo kbd { margin-left: auto; }
kbd { font: inherit; font-size: .72rem; border: 1px solid currentColor; border-radius: 5px; padding: 0 .35rem; opacity: .75; white-space: nowrap; }
.menu-usuario { position: relative; }
.botao-usuario { display: flex; align-items: center; gap: .55rem; min-height: 42px; padding: .2rem .45rem .2rem .25rem; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; color: var(--texto); }
.botao-usuario:hover, .botao-usuario[aria-expanded="true"] { background: var(--trilho); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--azul); color: #fff; font-family: var(--fonte-titulo); font-size: .8rem; font-weight: 600; letter-spacing: .04em; }
.usuario-info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.usuario-logado { font-size: .86rem; font-weight: 600; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario-perfil { font-size: .74rem; color: var(--suave); }
.botao-usuario .menu-seta { width: 16px; height: 16px; color: var(--suave); }
.botao-usuario[aria-expanded="true"] .menu-seta { transform: rotate(180deg); }
/* menu suspenso (usuário; mesmo desenho da paleta): raio 12, sombra, item com fundo claro no hover e no foco */
.menu-suspenso { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: .35rem; background: var(--painel); border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra-menu); }
.menu-suspenso [role="menuitem"] { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 38px; padding: .45rem .65rem; border: 0; border-radius: 8px; background: none; color: var(--texto); text-decoration: none; cursor: pointer; text-align: left; font-size: .92rem; }
.menu-suspenso [role="menuitem"] .ico { width: 18px; height: 18px; color: var(--suave); }
.menu-suspenso [role="menuitem"]:hover, .menu-suspenso [role="menuitem"]:focus { background: var(--trilho); }
.menu-suspenso [role="menuitem"]:focus-visible { outline: 2px solid var(--foco); outline-offset: -2px; }
.menu-suspenso kbd { margin-left: auto; color: var(--suave); }
.menu-separador { height: 1px; margin: .3rem .4rem; background: var(--borda); }

/* position + overflow-x: clip: rede de segurança contra o texto .sr (position: absolute) de dentro de tabela, quadro ou gráfico
   rolável, que escapa do recorte do contêiner de rolagem e alarga a página inteira no celular. Conteúdo largo de verdade
   continua tendo de rolar dentro do próprio contêiner (.tabela, .rolagem, quadro). */
.conteudo { padding: 1.6rem 2.25rem 3rem; max-width: 1320px; width: 100%; min-width: 0; outline: none; position: relative; overflow-x: clip; }
.grade > *, .detalhe > *, .contas-grade > * { min-width: 0; }

/* cabeçalho da página: título com o corte em X, subtítulo quando a tela tem, ações à direita */
.topo { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.topo > div:first-child > .cl:first-child { display: inline-block; font-size: .85rem; margin-bottom: .2rem; }
.topo h1 + p, .topo h1 + small { margin: .3rem 0 0; color: var(--suave); }
.topo .barra { justify-content: flex-end; }
.topo h1::before {
  content: ""; display: inline-block; width: .8em; height: .62em; margin-right: .4em; vertical-align: -.02em;
  background: var(--degrade); clip-path: polygon(70% 0, 100% 0, 30% 100%, 0 100%);
}
.barra { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.cartao { background: var(--painel); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1.1rem 1.2rem; box-shadow: var(--sombra-cartao); }
.grade { display: grid; gap: 1rem; }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
/* KPIs: rótulo pequeno em caixa alta, número grande em Bahnschrift, ícone discreto num círculo claro no canto */
.kpi { position: relative; padding-right: 3.6rem; }
.kpi > small:first-child { display: block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.kpi small { display: block; }
.kpi strong { display: block; font-family: var(--fonte-titulo); font-size: 1.55rem; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .sub { font-size: .84rem; color: var(--suave); margin-top: .25rem; }
.kpi::before { content: ""; position: absolute; top: 1rem; right: 1rem; width: 34px; height: 34px; border-radius: 50%; background: var(--azul-suave); }
.kpi::after {
  content: ""; position: absolute; top: calc(1rem + 8px); right: calc(1rem + 8px); width: 18px; height: 18px; background: var(--link);
  -webkit-mask: var(--kpi-icone) center / contain no-repeat; mask: var(--kpi-icone) center / contain no-repeat;
  --kpi-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h16M7 16v-5M12 16V7M17 16v-8'/%3E%3C/svg%3E");
}
.kpi:has(strong.pos)::before { background: var(--verde-bg); }
.kpi:has(strong.pos)::after { background: var(--verde); --kpi-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 17 5.5-5.5 4 4 7.5-7.5M15 8h5.5v5.5'/%3E%3C/svg%3E"); }
.kpi:has(strong.neg)::before { background: var(--vermelho-bg); }
.kpi:has(strong.neg)::after { background: var(--vermelho); --kpi-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3.5 7 5.5 5.5 4-4 7.5 7.5M15 16h5.5v-5.5'/%3E%3C/svg%3E"); }
.alerta { border-left: 4px solid var(--vermelho); background: var(--vermelho-bg); }
.alerta strong, .alerta p { margin: 0; }
.aviso-info { border-left: 4px solid var(--ambar); background: var(--ambar-bg); }

/* ---------- botões: primário (azul com profundidade), secundário (contorno), fantasma, perigo, mini ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid var(--borda-campo); background: var(--painel); color: var(--texto);
  padding: .45rem .95rem; border-radius: 10px; cursor: pointer; min-height: 38px; font-weight: 500; line-height: 1.25; text-decoration: none;
}
.btn:hover { background: var(--trilho); border-color: var(--suave); }
.btn:active { background: var(--borda); transform: translateY(1px); }
.btn.primario {
  background: var(--azul); border-color: var(--azul); color: #fff; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 1px 2px rgba(15, 27, 51, .14), 0 4px 12px -4px rgba(30, 91, 255, .55);
}
.btn.primario:hover { background: var(--azul-hover); border-color: var(--azul-hover); }
.btn.primario:active { background: var(--azul-ativo); border-color: var(--azul-ativo); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.btn.fantasma { border-color: transparent; background: transparent; color: var(--link); }
.btn.fantasma:hover { background: var(--azul-suave); border-color: transparent; }
.btn.perigo { color: var(--vermelho); border-color: var(--vermelho); }
.btn.perigo:hover { background: var(--vermelho-bg); border-color: var(--vermelho); }
.btn.perigo-solido { background: var(--perigo-solido); border-color: var(--perigo-solido); color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.perigo-solido:hover { filter: brightness(.92); background: var(--perigo-solido); }
.btn.mini { padding: .25rem .65rem; font-size: .85rem; min-height: 36px; border-radius: 8px; gap: .3rem; }
.btn .ico-btn { width: 16px; height: 16px; stroke-width: 2.2; margin-left: -.15rem; }
.btn.mini .ico-btn { width: 14px; height: 14px; }
.btn:disabled { opacity: .55; cursor: progress; transform: none; box-shadow: none; }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn.mini { min-height: 40px; } }
a.btn { color: var(--texto); }
a.btn.primario { color: #fff; }
button.cl { background: none; border: 0; padding: 0; color: var(--link); font-weight: 500; cursor: pointer; text-align: left; }
button.cl:hover { text-decoration: underline; }
a { color: var(--link); }
a.cl { color: var(--link); text-decoration: none; font-weight: 500; }
a.cl:hover { text-decoration: underline; }
input, select, textarea { border: 1px solid var(--borda-campo); border-radius: 9px; padding: .5rem .7rem; background: var(--painel); width: 100%; min-height: 40px; }
select:not([multiple]):not([size]) { appearance: none; background-image: var(--seta-select); background-repeat: no-repeat; background-position: right .55rem center; background-size: 16px; padding-right: 2.1rem; }
input:hover, select:hover, textarea:hover { border-color: var(--suave); }
/* campo em foco: borda e anel azuis (o anel tem 3:1 ou mais sobre o painel nos dois temas) */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--foco); outline-offset: 1px; border-color: var(--foco); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--azul); }
.barra input, .barra select { width: auto; }
.ajuda { font-size: .8rem; }
.marcar { flex-direction: row !important; align-items: center; gap: .5rem; }

/* ---------- abas internas (Relatórios, Fiscal, LGPD, Contratos, Parceiros): indicador em degradê embaixo da ativa; rolagem própria ---------- */
.rel-abas, .lgpd-abas ul, .fis-abas ul, .ct-subnav, .pa-abas {
  display: flex; flex-wrap: wrap; gap: .15rem; margin: 0 0 1.25rem; padding: 0; list-style: none; position: relative;
  border-bottom: 1px solid var(--borda); overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.rel-abas li, .lgpd-abas li, .fis-abas li { flex: none; }
:is(.rel-abas, .lgpd-abas, .fis-abas, .ct-subnav, .pa-abas) a {
  position: relative; display: inline-flex; align-items: center; min-height: 42px; padding: .45rem .7rem; margin: 0; flex: none; font-size: .93rem;
  border: 0; border-radius: 8px 8px 0 0; background: none; color: var(--suave); text-decoration: none; font-weight: 500; white-space: nowrap; top: 0;
}
:is(.rel-abas, .lgpd-abas, .fis-abas, .ct-subnav, .pa-abas) a:hover { color: var(--texto); background: var(--trilho); }
:is(.rel-abas, .lgpd-abas, .fis-abas, .ct-subnav, .pa-abas) a:focus-visible { outline-offset: -3px; }
:is(.rel-abas, .lgpd-abas, .fis-abas, .ct-subnav, .pa-abas) a[aria-current="page"] { color: var(--texto); font-weight: 600; background: none; border: 0; }
:is(.rel-abas, .lgpd-abas, .fis-abas, .ct-subnav, .pa-abas) a[aria-current="page"]::after {
  content: ""; position: absolute; left: .55rem; right: .55rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--degrade); transform-origin: left center;
}

/* ---------- tabelas ---------- */
/* position: relative nos contêineres de rolagem: sem isso, os .sr (position: absolute) de dentro da tabela ficam fora do recorte
   e alargam a página inteira no celular (rolagem horizontal da página) */
.tabela { padding: 0; overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .7rem .75rem; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: middle; }
th { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 600; }
thead th { background: var(--cab-tabela); }
.tabela thead th:first-child { border-top-left-radius: var(--raio); }
.tabela thead th:last-child { border-top-right-radius: var(--raio); }
th.num { text-align: right; }
tbody tr:hover { background: var(--hover-linha); }
tbody tr:last-child td { border-bottom-color: transparent; }
tfoot td { font-weight: 600; border-top: 2px solid var(--borda); border-bottom: 0; }
.th-ordenar { background: none; border: 0; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; }
.th-ordenar:hover { color: var(--texto); }
.barra-lote { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; border-left: 4px solid var(--azul); }
.barra-lote strong { margin-right: auto; }
th.sel, td.sel { width: 2.2rem; padding-right: 0; }
.vazio { color: var(--suave); text-align: center; padding: 2rem 1rem; margin: 0; }
/* estado vazio: ícone grande e discreto acima da frase que a tela já usa */
.vazio::before {
  content: ""; display: block; width: 40px; height: 40px; margin: 0 auto .6rem; background: var(--borda-campo); opacity: .55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 13.5 6 5.5h12l2.5 8M3.5 13.5V18a1.5 1.5 0 0 0 1.5 1.5h14a1.5 1.5 0 0 0 1.5-1.5v-4.5M3.5 13.5h5l1 2h5l1-2h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 13.5 6 5.5h12l2.5 8M3.5 13.5V18a1.5 1.5 0 0 0 1.5 1.5h14a1.5 1.5 0 0 0 1.5-1.5v-4.5M3.5 13.5h5l1 2h5l1-2h5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.acoes { white-space: nowrap; text-align: right; }
tr.cancelado td { opacity: .7; text-decoration: line-through; }
tr.cancelado td.acoes { text-decoration: none; opacity: 1; }
/* Lançamentos do Financeiro: até cinco ações por linha espremiam a descrição em três linhas; as ações quebram em duas fileiras e a descrição ganha largura mínima */
.fin-tab td.acoes { white-space: normal; width: 16.5rem; min-width: 13rem; }
.fin-tab td.acoes .btn { margin: .12rem 0 .12rem .2rem; padding-inline: .5rem; }
.fin-tab td:nth-last-child(5), .fin-tab th:nth-last-child(5) { min-width: 13.5rem; }

/* selos de situação: pílula com ponto colorido (a cor nunca é a única informação: o texto vai junto) */
.selo { display: inline-flex; align-items: center; gap: .35em; padding: .1rem .6rem .1rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.45; background: var(--trilho); color: var(--suave); border: 1px solid transparent; vertical-align: .08em; white-space: nowrap; }
.selo::before { content: ""; width: .45em; height: .45em; border-radius: 50%; background: currentColor; flex: none; }
.selo.pago, .selo.entrada, .selo.ganha { background: var(--verde-bg); color: var(--verde); }
.selo.atrasado, .selo.saida, .selo.perdida { background: var(--vermelho-bg); color: var(--vermelho); }
.selo.pendente, .selo.negociacao, .selo.parcial { background: var(--ambar-bg); color: var(--ambar); }
.selo.cancelado, .selo.inativo { background: var(--trilho); color: var(--suave); border-color: var(--borda); }
.selo.sev-critico { background: var(--vermelho-bg); color: var(--vermelho); }
.selo.sev-atencao { background: var(--ambar-bg); color: var(--ambar); }
h1 .selo { font-family: var(--fonte); font-size: .8rem; letter-spacing: 0; }

/* painel: tabela larga dentro de cartão rola ali dentro; colunas de altura livre (o cartão do funil não estica ao lado de uma tabela) */
.rolagem { overflow-x: auto; position: relative; }
.coluna-painel { display: grid; gap: 1rem; align-content: start; }

/* painel: "Atenção e hoje": cada alerta é uma linha com barra lateral na cor da gravidade, selo, texto e "Ver" à direita
   (a gravidade vai por texto no selo, nunca só pela cor) */
.lista-atencao { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.lista-atencao li {
  display: grid; grid-template-columns: 6rem 1fr auto; gap: .75rem; align-items: center; padding: .6rem .6rem .6rem .85rem;
  border-radius: 10px; background: var(--fundo); border: 1px solid var(--borda); border-left: 4px solid var(--borda-campo);
}
.lista-atencao li:has(.sev-critico) { border-left-color: var(--vermelho); }
.lista-atencao li:has(.sev-atencao) { border-left-color: var(--ambar); }
.lista-atencao li:has(.sev-info) { border-left-color: var(--azul); }
.lista-atencao small { display: block; }
.lista-atencao .selo { justify-self: start; }
.lista-atencao a.cl { display: inline-flex; align-items: center; min-height: 34px; padding: .25rem .75rem; border-radius: 8px; font-weight: 600; }
.lista-atencao a.cl:hover { background: var(--azul-suave); text-decoration: none; }
@media (max-width: 640px) { .lista-atencao li { grid-template-columns: 1fr; gap: .3rem; } .lista-atencao a.cl { justify-self: start; padding-left: 0; } }

.mes { display: flex; align-items: center; gap: .25rem; }
.mes strong { min-width: 9.5rem; text-align: center; text-transform: capitalize; font-family: var(--fonte-titulo); font-weight: 600; }
.filtros { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
/* campos e seletores de filtro ficam lado a lado (o estilo global dá 100% de largura a todo input e select); a busca ocupa o que sobra */
.filtros input, .filtros select { width: auto; }
.filtros input[type="search"] { flex: 1 1 16rem; }

/* tela baixa: são vinte e dois itens de menu e a lateral rola; compactar mantém mais itens à vista. O alvo continua com 32 px (WCAG 2.2 pede 24). */
@media (max-height: 820px) and (min-width: 861px) {
  .lateral { gap: .5rem; padding-top: .7rem; padding-bottom: .6rem; }
  .lateral nav a { padding-top: .2rem; padding-bottom: .2rem; min-height: 32px; }
  .menu-grupo { margin-top: .5rem; }
}

/* ---------- gráficos ---------- */
.grafico { margin: 0; }
/* a tabela .sr de um gráfico não encolhe para 1px (tabela nunca fica menor que o conteúdo) e, solta, alargava a página em telas
   de 320px; dentro de figure ela é recortada */
figure { position: relative; overflow: hidden; }
.fluxo { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; align-items: end; height: 210px; }
.fluxo .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .15rem; min-width: 0; }
.fluxo .barras { display: flex; gap: 3px; align-items: flex-end; flex: 1; width: 100%; justify-content: center; }
.fluxo .b { width: 40%; max-width: 26px; border-radius: 4px 4px 0 0; min-height: 2px; }
.fluxo .b.e, .amostra.e { background: var(--serie-e); }
.fluxo .b.s, .amostra.s { background: var(--serie-s); }
.fluxo .rotulo { text-transform: capitalize; }
.fluxo .valores { display: flex; flex-direction: column; align-items: center; font-size: .7rem; line-height: 1.25; white-space: nowrap; }
.legenda { display: flex; gap: 1rem; font-size: .85rem; color: var(--suave); margin-top: .5rem; }
.amostra { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.linha-saldo { width: 100%; height: 180px; display: block; }
.linha-saldo .saldo { stroke: var(--serie-e); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.linha-saldo .eixo-zero { stroke: var(--borda-campo); stroke-width: 1; vector-effect: non-scaling-stroke; }
.linha-saldo .piso { stroke: var(--vermelho); stroke-width: 1.5; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
/* o gráfico estica na horizontal (preserveAspectRatio none): um <circle> viraria elipse; um traço de comprimento zero com ponta redonda
   e vector-effect non-scaling-stroke continua sendo um ponto redondo de 10 px em qualquer largura */
.linha-saldo .ruptura { stroke: var(--vermelho); stroke-width: 10; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.legenda-grafico { font-size: .85rem; color: var(--suave); margin-top: .4rem; }

.funil { display: flex; flex-direction: column; gap: .5rem; }
.funil .linha { display: grid; grid-template-columns: 110px 1fr 120px; gap: .6rem; align-items: center; font-size: .9rem; }
.funil .trilho { background: var(--trilho); border-radius: 6px; height: 14px; overflow: hidden; }
.funil .trilho span { display: block; height: 100%; background: var(--azul); border-radius: 6px; }

/* ---------- quadro (CRM) ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: .85rem; overflow-x: auto; align-items: start; padding-bottom: .5rem; position: relative; /* contém os .sr (absolutos): sem isto escapam da rolagem do quadro e alargam a página */ }
.coluna { background: var(--trilho); border: 1px solid var(--borda); border-radius: var(--raio); padding: .65rem; min-height: 160px; }
.coluna.alvo { outline: 2px dashed var(--azul); }
.coluna h3 { margin: 0 0 .55rem; font-size: .86rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .1rem .15rem; }
.coluna h3 span { font-family: var(--fonte); font-weight: 600; font-size: .74rem; color: var(--suave); background: var(--painel); border: 1px solid var(--borda); border-radius: 999px; padding: 0 .5rem; min-width: 1.6rem; text-align: center; }
.card { background: var(--painel); border: 1px solid var(--borda); border-radius: 10px; padding: .65rem .75rem; margin-bottom: .55rem; cursor: grab; box-shadow: var(--sombra-cartao); }
.card:hover, .card:focus-within { border-color: var(--azul); }
.card.arrastando { opacity: .4; }
.card b { display: block; font-size: .92rem; }
.card small { display: block; }
.card .valor { font-family: var(--fonte-titulo); font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .25rem; }
.card .mover { display: flex; gap: .3rem; margin-top: .5rem; }
.card .mover select { flex: 1; min-width: 0; font-size: .8rem; min-height: 34px; padding: .2rem 1.8rem .2rem .5rem; background-position: right .4rem center; }

/* ---------- diálogos ---------- */
dialog { border: 1px solid var(--borda); border-radius: 14px; padding: 0; width: min(600px, 94vw); box-shadow: 0 24px 64px -12px var(--sombra); background: var(--painel); color: var(--texto); }
dialog::backdrop { background: rgba(10, 16, 32, .5); backdrop-filter: blur(2px); }
.modal-corpo { padding: 1.3rem 1.45rem; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; max-height: 75vh; overflow-y: auto; }
.modal-corpo h2 { grid-column: 1 / -1; margin: 0 0 .1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--borda); font-size: 1.2rem; }
.modal-corpo label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 500; color: var(--suave); }
.modal-corpo label .ajuda, .modal-corpo label small { font-weight: 400; }
.modal-corpo .cheio { grid-column: 1 / -1; }
.modal-corpo textarea { min-height: 84px; resize: vertical; }
.modal-corpo .resumo-form { grid-column: 1 / -1; margin: 0; padding: .6rem .8rem; background: var(--trilho); border-radius: 8px; font-size: .9rem; }
.modal-rodape { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; padding: .85rem 1.45rem; border-top: 1px solid var(--borda); background: var(--fundo); border-radius: 0 0 14px 14px; }
.confirmar-corpo { padding: 1.3rem 1.45rem 0; }
.confirmar-corpo h2 { margin-bottom: .5rem; font-size: 1.2rem; }
.confirmar-corpo p { margin: 0 0 1rem; color: var(--suave); }
.erro { color: var(--vermelho); margin: 0; min-height: 1.2em; font-size: .9rem; grid-column: 1 / -1; }

/* ---------- login: Noite com o X grande recortado ao fundo ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(120% 90% at 85% 15%, #13204a 0%, var(--noite) 55%); padding: 1rem; position: relative; overflow: hidden; }
.login-x { position: absolute; right: -14vmin; bottom: -22vmin; width: 92vmin; height: 70vmin; color: #fff; opacity: .07; pointer-events: none; }
.login-card { background: var(--painel); padding: 2.1rem 2rem 1.8rem; border-radius: 16px; width: min(390px, 100%); display: flex; flex-direction: column; gap: .9rem; position: relative; border: 1px solid var(--borda); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); }
.login-card .marca { color: var(--texto); justify-content: center; margin-bottom: .4rem; }
.login-card .logo-tech { width: 148px; height: 61px; display: block; color: var(--texto); }
.login-card h1 { font-size: 1.35rem; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 500; color: var(--suave); }
.login-card .btn.primario { min-height: 44px; }

.detalhe { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start; }
.ficha dl { margin: 0; display: grid; gap: .6rem; }
.ficha dt { font-size: .7rem; font-weight: 600; color: var(--suave); text-transform: uppercase; letter-spacing: .07em; }
.ficha dd { margin: 0; word-break: break-word; }
.linha-tempo { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.linha-tempo li { border-left: 3px solid var(--azul-claro); padding: .1rem 0 .1rem .7rem; }
.contas-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.conta-cartao { display: flex; flex-direction: column; gap: .25rem; }
.conta-cartao .saldo-conta { font-family: var(--fonte-titulo); font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- paleta (Ctrl+K): mesmo desenho do menu suspenso ---------- */
dialog.paleta { width: min(600px, 94vw); margin-top: 10vh; padding: 0; overflow: hidden; border-radius: 14px; box-shadow: var(--sombra-menu); }
.paleta input { border: 0; border-bottom: 1px solid var(--borda); border-radius: 0; padding: .95rem 1.15rem; font-size: 1.02rem; min-height: 54px; }
.paleta input:focus-visible { outline: 2px solid var(--foco); outline-offset: -2px; }
.paleta ul { list-style: none; margin: 0; padding: .4rem; max-height: 50vh; overflow-y: auto; }
.paleta li { padding: .55rem .75rem; border-radius: 8px; cursor: pointer; display: flex; gap: .75rem; align-items: baseline; }
.paleta li:hover { background: var(--trilho); }
.paleta li[aria-selected="true"] { background: var(--azul); color: #fff; }
.paleta-grupo { font-family: var(--fonte-titulo); font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--suave); min-width: 5.5rem; }
.paleta li[aria-selected="true"] .paleta-grupo { color: #fff; }
.paleta-vazio { color: var(--suave); cursor: default; }

/* ---------- aviso (toast) ---------- */
.aviso { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; margin-inline: auto; width: fit-content; background: var(--noite); color: #fff; padding: .65rem 1.1rem; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: .8rem; max-width: calc(100vw - 2rem); z-index: 30; }
.aviso.on { opacity: 1; pointer-events: auto; }
.aviso .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); box-shadow: none; }
.aviso .btn:hover { background: rgba(255, 255, 255, .12); }
.aviso :focus-visible { outline-color: var(--ciano); }
/* item 14: o aviso de algo que foi para a Lixeira aponta para ela (a rede de segurança do Desfazer, que some em 10 s) */
.aviso .aviso-lixeira { color: #fff; text-decoration: underline; }
.aviso:has(.aviso-lixeira) { flex-wrap: wrap; row-gap: .4rem; }

/* ---------- movimento: só para quem não pediu menos movimento ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .btn-icone, .btn-lateral, .lateral nav a, .menu-grupo, .busca-topo, .botao-usuario, input, select, textarea, .paleta li, a.cl, .card, .menu-suspenso [role="menuitem"] {
    transition: background-color var(--mov) ease, border-color var(--mov) ease, color var(--mov) ease, box-shadow var(--mov) ease, transform var(--mov) ease;
  }
  tbody tr { transition: background-color var(--mov) ease; }
  .lateral nav a .ico, .menu-seta { transition: color var(--mov) ease, transform 200ms var(--curva); }
  .menu-itens { transition: grid-template-rows 220ms var(--curva); }
  .menu-itens > div { transition: visibility 0s linear 220ms; }
  .menu-itens:not(.fechado) > div { transition: visibility 0s; }
  .menu-marcador.pronto { transition: transform 240ms var(--curva), opacity 160ms ease; }
  .menu-suspenso:not([hidden]) { animation: jlx-menu 140ms var(--curva); }
  .dica-trilho:not([hidden]) { animation: jlx-fundo 120ms ease; }
  .aviso { transform: translateY(10px); transition: opacity 200ms ease, transform 200ms var(--curva); }
  .aviso.on { transform: none; }
  dialog[open] { animation: jlx-janela 180ms var(--curva); }
  dialog[open]::backdrop { animation: jlx-fundo 180ms ease; }
  .lateral { transition: transform var(--mov-gaveta) var(--curva); }
  .gaveta-fundo { animation: jlx-fundo var(--mov-gaveta) ease; }
  /* troca de página (View Transitions): só o conteúdo anima; o resto da tela fica parado */
  .vt-pagina .conteudo { view-transition-name: conteudo; }
  ::view-transition { pointer-events: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  ::view-transition-old(conteudo) { animation: jlx-sai 110ms ease-in both; }
  ::view-transition-new(conteudo) { animation: jlx-entra 190ms var(--curva) both; }
}
@keyframes jlx-janela { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes jlx-menu { from { opacity: 0; transform: translateY(-4px); } }
@keyframes jlx-fundo { from { opacity: 0; } }
@keyframes jlx-sai { to { opacity: 0; } }
@keyframes jlx-entra { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* janela modal aberta: a página de trás não rola com a roda do mouse sobre o fundo escuro */
body:has(dialog[open]) { overflow: hidden; }

/* tema de alto contraste do Windows: o fundo some, então o item ativo da paleta e o do menu precisam de contorno */
@media (forced-colors: active) {
  .paleta li[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  .lateral nav a[aria-current="page"] { border-left: 4px solid Highlight; }
  .menu-marcador, .topo h1::before, .kpi::before, .kpi::after, .vazio::before { display: none; }
  :is(.rel-abas, .lgpd-abas, .fis-abas, .ct-subnav, .pa-abas) a[aria-current="page"]::after { background: Highlight; }
  .ico { stroke: CanvasText; }
}

/* ---------- celular e tablet: barra superior com o botão do menu; a lateral vira gaveta ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .so-computador { display: none !important; }
  .so-celular { display: inline-grid !important; }
  .barra-topo { height: 56px; padding: 0 .5rem; gap: .2rem; }
  .barra-topo .btn-icone { width: 44px; height: 44px; }
  .barra-topo .btn-icone .ico { width: 22px; height: 22px; }
  .marca-topo { display: flex !important; margin-right: auto; padding: .4rem .3rem; border-radius: 8px; }
  .marca-topo .logo { width: 64px; height: 20px; color: var(--texto); }
  .busca-topo { width: 44px; min-height: 44px; margin-left: 0; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .busca-topo .ico { width: 22px; height: 22px; }
  .busca-topo .busca-rotulo, .busca-topo kbd, .usuario-info, .botao-usuario .menu-seta { display: none; }
  .botao-usuario { padding: .2rem; min-height: 44px; }
  .lateral {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: 100%; z-index: 26;
    transform: translateX(-100%); visibility: hidden; box-shadow: 0 0 40px rgba(0, 0, 0, .3);
  }
  .gaveta-aberta .lateral { transform: none; visibility: visible; }
  .gaveta-fundo { position: fixed; inset: 0; z-index: 25; background: rgba(10, 16, 32, .5); backdrop-filter: blur(2px); }
  .lateral-rodape { display: none; }
  .conteudo { padding: 1.1rem 1rem 2.5rem; }
  .detalhe { grid-template-columns: 1fr; }
  .modal-corpo { grid-template-columns: 1fr; }
  .g2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .topo .barra { justify-content: flex-start; }
  .rel-abas, .lgpd-abas ul, .fis-abas ul, .ct-subnav, .pa-abas { flex-wrap: nowrap; } /* no celular as abas rolam de lado, dentro da própria faixa */
}
@media (max-width: 860px) and (prefers-reduced-motion: no-preference) {
  /* fechando: a gaveta desliza e só depois some da árvore de foco (visibility no fim) */
  .lateral { transition: transform var(--mov-gaveta) var(--curva), visibility 0s linear var(--mov-gaveta); }
  .gaveta-aberta .lateral { transition: transform var(--mov-gaveta) var(--curva), visibility 0s; }
}

@media print {
  .lateral, .barra-topo, .gaveta-fundo, .sprite, .dica-trilho, .menu-suspenso, .barra, .filtros, .aviso, .pular, .acoes, .btn, dialog { display: none !important; }
  .app { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .conteudo { padding: 0; max-width: none; }
  .cartao { border: 1px solid #999; break-inside: avoid; box-shadow: none; }
  .tabela { overflow: visible; }
  thead th { background: none; }
  .topo h1::before, .kpi::before, .kpi::after, .vazio::before { display: none; }
  .kpi { padding-right: 1.1rem; }
  .lista-atencao li { background: none; border-color: #999; }
  :focus-visible { outline: none !important; } /* o foco que a tela pôs no título não sai no papel */
  a { color: inherit; text-decoration: none; }
}

/* faixas de aviso acima do conteúdo */
.faixa { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .6rem 2.25rem; background: var(--ambar-bg); color: var(--ambar); border-bottom: 1px solid var(--borda); font-weight: 600; }
.campos-login { display: flex; flex-direction: column; gap: .9rem; }
.link-escuro { color: var(--suave); align-self: center; }

/* usuários, conta, backup */
.perfis { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.perfis dt { font-weight: 600; }
.perfis dd { margin: 0; color: var(--suave); }
.ficha-simples { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0 0 1rem; }
.ficha-simples dt { color: var(--suave); }
.ficha-simples dd { margin: 0; }
.senha-temporaria { font: 600 1.4rem/1.2 ui-monospace, Consolas, monospace; padding: .8rem 1rem; background: var(--trilho); border-radius: 8px; letter-spacing: .05em; user-select: all; text-align: center; }
.codigos { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .8rem; }
.codigos code, code { font: .9em ui-monospace, Consolas, monospace; background: var(--trilho); padding: .1rem .4rem; border-radius: 4px; overflow-wrap: anywhere; }
.qr-2fa .qr { width: 220px; max-width: 100%; background: #fff; padding: .4rem; border-radius: 8px; }
.qr-2fa .qr svg { width: 100%; height: auto; display: block; }
.faixa-ambiente { background: var(--vermelho-bg); color: var(--vermelho); justify-content: center; text-align: center; }
@media (max-width: 860px) { .faixa { padding: .6rem 1rem; } }
