/* VirtualWeb BD: tema claro por padrão, escuro em [data-tema="escuro"]; pares de cor com contraste AA. */

:root {
  color-scheme: light;
  --fundo: #ffffff;
  --fundo-2: #f6f8fa;
  --fundo-3: #eaeef2;
  --fundo-realce: #ddf4ff;
  --borda: #d0d7de;
  --borda-forte: #8c959f;
  --texto: #1f2328;
  --texto-2: #59636e;
  --realce: #0969da;
  --realce-texto: #ffffff;
  --selecao: #cfe3ff;
  --selecao-borda: #0969da;
  --perigo: #b42318;
  --perigo-fundo: #fdecea;
  --faixa-perigo: #b42318;
  --aviso: #7d4e00;
  --aviso-fundo: #fff4d6;
  --sucesso: #116329;
  --sucesso-fundo: #dafbe1;
  --nulo: #6e7781;
  --foco: #0969da;
  --sombra: 0 8px 24px rgba(31, 35, 40, 0.18);
  --fonte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fonte-mono: "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
}

[data-tema="escuro"] {
  color-scheme: dark;
  --fundo: #0d1117;
  --fundo-2: #161b22;
  --fundo-3: #21262d;
  --fundo-realce: #16304f;
  --borda: #30363d;
  --borda-forte: #6e7681;
  --texto: #e6edf3;
  --texto-2: #9da7b3;
  --realce: #4493f8;
  --realce-texto: #0d1117;
  --selecao: #1f3a5f;
  --selecao-borda: #4493f8;
  --perigo: #ff7b72;
  --perigo-fundo: #3c1618;
  --faixa-perigo: #b42318;
  --aviso: #e3b341;
  --aviso-fundo: #2e2410;
  --sucesso: #3fb950;
  --sucesso-fundo: #0f2a18;
  --nulo: #8b949e;
  --foco: #4493f8;
  --sombra: 0 8px 24px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.45 var(--fonte); color: var(--texto); background: var(--fundo); overflow: hidden; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--fonte-mono); }
:focus-visible { outline: 2px solid var(--foco); outline-offset: 1px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icone { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.fora-da-tela { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; opacity: 0; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.espaco { flex: 1; }
.nota { color: var(--texto-2); font-size: 12px; }
.vazio { color: var(--texto-2); margin: 0; padding: 12px; }
.erro, .erro-campo { color: var(--perigo); }
.erro-campo { margin: 0; min-height: 1.3em; }
.carregando { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; color: var(--texto-2); }

/* Botões e campos */
.botao {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 1px solid var(--borda); border-radius: 6px; background: var(--fundo); cursor: pointer; white-space: nowrap;
  text-decoration: none;
}
.botao:hover:not(:disabled) { background: var(--fundo-3); }
.botao:disabled { opacity: 0.55; cursor: default; }
.botao.primario { background: var(--realce); border-color: var(--realce); color: var(--realce-texto); }
.botao.primario:hover:not(:disabled) { background: var(--realce); filter: brightness(1.08); }
.botao.perigo { background: var(--faixa-perigo); border-color: var(--faixa-perigo); color: #ffffff; }
.botao.perigo:hover:not(:disabled) { background: var(--faixa-perigo); filter: brightness(1.12); }
.botao[aria-pressed="true"] { background: var(--fundo-realce); border-color: var(--realce); box-shadow: inset 0 0 0 1px var(--realce); font-weight: 600; }
.botao-pequeno { height: 24px; padding: 0 8px; font-size: 12px; }
.botao.grande { height: 42px; padding: 0 18px; font-size: 15px; font-weight: 600; }
.botao-icone {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer;
}
.botao-icone:hover { background: var(--fundo-3); }
.botao-icone[aria-pressed="true"] { border-color: var(--realce); background: var(--fundo-realce); }
select, input[type="text"], input[type="search"], input[type="number"], input[type="datetime-local"] {
  height: 28px; border: 1px solid var(--borda); border-radius: 6px; background: var(--fundo); padding: 0 6px;
}
select { max-width: 240px; }
select.producao { border-color: var(--perigo); color: var(--perigo); font-weight: 700; }
.selo {
  display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--borda); border-radius: 10px;
  font-size: 11px; line-height: 16px; white-space: nowrap; background: var(--fundo-3); color: var(--texto-2);
}
.selo-perigo { background: var(--faixa-perigo); border-color: var(--faixa-perigo); color: #ffffff; font-weight: 700; }
.selo-aviso { background: var(--aviso-fundo); border-color: var(--aviso); color: var(--aviso); }

/* Estrutura */
.app { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; }
.barra {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; min-width: 0; overflow-x: auto;
  background: var(--fundo-2); border-bottom: 1px solid var(--borda);
}
.marca { display: flex; align-items: center; gap: 6px; margin-right: 6px; font-weight: 700; white-space: nowrap; }
.marca .icone { width: 20px; height: 20px; color: var(--realce); }
.barra-contexto { display: flex; align-items: center; gap: 6px; }
.barra-contexto select { max-width: 190px; }
.grupo { display: flex; gap: 4px; margin-left: 8px; }
.usuario { padding: 0 6px; font-weight: 600; white-space: nowrap; }
/* Abaixo de 1800 px os botões secundários ficam só com o ícone; o nome segue no leitor de tela e no title. */
@media (max-width: 1799px) {
  .botao.compacto { padding: 0 7px; }
  .botao.compacto .rotulo-botao { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.area { display: grid; grid-template-columns: var(--largura-explorador, 280px) 5px minmax(0, 1fr); min-height: 0; }
.divisor { background: var(--borda); }
.divisor-v { cursor: col-resize; }
.divisor-h { flex: none; height: 5px; cursor: row-resize; }
.divisor:hover, .divisor:focus-visible { background: var(--realce); outline: none; }

/* Explorador */
.explorador { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--fundo-2); }
.explorador-topo { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 4px; }
.explorador-titulo { margin: 0; font-size: 13px; }
.explorador-filtro { margin: 0 8px 6px; }
.arvore { flex: 1; overflow: auto; padding-bottom: 12px; }
.no {
  display: flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 calc(var(--nivel) * 14px - 10px);
  white-space: nowrap; cursor: default; user-select: none;
}
.no:hover { background: var(--fundo-3); }
.no.focado { background: var(--selecao); }
.no:focus-visible { outline-offset: -2px; }
.no-seta { flex: none; width: 14px; color: var(--texto-2); text-align: center; cursor: pointer; }
.no-rotulo { overflow: hidden; text-overflow: ellipsis; }
.no-contagem { margin-left: 4px; color: var(--texto-2); font-size: 11px; }
.no-pseudo { color: var(--texto-2); font-style: italic; }
.no.producao .no-rotulo, .no.producao > .icone { color: var(--perigo); font-weight: 700; }

/* Centro: abas e editor */
.centro { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.abas-editor { display: flex; flex: none; overflow-x: auto; background: var(--fundo-2); border-bottom: 1px solid var(--borda); scrollbar-width: thin; }
.aba { display: flex; flex: none; align-items: center; max-width: 280px; border-right: 1px solid var(--borda); }
.aba.ativa { background: var(--fundo); box-shadow: inset 0 2px 0 var(--realce); }
.aba.producao { box-shadow: inset 0 3px 0 var(--faixa-perigo); }
.aba.producao .aba-titulo { color: var(--perigo); font-weight: 600; }
.aba-botao { display: flex; align-items: center; gap: 6px; min-width: 0; height: 32px; padding: 0 4px 0 10px; border: 0; background: transparent; cursor: pointer; }
.aba-titulo { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aba-contexto { max-width: 90px; overflow: hidden; color: var(--texto-2); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.aba-fechar { width: 22px; height: 22px; margin-right: 4px; border: 0; border-radius: 4px; background: transparent; color: var(--texto-2); cursor: pointer; }
.aba-fechar:hover { background: var(--fundo-3); color: var(--texto); }
.girando { flex: none; width: 12px; height: 12px; border: 2px solid var(--borda); border-top-color: var(--realce); border-radius: 50%; animation: girar 0.8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .girando { animation-duration: 3s; } }

.conteudo-aba { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.consulta { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.faixa-producao { flex: none; padding: 4px 12px; font-size: 12px; }
.faixa-producao, .status-producao { background: var(--faixa-perigo); color: #ffffff; font-weight: 700; letter-spacing: 0.02em; }
.editor { flex: 1; min-height: 60px; }
.resultados-host { display: flex; flex: none; flex-direction: column; height: var(--altura-resultados, 42%); min-height: 80px; }
.consulta.recolhido .resultados-host, .consulta.recolhido .divisor-h,
.consulta.sem-resultados .resultados-host, .consulta.sem-resultados .divisor-h { display: none; }
.especial { flex: 1; min-height: 0; overflow: hidden; }

/* Painel de resultados */
.resultados { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.resultados-topo { display: flex; flex: none; align-items: center; gap: 8px; padding: 0 8px; background: var(--fundo-2); border-bottom: 1px solid var(--borda); }
.resultados-abas, .sub-abas { display: flex; }
.resultados-aba { height: 30px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--texto-2); cursor: pointer; }
.resultados-aba[aria-selected="true"] { border-bottom-color: var(--realce); color: var(--texto); font-weight: 600; }
.resultados-aba.com-erro::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--perigo); vertical-align: 1px; }
.resultados-corpo { position: relative; flex: 1; min-height: 0; }
.resultados-painel { position: absolute; inset: 0; overflow: auto; }
.resultados-painel:focus { outline: none; }
.painel-resultados { display: flex; flex-direction: column; }
.lista-grades { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.lista-grades.varias { overflow: auto; }
.bloco-grade { display: flex; flex: 1 1 0; flex-direction: column; min-height: 140px; border-bottom: 1px solid var(--borda); }
.lista-grades.varias .bloco-grade { flex: 0 0 auto; height: max(200px, 48%); }
.bloco-barra { display: flex; flex: none; align-items: center; gap: 8px; padding: 2px 8px; background: var(--fundo-2); font-size: 12px; }
.bloco-linhas { color: var(--texto-2); }

/* Grade virtualizada */
.grade { --num: 40px; position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--fundo); outline-offset: -2px; }
.grade-canto { position: absolute; left: 0; top: 0; width: var(--num); height: 24px; background: var(--fundo-2); border-right: 1px solid var(--borda); border-bottom: 1px solid var(--borda); cursor: pointer; }
.grade-cabecalho { position: absolute; left: var(--num); right: 0; top: 0; height: 24px; overflow: hidden; background: var(--fundo-2); border-bottom: 1px solid var(--borda); }
.grade-numeros { position: absolute; left: 0; top: 24px; bottom: 0; width: var(--num); overflow: hidden; background: var(--fundo-2); border-right: 1px solid var(--borda); }
.grade-rolagem { position: absolute; left: var(--num); right: 0; top: 24px; bottom: 0; overflow: auto; }
.grade-trilho { position: relative; will-change: transform; }
.grade-tamanho { position: absolute; left: 0; top: 0; visibility: hidden; }
.grade-corpo { position: absolute; left: 0; top: 0; }
.grade-linha { position: absolute; left: 0; top: 0; height: 22px; contain: layout style; }
.grade-celula, .grade-numero { contain: strict; }
.grade-celula {
  position: absolute; top: 0; height: 22px; padding: 0 6px; overflow: hidden; line-height: 21px; white-space: nowrap; text-overflow: ellipsis;
  border-right: 1px solid var(--fundo-3); border-bottom: 1px solid var(--fundo-3); font-variant-numeric: tabular-nums; user-select: none;
}
.grade-celula.num { text-align: right; }
.grade-celula.nulo { color: var(--nulo); font-style: italic; }
.grade-celula.link { color: var(--realce); text-decoration: underline; cursor: pointer; }
.grade-celula.sel { background: var(--selecao); }
.grade-celula.sel.nulo { color: var(--texto-2); }
.grade-celula.ativa { box-shadow: inset 0 0 0 1px var(--selecao-borda); }
.grade:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--foco); }
.grade:focus-visible .grade-celula.ativa { box-shadow: inset 0 0 0 2px var(--foco); }
.grade-cabeca {
  position: absolute; top: 0; display: flex; align-items: center; height: 24px; padding: 0 2px 0 6px;
  border-right: 1px solid var(--borda); font-weight: 600; user-select: none;
}
.grade-cabeca.sel { background: var(--selecao); }
.grade-nome { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grade-ordenar { flex: none; width: 18px; height: 18px; padding: 0; border: 0; background: transparent; color: var(--texto-2); font-size: 10px; cursor: pointer; opacity: 0; }
.grade-cabeca:hover .grade-ordenar, .grade-ordenar.ligado { opacity: 1; }
.grade-redim { position: absolute; top: 0; right: -3px; z-index: 1; width: 7px; height: 100%; cursor: col-resize; }
.grade-numero {
  position: absolute; left: 0; top: 0; width: 100%; height: 22px; padding-right: 6px; line-height: 21px; text-align: right;
  color: var(--texto-2); border-bottom: 1px solid var(--fundo-3); font-variant-numeric: tabular-nums;
}
.grade-numero.sel { background: var(--selecao); color: var(--texto); }

/* Mensagens */
.mensagens { margin: 0; padding: 8px 12px; list-style: none; font-family: var(--fonte-mono); font-size: 12px; }
.msg { padding: 2px 0; white-space: pre-wrap; }
.msg-erro { color: var(--perigo); }
.msg-aviso { color: var(--aviso); }
.msg-linhas { color: var(--texto-2); }
.msg-link { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; white-space: pre-wrap; cursor: pointer; }
.msg-link:hover { text-decoration: underline; }

/* Plano de execução */
.plano { padding: 0 12px 12px; }
.plano-barra { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; padding: 8px 0; background: var(--fundo); }
.plano-bloco { margin-bottom: 16px; }
.plano-cabecalho { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.plano-titulo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 6px 0; }
.plano-titulo code { color: var(--texto-2); font-size: 12px; }
.plano-avisos { margin: 4px 0; padding-left: 18px; color: var(--aviso); }
.plano-indice { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--sucesso); border-radius: 6px; background: var(--sucesso-fundo); }
.plano-indice p { margin: 0 0 4px; color: var(--sucesso); }
.plano-indice pre { margin: 0 0 6px; font-size: 12px; white-space: pre-wrap; }
.plano-indice-acoes { display: flex; gap: 6px; }
.plano-desenho { overflow: auto; border: 1px solid var(--borda); border-radius: 6px; background: var(--fundo); }
.plano-svg { display: block; }
.plano-no rect { fill: var(--fundo-2); stroke: var(--borda-forte); stroke-width: 1; }
.plano-no:hover rect, .plano-no:focus rect { stroke: var(--realce); stroke-width: 2.5; }
.plano-no:focus { outline: none; }
.plano-no.instrucao rect { fill: var(--fundo-3); }
.plano-no.com-aviso rect { stroke: var(--aviso); stroke-width: 2; }
.plano-no text { fill: var(--texto); font-family: var(--fonte); font-size: 11px; }
.plano-no .plano-t1 { font-weight: 700; }
.plano-no .plano-t2, .plano-no .plano-t4 { fill: var(--texto-2); }
.plano-no.caro .plano-t3 { fill: var(--perigo); font-weight: 700; }
.plano-alerta path { fill: var(--aviso); }
.plano-alerta text { fill: var(--fundo); font-size: 10px; font-weight: 700; }
.plano-aresta { fill: none; stroke: var(--texto-2); stroke-linejoin: round; }
.plano-seta-ponta { fill: var(--texto-2); }
.plano-dica {
  position: fixed; z-index: 50; max-width: 440px; max-height: 70vh; padding: 8px 10px; overflow: auto; pointer-events: none;
  background: var(--fundo); border: 1px solid var(--borda); border-radius: 8px; box-shadow: var(--sombra); font-size: 12px;
}
.plano-dica dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0 0; }
.plano-dica dt { color: var(--texto-2); }
.plano-dica dd { margin: 0; word-break: break-word; }
.plano-dica-avisos { margin-top: 6px; color: var(--aviso); }
.plano-dica-avisos ul { margin: 2px 0 0; padding-left: 16px; }

/* Abas especiais: monitor, histórico e edição */
.especial-conteudo { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.especial-barra { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; background: var(--fundo-2); border-bottom: 1px solid var(--borda); }
.especial-barra.secundaria { background: var(--fundo); }
.especial-barra h2 { margin: 0 8px 0 0; font-size: 14px; }
.especial-corpo { flex: 1; min-height: 0; padding: 8px 12px; overflow: auto; }
.monitor-painel { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.campo-horas { width: 80px; }
.recuo { display: inline-block; width: calc(var(--recuo) * 16px); color: var(--texto-2); text-align: right; }
.filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.filtros label { display: grid; gap: 2px; color: var(--texto-2); font-size: 12px; }
.filtros input, .filtros select { color: var(--texto); }

.tabela-rolagem { max-width: 100%; overflow: auto; }
.tabela { min-width: 100%; border-collapse: collapse; font-size: 12px; }
.tabela caption { padding: 4px 0; font-weight: 600; text-align: left; }
.tabela th, .tabela td { padding: 3px 8px; border: 1px solid var(--borda); text-align: left; vertical-align: top; white-space: nowrap; }
.tabela thead th { position: sticky; top: 0; z-index: 1; background: var(--fundo-2); }
.tabela td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tabela td.acoes { white-space: nowrap; }
.tabela tr.bloqueada td { background: var(--aviso-fundo); }
.tabela tr.bloqueadora td:first-child { box-shadow: inset 3px 0 0 var(--perigo); }
.tabela tr.acima-do-teto td { color: var(--perigo); font-weight: 700; }
.sql-celula { max-width: 480px; overflow: hidden; font-family: var(--fonte-mono); text-overflow: ellipsis; }

.edicao-info { margin: 0; padding: 6px 12px; color: var(--texto-2); }
.edicao-info.aviso { background: var(--aviso-fundo); color: var(--aviso); font-weight: 600; }
.edicao-info.erro { background: var(--perigo-fundo); color: var(--perigo); font-weight: 600; }
.edicao-pendencias { color: var(--aviso); font-weight: 600; }
.edicao-rolagem { flex: 1; min-height: 0; overflow: auto; }
.tabela-edicao { border-collapse: collapse; font-size: 12px; }
.tabela-edicao th, .tabela-edicao td { max-width: 320px; height: 24px; padding: 0 6px; overflow: hidden; border: 1px solid var(--borda); text-overflow: ellipsis; white-space: nowrap; }
.tabela-edicao thead th { position: sticky; top: 0; z-index: 2; background: var(--fundo-2); text-align: left; }
.tabela-edicao td.nulo { color: var(--nulo); font-style: italic; }
.tabela-edicao td.pendente { background: var(--aviso-fundo); color: var(--texto); }
.tabela-edicao td.somente-leitura { background: var(--fundo-2); color: var(--texto-2); }
.tabela-edicao tr.linha-excluida td { color: var(--perigo); text-decoration: line-through; }
.tabela-edicao tr.linha-nova td { background: var(--sucesso-fundo); }
.tabela-edicao td:focus { outline: 2px solid var(--foco); outline-offset: -2px; }
.edicao-marca { position: sticky; left: 0; z-index: 1; width: 64px; background: var(--fundo-2); color: var(--texto-2); text-align: center; }
.tabela-edicao thead .edicao-marca { z-index: 3; }
.linha-placeholder th { color: var(--texto-2); }
.edicao-campo { width: 100%; min-width: 120px; height: 22px; padding: 0 4px; border: 1px solid var(--realce); border-radius: 2px; background: var(--fundo); }

/* Diálogos, menus e avisos */
.dialogo {
  width: min(720px, 94vw); max-height: 88vh; padding: 0; border: 1px solid var(--borda); border-radius: 10px;
  background: var(--fundo); color: var(--texto); box-shadow: var(--sombra);
}
.dialogo[open] { display: flex; flex-direction: column; }
.dialogo::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialogo-cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--borda); }
.dialogo-cabecalho h2 { margin: 0; font-size: 15px; }
.dialogo-corpo { padding: 12px 14px; overflow: auto; }
.dialogo-corpo > p:first-child { margin-top: 0; }
.dialogo-rodape { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--borda); }
.dialogo-ensaio .dialogo-cabecalho { background: var(--faixa-perigo); color: #ffffff; border-radius: 9px 9px 0 0; }
.dialogo-ensaio .dialogo-cabecalho .botao-icone:hover { background: rgba(255, 255, 255, 0.2); }
.dialogo-propriedades { width: min(980px, 96vw); }
.ensaio-confirmacao { display: grid; gap: 4px; margin-top: 12px; }
.ensaio-confirmacao label { font-weight: 600; }
.ensaio-confirmacao input { height: 34px; border: 2px solid var(--perigo); font-family: var(--fonte-mono); }
.ensaio-estado { margin-top: 10px; font-weight: 600; }
.ensaio-estado.sucesso { color: var(--sucesso); }
.ensaio-estado.falha { color: var(--perigo); }
.relogio { font-variant-numeric: tabular-nums; }
.alerta { padding: 8px 10px; border-radius: 6px; }
.alerta-perigo { background: var(--perigo-fundo); color: var(--perigo); font-weight: 600; }
.secao { margin-bottom: 8px; }
.secao summary { padding: 4px 0; font-weight: 600; cursor: pointer; }
.pares { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 4px 0 8px; }
.pares dt { color: var(--texto-2); }
.pares dd { margin: 0; overflow-wrap: anywhere; }
.definicao { max-height: 320px; margin: 4px 0 8px; padding: 8px; overflow: auto; border: 1px solid var(--borda); border-radius: 6px; background: var(--fundo-2); font-size: 12px; white-space: pre; }

.menu {
  position: fixed; z-index: 60; display: flex; flex-direction: column; min-width: 240px; padding: 4px;
  background: var(--fundo); border: 1px solid var(--borda); border-radius: 8px; box-shadow: var(--sombra);
}
.menu-item { display: flex; justify-content: space-between; gap: 16px; padding: 5px 10px; border: 0; border-radius: 4px; background: transparent; text-align: left; cursor: pointer; }
.menu-item:hover:not(:disabled), .menu-item:focus { background: var(--selecao); }
.menu-item:focus-visible { outline: 2px solid var(--foco); outline-offset: -2px; }
.menu-item:disabled { color: var(--texto-2); cursor: default; opacity: 0.6; }
.menu-item kbd { color: var(--texto-2); font-size: 11px; }
.menu-separador { height: 1px; margin: 4px 2px; background: var(--borda); }

.avisos { position: fixed; right: 12px; bottom: 36px; z-index: 70; display: flex; flex-direction: column; gap: 6px; max-width: min(440px, 90vw); }
.aviso { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; background: var(--fundo); border: 1px solid var(--borda); border-radius: 8px; box-shadow: var(--sombra); }
.aviso span { flex: 1; }
.aviso-erro { border-color: var(--perigo); color: var(--perigo); }
.aviso-aviso { border-color: var(--aviso); color: var(--aviso); }

/* Barra de status */
.status {
  display: flex; align-items: center; gap: 14px; height: 26px; padding: 0 10px; overflow: hidden;
  background: var(--fundo-2); border-top: 1px solid var(--borda); font-size: 12px; white-space: nowrap;
}
.status.producao { background: var(--faixa-perigo); border-top-color: var(--faixa-perigo); color: #ffffff; }
.status-producao { padding: 1px 8px; border: 1px solid #ffffff; border-radius: 4px; }
.status-item { display: inline-flex; align-items: center; gap: 4px; }
.status-estado[data-status="erro"], .status-estado[data-status="recusado"] { color: var(--perigo); font-weight: 600; }
.status.producao .status-estado { color: #ffffff; }

/* Tela de sessão (entrada e segundo fator) */
.sessao { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: var(--fundo-2); }
.sessao-cartao { width: min(500px, 100%); padding: 24px 28px; background: var(--fundo); border: 1px solid var(--borda); border-radius: 12px; box-shadow: var(--sombra); }
.sessao-marca { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--realce); font-size: 16px; font-weight: 700; }
.sessao-marca .icone { width: 24px; height: 24px; }
.sessao-cartao h1 { margin: 0 0 8px; font-size: 20px; }
.sessao-cartao .botao.grande .icone { width: 18px; height: 18px; }
.form-totp { display: grid; gap: 6px; margin-top: 12px; }
.form-totp label { font-weight: 600; }
.campo-codigo { height: 48px; border: 1px solid var(--borda-forte); border-radius: 8px; background: var(--fundo); font: 600 24px/1 var(--fonte-mono); letter-spacing: 0.3em; text-align: center; }
.copiavel { display: grid; gap: 4px; margin: 8px 0; }
.copiavel label { font-weight: 600; }
.copiavel-linha { display: flex; align-items: flex-start; gap: 6px; }
.campo-copiavel { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--borda); border-radius: 6px; background: var(--fundo-2); font-family: var(--fonte-mono); font-size: 12px; resize: vertical; }
