/* Componentes reutilizaveis: card, form, botao, tabela, toggle, flash. Dark. */

/* --------- Card --------- */
.cd {
  background: #0A111F;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--sombra-sm);
}

.cd + .cd { margin-top: 16px; }

.cd-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cd-titulo {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.cd-contagem {
  font-size: 12px;
  color: rgba(245, 249, 251, 0.5);
}

/* Linha de status (webhook/sincronizacao) — fica ABAIXO do cabecalho, em faixa
   propria, pra nao disputar espaco com o botao "Atualizar situacao". */
.sit-msg {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}

/* --------- Botoes --------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 40px;
  border-radius: 8px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }

.btn-primary {
  background: var(--accent);
  color: var(--texto-sobre-accent);
}
.btn-primary:hover { background: var(--accent-hover); }

/* Botao Salvar flutuante: injetado por app.js em todo form grande, fica
   visivel o formulario inteiro sem precisar rolar ate o rodape. */
.btn-flutuante {
  position: fixed;
  top: 78px;
  right: 24px;
  z-index: var(--z-dropdown);
  height: 34px;
  padding: 0 16px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
}
.btn-flutuante i { margin-right: 5px; }

.btn-ghost {
  background: transparent;
  color: rgba(245, 249, 251, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.04); color: #F5F9FB; }

.btn-danger {
  background: transparent;
  color: #F87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.08); }

/* Botao neutro: usado pelo modal "Sair sem salvar" (app.js) e em acoes
   secundarias. Superficie discreta com borda, sem competir com o primario. */
.btn-neutro {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-neutro:hover { background: var(--bg-elev); border-color: var(--accent-escura); }

.btn-icone {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: rgba(245, 249, 251, 0.65);
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.btn-icone:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #F5F9FB;
}

.btn-icone.desabilitado {
  color: rgba(245, 249, 251, 0.2);
  cursor: not-allowed;
}

/* --------- Formulario --------- */
.campo {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.campo label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(245, 249, 251, 0.85);
  margin-bottom: 6px;
}

.campo input,
.campo select,
.campo textarea {
  height: 40px;
  padding: 0 12px;
  background: #050911;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #F5F9FB;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.campo textarea { height: auto; padding: 10px 12px; min-height: 88px; }

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-sombra);
}

/* Inputs de edicao inline dentro das linhas de tabela (ex.: Catalogos):
   herdam o tema escuro em vez do branco padrao do navegador (o "zebrado").
   Checkbox/radio ficam de fora (ex.: selecao da conciliacao). */
.tbl input:not([type="checkbox"]):not([type="radio"]),
.tbl select,
.cat-grid-linha input:not([type="checkbox"]):not([type="radio"]),
.cat-grid-linha select {
  height: 36px;
  padding: 0 10px;
  background: #050911;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #F5F9FB;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.tbl input:not([type="checkbox"]):not([type="radio"]):focus,
.tbl select:focus,
.cat-grid-linha input:not([type="checkbox"]):not([type="radio"]):focus,
.cat-grid-linha select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-sombra);
}

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

.form-acoes {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
}

/* --------- Tabela --------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tbl th {
  text-align: left;
  padding: 10px 12px;
  color: rgba(245, 249, 251, 0.55);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
}

.tbl td {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #F5F9FB;
}

.tbl tr:hover td { background: rgba(255, 255, 255, 0.02); }

.tbl .col-acoes {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

/* --------- Grid de edicao inline de catalogo --------- */
/* O container .cat-grid define as colunas (--cat-cols) UMA vez. Cabecalho e cada
   linha ocupam a largura toda e herdam as MESMAS trilhas via subgrid, entao as
   colunas ficam no esquadro mesmo com input numa e texto na outra (grids
   independentes resolveriam cada fr pelo proprio conteudo e desalinhariam). */
.cat-grid {
  display: grid;
  grid-template-columns: var(--cat-cols);
}
.cat-grid-cab,
.cat-grid-linha {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}
.cat-grid-cab {
  color: rgba(245, 249, 251, 0.55);
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cat-grid-linha { border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.cat-grid-linha:hover { background: rgba(255, 255, 255, 0.02); }
.cat-grid-cab .cat-acoes { text-align: right; }
/* Itens podem encolher abaixo do min-content pra nao empurrar a trilha. */
.cat-grid-cab > *,
.cat-grid-linha > * { min-width: 0; }

/* --------- Toggle on/off (Padrao_Toggle_OnOff, tipo 3) --------- */
.cv-sw {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  vertical-align: middle;
}

.cv-sw input {
  position: absolute;
  left: -9999px;
}

.cv-sw label {
  position: absolute;
  inset: 0;
  margin: 0;                 /* neutraliza o margin-bottom de .campo label:
                                com top/bottom:0 ele encolheria o trilho (24->18)
                                e o knob transbordaria (ficava "fora de esquadro"). */
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background .15s ease;
}

.cv-sw label::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform .15s ease;
}

.cv-sw input:checked + label {
  background: #16a34a;
}
.cv-sw input:checked + label::before {
  transform: translateX(18px);
}

/* --------- Flash --------- */
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
}
.flash.ok    { background: rgba(22, 163, 74, 0.12); color: #86EFAC; border: 1px solid rgba(22, 163, 74, 0.3); }
.flash.erro  { background: rgba(248, 113, 113, 0.10); color: #FCA5A5; border: 1px solid rgba(248, 113, 113, 0.28); }
.flash.aviso { background: rgba(234, 179, 8, 0.10); color: #FDE68A; border: 1px solid rgba(234, 179, 8, 0.30); }

/* --------- Chips / status --------- */
.chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chip.ativo  { background: rgba(22, 163, 74, 0.15); color: #86EFAC; }
.chip.inativo { background: rgba(248, 113, 113, 0.12); color: #FCA5A5; }
.chip.matriz { background: var(--accent-soft); color: var(--accent); }

/* Status da Apuracao Assistida na grid: laranja=aguardando, verde=concluida,
   vermelho=erro, cinza=cancelada. */
.chip.st-processando { background: rgba(241, 140, 30, 0.16);  color: #F8B45A; }
.chip.st-concluida   { background: rgba(22, 163, 74, 0.15);   color: #86EFAC; }
.chip.st-erro        { background: rgba(231, 76, 60, 0.18);   color: #FCA5A5; }
.chip.st-cancelada   { background: rgba(148, 163, 184, 0.14); color: #CBD5E1; }

/* --------- Estado vazio --------- */
.vz {
  padding: 40px 16px;
  text-align: center;
  color: rgba(245, 249, 251, 0.5);
  font-size: 14px;
}

/* --------- Grid de permissoes --------- */
.perm-grupo {
  margin-bottom: 20px;
}

.perm-grupo-cab {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.perm-grupo-auto {
  font-size: 12px;
  color: rgba(245, 249, 251, 0.6);
  font-weight: 500;
  display: flex;
  gap: 14px;
  align-items: center;
}

.perm-grupo-auto label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}

.perm-linha {
  display: grid;
  grid-template-columns: 1fr 90px 90px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.perm-linha:last-child { border-bottom: 0; }

.perm-linha input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* --------- Multi-select via checkbox pill (padrao Areas Adjacentes) --------- */
.chk-multi {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 4px 0;
}
.chk-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #F5F9FB; font-size: 13px; cursor: pointer;
  transition: background 120ms, border-color 120ms;
  user-select: none;
}
.chk-pill:hover { background: rgba(0,176,255,0.08); border-color: var(--accent); }
.chk-pill:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
}
.chk-pill input { accent-color: var(--accent); }

.cnt-chip {
  display: inline-block; min-width: 22px; padding: 1px 8px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 12px; font-size: 11px; font-weight: 700;
  text-align: center; margin-left: 8px;
}

/* --------- Grid de correcao (admin) --------- */
.grid-card { padding: 12px 12px 4px; }
.grid-filtro {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 4px 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 8px;
}
.grid-filtro input {
  flex: 1; height: 36px; padding: 0 12px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  color: #F5F9FB; border-radius: 8px; font-size: 13px;
}
.grid-filtro input:focus { outline: none; border-color: var(--accent); }
.grid-wrap {
  max-height: calc(100vh - 260px);
  overflow-x: scroll;   /* SEMPRE visivel, mesmo sem overflow */
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.06); border-radius: 8px;
  scrollbar-gutter: stable;
}
.grid-wrap .grid-tbl { min-width: 2400px; width: max-content; }

/* Forca a scrollbar horizontal aparecer sempre no Chrome/Edge */
.grid-wrap::-webkit-scrollbar { height: 14px; width: 10px; }
.grid-wrap { scrollbar-width: auto; }
.grid-wrap::-webkit-scrollbar { height: 12px; width: 10px; }
.grid-wrap::-webkit-scrollbar-thumb { background: rgba(0,176,255,0.35); border-radius: 6px; }
.grid-wrap::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.grid-wrap::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }

.grid-tbl thead th {
  position: sticky; top: 0; z-index: 2;
  background: #0F1626; color: #F5F9FB;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  user-select: none;
}
.grid-tbl thead th.sort-asc::after  { content: ' ▲'; color: var(--accent); font-size: 10px; }
.grid-tbl thead th.sort-desc::after { content: ' ▼'; color: var(--accent); font-size: 10px; }
.grid-tbl tbody td { white-space: nowrap; padding: 8px 12px; }
.grid-tbl tbody tr:hover td { background: rgba(0,176,255,0.05); }
.grid-tbl .acoes-fixas {
  position: sticky; left: 0; z-index: 1; background: #0A111F;
  border-right: 1px solid rgba(255,255,255,0.08);
}
.grid-tbl td[contenteditable] { cursor: text; }
.grid-tbl td[contenteditable]:hover { background: rgba(0,176,255,0.06); }
.grid-tbl td.td-editing {
  outline: 2px solid var(--accent); outline-offset: -2px; background: rgba(0,176,255,0.12);
}
.grid-tbl td.td-saved  { background: rgba(22,163,74,0.18); }
.grid-tbl td.td-pending { background: rgba(255,193,7,0.20); font-weight: 600; }
.grid-tbl td.td-error   { background: rgba(220,53,69,0.25); }

/* --------- Login (identidade landing) --------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 20%, rgba(0, 176, 255, 0.10), transparent 40%),
              radial-gradient(circle at 80% 90%, rgba(97, 89, 225, 0.10), transparent 45%),
              #050911;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  background: #0A111F;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.login-brand {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.login-logo { width: 46px; height: 46px; object-fit: contain; flex: 0 0 auto; }

.login-marca {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.login-marca .marca-amply { color: #F5F9FB; }
.login-marca .marca-sol   { color: var(--accent); margin-left: 4px; }
.login-slogan {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(245,249,251,.6);
}

.login-tit {
  font-family: 'Space Grotesk', 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 13px;
  color: rgba(245, 249, 251, 0.55);
  margin-bottom: 22px;
}

.login-page .btn-primary {
  width: 100%;
  justify-content: center;
  background: linear-gradient(120deg, #00B0FF 0%, #6159E1 100%);
  color: #FFFFFF;
}

.login-page .btn-primary:hover {
  filter: brightness(1.08);
}

/* Toggle de olho no campo de senha (injetado por app.js) */
.senha-wrap { position: relative; display: block; }
.senha-wrap input[type="password"],
.senha-wrap input[type="text"] { padding-right: 42px; width: 100%; }
.senha-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--tx-suave, #98a4b3);
  cursor: pointer; padding: 6px 8px; line-height: 1; border-radius: 6px;
}
.senha-toggle:hover { color: var(--accent, #00B0FF); background: var(--accent-soft, rgba(0,176,255,0.12)); }
.senha-toggle i { font-size: 18px; }

/* Breadcrumb estrutural (montado pelo core/breadcrumb.py) */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  font-size: 12px; letter-spacing: .01em;
  margin: 0 0 12px 0; padding: 6px 10px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 6px;
}
.breadcrumb-item { color: rgba(245,249,251,.55); text-decoration: none; padding: 2px 6px; border-radius: 4px; }
a.breadcrumb-item:hover { color: var(--accent); background: var(--accent-soft, rgba(0,176,255,.10)); }
.breadcrumb-atual { color: var(--accent); font-weight: 600; }
.breadcrumb-sep { color: rgba(245,249,251,.30); font-size: 14px; margin: 0 2px; }

/* Linha de tabela toda clicavel: hover destaca + cursor pointer */
tr.linha-clicavel { cursor: pointer; transition: background .12s; }
tr.linha-clicavel:hover { background: rgba(0,176,255,.06); }

/* ========================================================================
   FASE 3 - Abas, barra Salvar sticky, SelectBusca, modal
   ======================================================================== */

/* --------- Abas (Padrao_Tabs) --------- */
.abas {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
}
.aba {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
}
.aba:hover { color: var(--text); }
.aba.ativa { color: var(--accent); border-bottom-color: var(--accent); }
.aba i { font-size: 16px; }
.aba-contagem {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}

/* --------- Barra Salvar sticky no topo do form (UX default) --------- */
.barra-salvar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 0;
  margin-bottom: var(--sp-4);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.barra-salvar-dica { color: var(--accent); font-size: 13px; font-weight: 600; }

/* --------- SelectBusca --------- */
.sb-wrap { position: relative; }
.sb-nativo {
  position: absolute; opacity: 0; pointer-events: none; height: 0; width: 0;
}
/* O input da SelectBusca carrega o proprio tema escuro, pra ficar certo tambem
   FORA de um .campo (ex.: filtro no cabecalho do card, onde antes caia no branco
   padrao do navegador). Dentro de .campo, ".campo input" (mais especifico) vence
   e mantem o visual do formulario. */
.sb-campo {
  cursor: text;
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #050911;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #F5F9FB;
  font-size: 14px;
  outline: none;
}
.sb-campo:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-sombra); }
/* Caixa de largura fixa pro campo de filtro (busca ao vivo) no cabecalho do card. */
.filtro-bloco-box { width: 250px; }
.filtro-bloco-box .sb-wrap { width: 100%; }
.filtro-bloco-box .sb-campo { height: 34px; }
.sb-lista {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  z-index: var(--z-sticky);
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--sombra);
}
.sb-item { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.sb-item:hover,
.sb-item-ativo { background: var(--accent-soft); color: var(--accent); }

/* --------- Modal --------- */
.modal-fundo {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 16px;
  overflow-y: auto;
}
.modal-cx {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--sombra-lg);
  padding: 20px;
  width: 100%; max-width: 720px;
}

/* ========================================================================
   FASE 4 - Importacao NFe: dropzone, paginacao, coluna numerica
   ======================================================================== */
.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--text-dim);
  transition: border-color .15s, background .15s;
  margin-bottom: var(--sp-4);
}
.dropzone.sobre { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type="file"] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.dropzone-msg { font-weight: 600; }
.dropzone-msg i { font-size: 22px; display: block; margin-bottom: 6px; }
.dropzone-nome { margin-top: 8px; color: var(--text); font-size: .9em; }

.aba-painel { padding-top: 4px; }

.col-num { text-align: right; font-variant-numeric: tabular-nums; }

.paginacao {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; padding: 14px 0 4px;
}
.paginacao-info { color: var(--text-dim); font-size: .9em; }

.filtros .form-acoes { margin-top: 4px; }

/* Loading com texto especifico, fora do botao (Padrao_Loading_Estado) */
.overlay-loading {
  position: fixed; inset: 0; z-index: var(--z-modal, 1000);
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 9, 17, .72);
}
/* Ocultacao via `hidden` e garantida globalmente por [hidden]{display:none
   !important} em base.css — nao repetir o remendo por componente. */
.overlay-cx {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 24px;
  color: var(--text); font-weight: 600; box-shadow: var(--sombra-lg);
}
.overlay-msg { color: var(--text); }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* --- Fase 6: selecao em lote da grid de divergencias --- */
.tsel {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin: 0; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: 5px; background: var(--bg-elev);
  position: relative; vertical-align: middle;
}
.tsel:checked { background: var(--accent); border-color: var(--accent); }
.tsel:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px; border: solid var(--texto-sobre-accent);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.tsel:indeterminate { background: var(--accent); border-color: var(--accent); }
.tsel:indeterminate::after {
  content: ""; position: absolute; left: 3px; top: 7px;
  width: 10px; height: 2px; background: var(--texto-sobre-accent); border: 0; transform: none;
}
.tsel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.barra-lote {
  display: flex; align-items: center; gap: 10px;
  position: sticky; bottom: 0; z-index: 5;
  margin-top: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 -4px 16px rgba(0,0,0,.25);
  font-size: 13px; color: var(--text);
}
