/* Gerenciador de campanhas (Fase 3). Cores só pelos tokens do tema.css (claro e escuro). Sem style inline (CSP).
   As colunas fixas e a linha de totais usam fundo OPACO: com fundo translúcido, o texto das outras colunas
   apareceria por baixo durante a rolagem horizontal. */
.nx-gc { background: var(--nx-superficie); border: 1px solid var(--nx-linha); border-radius: 8px; overflow: hidden; }

/* abas */
.nx-gc-abas { display: flex; border-bottom: 1px solid var(--nx-linha); overflow-x: auto; }
.nx-gc-aba {
  flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .85rem 1.1rem;
  border: 0; border-bottom: 2px solid transparent; background: var(--nx-superficie); color: var(--nx-texto-suave);
  font-weight: 500; font-size: .88rem; cursor: pointer; white-space: nowrap;
}
.nx-gc-aba:hover { background: var(--nx-hover); color: var(--nx-texto-forte); }
.nx-gc-aba.ativa { color: var(--nx-destaque-texto); border-bottom-color: var(--nx-destaque); font-weight: 600; }
.nx-gc-chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .15rem .3rem .15rem .6rem; border-radius: 999px;
  background: var(--nx-botao); color: #fff; font-size: .72rem; font-weight: 500;
}
.nx-gc-chip button {
  display: grid; place-items: center; width: 1.1rem; height: 1.1rem; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .25); color: #fff; font-size: .6rem; cursor: pointer;
}

/* barra de ações */
.nx-gc-barra { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; flex-wrap: wrap; }
.nx-gc-barra .nx-espaco { flex: 1; }
.nx-gc-atualizado { color: var(--nx-texto-suave); font-size: .8rem; }
.nx-gc-menu { position: relative; }
.nx-gc-menu-lista {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 14rem; padding: .3rem;
  background: var(--nx-superficie); border: 1px solid var(--nx-linha); border-radius: 6px; box-shadow: var(--nx-sombra-menu);
}
.nx-gc-menu-lista button {
  display: flex; align-items: center; gap: .55rem; width: 100%; padding: .5rem .6rem; border: 0; border-radius: 4px;
  background: none; color: var(--nx-texto); font-size: .84rem; text-align: left; cursor: pointer;
}
.nx-gc-menu-lista button:hover:not(:disabled) { background: var(--nx-hover); color: var(--nx-texto-forte); }
.nx-gc-menu-lista button:disabled { color: var(--nx-texto-suave); opacity: .7; cursor: not-allowed; }

/* filtros */
.nx-gc-filtros { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .8rem; padding: 0 1rem 1rem; }
.nx-gc-filtros label { display: block; margin-bottom: .3rem; color: var(--nx-texto-suave); font-size: .75rem; font-weight: 500; }
@media (max-width: 1199.98px) { .nx-gc-filtros { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .nx-gc-filtros { grid-template-columns: 1fr 1fr; } }

/* tabela */
.nx-gc-tabela-wrap { overflow: auto; max-height: 70vh; border-top: 1px solid var(--nx-linha); }
.nx-gc-tabela { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.nx-gc-tabela th, .nx-gc-tabela td {
  padding: .7rem .85rem; border-bottom: 1px solid var(--nx-linha-2); white-space: nowrap; background: var(--nx-superficie);
}
.nx-gc-tabela thead th {
  position: sticky; top: 0; z-index: 3; background: var(--nx-superficie-2); color: var(--nx-texto-suave);
  font-size: .75rem; font-weight: 500; text-transform: none; letter-spacing: 0; text-align: right; cursor: pointer; user-select: none;
  border-bottom-color: var(--nx-linha);
}
.nx-gc-tabela thead th.esq { text-align: left; }
.nx-gc-tabela thead th .nx-ico { margin-left: .3rem; color: var(--nx-texto-suave); font-size: .65rem; opacity: .7; }
.nx-gc-tabela thead th.ordenado { color: var(--nx-destaque-texto); }
.nx-gc-tabela thead th.ordenado .nx-ico { color: var(--nx-destaque-texto); opacity: 1; }
.nx-gc-tabela td { text-align: right; color: var(--nx-texto); font-variant-numeric: tabular-nums; }
.nx-gc-tabela td.esq { text-align: left; }
.nx-gc-tabela tbody tr:hover td { background: var(--nx-hover); }
.nx-gc-tabela tbody tr.marcada td { background: var(--nx-selecionada); }
.nx-gc-tabela tfoot td {
  position: sticky; bottom: 0; z-index: 2; background: var(--nx-superficie-2); border-top: 1px solid var(--nx-linha);
  font-weight: 600; color: var(--nx-texto-forte);
}
/* primeiras colunas fixas na rolagem horizontal */
.nx-gc-fixa1, .nx-gc-fixa2, .nx-gc-fixa3 { position: sticky; z-index: 2; }
.nx-gc-fixa1 { left: 0; width: 2.6rem; min-width: 2.6rem; }
.nx-gc-fixa2 { left: 2.6rem; width: 4.6rem; min-width: 4.6rem; text-align: center !important; }
.nx-gc-fixa3 {
  left: 7.2rem; min-width: 15rem; max-width: 19rem; box-shadow: 1px 0 0 var(--nx-linha);
  text-align: left !important; white-space: normal !important;
}
.nx-gc-tabela thead .nx-gc-fixa1, .nx-gc-tabela thead .nx-gc-fixa2, .nx-gc-tabela thead .nx-gc-fixa3 { z-index: 4; }
.nx-gc-tabela tfoot .nx-gc-fixa1, .nx-gc-tabela tfoot .nx-gc-fixa2, .nx-gc-tabela tfoot .nx-gc-fixa3 { z-index: 3; }
.nx-gc-nome { display: flex; align-items: flex-start; gap: .5rem; font-weight: 500; color: var(--nx-texto-forte); line-height: 1.35; }
.nx-gc-nome small { display: block; color: var(--nx-texto-suave); font-weight: 400; font-size: .72rem; }
.nx-gc-bola { width: .55rem; height: .55rem; margin-top: .38rem; border-radius: 50%; flex-shrink: 0; background: var(--nx-texto-suave); }
.nx-gc-bola.ativa { background: var(--nx-positivo); }
.nx-gc-bola.pausada { background: var(--nx-texto-suave); }
.nx-gc-bola.erro { background: var(--nx-negativo); }
.nx-gc-orc { display: inline-flex; align-items: center; gap: .45rem; }
.nx-gc-orc button { border: 0; background: none; color: var(--nx-texto-suave); cursor: pointer; padding: 0; }
.nx-gc-orc button:hover:not(:disabled) { color: var(--nx-destaque-texto); }
.nx-gc-orc button:disabled { cursor: not-allowed; opacity: .4; }
.nx-gc-orc small { display: block; color: var(--nx-texto-suave); font-size: .7rem; }
.nx-gc-tabela .form-check-input { cursor: pointer; }
.nx-gc-tabela .form-switch .form-check-input { width: 2.2em; height: 1.15em; float: none; margin: 0; }
.nx-gc-tabela .form-switch .form-check-input:checked { background-color: var(--nx-botao); border-color: var(--nx-botao); }
.nx-gc-tabela .form-check-input:disabled { cursor: not-allowed; }
.nx-gc-tabela .positivo { color: var(--nx-positivo); font-weight: 600; }
.nx-gc-tabela .negativo { color: var(--nx-negativo); font-weight: 600; }
.nx-gc-vazio { padding: 2.5rem 1rem; text-align: center; color: var(--nx-texto-suave); background: var(--nx-superficie); }
.nx-gc-vazio .nx-ico { display: block; margin-bottom: .6rem; font-size: 1.6rem; color: var(--nx-campo-borda); }

/* janela de colunas */
.nx-colunas { display: grid; gap: .3rem; max-height: 55vh; overflow: auto; }
.nx-colunas li {
  display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border: 1px solid var(--nx-linha);
  border-radius: 6px; list-style: none; background: var(--nx-superficie); color: var(--nx-texto);
}
.nx-colunas li .nx-espaco { flex: 1; }
.nx-colunas ul { margin: 0; padding: 0; display: grid; gap: .3rem; }
.nx-colunas li small { font-size: .72rem; }
.nx-colunas-presets { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .9rem; }
.nx-colunas-presets .ativo { background: var(--nx-destaque-suave); border-color: var(--nx-destaque-texto); color: var(--nx-destaque-texto); }
.nx-colunas-grade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1rem; margin-bottom: .6rem; }
.nx-colunas-titulo { margin: 0 0 .4rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--nx-texto-suave); }
.nx-colunas-grupos { max-height: 55vh; overflow: auto; display: grid; gap: .8rem; padding-right: .3rem; }
.nx-colunas-grupos fieldset { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .8rem; }
.nx-colunas-grupos legend { grid-column: 1 / -1; float: none; width: auto; margin: 0 0 .2rem; padding: 0; font-size: .8rem; font-weight: 600; color: var(--nx-texto-forte); }
.nx-colunas-opcao { display: flex; align-items: center; gap: .45rem; padding: .15rem 0; font-size: .82rem; color: var(--nx-texto); cursor: pointer; }
.nx-colunas-opcao .form-check-input { margin: 0; flex: none; }
.nx-gc-tabela .erp-selo { white-space: nowrap; }
@media (max-width: 767.98px) {
  .nx-colunas-grade { grid-template-columns: 1fr; }
  .nx-colunas-grupos fieldset { grid-template-columns: 1fr; }
}

/* Contas Meta */
.nx-conexao-scopes { display: flex; flex-wrap: wrap; gap: .3rem; }
@media (max-width: 767.98px) {
  .nx-gc-aba { flex: 1 0 auto; padding: .7rem .8rem; font-size: .82rem; }
  .nx-gc-fixa3 { min-width: 11rem; }
}

/* Tabela sem itens: o cabeçalho e os totais continuam visíveis. */
.nx-gc-sem-itens td { padding: 2.5rem 1rem; text-align: center; color: var(--nx-texto-suave); background: var(--nx-superficie); white-space: normal; }
