/* ===================== tokens ===================== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #475467;
  --text-3: #98a2b3;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-text: #3730a3;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .25);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --marca-1: #4f46e5;
  --marca-2: #7c3aed;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e12;
    --surface: #14171c;
    --surface-2: #191d23;
    --surface-3: #21262e;
    --border: #262b33;
    --border-strong: #353c47;
    --text: #f2f4f7;
    --text-2: #a4acb9;
    --text-3: #6b7380;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: #1e1b4b;
    --accent-text: #c7d2fe;
    --danger: #f97066;
    --danger-soft: #3b1513;
    --warn: #fdb022;
    --warn-soft: #3a2a0c;
    --ok: #47cd89;
    --ok-soft: #0f2e20;
    --info: #84caff;
    --info-soft: #102a45;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* ===================== base ===================== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .35em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 650; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--text-2); }
.sutil { color: var(--text-3); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.espaco-topo { margin-top: 1.2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.g { width: 22px; height: 22px; }

/* ===================== formulário ===================== */
label { display: block; font-weight: 600; font-size: .86rem; margin: 0 0 .4rem; color: var(--text); }
.campo { margin-bottom: 1.05rem; }
.ajuda { font-size: .8rem; color: var(--text-2); margin-top: .35rem; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%;
  padding: .66rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { font-family: var(--mono); font-size: .84rem; min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input.codigo { font-family: var(--mono); font-size: 1.55rem; letter-spacing: .5em; text-align: center; padding: .7rem .5rem .7rem 1rem; }
.check { display: flex; gap: .55rem; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.senha-wrap { position: relative; }
.senha-wrap input { padding-right: 2.8rem; }
.ver-senha {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-3); padding: .4rem .5rem; box-shadow: none;
}
.ver-senha:hover { background: none; color: var(--text); }
.caps { display: none; align-items: center; gap: .35rem; font-size: .8rem; color: var(--warn); margin-top: .35rem; }
.caps.on { display: flex; }

.requisitos { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .25rem; font-size: .82rem; }
.requisitos li { display: flex; align-items: center; gap: .45rem; color: var(--text-3); }
.requisitos li::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid currentColor; flex: none;
}
.requisitos li.ok { color: var(--ok); }
.requisitos li.ok::before { background: currentColor; box-shadow: inset 0 0 0 2.5px var(--surface); }
.forca { height: 6px; border-radius: 99px; background: var(--surface-3); margin-top: .55rem; overflow: hidden; }
.forca span { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .25s, background .25s; background: var(--danger); }

/* ===================== botões ===================== */
button, .botao {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
button:hover, .botao:hover { background: var(--accent-hover); text-decoration: none; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button.secundario, .botao.secundario { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.secundario:hover, .botao.secundario:hover { background: var(--surface-2); }
button.perigo, .botao.perigo { background: var(--danger); }
button.perigo:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
button.perigo-suave { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
button.perigo-suave:hover { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; box-shadow: none; }
button.link:hover { background: none; text-decoration: underline; }
button.fantasma { background: none; color: var(--text-2); box-shadow: none; }
button.fantasma:hover { background: var(--surface-3); color: var(--text); }
button.pequeno, .botao.pequeno { padding: .34rem .65rem; font-size: .8rem; }
.largo { width: 100%; }
button.carregando { position: relative; color: transparent !important; pointer-events: none; }
button.carregando::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: girar .7s linear infinite;
}
button.secundario.carregando::after { border-color: var(--border-strong); border-top-color: var(--text); }
@keyframes girar { to { transform: rotate(360deg); } }

.aviso { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .88rem; border: 1px solid transparent; }
.aviso svg.ic { margin-top: 1px; }
.aviso.erro { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.aviso.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.aviso.alerta { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.aviso.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

/* ===================== telas de login ===================== */
.tela-login { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 44%) 1fr; }
.lado-marca {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--marca-1), var(--marca-2));
  color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
}
.lado-marca::before, .lado-marca::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08);
}
.lado-marca::before { width: 520px; height: 520px; right: -220px; top: -180px; }
.lado-marca::after { width: 380px; height: 380px; left: -160px; bottom: -160px; }
.lado-marca > * { position: relative; z-index: 1; }
.lado-marca .marca { color: #fff; }
.lado-marca .marca .logo { background: rgba(255, 255, 255, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.lado-marca .chamada { margin: auto 0; max-width: 440px; }
.lado-marca h2 { font-size: 2rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; margin-bottom: .6rem; }
.lado-marca p { color: rgba(255, 255, 255, .82); font-size: 1rem; }
.lado-marca ul { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: .9rem; }
.lado-marca li { display: flex; gap: .75rem; align-items: flex-start; color: rgba(255, 255, 255, .92); font-size: .94rem; }
.lado-marca li .bolha { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); flex: none; }
.lado-marca li strong { display: block; color: #fff; }
.lado-marca .rodape-marca { font-size: .8rem; color: rgba(255, 255, 255, .65); }
.lado-form { display: grid; place-items: center; padding: 40px 24px; }
.cartao { width: 100%; max-width: 410px; }
.cartao.largo-cartao { max-width: 470px; }
.cartao > .marca { display: none; }
.marca { display: flex; align-items: center; gap: .65rem; font-weight: 650; font-size: 1.02rem; }
.marca .logo {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(150deg, var(--marca-1), var(--marca-2)); color: #fff; font-weight: 750; font-size: .9rem; letter-spacing: .02em;
}
.cabeca-form { margin-bottom: 1.6rem; }
.cabeca-form h1 { font-size: 1.65rem; }
.para-sistema { font-size: .92rem; color: var(--text-2); margin: 0; }
.destino-chip {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: .8rem;
  padding: .3rem .7rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); font-size: .8rem; font-weight: 600;
}
.quem-chip {
  display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 1.2rem; font-size: .88rem;
}

.etapas { display: flex; gap: .4rem; margin-bottom: 1.6rem; }
.etapas li { list-style: none; flex: 1; }
.etapas { padding: 0; }
.etapas .barra { height: 4px; border-radius: 99px; background: var(--surface-3); }
.etapas .rot { font-size: .72rem; color: var(--text-3); margin-top: .4rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.etapas li.feita .barra { background: var(--accent); }
.etapas li.atual .barra { background: linear-gradient(90deg, var(--accent) 50%, var(--surface-3) 50%); }
.etapas li.atual .rot, .etapas li.feita .rot { color: var(--accent); }

.opcao-mfa {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 1rem; background: var(--surface);
}
.opcao-mfa.recomendada { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.opcao-mfa .titulo { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.opcao-mfa .titulo .icone { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.opcao-mfa .titulo h2 { margin: 0; font-size: 1rem; }
.etiqueta { margin-left: auto; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ok); background: var(--ok-soft); padding: .15rem .5rem; border-radius: 99px; }
.totp-grade { display: grid; grid-template-columns: 148px 1fr; gap: 16px; align-items: start; margin-top: .9rem; }
.qr { display: block; border-radius: 10px; background: #fff; padding: 6px; width: 148px; height: 148px; border: 1px solid var(--border); }
.passos-totp { margin: 0; padding-left: 1.1rem; font-size: .85rem; color: var(--text-2); display: grid; gap: .3rem; }
.segredo { font-family: var(--mono); background: var(--surface-2); border: 1px dashed var(--border-strong); padding: .55rem; border-radius: 8px; text-align: center; word-break: break-all; font-size: .82rem; letter-spacing: .04em; }
.codigos { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .9rem; font-family: var(--mono); font-size: .95rem; background: var(--surface-2); border: 1px solid var(--border); padding: 1rem 1.1rem; border-radius: var(--radius); margin-bottom: .8rem; }
.codigos span { padding: .15rem 0; }
.separador { display: flex; align-items: center; gap: .75rem; color: var(--text-3); font-size: .78rem; margin: 1.2rem 0; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.separador::before, .separador::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--accent); font-size: .88rem; font-weight: 500; }
details[open] summary { margin-bottom: .8rem; }
.rodape-login { margin-top: 1.6rem; text-align: center; font-size: .8rem; color: var(--text-3); }
.rodape-login.aviso-golpe { display: flex; gap: .5rem; text-align: left; align-items: flex-start; padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); }
.botao-passkey { padding: .8rem 1rem; font-size: .95rem; }
.icone-grande { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 1rem; }
.icone-grande.ok { background: var(--ok-soft); color: var(--ok); }
.icone-grande.erro { background: var(--danger-soft); color: var(--danger); }
.icone-grande.info { background: var(--accent-soft); color: var(--accent); }
.icone-grande svg.ic { width: 28px; height: 28px; }

@media (max-width: 900px) {
  .tela-login { grid-template-columns: 1fr; }
  .lado-marca { display: none; }
  .cartao > .marca { display: flex; margin-bottom: 1.8rem; }
  .lado-form { place-items: start center; padding-top: 48px; }
  .totp-grade { grid-template-columns: 1fr; justify-items: center; }
}

/* ===================== app (admin / conta) ===================== */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.lateral {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.lateral .marca { padding: 0 8px; margin-bottom: 1.4rem; }
.lateral .grupo { font-size: .7rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; padding: 1rem 10px .4rem; }
.lateral a.item {
  display: flex; align-items: center; gap: .65rem;
  padding: .52rem .7rem; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 550; font-size: .9rem;
}
.lateral a.item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.lateral a.item.ativo { background: var(--accent-soft); color: var(--accent-text); }
.lateral a.item .contador { margin-left: auto; font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.lateral .rodape { margin-top: auto; padding: 14px 6px 0; border-top: 1px solid var(--border); }
.perfil { display: flex; gap: .65rem; align-items: center; }
.perfil .nome { font-weight: 600; font-size: .88rem; line-height: 1.2; }
.perfil .sub { font-size: .76rem; color: var(--text-2); }
.perfil-acoes { display: flex; gap: .35rem; margin-top: .8rem; }
.perfil-acoes a { flex: 1; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font-size: .8rem; padding: .4rem; border-radius: 7px; color: var(--text-2); border: 1px solid var(--border); font-weight: 550; }
.perfil-acoes a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: .78rem; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: var(--av, var(--accent));
}
.avatar.p { width: 28px; height: 28px; font-size: .68rem; }
.avatar.g { width: 52px; height: 52px; font-size: 1.05rem; }
.avatar.quadrado { border-radius: 10px; }
.pessoa { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.pessoa .nome { font-weight: 600; }
.pessoa .sub { font-size: .78rem; color: var(--text-2); }

.conteudo { padding: 32px 40px 48px; min-width: 0; max-width: 1320px; width: 100%; }
.topo { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.topo h1 { margin-bottom: .2rem; }
.topo p { margin: 0; max-width: 720px; }
.painel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 1.2rem; box-shadow: var(--shadow-sm); }
.painel > h2:first-child { margin-bottom: .9rem; }
.painel-cabeca { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.painel-cabeca h2 { margin: 0; }
.grade { display: grid; gap: 1rem; }
.grade.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grade.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grade.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; gap: 14px; align-items: flex-start; }
.kpi .ic-kpi { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.kpi .ic-kpi.alerta { background: var(--warn-soft); color: var(--warn); }
.kpi .ic-kpi.critico { background: var(--danger-soft); color: var(--danger); }
.kpi .ic-kpi.ok { background: var(--ok-soft); color: var(--ok); }
.kpi .rotulo { font-size: .8rem; color: var(--text-2); font-weight: 550; }
.kpi .valor { font-size: 1.75rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.02em; }
.kpi .valor .de { font-size: .9rem; color: var(--text-3); font-weight: 600; }
.kpi .valor.alerta { color: var(--warn); }
.kpi .valor.critico { color: var(--danger); }
a.kpi:hover { border-color: var(--border-strong); text-decoration: none; color: inherit; }
a.kpi { color: inherit; }

.filtros { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filtros input, .filtros select { width: auto; min-width: 190px; }
.busca { position: relative; flex: 1; min-width: 240px; max-width: 420px; }
.busca svg.ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.busca input { padding-left: 2.3rem; width: 100%; }
.tabela-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: .72rem .95rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); background: var(--surface-2); font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr.clicavel { cursor: pointer; transition: background .1s; }
tbody tr.clicavel:hover { background: var(--surface-2); }
tbody tr.clicavel td:last-child { color: var(--text-3); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.vazio { padding: 3rem 1rem; text-align: center; color: var(--text-2); }
.vazio .icone-grande { margin: 0 auto 1rem; }
.vazio strong { display: block; color: var(--text); margin-bottom: .2rem; }
.paginacao { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; font-size: .85rem; color: var(--text-2); }
.acoes { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.esqueleto { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: brilho 1.2s infinite; }
.esqueleto.titulo { width: 220px; height: 26px; }
.forca.mini { width: 80px; margin: 0; }
@keyframes brilho { to { background-position: -200% 0; } }

.selo { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.selo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.selo.sem-ponto::before { display: none; }
.selo.ok { background: var(--ok-soft); color: var(--ok); }
.selo.erro { background: var(--danger-soft); color: var(--danger); }
.selo.alerta { background: var(--warn-soft); color: var(--warn); }
.selo.info { background: var(--info-soft); color: var(--info); }
.selo.roxo { background: var(--accent-soft); color: var(--accent-text); }

/* ===================== modal ===================== */
dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
}
dialog[open] { animation: entrar .16s ease-out; display: flex; flex-direction: column; overflow: hidden; }
@keyframes entrar { from { opacity: 0; transform: translateY(8px) scale(.99); } }
dialog::backdrop { background: rgba(12, 14, 18, .5); backdrop-filter: blur(2px); }
.modal-topo { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 18px 22px 0; }
.modal-topo h2 { margin: 0; font-size: 1.15rem; }
.modal-topo .pessoa .sub { font-size: .8rem; }
.modal-corpo { padding: 18px 22px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-rodape { flex: none; display: flex; justify-content: flex-end; gap: .5rem; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-rodape .esq { margin-right: auto; }
.fechar { background: none; color: var(--text-3); padding: .3rem; box-shadow: none; }
.fechar:hover { background: var(--surface-3); color: var(--text); }
.abas { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); padding: 0 22px; margin-top: 14px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.abas button {
  background: none; color: var(--text-2); border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  padding: .65rem .8rem; font-weight: 600; font-size: .86rem; box-shadow: none; margin-bottom: -1px;
}
.abas button:hover { background: none; color: var(--text); }
.abas button.ativa { color: var(--accent); border-bottom-color: var(--accent); }
.abas button .n { font-size: .72rem; background: var(--surface-3); color: var(--text-2); padding: 0 .4rem; border-radius: 99px; margin-left: .3rem; }
.aba { display: none; }
.aba.ativa { display: block; }
.linha-acesso { display: grid; grid-template-columns: 1.5fr 1.1fr 1.1fr auto; gap: .55rem; margin-bottom: .55rem; align-items: center; padding: .55rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.cab-acessos { display: grid; grid-template-columns: 1.5fr 1.1fr 1.1fr auto; gap: .55rem; padding: 0 .55rem .35rem; font-size: .72rem; color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.cab-acessos span:last-child { width: 32px; }
.secao-modal { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: .55rem 1rem; font-size: .88rem; margin: 0; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; }
.segredo-mostrado { font-family: var(--mono); background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text); padding: .9rem; border-radius: 10px; word-break: break-all; margin: .5rem 0 1rem; font-size: .95rem; }
.cartoes-acao { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.cartao-acao { display: flex; gap: .7rem; align-items: flex-start; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: .8rem .9rem; border-radius: var(--radius-sm); box-shadow: none; font-weight: 500; white-space: normal; }
.cartao-acao:hover { background: var(--surface-2); border-color: var(--border-strong); }
.cartao-acao strong { display: block; font-size: .88rem; }
.cartao-acao span { font-size: .78rem; color: var(--text-2); font-weight: 400; }
.cartao-acao.perigo { color: var(--danger); }
.cartao-acao.perigo span { color: color-mix(in srgb, var(--danger) 70%, var(--text-2)); }
.escopo { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .5rem; cursor: pointer; font-weight: 400; }
.escopo:hover { background: var(--surface-2); }
.escopo input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.escopo code { font-weight: 600; color: var(--text); }
.escopo .desc { display: block; font-size: .82rem; color: var(--text-2); }
pre.codigo-bloco { background: #0f1218; color: #d6dbe4; padding: 14px 16px; border-radius: 10px; font-family: var(--mono); font-size: .8rem; line-height: 1.6; overflow-x: auto; margin: .5rem 0 1rem; white-space: pre; }
.copiavel { display: flex; gap: .4rem; align-items: center; }
.copiavel code { flex: 1; background: var(--surface-2); border: 1px solid var(--border); padding: .45rem .6rem; border-radius: 7px; overflow-x: auto; white-space: nowrap; }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50;
  display: flex; gap: .6rem; align-items: center;
  padding: .8rem 1rem; border-radius: 10px; box-shadow: var(--shadow-lg);
  background: var(--text); color: var(--bg); font-size: .9rem; max-width: 400px; animation: entrar .18s ease-out;
}
.toast.erro { background: var(--danger); color: #fff; }

/* ===================== conta / portal ===================== */
.boas-vindas { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.portal { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.portal a, .portal .sem-link {
  display: flex; gap: .8rem; align-items: center; padding: 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.portal a:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.portal .sem-link { opacity: .7; }
.portal strong { display: block; font-size: .95rem; }
.portal .nivel { font-size: .78rem; color: var(--text-2); }
.portal .seta { margin-left: auto; color: var(--text-3); }
.metodo { display: flex; gap: 1rem; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.metodo:last-child { border-bottom: 0; padding-bottom: 0; }
.metodo:first-of-type { padding-top: 0; }
.metodo .icone { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.metodo .icone.on { background: var(--ok-soft); color: var(--ok); }
.metodo .corpo { flex: 1; min-width: 0; }
.metodo .corpo h3 { display: flex; align-items: center; gap: .5rem; margin-bottom: .15rem; }
.metodo .corpo p { margin: 0; font-size: .85rem; color: var(--text-2); }
.metodo .lista { margin-top: .6rem; display: grid; gap: .35rem; }
.metodo .lista .linha { display: flex; justify-content: space-between; align-items: center; font-size: .86rem; padding: .45rem .65rem; background: var(--surface-2); border-radius: 7px; }
.form-inline { display: flex; gap: .5rem; margin-top: .7rem; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 180px; }

@media (max-width: 1100px) {
  .grade.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); padding: 12px; }
  .lateral .grupo { display: none; }
  .lateral .marca { width: 100%; margin-bottom: .4rem; }
  .lateral .rodape { margin: .4rem 0 0; width: 100%; border: 0; padding-top: 0; }
  .conteudo { padding: 22px 16px 40px; }
  .grade.c3, .grade.c2 { grid-template-columns: 1fr; }
  .linha-acesso { grid-template-columns: 1fr 1fr; }
  .cab-acessos { display: none; }
  .dl { grid-template-columns: 1fr; }
  .cartoes-acao { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .grade.c4 { grid-template-columns: 1fr; }
}

dialog.dialogo-confirmar { width: min(440px, calc(100vw - 32px)); }
.pular-mfa { margin-top: .4rem; text-align: center; }
.pular-mfa .ajuda { margin-top: .2rem; }

/* campos personalizados */
.atributos-acesso { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 .6rem; }
.atributos-acesso:empty { display: none; }
.atributos-acesso .campo { margin-bottom: .2rem; }
.atributos-acesso label { font-size: .76rem; color: var(--text-2); margin-bottom: .2rem; }
.atributos-acesso input, .atributos-acesso select { padding: .45rem .6rem; font-size: .85rem; }
.obrigatorio { color: var(--danger); }
.linha-campo { display: grid; grid-template-columns: 1.4fr 1.1fr 1fr auto auto; gap: .5rem; align-items: center; padding: .55rem; margin-bottom: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.linha-campo .opcoes-campo { grid-column: 1 / -1; }
.linha-campo .check { font-size: .82rem; white-space: nowrap; margin: 0; }
@media (max-width: 900px) { .linha-campo { grid-template-columns: 1fr 1fr; } }
