/* V2 DNS: mesma base visual do version2.network (tokens em tokens.css). */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: var(--t-lg); }
h2 { font-size: var(--t-md); }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--brand); }
code, .mono { font-family: var(--font-mono); font-size: 0.875em; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--s-2); top: var(--s-1); background: var(--paper); padding: 0.4rem 0.8rem; z-index: 10; }

/* ------------------------------------------------ cabeçalho */
.top {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  height: 3.5rem;
  padding: 0 var(--s-2);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top[hidden] { display: none; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.scope { flex: 1; min-width: 0; display: flex; align-items: center; }
.scope-sel { width: auto; max-width: 22rem; min-height: 2.25rem; padding: 0.25rem 2rem 0.25rem 0.7rem; font-weight: 500; background-color: var(--surface); border-color: var(--line); }
.scope-sel.scope-admin { color: var(--brand); }
.scope-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who { display: flex; align-items: center; gap: var(--s-1); white-space: nowrap; }
.quick { position: relative; display: flex; align-items: center; }
.quick .ico { position: absolute; left: 0.6rem; color: var(--ink-3); pointer-events: none; }
.quick input { width: 15rem; padding: 0.35rem 0.6rem 0.35rem 2rem; font-size: var(--t-sm); margin-right: var(--s-2); }
.who-name { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-size: var(--t-sm); color: var(--ink); }
.who-role { color: var(--ink-3); font-size: 0.75rem; }
.menu-btn { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------ menu lateral (contexto) */
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: calc(100vh - 3.5rem); background: linear-gradient(to right, var(--surface) calc(15rem - 1px), var(--line) calc(15rem - 1px), var(--line) 15rem, var(--paper) 15rem); }
.bare .shell { background: var(--paper); }
.bare .shell { display: block; }
.side { border-right: 1px solid var(--line); background: var(--surface); padding: var(--s-2) var(--s-1); position: sticky; top: 3.5rem; height: calc(100vh - 3.5rem); overflow-y: auto; }
.side[hidden] { display: none; }
.side-sec + .side-sec { margin-top: var(--s-2); }
.side-title { font-size: 0.75rem; font-weight: 600; color: var(--ink-3); padding: 0 0.65rem; margin-bottom: 0.25rem; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: flex; align-items: center; gap: 0.6rem; padding: 0.42rem 0.65rem; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-size: 0.9rem; }
.side a:hover { color: var(--ink); background: color-mix(in srgb, var(--line) 45%, transparent); }
.side a[aria-current='page'] { color: var(--brand); background: var(--paper); box-shadow: inset 2px 0 0 var(--brand); font-weight: 500; }
.side a .ico { flex: none; color: var(--ink-3); }
.side a[aria-current='page'] .ico { color: var(--brand); }
.side a span:first-of-type { flex: 1; }
.brand-sub { color: var(--ink-3); font-weight: 500; }
.side-prods > li + li { margin-top: 0.15rem; }
.side-prod-name { display: flex; align-items: center; gap: 0.6rem; width: 100%; margin: 0; padding: 0.42rem 0.65rem; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--ink); background: none; border: 0; border-radius: var(--radius); cursor: pointer; text-align: left; }
.side-prod-name:hover { background: color-mix(in srgb, var(--line) 45%, transparent); }
.side-prod-name > span:first-of-type { flex: 1; }
.side-prod-name .ico:last-child { color: var(--ink-3); transition: transform 0.15s ease; }
.side-prod-name[aria-expanded='true'] .ico:last-child { transform: rotate(90deg); }
.side-prod:not(.is-live) .side-prod-name { font-weight: 500; color: var(--ink-2); }
.side-prod-body[hidden] { display: none; }
/* Menu fechado com a página atual dentro: o nome do produto fica na cor da marca, para saber onde se está. */
.side-prod.is-here > .side-prod-name[aria-expanded='false'] { color: var(--brand); box-shadow: inset 2px 0 0 var(--brand); }
.side-prod { padding-bottom: 0.2rem; }
@media (prefers-reduced-motion: reduce) { .side-prod-name .ico:last-child { transition: none; } }
.side-prod-name .ico { color: var(--brand); flex: none; }
.side-prod + .side-prod { border-top: 1px solid var(--line); padding-top: 0.2rem; }
.side-sub { margin-left: 0.95rem; padding-left: 0.4rem; border-left: 1px solid var(--line); }
.side-sub + .side-sub { margin-top: 0.4rem; }
.side-subtitle { font-size: 0.7rem; font-weight: 600; color: var(--ink-3); padding: 0.15rem 0.65rem; margin: 0; }
.side .soon { flex: none !important; font-size: 0.68rem; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 0.05rem 0.45rem; }
.prod-soon { max-width: 40rem; }
.prod-soon-ico { width: 3rem; height: 3rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); color: var(--brand); }
.side-back { margin-top: var(--s-3); border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: var(--s-2) !important; font-size: var(--t-sm) !important; }

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 0; background: none; color: var(--ink); border-radius: var(--radius); cursor: pointer; }
  .bare .menu-btn { display: none; }
  .brand span { display: none; }
  .who-name { display: none; }
  .quick input { width: 8.5rem; margin-right: 0; }
  .scope-sel { max-width: 100%; }
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--paper); }
  .side { position: fixed; top: 3.5rem; left: 0; bottom: 0; width: min(18rem, 85vw); height: auto; z-index: 19; transform: translateX(-100%); transition: transform 0.18s ease; box-shadow: none; }
  .nav-open .side { transform: none; box-shadow: 0 12px 40px rgb(0 0 0 / 0.25); }
}
/* Celular: a busca do topo vira a lupa e, ao tocar, abre por cima do topo inteiro; o seletor de cliente fica com o espaço. */
@media (max-width: 560px) {
  .top { gap: var(--s-1); padding: 0 var(--s-1); }
  .quick input { width: 2.5rem; min-height: 2.5rem; padding: 0 0 0 2.5rem; cursor: pointer; }
  .quick .ico { left: 0.75rem; }
  .quick:focus-within { position: absolute; inset: 0 var(--s-1); background: var(--paper); z-index: 1; }
  .quick:focus-within input { width: 100%; cursor: text; }
}

/* ------------------------------------------------ layout */
main { max-width: var(--max); width: 100%; margin: 0 auto; padding: var(--s-3) var(--gutter) var(--s-6); min-width: 0; }
.bare main { padding-top: var(--s-4); }
main:focus, main:focus-visible { outline: none; }
main[aria-busy="true"] { opacity: .5; cursor: progress; transition: opacity .15s ease-out; }
@media (prefers-reduced-motion: reduce) { main[aria-busy="true"] { transition: none; } }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-3); }
.page-head h1 { font-size: 1.5rem; }
.page-head p { color: var(--ink-2); margin-top: 0.3rem; max-width: 70ch; }
.crumbs { font-size: var(--t-sm); color: var(--ink-3); margin-bottom: 0.35rem; }
.crumbs a { color: var(--ink-3); }
.stack > * + * { margin-top: var(--s-3); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-1); align-items: end; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s-2); }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--s-3);
  background: var(--paper);
}
.panel > h2 + *, .panel > h3 + * { margin-top: var(--s-2); }
section > h2 { font-size: 1.125rem; }

.narrow { max-width: 26rem; margin: 8vh auto 0; }
.narrow .brand { margin-bottom: var(--s-3); }

/* ------------------------------------------------ botões de ícone, diálogo e avisos */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border: 1px solid transparent; border-radius: var(--radius);
  background: none; color: var(--ink-2); cursor: pointer; text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }
.icon-btn.danger { color: var(--error); }
.icon-btn.danger:hover { background: var(--error-tint); border-color: var(--error); }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.15rem; }
.row-actions .sep { width: 1px; height: 1.25rem; background: var(--line); margin: 0 0.4rem; }
.btn .ico { margin-left: -0.15rem; }
.btn-danger-solid { background: var(--error); color: #fff; }
.btn-danger-solid:hover { filter: brightness(0.92); }

.dlg { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: var(--s-3); width: min(30rem, calc(100vw - 2rem)); background: var(--paper); color: var(--ink); }
.dlg::backdrop { background: rgb(8 14 30 / 0.45); }
.dlg h2 { font-size: 1.125rem; }
.dlg:has(.dlg-wide) { width: min(56rem, calc(100vw - 2rem)); }
.dlg-actions { justify-content: flex-end; }
.toasts { position: fixed; right: var(--s-2); bottom: var(--s-2); display: grid; gap: var(--s-1); z-index: 50; max-width: min(26rem, calc(100vw - 2rem)); }
.toast { padding: 0.7rem 0.9rem; border-radius: var(--radius); background: var(--ink); color: var(--paper); box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); font-size: var(--t-sm); }
.toast-error { background: var(--error); color: #fff; }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ------------------------------------------------ formulários */
label { display: block; font-weight: 500; font-size: var(--t-sm); margin-bottom: 0.3rem; }
.hint { display: block; color: var(--ink-3); font-size: var(--t-sm); font-weight: 400; margin-top: 0.25rem; }
.field { min-width: 0; }
.field + .field { margin-top: var(--s-2); }
.row .field + .field, .grid2 .field + .field { margin-top: 0; }

input, select, textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
textarea { font-family: var(--font-mono); font-size: 0.8125rem; min-height: 8rem; resize: vertical; }
input[type='checkbox'], input[type='radio'] { width: auto; min-height: 0; accent-color: var(--brand); }
input[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--error); }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.45rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
.btn-secondary { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-danger { border-color: var(--error); background: transparent; color: var(--error); }
.btn-link { background: none; border: 0; color: var(--brand); padding: 0; min-height: 0; cursor: pointer; font: inherit; }
.btn[disabled] { opacity: 0.55; cursor: wait; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary, :root:not([data-theme="light"]) .btn-primary:hover { color: var(--paper); }
}
/* Escolha manual no painel (botão de tema): vale mesmo com o sistema claro. */
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-primary:hover { color: var(--paper); }

.actions { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-3); }

/* ------------------------------------------------ mensagens */
.msg { border-radius: var(--radius); padding: 0.65rem 0.85rem; border: 1px solid; }
.msg ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.msg-error { background: var(--error-tint); border-color: var(--error); color: var(--ink); }
.msg-ok { background: var(--ok-tint); border-color: var(--ok); color: var(--ink); }
.msg-info { background: var(--brand-tint); border-color: var(--brand); color: var(--ink); }
.msg-warn { background: var(--dev-tint); border-color: var(--dev); color: var(--ink); }
.msg[hidden] { display: none; }

/* ------------------------------------------------ tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--ink-3); background: var(--surface); font-size: var(--t-sm); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td a { font-weight: 500; }
.empty { padding: var(--s-4); text-align: center; color: var(--ink-3); }
th.sel, td.sel { width: 2.5rem; }
table.edit td { padding: 0.45rem 0.5rem; }
table.edit input { min-width: 9.5rem; }
table.edit input[type='number'] { min-width: 5.5rem; width: 6rem; }

.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  background: var(--planned-tint);
  color: var(--planned);
}
.tag-ok { background: var(--ok-tint); color: var(--ok); }
.tag-warn { background: var(--dev-tint); color: var(--dev); }
.tag-error { background: var(--error-tint); color: var(--error); }
.tag-brand { background: var(--brand-tint); color: var(--brand); }

.ip-list { display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; font-family: var(--font-mono); font-size: 0.8125rem; }

/* ------------------------------------------------ abas */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); margin-bottom: var(--s-3); overflow-x: auto; }
.tabs a { padding: 0.55rem 0.9rem; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 500; }

/* ------------------------------------------------ lista de prefixos do ASN */
.pfx-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s-2); }
.pfx-list { max-height: 18rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.35rem 0.6rem; }
.pfx-list label { font-family: var(--font-mono); font-weight: 400; font-size: 0.8125rem; margin: 0; padding: 0.15rem 0; }
.pfx-list .covered { color: var(--ink-3); }
h3 .btn-link { font-weight: 400; font-size: var(--t-sm); }
.secret { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.08em; word-break: break-all; background: var(--surface); padding: 0.6rem 0.8rem; border-radius: var(--radius); }
.codes { columns: 2; font-family: var(--font-mono); padding-left: 1.2rem; }
.link-box { display: flex; gap: var(--s-1); }
.link-box input { font-family: var(--font-mono); font-size: 0.8125rem; }

/* ------------------------------------------------ painel */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--s-2); }
.tile { display: flex; flex-direction: column; gap: 0.15rem; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s-2) var(--s-3); }
.tile-label { font-size: var(--t-sm); color: var(--ink-3); }
.tile-value { font-size: var(--t-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-bad { border-color: var(--error); background: var(--error-tint); }
.tile-warn { border-color: var(--dev); background: var(--dev-tint); }
.badge { display: inline-block; min-width: 1.25rem; padding: 0 0.35rem; border-radius: 999px; background: var(--error); color: #fff; font-size: 0.75rem; text-align: center; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0.35rem 0; font-size: 0.875rem; }
.timeline li::before { content: ''; position: absolute; left: calc(-1rem - 5px); top: 0.75rem; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li + li { margin-top: 0.4rem; }
.alerts { border-color: var(--error); }
.maint { justify-content: space-between; align-items: center; }

/* ------------------------------------------------ node */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--s-2); }
.cards .panel { padding: var(--s-2) var(--s-3); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem var(--s-2); margin: var(--s-2) 0 0; font-size: 0.875rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.reasons { margin: var(--s-1) 0 0; padding-left: 1.1rem; }
.reasons li + li { margin-top: 0.25rem; }
.err { color: var(--error); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-2); margin-top: var(--s-2); }
.chart { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.6rem 0.75rem; }
.chart figcaption { display: flex; justify-content: space-between; font-size: var(--t-sm); color: var(--ink-3); }
.chart figcaption strong { color: var(--ink); font-weight: 500; }
.spark { display: block; width: 100%; height: 4.5rem; margin-top: 0.35rem; }
.spark polyline { fill: none; stroke: var(--brand); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
pre.log, pre.code {
  margin: 0;
  max-height: 22rem;
  overflow: auto;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
details summary { cursor: pointer; padding: 0.3rem 0; font-size: 0.8125rem; }
details pre { margin-top: 0.35rem; }

@media (max-width: 40rem) {
  main { padding-top: var(--s-2); }
  .panel { padding: var(--s-2); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.badge.badge-warn { background: var(--brand); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s-2) var(--s-3); margin: 0; }
legend { padding: 0 0.35rem; font-weight: 500; }
.panel > .kv:first-child { margin-top: 0; }
[hidden] { display: none !important; }

/* ------------------------------------------------ terminal web */
.term-page { min-height: 100vh; display: flex; flex-direction: column; }
.term-title { flex: 1; font-family: var(--font-mono); font-size: var(--t-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-main { flex: 1; display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-2) var(--gutter); max-width: none; width: 100%; box-sizing: border-box; }
.term-intro { max-width: 46rem; margin: var(--s-4) auto; }
.term-wrap { flex: 1; min-height: 20rem; background: #0b1220; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.5rem; overflow: hidden; }
.term-replay { flex: 0 0 auto; overflow-x: auto; }
.term-status { color: var(--ink-3); }
.term-controls { align-items: center; }
.term-controls select { width: auto; }
.term-seek { width: 100%; accent-color: var(--brand); margin: 4px 0; }

/* QR Code do verificador: sempre fundo branco (leitura pela câmera em qualquer tema) */
.qr-box { display: flex; justify-content: center; }
.qr { border-radius: var(--radius); border: 1px solid var(--line); }

/* ------------------------------------------------ gráficos (paleta categórica validada, claro e escuro) */
:root { --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
  --q1: #86b6ef; --q2: #5598e7; --q3: #2a78d6; --q4: #1c5cab; --q5: #104281; --q6: #0d366b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --q1: #184f95; --q2: #256abf; --q3: #3987e5; --q4: #6da7ec; --q5: #9ec5f4; --q6: #cde2fb; }
}
/* Escolha manual no painel (botão de tema): vale mesmo com o sistema claro. */
:root[data-theme="dark"] { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
    --q1: #184f95; --q2: #256abf; --q3: #3987e5; --q4: #6da7ec; --q5: #9ec5f4; --q6: #cde2fb; }
.filters { align-items: end; }
.filters .field { min-width: 11rem; }
.filters > input, .filters > select { width: auto; min-width: 12rem; flex: 1 1 12rem; }
.lc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: var(--s-2); }
.lc { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.75rem 0.9rem; position: relative; min-width: 0; background: var(--paper); }
.lc figcaption { display: flex; justify-content: space-between; gap: var(--s-1); align-items: baseline; }
.lc-title { font-weight: 600; color: var(--ink); }
.lc-unit { font-size: var(--t-sm); color: var(--ink-3); }
.lc-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: var(--t-sm); color: var(--ink-2); margin-top: 0.35rem; }
.sw { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; background: var(--c); margin-right: 0.35rem; vertical-align: -0.05rem; }
.lc-plot { margin-top: 0.4rem; min-height: 190px; }
.lc-plot svg { display: block; }
.lc-gl { stroke: var(--line); stroke-width: 1; }
.lc-axis { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.lc-end { fill: var(--ink-2); font-size: 11px; }
.lc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lc-cross { stroke: var(--line-strong); stroke-width: 1; }
.lc-dot { stroke: var(--paper); stroke-width: 2; }
.lc-hit { fill: transparent; cursor: crosshair; touch-action: pan-y; }
.lc-tip { position: absolute; top: 3.2rem; z-index: 2; pointer-events: none; background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 0.4rem 0.6rem; font-size: var(--t-sm); color: var(--ink-2); box-shadow: 0 4px 14px rgb(0 0 0 / 0.12); white-space: nowrap; }
.lc-tip strong { display: block; color: var(--ink); margin-bottom: 0.15rem; }
.lc-tip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lc-data { margin-top: 0.4rem; }
.lc-data .table-wrap { max-height: 16rem; overflow: auto; }
.bars { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.bars li { display: grid; grid-template-columns: 7.5rem 1fr 4rem; gap: 0.6rem; align-items: center; font-size: var(--t-sm); }
.bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 0.75rem; background: var(--surface); border-radius: 4px; overflow: hidden; }
.bar { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 0 4px 4px 0; }
.bar-value { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ faixa de indicadores */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); }
.stat { padding: 0.85rem 1rem; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat dt { font-size: var(--t-sm); color: var(--ink-3); }
.stat dd { margin: 0.2rem 0 0; display: flex; flex-direction: column; }
.stat strong { font-size: 1.375rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat dd span { font-size: 0.8125rem; color: var(--ink-3); }
.stat-crit { box-shadow: inset 0 3px 0 var(--error); }
.stat-crit strong { color: var(--error); }
.stat-warn { box-shadow: inset 0 3px 0 var(--dev); }
@media (max-width: 40rem) { .stat { border-left: 0; border-top: 1px solid var(--line); } .stat:first-child { border-top: 0; } }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); }

/* ------------------------------------------------ mapa de saúde dos nodes */
.hmap-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; list-style: none; margin: 0; padding: 0; font-size: var(--t-sm); color: var(--ink-2); }
.hmap-legend li { display: flex; align-items: center; gap: 0.4rem; }
.hmap-group { margin-top: var(--s-2); }
.hmap-group h3 { font-size: 0.95rem; font-weight: 600; display: flex; align-items: baseline; gap: 0.4rem; }
.hmap-group h3 a { color: var(--ink); text-decoration: none; }
.hmap-group h3 a:hover { text-decoration: underline; }
.hmap-nodes { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 0.5rem; }
.hm { display: grid; gap: 0.15rem; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--paper); border-left-width: 3px; }
.hm:hover { border-color: var(--line-strong); background: var(--surface); }
.hm-name { display: flex; align-items: center; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-state { font-size: 0.8125rem; color: var(--ink-2); }
.hm-metrics { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; font-size: 0.75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hm-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; flex: none; }
.hm-ok { border-left-color: var(--ok); } .hm-dot.hm-ok { background: var(--ok); }
.hm-warn { border-left-color: var(--dev); } .hm-dot.hm-warn { background: var(--dev); }
.hm-crit { border-left-color: var(--error); } .hm-dot.hm-crit { background: var(--error); }
.hm-crit .hm-state { color: var(--error); font-weight: 500; }
.hm-maint { border-left-color: var(--brand); } .hm-dot.hm-maint { background: var(--brand); }
.hm-pend { border-left-color: var(--line-strong); border-left-style: dashed; } .hm-dot.hm-pend { background: transparent; border: 2px solid var(--line-strong); }
.btn-sm { min-height: 2rem; padding: 0.3rem 0.7rem; font-size: var(--t-sm); }
.table-wrap { position: relative; }
/* Indicadores (mesmo desenho da faixa do painel) */
.tiles { gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.tiles .tile { border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 0.85rem 1rem; background: none; }
.tiles .tile:first-child { border-left: 0; }
.tiles .tile-value { font-size: 1.375rem; }
.tiles .tile-bad { background: none; box-shadow: inset 0 3px 0 var(--error); }
.tiles .tile-bad .tile-value { color: var(--error); }
.tiles .tile-warn { background: none; box-shadow: inset 0 3px 0 var(--dev); }
@media (max-width: 40rem) { .tiles .tile { border-left: 0; border-top: 1px solid var(--line); } .tiles .tile:first-child { border-top: 0; } }
.bars-wide li { grid-template-columns: minmax(8rem, 15rem) 1fr 4rem; }
.bars-wide .bar-label { font-size: 0.8125rem; }
.msg + .tabs { margin-top: var(--s-2); }
.nowrap { white-space: nowrap; }

/* CPU por núcleo (página do node) */
.cores { display: flex; align-items: flex-end; gap: 3px; height: 2.25rem; max-width: 22rem; }
.core { flex: 1; min-width: 4px; max-width: 1.25rem; height: 100%; background: color-mix(in srgb, var(--line) 60%, transparent); border-radius: 2px; display: flex; align-items: flex-end; overflow: hidden; }
.core-use { width: 100%; background: var(--brand); display: flex; align-items: flex-end; }
.core-hot .core-use { background: var(--error); }
.core-soft { width: 100%; background: color-mix(in srgb, var(--paper) 45%, transparent); }

/* Uplinks OSPF (ajustes do node) */
.uplinks input, .uplinks select { min-width: 0; width: 100%; }
.uplinks td:first-child { min-width: 7rem; }
.uplinks td:nth-child(5) { min-width: 9rem; }
.uplinks td:nth-child(5) input { margin-top: 0.3rem; }
.uplinks td:nth-child(3) { min-width: 6.5rem; }
.uplinks + * , .table-wrap:has(.uplinks) ~ p:last-child { margin-bottom: var(--s-2); }

/* Captura de pacotes */
.capture-out { max-height: 28rem; overflow: auto; white-space: pre; font-size: 0.78rem; line-height: 1.45; }
.panel form > .grid2 + .grid2 { margin-top: var(--s-1); }

/* Testar resolução */
tr.row-warn td { background: color-mix(in srgb, var(--dev-tint, #fff4e0) 60%, transparent); }
.stack-sm { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; }

/* RPKI: etapas até as ROAs (ASN → registro.br → certificado → publicação). */
.rpki-head { align-items: center; justify-content: space-between; }
.rpki-head h2 { margin: 0; }
.panel > .rpki-head + .steps { margin-top: var(--s-3); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--s-1); counter-reset: st; }
.steps li { counter-increment: st; border-top: 2px solid var(--line); padding-top: 0.4rem; font-size: var(--t-sm); color: var(--ink-3); }
.steps li::before { content: counter(st) '. '; font-family: var(--font-mono); }
.steps li.done { border-color: var(--ok); color: inherit; }
.steps-3 li::before { content: none; }
.steps li.now { border-color: var(--brand); color: inherit; font-weight: 600; }
/* RPKI: lista de contas (uma linha cada, com link para a página da conta) e a página da conta. */
.rpki-table { align-items: stretch; }
.rpki-table table { width: 100%; }
.rpki-table > .stack-sm { align-items: stretch; }
.rpki-acc { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.rpki-acc > a { font-weight: 600; overflow-wrap: anywhere; }
.rpki-next { color: var(--brand); font-weight: 600; }
.rpki-pfx { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.6rem; }
/* Os números do topo da conta são botões: cada um vira o filtro da aba Prefixos. */
.rpki-kpis { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); margin: var(--s-2) 0; }
button.stat { font: inherit; color: inherit; text-align: left; background: none; border: 0; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.2rem; cursor: pointer; transition: background-color 120ms ease-out; }
button.stat:first-child { border-left: 0; }
button.stat:hover:not(:disabled) { background: var(--surface); }
button.stat[aria-pressed=true] { background: var(--brand-tint); }
button.stat[aria-pressed=true] .stat-l { color: var(--brand); font-weight: 600; }
button.stat:disabled { cursor: default; }
button.stat:disabled strong { color: var(--ink-3); }
.stat-l { font-size: var(--t-sm); color: var(--ink-3); }
@media (max-width: 40rem) { button.stat { border-left: 0; } }
@media (prefers-reduced-motion: reduce) { button.stat { transition: none; } }
.tabs button .seg-n { margin-left: 0.4rem; }
.seg-n.seg-bad { color: var(--error); opacity: 1; font-weight: 600; }
.rpki-tools { justify-content: space-between; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.rpki-tools input[type=search] { flex: 1 1 12rem; max-width: 24rem; width: auto; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.seg button { font: inherit; font-size: 0.8125rem; min-height: 2.25rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink-2); cursor: pointer; display: inline-flex; gap: 0.4rem; align-items: center; }
.seg button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.seg-n { font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.8; }
.rpki-add .field { flex: 1 1 14rem; }
.rpki-add-panel { margin-top: var(--s-3); }
@media (pointer: coarse) { .seg button { min-height: 2.75rem; } }
@media (max-width: 480px) {
  .rpki-tools input[type=search] { max-width: none; }
}
.rpki-howto { padding-left: 1.2rem; }
.rpki-step2 > summary { cursor: pointer; }
.rpki-step2[open] > summary { margin-bottom: var(--s-2); }
.rpki-howto > li > p:first-child { margin-top: 0; }
.tag { white-space: nowrap; }
.code-box { position: relative; }
.code-box .code-copy { position: absolute; top: 0.5rem; right: 0.5rem; }
.code-box pre.code { padding-right: 6.5rem; }

/* Links de navegação: sem sublinhado em tabelas, trilha e menus; volta no hover e no foco. */
table a, .crumbs a, .sec-head a { text-decoration: none; font-weight: 500; }
table a:hover, table a:focus-visible, .crumbs a:hover, .sec-head a:hover { text-decoration: underline; }
.table-wrap + p { margin-top: var(--s-1); }

/* Incidentes: severidade na borda da linha; resolvidos atenuados. */
.inc-table td:first-child { border-left: 3px solid transparent; }
.inc-row.sev-critical td:first-child { border-left-color: var(--error); }
.inc-row.sev-warning td:first-child { border-left-color: var(--dev); }
.inc-row:not(.is-done) .inc-title { font-weight: 600; }
.inc-row.is-done td { color: var(--ink-3); }
.inc-row.is-done td:first-child { border-left-color: var(--line); }
.inc-row.is-done .inc-title { color: var(--ink-2, var(--ink-3)); font-weight: 400; }

/* Faixa de incidentes em andamento (topo do painel). */
.inc-banner { border: 1px solid var(--line); border-left: 4px solid var(--dev); border-radius: var(--radius-lg); padding: var(--s-2) var(--s-3); background: var(--dev-tint); }
.inc-banner.sev-critical { border-left-color: var(--error); background: var(--error-tint); }
.inc-banner-head { display: flex; align-items: center; gap: var(--s-1); flex-wrap: wrap; }
.inc-banner-head .ico { color: var(--dev); }
.inc-banner.sev-critical .inc-banner-head .ico { color: var(--error); }
.inc-banner-head a { margin-left: auto; }
.inc-banner ul { list-style: none; margin: var(--s-1) 0 0; padding: 0; }
.inc-banner li { padding: 0.2rem 0; }
.inc-banner li a { font-weight: 600; }

/* Alertas ativos do node: um cartão por alerta, com a severidade na borda. */
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.alert-item { display: flex; gap: var(--s-2); align-items: center; justify-content: space-between; flex-wrap: wrap;
  border: 1px solid var(--line); border-left: 3px solid var(--dev); border-radius: var(--radius); padding: var(--s-1) var(--s-2); }
.alert-item.sev-critical { border-left-color: var(--error); }
.alert-item p { margin: 0.25rem 0 0; }
.stack > .inc-banner + .stats { margin-top: var(--s-3); }
.inc-banner .tag { background: var(--paper); }
.inc-banner a { text-decoration: none; }
.inc-banner a:hover, .inc-banner a:focus-visible { text-decoration: underline; }
tr.row-warn td { background: var(--error-tint); }
label.check { display: inline-flex; gap: 0.5rem; align-items: center; cursor: pointer; }
.alert-item.sev-info { border-left-color: var(--line); }

/* Faixa de incidentes em andamento (todas as páginas do cliente, menos o painel e a lista de incidentes). */
.alert-strip { display: flex; align-items: center; gap: var(--s-1); flex-wrap: wrap; margin-bottom: var(--s-3);
  border: 1px solid var(--line); border-left: 4px solid var(--dev); border-radius: var(--radius-lg); padding: 0.6rem var(--s-2); background: var(--dev-tint); }
.alert-strip.sev-critical { border-left-color: var(--error); background: var(--error-tint); }
.alert-strip .ico { color: var(--dev); }
.alert-strip.sev-critical .ico { color: var(--error); }
.alert-strip .btn { margin-left: auto; }
.alert-strip a:not(.btn) { font-weight: 600; text-decoration: none; }
.login-alert h2 { gap: 0.5rem; align-items: center; }

/* Anycast e roteamento: escolha do protocolo e histórico da atualização em sequência */
.choice { display: grid; gap: 0.4rem; justify-items: start; }
td .check { margin-top: 0.3rem; }
.log-list { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: 0.45rem; }
.log-list .tag { margin: 0.25rem 0.3rem 0 0; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: var(--s-3); }
.kv dd .tag { white-space: normal; }

/* ------------------------------------------------ saúde da plataforma (equipe V2) */
.health-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); }
.health-head h2 { font-size: 1rem; margin: 0; min-width: 0; }
.health-head .tag { flex-shrink: 0; }
.health-critico { box-shadow: inset 0 3px 0 var(--error); }
.health-atencao { box-shadow: inset 0 3px 0 var(--dev); }
.health-desligado { opacity: 0.72; }
.health-act { overflow-wrap: anywhere; }

/* ------------------------------------------------ RPKI: tabela com busca, filtros e páginas */
.tabs button { font: inherit; padding: 0.55rem 0.9rem; min-height: 2.75rem; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 500; }
.seg-label { align-self: center; margin-right: 0.25rem; }
.seg button:disabled { opacity: 0.45; cursor: default; }
.th-sort { font: inherit; font-weight: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
.pager { justify-content: center; align-items: center; gap: var(--s-2); }
.row.tags { gap: 0.25rem; flex-wrap: wrap; }
.stack-table tr.hit td { background: var(--brand-tint); }
.hold-asn + .hold-asn { margin-top: var(--s-1); }
/* Celular: cada linha vira um bloco com o nome da coluna ao lado do valor (sem rolagem horizontal). */
@media (max-width: 640px) {
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { padding: var(--s-1) 0; border-bottom: 1px solid var(--line); }
  .stack-table td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s-1); padding: 0.25rem 0; border: 0; text-align: left; }
  .stack-table td::before { content: attr(data-label); color: var(--ink-3); font-size: 0.8125rem; font-family: var(--font-sans, inherit); }
  .stack-table td.num { text-align: left; }
}

/* Faixa do ambiente de homologação (V2DNS_ENV=homologacao). */
.env-strip { background: var(--dev); color: var(--paper); font-weight: 600; font-size: 0.8125rem; text-align: center; padding: 0.35rem var(--s-2); letter-spacing: 0.02em; }
/* Acesso Remoto: tela do WinBox (canvas do Guacamole). */
.wb-wrap { background: #0b1220; border-radius: var(--radius-lg); overflow: hidden; width: 100%; }
.wb-wrap > div { margin: 0 auto; }
