body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1f2933; background: #fff; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 6px; padding: .55rem 1rem; background: #0b5cad; color: #fff; }
button:hover { background: #094a8c; }
input { font: inherit; padding: .55rem .7rem; border: 1px solid #b6c0cc; border-radius: 6px; box-sizing: border-box; }
input:focus-visible, button:focus-visible { outline: 3px solid #f5b400; outline-offset: 1px; }

/* Login */
body.login { min-height: 100vh; display: grid; place-items: center; background: #f2f5f9; }
.login main { width: min(22rem, calc(100vw - 2rem)); background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 2px 12px rgba(15, 35, 60, .12); }
.login h1 { margin: 0 0 .25rem; font-size: 1.4rem; }
.login p { margin: 0 0 1.25rem; color: #52606d; }
.login label { display: block; margin: 0 0 .3rem; font-weight: 600; font-size: .9rem; }
.login input { width: 100%; margin-bottom: 1rem; }
.login button { width: 100%; }

/* Documentação */
.barra { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1.25rem; background: #12283f; color: #fff; }
.barra form { margin: 0; display: flex; align-items: center; gap: .75rem; }
.barra button { background: transparent; border: 1px solid #8fa3b8; padding: .3rem .8rem; }
.barra button:hover { background: #1d3c5c; }

/* Páginas internas */
.barra nav { display: flex; gap: .25rem; margin-right: auto; margin-left: 1rem; }
.barra nav a { color: #d5dfea; text-decoration: none; padding: .3rem .7rem; border-radius: 6px; }
.barra nav a:hover { background: #1d3c5c; }
.barra nav a[aria-current] { background: #24486e; color: #fff; }
.barra nav a:focus-visible { outline: 3px solid #f5b400; }
.aviso { max-width: 1420px; margin: 1rem auto 0; padding: 0 20px; box-sizing: border-box; color: #52606d; }
.conteudo { max-width: 1040px; margin: 0 auto; padding: 1.5rem 20px 3rem; }
.conteudo.estreito { max-width: 30rem; }
.conteudo h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
.conteudo h2 { font-size: 1.15rem; margin: 2.25rem 0 .75rem; }
.sub { color: #52606d; margin: 0 0 1rem; }
.erro, .sucesso, .novo { padding: .7rem .9rem; border-radius: 6px; margin: 0 0 1rem; }
.erro { color: #a61b1b; background: #fdecec; }
.sucesso { color: #0b5a1c; background: #e6f4e8; }
.novo { background: #eaf2fc; border: 1px solid #b9d3f2; }
.novo p { margin: 0 0 .6rem; }
.copia { display: flex; gap: .6rem; }
.copia input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; background: #fff; }
.criar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1.25rem; }
.criar label { font-weight: 600; }
.criar input { flex: 1 1 16rem; min-width: 0; }
.rolagem { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid #e3e8ee; white-space: nowrap; }
thead th { font-size: .8rem; color: #52606d; font-weight: 600; }
tbody th { font-weight: 600; white-space: normal; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td form { margin: 0; text-align: right; }
td:last-child { text-align: right; }
tr.revogado th, tr.revogado td { color: #7b8794; }
.selo { font-size: .85rem; }
button.perigo { background: transparent; color: #a61b1b; border: 1px solid #d9a3a3; padding: .25rem .7rem; }
button.perigo:hover { background: #fdecec; }
.vazio { color: #52606d; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.filtros label { color: #52606d; font-size: .9rem; }
select { font: inherit; padding: .4rem .6rem; border: 1px solid #b6c0cc; border-radius: 6px; background: #fff; margin-left: .35rem; max-width: 16rem; }
.cartao { border: 1px solid #e3e8ee; border-radius: 10px; padding: 1rem 1.25rem; }
.campos { margin-bottom: 1.25rem; }
.campos h2 { margin: 0 0 .9rem; }
.campos label { display: block; margin: 0 0 .3rem; font-weight: 600; font-size: .9rem; }
.campos input { width: 100%; margin-bottom: 1rem; }
.campos .dica { margin: -.7rem 0 1rem; font-size: .85rem; color: #52606d; }

/* Gráfico de consultas: cores por código HTTP, validadas para daltonismo na ordem da pilha */
.viz-root {
  --superficie: #ffffff; --tinta: #191919; --tinta-2: #666666; --grade: #e7e7e7; --linha-base: #c2c2c2;
  --serie-1: #257de0; --serie-2: #f47230; --serie-3: #00b894; --serie-4: #f2a600; --serie-5: #ee7fac; --serie-6: #008a17;
  --serie-outro: #8a8a8a;
  background: var(--superficie); color: var(--tinta);
}
.viz-root .sub { color: var(--tinta-2); margin-bottom: .6rem; }
.legenda { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .85rem; color: var(--tinta-2); margin-bottom: .5rem; }
.legenda .item { display: inline-flex; align-items: center; gap: .4rem; }
.legenda .chave { width: 10px; height: 10px; border-radius: 2px; }
.grafico { position: relative; }
.grafico svg { display: block; }
.grafico .grade { stroke: var(--grade); stroke-width: 1; }
.grafico .base { stroke: var(--linha-base); stroke-width: 1; }
.grafico .eixo { fill: var(--tinta-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.grafico .toque { fill: transparent; outline: none; }
.grafico .coluna.ativa .toque { fill: rgba(25, 25, 25, .06); }
.grafico .toque:focus-visible { stroke: #0b5cad; stroke-width: 2; }
.dica-grafico { position: absolute; pointer-events: none; background: var(--superficie); border: 1px solid rgba(11, 11, 11, .1); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 35, 60, .14); padding: .5rem .7rem; font-size: .85rem; white-space: nowrap; z-index: 1; }
.dica-grafico strong { display: block; margin-bottom: .3rem; }
.dica-grafico .linha { display: flex; align-items: center; gap: .45rem; color: var(--tinta-2); }
.dica-grafico .linha b { color: var(--tinta); min-width: 2.2rem; text-align: right; font-variant-numeric: tabular-nums; }
.dica-grafico .traco { width: 12px; height: 3px; border-radius: 2px; }
.dica-grafico .total { margin-top: .25rem; padding-top: .25rem; border-top: 1px solid var(--grade); }
.viz-root details { margin-top: .75rem; font-size: .9rem; }
.viz-root summary { cursor: pointer; color: var(--tinta-2); }

/* Origem das consultas: uma série só, barras horizontais com o valor ao lado */
.origens th, .origens td { border-bottom: 0; padding: .35rem .75rem; }
.origens thead th { border-bottom: 1px solid var(--grade); }
.origens tbody th { font-weight: 500; white-space: nowrap; max-width: 22rem; overflow: hidden; text-overflow: ellipsis; }
.origens .trilho { width: 55%; min-width: 8rem; padding-left: 0; padding-right: 0; }
.origens .barra-h { display: block; height: 12px; min-width: 2px; background: var(--serie-1); border-radius: 0 4px 4px 0; }
.origens .parte { color: var(--tinta-2); }
.origens tbody tr:hover { background: rgba(25, 25, 25, .04); }
.viz-root code { font-size: .9em; }
