/* ════════════════════════════════════════════
   ADMIN — GRID E CARDS
════════════════════════════════════════════ */

/* O painel admin tem tabelas largas (auditoria/salvaguardas com 7 colunas). Usa mais
   largura da tela que a tela do cidadão (limitada a 800px para leitura), evitando o
   scroll lateral no desktop. O .table-wrap mantém overflow-x como fallback em telas
   estreitas. */
#main-admin.main-content {
  max-width: min(1320px, 96vw);
}

/* ════════════════════════════════════════════
   NAVEGAÇÃO POR SEÇÕES (VIEWS)
════════════════════════════════════════════ */
/* Barra de navegação fixa logo abaixo da topbar (60px). Troca a view exibida sem rolar
   uma página única; itens super-only ([data-super]) somem para o operador via JS. */
.admin-nav {
  position: sticky;
  top: 60px;
  z-index: 90;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
}
.admin-nav-inner {
  max-width: min(1320px, 96vw);
  margin: 0 auto;
  display: flex;
  gap: var(--sp-1);
  padding: 0 var(--sp-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-nav-inner::-webkit-scrollbar { display: none; }
.admin-nav-item {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: var(--sp-4) var(--sp-4) calc(var(--sp-4) - 3px);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.admin-nav-item:hover { color: var(--c-text); }
.admin-nav-item.is-active {
  color: var(--c-brand);
  border-bottom-color: var(--c-brand);
}
.admin-nav-item:focus-visible {
  outline: 2px solid var(--c-brand);
  outline-offset: -3px;
  border-radius: var(--r-sm);
}

/* Uma view visível por vez. */
.admin-view { display: none; }
.admin-view.is-active { display: block; animation: admin-view-in var(--t-fast) ease-out; }
@keyframes admin-view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .admin-view.is-active { animation: none; }
}

/* ════════════════════════════════════════════
   FILTROS, PAGINAÇÃO E AUXILIARES
════════════════════════════════════════════ */
.filtros-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.filtros-spacer { flex: 1 1 auto; }

.table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.table-pager:empty { display: none; }
.pager-info { font-size: var(--text-sm); color: var(--c-muted); }
.pager-info strong { color: var(--c-text); font-weight: 800; }
.pager-controls { display: flex; gap: var(--sp-2); }

.field-hint {
  font-size: var(--text-xs);
  color: var(--c-muted);
  margin-top: var(--sp-1);
  line-height: 1.5;
}
.w-full { width: 100%; }

/* Coluna numérica: alinhada à direita com dígitos tabulares (não "dançam"). */
.hist-table .col-num,
.hist-table th.col-num { text-align: right; font-variant-numeric: tabular-nums; }
.hist-table .mono { font-variant-numeric: tabular-nums; }

/* Crachá de perfil do usuário. */
.papel-tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  letter-spacing: .03em;
  white-space: nowrap;
}
.papel-tag.is-super    { background: var(--c-accent-bg); color: var(--c-accent-dk); border: 1px solid var(--c-accent-bd); }
.papel-tag.is-operador { background: rgba(23, 69, 141, .08); color: var(--c-brand); border: 1px solid var(--c-border); }
.papel-tag.is-comissao { background: var(--c-success-bg); color: var(--c-success-fg); border: 1px solid var(--c-success-bd); }

/* Spinner de carregamento dentro das tabelas. */
.table-spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-brand);
  border-radius: 50%;
  animation: table-spin-rot .7s linear infinite;
  vertical-align: -2px;
  margin-right: var(--sp-1);
}
@keyframes table-spin-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .table-spin { animation: none; } }

/* Crachá de papel na topbar reflete o perfil real (super/operador). */
.topbar .admin-badge { white-space: nowrap; }

/* Cadeado da consulta de servidores (step-up auth antes de ver CPF/cotas) — cartão calmo e centrado */
.consulta-lock {
  max-width: 440px;
  margin: var(--sp-4) auto;
  text-align: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6);
  box-shadow: var(--sh-sm);
}
.consulta-lock-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto var(--sp-4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(23, 69, 141, .08);
  color: var(--c-brand);
}
.consulta-lock-title { font-size: var(--text-lg); font-weight: 800; color: var(--c-text); margin-bottom: var(--sp-2); }
.consulta-lock-desc { font-size: var(--text-sm); color: var(--c-muted); line-height: 1.55; margin-bottom: var(--sp-5); }
.consulta-lock-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.consulta-lock-form .search-input,
.consulta-lock-form .btn { width: 100%; }

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.section-header h2 {
  font-size: var(--text-lg);
  font-weight: 900;
  color: var(--c-brand);
  line-height: 1.2;
}
.section-header h3 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--c-text);
}
.section-sub {
  font-size: var(--text-sm);
  color: var(--c-muted);
  margin-top: var(--sp-1);
}

.admin-grid {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
  align-items: start;
}
@media (max-width: 880px) { .admin-grid { grid-template-columns: 1fr; } }

/* Usuários: formulário compacto (não estica os campos pela tela inteira) + tabela ocupando
   o resto. Em telas estreitas empilha, mas o formulário fica limitado para não ficar esparso. */
.usuarios-grid {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}
.usuarios-form-card { align-self: start; }
@media (max-width: 880px) {
  .usuarios-grid { grid-template-columns: 1fr; }
  .usuarios-form-card { max-width: 560px; }
}

/* Ações por usuário: empilhadas e com a mesma largura, para um bloco uniforme. */
.acoes-usuario {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: stretch;
}
.acoes-usuario .btn {
  width: 100%;
  max-width: 160px;
  white-space: nowrap;
}

.admin-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-top: 3px solid var(--c-brand);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-sm);
  align-self: start;
  /* Permite que o card encolha abaixo do conteúdo: sem isto o min-width:auto
     dos itens de grid faz a tabela (min-width:520) estourar o layout em vez de
     rolar dentro do .table-wrap (overflow-x:auto). */
  min-width: 0;
}
.admin-card h3 {
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--c-brand);
  margin-bottom: var(--sp-2);
}
.card-desc {
  font-size: var(--text-xs);
  color: var(--c-muted);
  margin-bottom: var(--sp-4);
  line-height: 1.55;
}
.card-desc code {
  background: rgba(23,69,141,.07);
  padding: 1px var(--sp-1);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: var(--c-brand);
  font-weight: 700;
  word-break: break-all;
}

/* DB stats rows */
.db-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--c-border);
  font-size: var(--text-sm);
}
.db-stat-row:last-child { border-bottom: none; }
.db-stat-label { color: var(--c-muted); }
.db-stat-value { font-weight: 800; color: var(--c-text); }
.db-stat-value.green { color: var(--c-success); }

/* ── Faixa de métricas do banco (visão geral, largura total) ── */
.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
@media (max-width: 720px) { .stat-band { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .stat-band { grid-template-columns: 1fr; } }

.stat-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  padding: var(--sp-5);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
}
.stat-metric::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--c-brand);
}
.stat-metric-num {
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--c-brand);
  line-height: 1;
  letter-spacing: -.01em;
}
.stat-metric-status {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--c-success);
  line-height: 1;
}
.status-dot {
  width: 9px; height: 9px;
  border-radius: var(--r-full);
  background: var(--c-success);
  box-shadow: 0 0 0 3px var(--c-success-bg);
  flex-shrink: 0;
}
.stat-metric-status.is-offline { color: var(--c-error); }
.stat-metric-status.is-offline .status-dot { background: var(--c-error); box-shadow: 0 0 0 3px var(--c-error-bg); }
.stat-metric-lbl {
  font-size: var(--text-xs);
  color: var(--c-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Variantes de cor */
.stat-metric--success::before { background: var(--c-success); }
.stat-metric--success .stat-metric-num { color: var(--c-success); }
.stat-metric--brand::before { background: var(--c-brand); }
.stat-metric--brand .stat-metric-num { color: var(--c-brand); }
.stat-metric--accent::before { background: var(--c-accent); }
.stat-metric--accent .stat-metric-num { color: var(--c-accent); }
.stat-metric--warn::before { background: var(--c-warn); }
.stat-metric--warn .stat-metric-num { color: var(--c-warn); }

/* Título de seção dentro da visão geral */
.stat-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--sp-3);
}

/* ── Gráficos ── */
.graficos-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  align-items: start;
}
@media (max-width: 760px) { .graficos-grid { grid-template-columns: 1fr; } }

.grafico-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--sh-sm);
}

.grafico-titulo {
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-muted);
  margin-bottom: var(--sp-4);
}

/* ── Pizza donut ── */
.grafico-pizza-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}
.grafico-pizza {
  width: 130px;
  height: 130px;
  min-width: 130px;
  min-height: 130px;
  max-width: 130px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.08));
}
#pizza-ciencia,
#pizza-recurso { transition: stroke-dasharray .6s ease; }

.grafico-pizza-legenda {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 100%;
}
.legenda-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}
.legenda-cor {
  width: 12px; height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
}
/* Cor da legenda em classe (a CSP bloqueia style="" inline; ver .bh-fill--*). */
.legenda-cor--ciencia { background: var(--c-brand); }
.legenda-cor--recurso { background: var(--c-accent); }
.legenda-nome {
  font-size: var(--text-xs);
  color: var(--c-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.legenda-val {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--c-text);
}

/* ── Barras HORIZONTAIS (robustas — crescem em largura, sem altura fixa nem absolute) ── */
.grafico-card--barras { display: flex; flex-direction: column; }

#grafico-barras {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  justify-content: center;
  flex: 1;
}

.bh-row { width: 100%; }

.bh-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.bh-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text);
}
.bh-val {
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}
.bh-pct {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-muted);
}

/* Trilho da barra: largura total, cinza claro. A barra (fill) cresce dentro dele. */
.bh-track {
  width: 100%;
  height: 14px;
  background: var(--c-bg);
  border-radius: var(--r-full);
  overflow: hidden;
}
.bh-fill {
  height: 100%;
  border-radius: var(--r-full);
  min-width: 4px;
  transition: width .6s ease;
  background: var(--c-muted);
}
/* Cores por categoria em classe (a CSP bloqueia style="" inline; a largura é aplicada
   via JS por el.style.width, que não é atributo inline e não viola a política). */
.bh-fill--ciencia { background: var(--c-brand); }
.bh-fill--recurso { background: var(--c-accent); }
.bh-fill--sem     { background: #94a3b8; }

/* ── Card de importação: empilhamento dos controles ── */
.import-stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.file-trigger {
  cursor: pointer;
  justify-content: center;
  gap: var(--sp-2);
}
.import-filename {
  font-size: var(--text-xs);
  color: var(--c-muted);
  min-height: 16px;
  word-break: break-all;
}

#import-preview { margin-top: var(--sp-4); font-size: var(--text-sm); }
.preview-ok  { background: var(--c-success-bg); border: 1px solid var(--c-success-bd); color: var(--c-success); font-weight: 600; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); }
.preview-err { background: var(--c-error-bg);   border: 1px solid var(--c-error-bd);   color: var(--c-error);   font-weight: 600; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); }
.recurso-success { background: var(--c-success-bg); border: 1px solid var(--c-success-bd); color: var(--c-success); font-weight: 600; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); margin-top: var(--sp-3); font-size: var(--text-sm); }


/* ── Search ── */
.search-input {
  min-height: 40px;
  padding: 0 var(--sp-3);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-surface);
  outline: none;
  width: 240px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search-input:focus {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(23,69,141,.1);
}

/* Filtros estruturados (situação, GST, ordenação): mesmo visual do campo de busca. */
.filtro-select {
  min-height: 40px;
  padding: 0 var(--sp-6) 0 var(--sp-3);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-family: var(--font);
  color: var(--c-text);
  background-color: var(--c-surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6472' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.filtro-select:focus {
  border-color: var(--c-brand);
  box-shadow: 0 0 0 3px rgba(23,69,141,.1);
}


/* ════════════════════════════════════════════
   TABLE
════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  box-shadow: var(--sh-sm);
  -webkit-overflow-scrolling: touch;
}
.hist-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
  min-width: 520px;
}
.hist-table th {
  background: var(--c-brand);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.85);
  text-align: left;
  border-bottom: 2px solid var(--c-accent);
  white-space: nowrap;
}
.hist-table td {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.hist-table tr:last-child td { border-bottom: none; }
.hist-table tbody tr:hover td { background: rgba(23,69,141,.03); }

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 800;
  padding: 2px var(--sp-3);
  border-radius: var(--r-full);
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill.apto       { background: var(--c-success-bg); color: var(--c-success); border: 1px solid var(--c-success-bd); }
.status-pill.inapto     { background: var(--c-error-bg);   color: var(--c-error);   border: 1px solid var(--c-error-bd); }
.status-pill.em_analise { background: var(--c-analise-bg); color: var(--c-warn-strong); border: 1px solid var(--c-analise-bd); }

/* Export btn */
#btn-export {
  width: auto;
  font-size: var(--text-xs);
  padding: 0 var(--sp-4);
}

/* ── Modal edição de cotas ── */
.edit-cotas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
}
.edit-total-preview {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  color: var(--c-muted);
  text-align: right;
  border: 1px solid var(--c-border);
}
.edit-total-preview strong { color: var(--c-brand); font-size: var(--text-lg); }

/* Seção de períodos com separação visual clara */
.edit-periodos-secao {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
}
.edit-periodos-titulo {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}
.edit-periodos-lista {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.edit-periodo-row {
  display: grid;
  grid-template-columns: 90px 1fr 100px 40px;
  gap: var(--sp-3);
  align-items: center;
  background: var(--c-bg);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}
.edit-periodo-row input {
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  width: 100%;
}
.edit-periodo-row input:focus {
  outline: none;
  border-color: var(--c-brand);
  box-shadow: 0 0 0 2px rgba(23,69,141,.12);
}
.edit-periodo-label {
  font-size: var(--text-xs);
  color: var(--c-muted);
  margin-bottom: 2px;
}
.edit-periodo-field { display: flex; flex-direction: column; gap: 2px; }
.btn-rm-periodo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--c-danger-bd);
  cursor: pointer;
  color: var(--c-error);
  font-size: 18px;
  line-height: 1;
  border-radius: var(--r-md);
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.btn-rm-periodo:hover { background: var(--c-error-bg); }
.btn-add-periodo {
  margin-top: var(--sp-3);
  width: 100%;
  justify-content: center;
  border-style: dashed;
  color: var(--c-brand);
}



/* ════════════════════════════════════════════
   MODAL — Termo de Ciência e Responsabilidade
════════════════════════════════════════════ */
.termo-header {
  background: linear-gradient(135deg, var(--c-brand-dk), var(--c-brand) 70%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.termo-brasao {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: rgba(255,255,255,.14);
  border: 1.5px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 900; color: #fff; flex-shrink: 0;
}
.termo-header .modal-nome { color: #fff; }
.termo-org {
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(255,255,255,.78);
}
.termo-faixa {
  width: 50px; height: 3px;
  background: linear-gradient(90deg, #e8c878, #c79a3c);
  border-radius: 3px; margin-top: 6px;
}

.termo-aviso {
  background: var(--c-brand-light);
  border: 1px solid #c3d3ec;
  border-left: 4px solid var(--c-brand);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--c-brand-dk);
  margin-bottom: var(--sp-4);
}

.termo-id { margin-bottom: var(--sp-4); }
.termo-id-titulo {
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--c-brand-dk); border-bottom: 1.5px solid var(--c-border);
  padding-bottom: var(--sp-2); margin-bottom: var(--sp-3);
}
.termo-id-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3) var(--sp-4); }
.termo-campo { display: flex; flex-direction: column; gap: 4px; }
.termo-campo-full { grid-column: 1 / -1; }
.termo-campo .search-input { width: 100%; }
.termo-label {
  font-size: 11px; font-weight: 700; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .03em;
}
.termo-label .req { color: #c0392b; }
.termo-label .termo-opc { color: #aab2c0; font-weight: 600; text-transform: none; letter-spacing: 0; }
.termo-fixo {
  background: var(--c-brand-light) !important;
  border-color: var(--c-brand-lt) !important;
  font-weight: 700; color: var(--c-brand-dk);
}

.termo-scroll {
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
  padding: var(--sp-3) var(--sp-4);
  height: 190px; overflow-y: auto;
  font-size: 12.5px; line-height: 1.6; color: var(--c-text);
}
.termo-scroll p { margin: 7px 0; text-align: justify; }
.termo-scroll p:first-child { margin-top: 0; }
.termo-hint {
  font-size: 11px; color: var(--c-muted); text-align: center;
  margin-top: var(--sp-2); font-style: italic;
}

.termo-aceite {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  background: var(--c-accent-bg); border: 1px solid var(--c-accent-bd);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-4);
  cursor: pointer; font-size: 12.5px; color: #5a4000; line-height: 1.5;
}
.termo-aceite input { margin-top: 3px; width: 17px; height: 17px; flex-shrink: 0; cursor: pointer; }
.termo-aceite strong { color: #4a3400; }

.termo-footer {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
}
.termo-meta { font-size: 11px; color: var(--c-muted); }
.termo-btns { display: flex; gap: var(--sp-2); }

/* Marcadores de campo obrigatório/opcional em formulários do admin (ex.: cadastro de servidor). */
.form-group label .req { color: #c0392b; font-weight: 800; }
.form-group label .opc { color: #aab2c0; font-weight: 600; font-size: 11px; }
