/* Configurações do admin (assets/js/admin.js) no visual do cotador. Usa só os tokens do
   cotar-ui.css (--surface, --ink*, --line, --fill*, --brand*, --outline), então segue o tema
   claro/escuro sozinho. Sem faixa lateral colorida em container (regra do cotador). */

:where(body.pg-cfg) .wrap { max-width: 980px; }
.cfg-abas { display: inline-flex; margin: 8px 0 24px; flex-wrap: wrap; }
.cfg-abas .seg-b[aria-pressed="true"], [data-amb][aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 3px 8px -3px rgba(0,0,0,.1); }
.cfg-corpo { display: flex; flex-direction: column; gap: 20px; }
.cfg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.cfg-t { font-size: 21px; font-weight: 600; letter-spacing: .2px; margin: 0; color: var(--ink); }
.cfg-s { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.cfg-txt { font-size: 14px; color: var(--ink-2); margin: 8px 0 16px; line-height: 1.5; }
.cfg-txt a { color: var(--brand); }
.cfg-busca { max-width: 360px; margin-bottom: 8px; }
.cfg-lista { display: flex; flex-direction: column; }
.cfg-grupo { margin-top: 16px; }
.cfg-grupo-h { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 2px 6px; border-bottom: 1px solid var(--line); }
.cfg-linha { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cfg-linha:last-child { border-bottom: 0; }
.cfg-linha.cfg-off { opacity: .5; pointer-events: none; }
.cfg-linha-n { flex: 1; min-width: 0; font-size: 15px; color: var(--ink); }
.cfg-linha-n small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.cfg-tag { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--fill-2); color: var(--ink-2); white-space: nowrap; }
.cfg-tag.ok { background: var(--brand-tint); color: var(--brand); }
.cfg-tag.warn { background: var(--accent-tint); color: var(--accent-ink); }
.cfg-av { width: 36px; height: 36px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.cfg-linha .link-btn { cursor: pointer; }

/* interruptor */
.cfg-switch { position: relative; width: 44px; height: 26px; flex: none; }
.cfg-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cfg-switch input:disabled { cursor: default; }
.cfg-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--fill-2); transition: background .18s; }
.cfg-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.cfg-switch input:checked + span { background: var(--brand); }
.cfg-switch input:checked + span::after { transform: translateX(18px); }
.cfg-switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.cfg-switch-lg { margin-top: 4px; }

/* Módulo de integração automática (integracao.js, marcação do Cotar+ antigo): só o mínimo para
   ler bem dentro do cartão do cotador. */
.cfg-legado .card { padding: 0; background: transparent; }
.cfg-legado .card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cfg-legado .card__head h3 { font-size: 21px; font-weight: 600; margin: 0; color: var(--ink); }
.cfg-legado .text-muted, .cfg-legado .hint { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.cfg-legado .hint { display: block; font-size: 12.5px; margin-top: 6px; }
.cfg-legado .flex { display: flex; } .cfg-legado .items-center { align-items: center; }
.cfg-legado .gap-8 { gap: 8px; } .cfg-legado .mt-16 { margin-top: 16px; }
.cfg-legado .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cfg-legado .col-span-2 { grid-column: span 2; }
.cfg-legado .field { display: flex; flex-direction: column; gap: 6px; }
.cfg-legado .field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cfg-legado .field-input, .cfg-legado .field-select { width: 100%; }
.cfg-legado textarea.field-input { height: auto; border-radius: 16px; padding: 12px 16px; }
.cfg-legado table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.cfg-legado table.data th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cfg-legado table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cfg-legado .badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--fill-2); color: var(--ink-2); }
.cfg-legado .badge-ok { background: var(--brand-tint); color: var(--brand); }
.cfg-legado .badge-warn { background: var(--accent-tint); color: var(--accent-ink); }
.cfg-legado input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }

@media (max-width: 760px) {
  .cfg-abas { display: flex; width: 100%; }
  .cfg-abas .seg-b { flex: 1; padding: 0 6px; }
  .cfg-head { flex-wrap: wrap; }
  .cfg-legado .form-grid { grid-template-columns: 1fr; }
  .cfg-legado .col-span-2 { grid-column: auto; }
}
