/* Veritas 2.0 — ajustes do sistema real sobre o design system do protótipo (veritas.css). */
@layer utilities {
  [hidden] { display: none !important; }
  .grow { flex: 1; min-width: 0; }
  .empty-cell { text-align: center; padding: 48px 16px; }
  .th-sort { all: unset; cursor: pointer; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; border-radius: 4px; }
  .th-sort:focus-visible { outline: 2px solid var(--brand-gold-400); outline-offset: 2px; }
  th[aria-sort] .th-sort::after { content: " ↑"; }
  th[aria-sort="descending"] .th-sort::after { content: " ↓"; }
  tr[tabindex] { cursor: pointer; }
  .ml-2 { margin-left: 8px; }
  .mb-4 { margin-bottom: 16px; }
  .nowrap { white-space: nowrap; }
  .toast { bottom: 16px; }
  body:has(.actionbar) .toast { bottom: 88px; }
  .qr-img { width: 168px; height: 168px; border-radius: 12px; background: #fff; padding: 6px; border: 1px solid var(--border); }
  .perm-module { margin: 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; }
  .perm-module legend { padding: 0 6px; font-weight: 650; }
  .perm-module .check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; margin-top: 6px; }
  .loading { display: grid; place-items: center; min-height: 40vh; color: var(--text-3); }
  .auth-view .login-form { padding: 24px 0; }
  .auth-back { align-self: flex-start; }
  .method-list { display: flex; flex-direction: column; gap: 10px; }
  .kv-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.5px; }
  .kv-grid dt { color: var(--text-3); }
  .kv-grid dd { margin: 0; }
  .tpl-fields .field-head { display: flex; align-items: center; gap: 8px; }
  .tpl-vars { display: flex; flex-wrap: wrap; gap: 6px; }
  .tpl-vars button { cursor: pointer; font-family: var(--font-mono, ui-monospace, monospace); }
  .email-body p { margin: 0; white-space: pre-line; }
  .tpl-locales, .tpl-vars-wrap { gap: 4px; }
  .email-preview-label { margin-bottom: 8px; }
  .email-brand { letter-spacing: .08em; color: #00183f; }
  .email-after { color: #42506a; }
  .email-summary { padding: 8px 16px; cursor: pointer; }
  .email-text { white-space: pre-wrap; font-size: 12.5px; margin: 0; padding: 12px 16px; background: var(--surface-2); border-top: 1px solid var(--border); max-height: 260px; overflow: auto; }
  .align-end { align-items: flex-end; }
  .due-late { color: var(--st-rej); font-weight: 600; }
  .due-soon { color: var(--st-quar); font-weight: 600; }
  .due-ok { color: var(--st-ok); font-weight: 600; }
  .due-late svg, .due-soon svg, .due-ok svg { width: 14px; height: 14px; vertical-align: -2px; }
  td .due-late, td .due-soon { display: block; }
  .cost-line { align-items: end; }
  .cost-line-remove { justify-content: flex-end; }
  .upload-form .card-title .req { color: var(--st-rej); }
}

/* Painel (EP-11): uma série por gráfico na cor --chart-bar (gold-600, validada nos temas claro e escuro). */
@layer utilities {
  :root { --chart-bar: var(--brand-gold-600); }
  .chart { position: relative; }
  .chart svg { display: block; overflow: visible; }
  .chart-bar { fill: var(--chart-bar); }
  .chart-grid { stroke: var(--border); stroke-width: 1; }
  .chart-base { stroke: var(--border-strong, var(--border)); stroke-width: 1; }
  .chart-axis { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
  .chart-hit { fill: transparent; cursor: pointer; outline: none; }
  .chart-hit.active { fill: color-mix(in srgb, var(--text) 6%, transparent); }
  .chart-hit:focus-visible { stroke: var(--brand-gold-600); stroke-width: 2; }
  .chart-tip { position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; white-space: nowrap; padding: 6px 10px; border-radius: 8px;
    background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-sm); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .chart-fill { background: var(--chart-bar); border-radius: 999px; }
  .chart-bars .num { color: var(--text-2); }
  .kpi-icon { background: var(--surface-3); }
  .kpi.feature .kpi-icon { background: rgba(255,255,255,.12); }
  .kpi-icon.tone-st-new { color: var(--st-new); background: var(--st-new-bg); }
  .kpi-icon.tone-st-audit { color: var(--st-audit); background: var(--st-audit-bg); }
  .kpi-icon.tone-st-quar { color: var(--st-quar); background: var(--st-quar-bg); }
  .kpi-icon.tone-st-ok { color: var(--st-ok); background: var(--st-ok-bg); }
  .kpi-icon.tone-st-rej { color: var(--st-rej); background: var(--st-rej-bg); }
  .dash-filters .row.wrap { gap: 12px; }
  .dash-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  @media (max-width: 640px) {
    .chart-axis { font-size: 20px; }
    .chart-tick.odd { display: none; }
  }
}

/* Fora de camada, como as regras responsivas do veritas.css que redefinem .hbar: mesmas colunas em todas as
   linhas, para que barras de valores iguais fiquem do mesmo tamanho. */
.chart-bars { display: grid; grid-template-columns: minmax(90px, 1.2fr) minmax(60px, 3fr) auto; gap: 4px 0; }
.chart-bars > .hbar { grid-column: 1 / -1; grid-template-columns: subgrid; }


/* Relatórios (EP-12) */
@layer utilities {
  .rep-catalog { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .rep-card { display: block; }
  .rep-card .row { gap: 10px; align-items: center; }
  .rep-applied { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .rep-applied .chip { white-space: normal; }
  .rep-print-brand { display: none; }
  .rep-table td { white-space: nowrap; }
  .rep-table tbody tr[tabindex] { cursor: pointer; }
  .rep-totals { border-top: 1px solid var(--border); }
  .rep-totals .kv-table { width: auto; min-width: min(100%, 520px); }
  .rep-totals-wrap { overflow-x: auto; max-width: 100%; }
  .th-sort .sort-ic { width: 12px; height: 12px; vertical-align: -1px; margin-left: 2px; }
  /* Log do sistema (EP-13) */
  .log-saved { align-items: center; }
  .align-start { align-self: flex-start; }
  /* Quarentena: parte e pessoa que responde (REQ-TML-004) */
  .party-row { display: grid; gap: 6px; }
  .party-person-wrap { padding-left: 28px; }
  .party-person { max-width: 420px; }
  /* Migração (EP-14) */
  .mig-sources { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
  .mig-issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .mig-issues .btn { justify-content: flex-start; gap: 8px; height: auto; min-height: 30px; text-align: left; white-space: normal; }
  .mig-chip { font-size: 10.5px; margin: 1px 2px 1px 0; }
  .mig-table td { vertical-align: top; }
  /* filtros das linhas numa faixa só: relatório, problema, busca e o botão */
  .mig-filters { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 280px) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
  @media (max-width: 760px) { .mig-filters { grid-template-columns: minmax(0, 1fr); } }
  /* Retenção de dados */
  .ret-rows { display: grid; gap: 0; padding-top: 0; }
  .ret-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
  .ret-row:first-child { border-top: 0; }
  .ret-row .ret-countries { grid-column: 1 / -1; padding-left: 16px; border-left: 2px solid var(--border); }
  .ret-input { align-items: center; flex-wrap: nowrap; }
  .ret-months { width: 96px; }
  .ret-years { min-width: 64px; }
  .ret-add { max-width: 260px; }
  @media (max-width: 560px) { .ret-row { grid-template-columns: minmax(0, 1fr); } .ret-years { min-width: 0; } }
  .log-saved-item { display: inline-flex; align-items: center; gap: 2px; }
  .log-table tbody tr[tabindex] { cursor: pointer; }
  .log-table code, .log-table .tag, .log-table .chip { white-space: nowrap; }
  .log-hash code { overflow-wrap: anywhere; }
  .log-diff td { vertical-align: top; overflow-wrap: anywhere; }
  .log-diff tr.changed td { background: var(--st-quar-bg); }
  .log-diff tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--st-quar); }
  .log-json { margin: 8px 0 0; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
    font-size: 12px; line-height: 1.5; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
}
/* Fora de camada: precisa vencer o "bottom: 72px" do veritas.css no celular, que também está fora de camada.
   Sem a faixa de apresentação do protótipo no rodapé, a barra de ações encosta na borda da tela. */
.actionbar { bottom: 12px; }

/* Linha de ferramentas das listas (pageHead com `lead`): busca com lupa, sem cartão em volta. */
@layer screens {
  .search-box { position: relative; flex: 0 1 420px; min-width: 220px; }
  .search-box > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
  .search-box > .input { padding-left: 36px; }
  @media (max-width: 900px) { .search-box { flex: 1 1 100%; } }

  /* Fornecedores: cada filial numa linha de colunas fixas (bandeira · cidade · documento · moeda), alinhadas entre
     filiais e entre fornecedores; unidades agrupadas por cliente, com a bandeira do país. */
  table.k-list td { padding-top: 12px; padding-bottom: 12px; vertical-align: top; }
  table.k-list td.mid { vertical-align: middle; }
  table.k-list .k-col-sup { width: 22%; }
  table.k-list .k-col-fit { width: 1%; }
  .k-meta { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
  .k-meta svg { width: 13px; height: 13px; }
  .k-branches { display: grid; grid-template-columns: 24px 128px 186px 70px; column-gap: 10px; row-gap: 7px; align-items: center; }
  .k-branch { display: contents; }
  .k-city { font-weight: 560; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .k-doc { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; white-space: nowrap; }
  .k-doc .kind { flex: none; width: 34px; font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--text-3); }
  .k-doc .id { color: var(--text-2); font-variant-numeric: tabular-nums; }
  .k-cur { justify-self: start; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px 0 4px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--border); }
  .k-cur-none { padding-left: 8px; font-size: 12px; color: var(--text-3); }
  .k-more { grid-column: 2 / -1; font-size: 12px; font-weight: 600; color: var(--text-2); }
  .k-units { display: flex; flex-direction: column; gap: 7px; }
  .k-ugroup { display: flex; align-items: flex-start; gap: 10px; }
  .k-uclient { flex: none; width: 92px; padding-top: 3px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); overflow-wrap: anywhere; }
  .k-upills { display: flex; flex-wrap: wrap; gap: 6px; }
  .k-upill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 6px; border-radius: 7px; font-size: 12.5px; white-space: nowrap;
    background: var(--surface-2); border: 1px solid var(--border); }
  :is(.k-cur, .k-upill) .flag { width: 16px; height: 11px; border-radius: 3px; }
  table.k-list tr.is-off td:not(.mid) { opacity: .55; }

  /* Configurações (padrão das configurações do DIGREJA com a identidade do Veritas; preview aprovado em 24/11/2026,
     docs/veritas-2/preview-configuracoes): busca de opções, menu de seções, cartões por assunto, barra de salvar. */
  .cfg-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
  .cfg-search { position: relative; flex: 1 1 360px; max-width: 520px; }
  .cfg-search .search { max-width: none; height: var(--control-h); padding: 0 12px; }
  .cfg-search .search svg { width: 17px; height: 17px; flex: none; }
  .cfg-search .cb-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; }
  .cfg-hit { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .cfg-hit-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); flex: none; }
  .cfg-hit-ic svg { width: 15px; height: 15px; }
  .cfg-hit mark { background: rgba(236,184,68,.35); color: inherit; border-radius: 3px; padding: 0 1px; }

  .cfg-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 20px; align-items: start; }
  .cfg-menu { position: sticky; top: 92px; padding: 10px; }
  .cfg-menu-title { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); padding: 12px 10px 6px; }
  .cfg-menu-title:first-child { padding-top: 4px; }
  .cfg-menu-sep { height: 1px; margin: 8px 6px 0; background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px); }
  .cfg-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 12px; color: var(--text-2); text-decoration: none;
    transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
  .cfg-item + .cfg-item { margin-top: 2px; }
  .cfg-item:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
  :root[data-theme="dark"] .cfg-item:hover { background: var(--surface-3); }
  .cfg-item:focus-visible { outline: none; box-shadow: var(--focus); }
  .cfg-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-2); }
  .cfg-ic svg { width: 17px; height: 17px; }
  .cfg-item-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .cfg-item-t strong { font-size: 13.5px; font-weight: 600; line-height: 1.25; }
  .cfg-item-t small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cfg-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--st-muted); box-shadow: 0 0 0 3px var(--st-muted-bg); }
  .cfg-dot.ok { background: var(--st-ok); box-shadow: 0 0 0 3px var(--st-ok-bg); }
  .cfg-dot.env { background: var(--st-quar); box-shadow: 0 0 0 3px var(--st-quar-bg); }
  .cfg-ext { width: 14px; height: 14px; color: var(--text-3); flex: none; }
  /* ativo: faixa navy da marca e ícone dourado, como o item ativo do menu lateral */
  .cfg-item[aria-current="page"] { background: var(--th-bg); color: #fff; box-shadow: 0 10px 24px -12px rgba(0,24,63,.6); transform: none; }
  .cfg-item[aria-current="page"] .cfg-ic { background: rgba(236,184,68,.16); color: var(--brand-gold-400); }
  .cfg-item[aria-current="page"] small { color: rgba(255,255,255,.62); }
  .cfg-item[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-gradient); }
  .cfg-menu-foot { margin: 10px 4px 2px; padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); display: grid; gap: 5px; }
  :root[data-theme="dark"] .cfg-menu-foot { background: var(--surface-3); }
  .cfg-menu-foot span { display: flex; align-items: center; gap: 8px; }

  .cfg-sec-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
  .cfg-sec-head > div:nth-child(2) { flex: 1 1 240px; min-width: 0; }
  .cfg-sec-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--th-bg); color: var(--brand-gold-400);
    box-shadow: 0 10px 22px -12px rgba(0,24,63,.7), inset 0 1px 0 rgba(255,255,255,.12); }
  .cfg-sec-ic svg { width: 22px; height: 22px; }
  .cfg-sec-head h2 { font-size: 19px; font-weight: 680; letter-spacing: -.015em; }
  .cfg-sec-head p { color: var(--text-2); font-size: 13px; margin-top: 3px; max-width: 760px; }
  .cfg-sec-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }

  .cfg-form, .cfg-stack, .cfg-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .cfg-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
  .cfg-card { overflow: hidden; background-image: var(--card-accent); background-repeat: no-repeat; background-size: 100% 3px; }
  .cfg-card-head { display: flex; align-items: center; gap: 12px; padding: 15px 22px 13px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
  .cfg-card-head .cfg-ic { width: 30px; height: 30px; background: var(--accent-soft); color: var(--accent-strong); }
  .cfg-card-head .cfg-ic svg { width: 16px; height: 16px; }
  .cfg-card-head .card-title { font-size: 14.5px; }
  .cfg-card-head .card-sub { display: block; margin-top: 1px; }
  .cfg-card-head > div { flex: 1; min-width: 0; }
  .cfg-card-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
  .choice-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .choice .rec { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--st-ok); background: var(--st-ok-bg); padding: 1px 6px; border-radius: 99px; vertical-align: 1px; }
  .choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }

  .help-btn { width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-3); font-size: 10.5px; font-weight: 700; line-height: 1;
    display: inline-grid; place-items: center; cursor: pointer; padding: 0; margin-left: 2px; align-self: center; transition: color .2s, border-color .2s, background .2s; }
  .help-btn:hover, .help-btn[aria-expanded="true"] { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }
  .help-btn:focus-visible { outline: none; box-shadow: var(--focus); }
  .help-pop { position: absolute; z-index: 70; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
  .help-pop strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 3px; }

  .cfg-side .kv-grid { font-size: 13px; }
  .cfg-side code { font-size: 12px; overflow-wrap: anywhere; }
  .folder-tree { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--border); display: grid; gap: 8px; }
  .folder-tree li { display: flex; flex-direction: column; gap: 2px; }
  .folder-tree code { font-size: 12px; overflow-wrap: anywhere; }
  .cfg-meter { display: grid; gap: 6px; }
  .cfg-meter-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); }
  .cfg-meter-bar { position: relative; height: 6px; border-radius: 99px; background: var(--surface-3); }
  .cfg-meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--st-ok); transition: width .3s var(--ease); }
  .cfg-meter-fill.below { background: var(--brand-gold-500); }
  .cfg-meter-goal { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--text); transition: left .3s var(--ease); }

  .cfg-savebar { position: sticky; bottom: 16px; z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 18px; border-radius: 14px;
    border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow-lg); }
  .cfg-dirty { display: none; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--st-quar); }
  .cfg-dirty::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--st-quar-bg); }
  .cfg-sec.dirty .cfg-dirty { display: inline-flex; }
  .cfg-sec.dirty .cfg-saved-line { display: none; }

  .cfg-result { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; background: var(--st-ok-bg); color: var(--st-ok); border: 1px solid color-mix(in srgb, var(--st-ok) 25%, transparent); }
  .cfg-result svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
  .cfg-result.warn { background: var(--st-quar-bg); color: var(--st-quar); border-color: color-mix(in srgb, var(--st-quar) 25%, transparent); }
  .cfg-result p { color: var(--text); overflow-wrap: anywhere; }
  .cfg-flash { animation: cfg-flash 1.8s var(--ease); border-radius: 12px; }
  @keyframes cfg-flash { 0%, 35% { box-shadow: 0 0 0 4px rgba(236,184,68,.55); background: rgba(236,184,68,.08); } 100% { box-shadow: 0 0 0 0 rgba(236,184,68,0); } }

  @media (max-width: 1180px) { .cfg-grid { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 980px) {
    .cfg-layout { grid-template-columns: minmax(0, 1fr); }
    .cfg-menu { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
    .cfg-menu-title, .cfg-menu-sep, .cfg-menu-foot, .cfg-item-t small, .cfg-dot, .cfg-ext { display: none; }
    .cfg-item { width: auto; flex: none; padding: 7px 12px 7px 7px; }
    .cfg-item + .cfg-item { margin-top: 0; }
    .cfg-item[aria-current="page"]::before { display: none; }
    .cfg-item-t strong { white-space: nowrap; }
  }
  @media (max-width: 640px) {
    .choice-2, .choice-3 { grid-template-columns: minmax(0, 1fr); }
    .cfg-card-body { padding: 16px; }
    .cfg-card-head { padding: 13px 16px 11px; }
    .cfg-sec-meta { margin-left: 0; }
    .cfg-savebar { position: static; padding: 12px; }
    .cfg-savebar .hint { flex-basis: 100%; }
    .cfg-savebar .spacer { display: none; }
    .cfg-savebar [type="submit"] { margin-left: auto; }
  }
  /* Novidades (preview aprovado em 24/11/2026, docs/veritas-2/preview-novidades) */
  .rel-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 18px; }
  .rel-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 20px 24px; border-radius: var(--radius-lg); color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, rgba(236,184,68,.22) 0%, rgba(236,184,68,0) 45%), var(--th-bg); box-shadow: var(--shadow-md); }
  .rel-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold-gradient); }
  .rel-hero-ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex: none; background: rgba(236,184,68,.16); color: var(--brand-gold-400); border: 1px solid rgba(236,184,68,.35); }
  .rel-hero-ic svg { width: 26px; height: 26px; }
  .rel-hero h2 { font-size: 19px; font-weight: 680; letter-spacing: -.01em; }
  .rel-hero p { color: rgba(255,255,255,.72); font-size: 13px; margin-top: 3px; }
  .rel-hero .btn-gold { flex: none; }
  .rel-hero.done { background: radial-gradient(120% 140% at 100% 0%, rgba(79,209,165,.18) 0%, rgba(79,209,165,0) 45%), var(--th-bg); }
  .rel-hero.done .rel-hero-ic { color: #4fd1a5; background: rgba(79,209,165,.14); border-color: rgba(79,209,165,.35); }
  .rel-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .rel-stat { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
  .rel-stat b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
  .rel-stat span { font-size: 12px; color: var(--text-3); }
  .rel-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
  .rel-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

  .rel-kind { display: inline-block; margin-right: 6px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 1px 7px; border-radius: 99px; vertical-align: 2px; }
  .k-NEW .rel-kind, .rel-kind.k-NEW { color: var(--st-new); background: var(--st-new-bg); }
  .k-IMPROVEMENT .rel-kind, .rel-kind.k-IMPROVEMENT { color: var(--accent-strong); background: var(--accent-soft); }
  .k-FIX .rel-kind, .rel-kind.k-FIX { color: var(--st-audit); background: var(--st-audit-bg); }
  .k-SECURITY .rel-kind, .rel-kind.k-SECURITY { color: var(--st-ok); background: var(--st-ok-bg); }
  .rel-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
  .rel-ic svg { width: 17px; height: 17px; }
  :is(.k-NEW) > .rel-ic, .rel-ic.k-NEW { background: var(--st-new-bg); color: var(--st-new); }
  :is(.k-IMPROVEMENT) > .rel-ic, .rel-ic.k-IMPROVEMENT { background: var(--accent-soft); color: var(--accent-strong); }
  :is(.k-FIX) > .rel-ic, .rel-ic.k-FIX { background: var(--st-audit-bg); color: var(--st-audit); }
  :is(.k-SECURITY) > .rel-ic, .rel-ic.k-SECURITY { background: var(--st-ok-bg); color: var(--st-ok); }

  .rel-timeline { position: relative; display: flex; flex-direction: column; gap: 18px; padding-left: 34px; }
  .rel-timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--brand-gold-400), var(--border) 40%); }
  .rel { position: relative; }
  .rel-dot { position: absolute; left: -34px; top: 20px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--brand-gold-500); color: var(--brand-gold-600); box-shadow: 0 0 0 4px var(--bg); }
  .rel-dot svg { width: 12px; height: 12px; }
  .rel.ack .rel-dot { border-color: var(--st-ok); color: var(--st-ok); }
  .rel-card { overflow: hidden; background-image: var(--card-accent); background-repeat: no-repeat; background-size: 100% 3px; }
  .rel.ack .rel-card { background-image: none; }
  .rel-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 22px 14px; flex-wrap: wrap; }
  .rel-date { flex: none; width: 56px; text-align: center; border-radius: 12px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface); }
  .rel-date b { display: block; font-size: 21px; font-weight: 700; padding: 4px 0 1px; font-variant-numeric: tabular-nums; }
  .rel-date span { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: var(--th-bg); padding: 2px 0; }
  .rel-title { flex: 1 1 260px; min-width: 0; }
  .rel-title small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
  .rel-title h3 { font-size: 16.5px; font-weight: 660; letter-spacing: -.01em; margin-top: 2px; }
  .rel-title p { font-size: 13px; color: var(--text-2); margin-top: 3px; }
  .rel-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .rel-more { all: unset; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; }
  .rel-more:focus-visible { outline: 2px solid var(--brand-gold-400); outline-offset: 2px; }
  .rel-more svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
  .rel-more[aria-expanded="true"] svg { transform: rotate(180deg); }

  .rel-items { list-style: none; margin: 0; padding: 4px 22px 6px; display: flex; flex-direction: column; }
  .rel-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 13px 0; border-top: 1px solid var(--border); }
  .rel-item strong { font-size: 14px; font-weight: 620; }
  .rel-item p { font-size: 13px; color: var(--text-2); margin-top: 2px; line-height: 1.5; }
  .rel-go { font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 6px 8px; border-radius: 8px; }
  .rel-go:hover { background: var(--surface-3); color: var(--text); }
  .rel-go svg { width: 14px; height: 14px; }

  .rel-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 22px; border-top: 1px solid var(--border); background: var(--surface-2); }
  :root[data-theme="dark"] .rel-foot, :root[data-theme="dark"] .rel-who { background: color-mix(in srgb, var(--surface-3) 50%, var(--surface)); }
  .rel-team { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
  .rel-avatars { display: flex; }
  .rel-avatars .avatar { width: 26px; height: 26px; font-size: 10px; margin-left: -6px; box-shadow: 0 0 0 2px var(--surface-2); }
  .rel-avatars .avatar:first-child { margin-left: 0; }
  .rel-avatars .avatar.off { background: var(--surface-3); color: var(--text-3); }
  .rel-team button { all: unset; cursor: pointer; font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
  .rel-team button:focus-visible { outline: 2px solid var(--brand-gold-400); outline-offset: 2px; border-radius: 4px; }
  .rel-stamp { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--st-ok); font-weight: 600; }
  .rel-stamp svg { width: 16px; height: 16px; }
  .rel-who { padding: 0 22px 14px; background: var(--surface-2); }
  .rel-who table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .rel-who td { padding: 7px 0; border-top: 1px dashed var(--border-strong); }
  .rel-who td:last-child { text-align: right; color: var(--text-3); }
  .rel-who .ok { color: var(--st-ok); font-weight: 600; }

  /* Aviso de novidades na entrada (diálogo com cabeçalho na faixa navy) */
  .modal.news .modal-head { color: #fff; border: 0; padding: 24px 24px 20px; background: radial-gradient(120% 140% at 100% 0%, rgba(236,184,68,.25) 0%, rgba(236,184,68,0) 50%), var(--th-bg); }
  .modal.news .modal-kicker { color: var(--brand-gold-400); }
  .modal.news .modal-head p { color: rgba(255,255,255,.72); }
  .modal.news .modal-icon { background: rgba(236,184,68,.16); border: 1px solid rgba(236,184,68,.35); box-shadow: none; }
  .modal.news .modal-x { color: rgba(255,255,255,.7); }
  .modal.news .modal-x:hover { background: rgba(255,255,255,.1); color: #fff; }
  .rel-notice { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .rel-notice li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; }
  .rel-notice .rel-ic { width: 30px; height: 30px; border-radius: 9px; }
  .rel-notice .rel-ic svg { width: 15px; height: 15px; }
  .rel-notice strong { font-size: 13.5px; }
  .rel-notice p { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
  .rel-all { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
  .rel-all svg { width: 15px; height: 15px; }

  @media (max-width: 1100px) { .rel-top { grid-template-columns: minmax(0, 1fr); } }
  @media (max-width: 640px) {
    .rel-hero { flex-wrap: wrap; padding: 18px; }
    .rel-hero .btn-gold { width: 100%; }
    .rel-timeline { padding-left: 0; }
    .rel-timeline::before, .rel-dot { display: none; }
    .rel-head, .rel-foot, .rel-who { padding-left: 16px; padding-right: 16px; }
    .rel-items { padding: 4px 16px 6px; }
    .rel-item { grid-template-columns: 34px minmax(0, 1fr); }
    .rel-go { grid-column: 2; justify-self: start; padding-left: 0; }
    .rel-legend { margin-left: 0; }
    .rel-foot .btn-primary { width: 100%; }
  }
}

@media print {
  .rep-filters, .rep-actions, .rep-no-print, #rep-exports, .page-head, .table-foot .pager, .hint { display: none !important; }
  .rep-print-brand { display: block !important; margin-bottom: 6px; }
  .rep-table th, .rep-table td { padding: 3px 5px !important; font-size: 8px !important; white-space: normal !important; }
  .rep-applied .chip { background: none !important; border: 1px solid #ccc; color: #000 !important; font-size: 8px; }
  .rep-preview { border: 0 !important; }
  .log-table th, .log-table td { padding: 3px 5px !important; font-size: 8px !important; }
  .log-table .chip { background: none !important; color: #000 !important; padding: 0 !important; }
}
