/* Aprovy — complementos do painel sobre o brittec-ui.css (padrão ERP Brittec). */

/* Variáveis que a faixa de ambiente (env-banner.css) usa no popover de novidades */
:root {
  --bg-elev-1: #fff; --bg-elev-2: #F8FAFC; --bg-elev-3: #F1F5F9;
  --border-soft: #E2E8F0; --border-strong: #CBD5E1;
  --text-primary: #0F172A; --text-secondary: #64748B;
  --status-active: #059669; --shadow-float: 0 10px 15px -3px rgb(0 0 0 / .1);
}
.text-n-text { color: var(--n-text) !important; }
.text-n-muted { color: var(--n-muted) !important; }
.text-n-accent { color: var(--n-accent) !important; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.min-h-0 { min-height: 0; }
body { overflow: hidden; }
a { color: var(--n-accent); }

/* Cabeçalho da página (igual às telas do ERP) */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  padding-bottom: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--n-border); flex-wrap: wrap; }
.page-crumb { display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 500; color: var(--n-muted); margin-bottom: .25rem; }
.page-crumb a { color: var(--n-muted); text-decoration: none; }
.page-crumb a:hover { color: var(--n-text); }
.page-crumb b { color: var(--n-text); font-weight: 600; }
.page-title { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; color: var(--n-text); }
.page-sub { color: var(--n-muted); font-size: .875rem; margin-top: .25rem; }

/* Barra de busca e filtros (lista_clientes do ERP) */
.filter-bar { background: #fff; border: 1px solid var(--n-border); border-radius: .75rem; padding: 1rem 1.5rem; display: flex;
  gap: 1rem; align-items: center; margin-bottom: 1.5rem; box-shadow: var(--n-shadow-sm); flex-wrap: wrap; }
.search-input-wrapper { flex: 1; position: relative; min-width: 240px; }
.search-input-wrapper i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--n-muted); font-size: 1.125rem; }
.search-input { width: 100%; border: 1px solid var(--n-border); border-radius: .5rem; padding: .625rem 1rem .625rem 2.75rem;
  font-size: .875rem; transition: .2s; background: #F8FAFC; }
.search-input:focus { outline: none; border-color: var(--n-accent); background: #fff; box-shadow: 0 0 0 3px rgba(2,132,199,.1); }
.n-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.n-chip { border: 1px solid var(--n-border); background: #fff; color: var(--n-muted); border-radius: 999px; padding: .375rem .875rem;
  font-size: .8125rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: .2s; }
.n-chip:hover { color: var(--n-text); border-color: #CBD5E1; }
.n-chip.active { background: var(--n-text); border-color: var(--n-text); color: #fff; font-weight: 600; }
.n-chip .n-chip-count { opacity: .7; margin-left: .25rem; }

/* Tabela */
.n-table td { font-size: .875rem; }
.n-table tbody tr:hover td { cursor: default; }
.n-table td a { color: var(--n-text); font-weight: 600; text-decoration: none; }
.n-table td a:hover { color: var(--n-accent); }
.cell-sub { display: block; font-size: .75rem; color: var(--n-muted); margin-top: .125rem; }
.cell-mono { font-family: 'JetBrains Mono', monospace; font-size: .75rem; color: var(--n-muted); }
.id-badge { display: inline-block; background: #F1F5F9; color: #64748B; font-family: 'JetBrains Mono', monospace; font-size: .6875rem;
  font-weight: 700; padding: .125rem .5rem; border-radius: 4px; border: 1px solid #E2E8F0; }
.n-table td.ca-diff { color: #B45309; font-weight: 700; }
.badge-info { background: #F0F9FF; color: #0284C7; border-color: #BAE6FD; }
.badge-purple { background: #F5F3FF; color: #7C3AED; border-color: #DDD6FE; }
.user-cell { display: flex; align-items: center; gap: .75rem; }

/* Paginação */
.n-pagination { display: flex; align-items: center; justify-content: space-between; padding: .875rem 1.5rem; border-top: 1px solid var(--n-border-light);
  font-size: .8125rem; color: var(--n-muted); }
.n-pagination .pg { display: flex; gap: .375rem; align-items: center; }

/* Estado vazio */
.n-empty { text-align: center; padding: 3rem 1.5rem; color: var(--n-muted); }
.n-empty i { font-size: 2.25rem; color: #CBD5E1; }
.n-empty b { display: block; color: var(--n-text); font-size: .9375rem; margin: .75rem 0 .25rem; }

/* KPIs com ícone (dashboard do ERP) */
.kpi-card .kpi-label i { font-size: 1.25rem; color: var(--n-muted); }
.kpi-sub { font-size: .75rem; color: var(--n-muted); margin-top: .5rem; }
.kpi-meter { height: 6px; background: #F1F5F9; border-radius: 999px; margin-top: .75rem; overflow: hidden; }
.kpi-meter span { display: block; height: 100%; background: var(--n-text); border-radius: 999px; }

/* Cards de conteúdo */
.n-card + .n-card { margin-top: 1.5rem; }
.card-body-premium { padding: 1.25rem 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; align-items: start; margin-top: 1.5rem; }
.grid-2 > .n-card + .n-card { margin-top: 0; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.n-dl { display: grid; grid-template-columns: 170px 1fr; gap: .625rem 1rem; margin: 0; font-size: .875rem; }
.n-dl dt { color: var(--n-muted); font-weight: 500; }
.n-dl dd { margin: 0; color: var(--n-text); word-break: break-word; }

/* Barras horizontais */
.n-bars { display: flex; flex-direction: column; gap: .75rem; }
.n-bar { display: grid; grid-template-columns: 180px 1fr 40px; gap: .75rem; align-items: center; font-size: .8125rem; }
.n-bar-track { height: 8px; border-radius: 999px; background: #F1F5F9; overflow: hidden; }
.n-bar-track span { display: block; height: 100%; background: var(--n-accent); border-radius: 999px; }
.n-bar-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--n-muted); font-weight: 600; }

/* Avisos */
.n-note { border: 1px solid #FDE68A; background: #FFFBEB; color: #92400E; border-radius: .75rem; padding: .875rem 1.125rem; font-size: .875rem;
  display: flex; gap: .625rem; align-items: flex-start; margin-bottom: 1.5rem; }
.n-note i { font-size: 1.125rem; margin-top: 1px; }
.n-note.info { border-color: #BAE6FD; background: #F0F9FF; color: #075985; }
.n-note.ok { border-color: #A7F3D0; background: #ECFDF5; color: #065F46; }
.n-note.err { border-color: #FCA5A5; background: #FEF2F2; color: #991B1B; }

/* Formulários */
.n-form { display: flex; flex-direction: column; gap: 1rem; }
textarea.n-input { min-height: 130px; resize: vertical; }
.n-hint { font-size: .75rem; color: var(--n-muted); }
.field-error { color: #DC2626; font-size: .8125rem; font-weight: 500; display: block; }
.inline-form { margin: 0; display: inline-flex; }
select.n-input.n-input-sm { padding: .25rem .5rem; font-size: .8125rem; width: auto; }
.btn-danger-neural { background: #DC2626; color: #fff; border: 0; padding: .5rem 1.25rem; border-radius: .375rem; font-size: .8125rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: .375rem; cursor: pointer; box-shadow: var(--n-shadow-sm); }
.btn-danger-neural:hover { background: #B91C1C; }
.btn-sm-neural { padding: .375rem .875rem !important; font-size: .75rem !important; }

/* Toast vindo do servidor */
.n-toast .toast-close { background: none; border: 0; color: var(--n-muted); font-size: 1.125rem; line-height: 1; padding: 0 0 0 .5rem; cursor: pointer; }

/* Erro sem login */
.erro-publico { min-height: 100vh; display: grid; place-items: center; background: var(--n-bg); }

/* Faixa de ambiente no layout do ERP: empurra o app e o login para baixo dela */
.app-shell { height: calc(100vh - var(--env-h, 0px)) !important; margin-top: var(--env-h, 0px); }
.app-shell .main-area { height: 100% !important; }
:root.has-env .login-wrapper { min-height: calc(100vh - var(--env-h)); margin-top: var(--env-h); }
.login-wrapper .form-check { padding-left: 0; }

/* ==========================================================================
   Tipografia — mesma Inter do ERP, com tamanhos maiores para leitura
   ========================================================================== */
body {
  font-size: .9375rem; line-height: 1.55; font-optical-sizing: auto;
  text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale;

}

/* Cabeçalho da página */
.page-crumb { font-size: .8125rem; }
.page-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.page-sub { font-size: .9375rem; }

/* Menu lateral */
.sidebar-link { font-size: .9375rem; }
.sidebar-link.active { font-weight: 600; }

/* Cards e indicadores */
.card-title-premium { font-size: .9375rem; font-weight: 650; letter-spacing: -.01em; }
.kpi-label { font-size: .8125rem; letter-spacing: .01em; }
.kpi-value { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .8125rem; }

/* Tabelas */
.n-table th { font-size: .75rem; font-weight: 600; letter-spacing: .04em; }
.n-table td { font-size: .875rem; font-variant-numeric: tabular-nums; }
.n-table td a, .n-table td b { font-weight: 600; letter-spacing: -.005em; }
.cell-sub { font-size: .8125rem; line-height: 1.45; }
.cell-email { font-size: .8125rem; color: var(--n-muted); overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.cell-mono, .font-mono { font-size: .8125rem; }

/* Etiquetas */
.n-badge { font-size: .71875rem; font-weight: 600; letter-spacing: .03em; }

/* Listas, barras, avisos */
.n-dl { font-size: .9375rem; }
.n-bar { font-size: .875rem; }
.n-note { font-size: .9375rem; line-height: 1.5; }

/* Formulários e botões */
.n-input, .search-input { font-size: .9375rem; }
.form-label.n-label { font-size: .75rem; font-weight: 600; letter-spacing: .04em; }
.n-hint { font-size: .8125rem; }
.btn-neural, .btn-outline-neural, .btn-danger-neural { font-size: .875rem; }
.n-chip { font-size: .875rem; }
.toast-title { font-size: .9375rem; }
.toast-message { font-size: .875rem; }

/* Com a letra maior: cabeçalhos não quebram; datas e valores usam espaço fixo (filtros) */
.n-table th { white-space: nowrap; }
.n-table th, .n-table td { padding-left: 1rem; padding-right: 1rem; }
.n-table th:first-child, .n-table td:first-child { padding-left: 1.5rem; }
.n-table th:last-child, .n-table td:last-child { padding-right: 1.5rem; }
.n-table td:has(.cell-sub) { min-width: 170px; }
.cell-warn { display: block; font-size: .75rem; color: #B45309; margin-top: .125rem; white-space: nowrap; }

/* Barra de consumo da IA (gasto do mês x limite) */
.n-meter { height: 6px; border-radius: 999px; background: var(--n-border, #E2E8F0); overflow: hidden; }
.n-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--n-primary, #4F46E5); transition: width .3s; }
.n-meter > span.is-alto { background: #D97706; }

/* Tabelas de dados do edital: colunas fixas e texto longo (etapas, matérias) quebra dentro da célula. */
.n-table.tabela-dados { table-layout: fixed; width: 100%; min-width: 860px; }
.n-table.tabela-dados td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; line-height: 1.45; min-width: 0; }
.n-table.tabela-dados .cell-warn { white-space: normal; }
.n-table.tabela-dados th { white-space: normal; vertical-align: bottom; }
