/* Prompt 37 — serviço admin. Mesmos tokens do CorvFin (claro/escuro pelo sistema), contraste >= 4,5:1. */
:root {
  color-scheme: light;
  --bg: #F4F7F5;
  --surface: #FFFFFF;
  --surface-2: #E8F0EC;
  --text: #14221D;
  --text-secondary: #5C7067;
  --line: #D3E0D8;
  --brand: #1F7A5C;
  --brand-strong: #146B57;
  --danger-text: #B42318;
  --radius: 14px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111315;
    --surface: #171A1C;
    --surface-2: #1D2124;
    --text: #F1F3F2;
    --text-secondary: #AAB2AE;
    --line: #2B3134;
    --brand: #26916E;
    --brand-strong: #1F7A5C;
    --danger-text: #FCA5A5;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px; z-index: 10; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
main:focus { outline: none; }

h1 { font-size: 1.3rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
.muted, .status { color: var(--text-secondary); }
.status:empty { display: none; }
.status.error { color: var(--danger-text); font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 16px 0; max-width: 520px; }
#viewHome .card { max-width: none; }

form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
label { font-weight: 700; }
input[type="text"], input[type="email"], input[type="password"] {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
#codeInput, #enrollCode, #stepUpCode { font-family: var(--mono); letter-spacing: 0.1em; }

.btn { font: inherit; font-weight: 700; min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; }
.btn.primary { background: var(--brand-strong); border-color: var(--brand-strong); color: #FFFFFF; }
.btn.danger { color: var(--danger-text); }
.btn.ghost { background: transparent; }
.btn.link { background: transparent; border: none; text-decoration: underline; padding-left: 0; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.steps { padding-left: 20px; }
.qr { display: block; width: 240px; max-width: 100%; height: auto; background: #FFFFFF; padding: 8px; border-radius: 8px; margin: 12px 0; }
.label { font-weight: 700; margin: 8px 0 4px; }
.secret { display: block; font-family: var(--mono); font-weight: 700; letter-spacing: 0.06em; word-break: break-word; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding-left: 34px; font-family: var(--mono); font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 0.85rem; color: var(--text-secondary); }

/* Prompt 38 — abas, detalhe do usuário, formulários e diálogo de confirmação (mesmos tokens nos dois temas) */
input[type="search"], input[type="number"], select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
.stepup { max-width: none; }
form.inline, form.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
form.inline label { flex-basis: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 180px; flex: 1 1 180px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tab { font: inherit; font-weight: 700; min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-secondary); cursor: pointer; }
.tab[aria-current="page"] { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: inset 0 -3px 0 var(--brand); }
.tabpanel { margin-top: 8px; }
.tabpanel .card { max-width: none; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 8px 0; }
legend { font-weight: 700; padding: 0 4px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
.checks .check { margin: 4px 0; font-weight: 500; }
.ents { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ent { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ent .check { margin: 0; }
.info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 8px; }
.info dt { font-weight: 700; color: var(--text-secondary); }
.info dd { margin: 0; word-break: break-word; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 16px; }
td .btn.link { min-height: 32px; padding: 0; text-align: left; word-break: break-word; }
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; max-width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); }
@media (max-width: 600px) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tab { flex: 0 0 auto; }
  form.row .btn { flex: 1 1 auto; }
}
/* Lote 38c (N-47): ofertas mensal e anual lado a lado no editor de planos */
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.offer { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.offer h3 { margin: 0; }
.offer .check { margin: 6px 0 0; font-weight: 600; }
.offer-fields { display: flex; flex-direction: column; gap: 6px; }
.offer-fields[hidden] { display: none; }
input[type="date"] { font: inherit; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
