/* ═══════════════════════════════════════════════════════════════
   WA PRO API  design system do painel
   Dark sofisticado, verde-esmeralda calibrado, glass sutil,
   micro-interações curtas e layout 100% responsivo.
   ═══════════════════════════════════════════════════════════════ */
:root {
  /* paleta — identidade visual Invisivel (WA Pro API) */
  --bg: #04060a;
  --bg-soft: #080c12;
  --surface: #0b1017;
  --surface-2: #10161f;
  --surface-3: #16202b;
  --line: rgba(255, 255, 255, .08);
  --line-soft: rgba(255, 255, 255, .05);
  --text: #e9eef5;
  --text-2: #aab5c4;
  --text-3: #6d7889;
  --muted: #8695a9;

  --brand: #00e58f;
  --brand-2: #5cf5bd;
  --brand-3: #00a86b;
  --brand-ink: #04231a;
  --brand-glow: rgba(0, 229, 143, .18);
  --brand-cyan: #00c2ff;
  --grad: linear-gradient(135deg, #00e58f 0%, #00c2ff 100%);
  --grad-ai: linear-gradient(135deg, #8f6bff 0%, #4f8bff 55%, #00c2ff 100%);
  --grad-wa: linear-gradient(150deg, #25d366 0%, #128c7e 100%);
  --glow: 0 0 0 1px rgba(0, 229, 143, .35), 0 8px 30px -6px rgba(0, 229, 143, .35);

  --blue: #3ba7ff;
  --violet: #7c5cff;
  --amber: #ffb547;
  --red: #ff5c7a;
  --pink: #f472b6;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 22px;

  --sh-1: 0 1px 2px rgba(0,0,0,.5);
  --sh-2: 0 10px 30px -14px rgba(0,0,0,.8);
  --sh-3: 0 24px 60px -20px rgba(0,0,0,.85);
  --ring: 0 0 0 3px rgba(0,229,143,.28);

  --sidebar-w: 254px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Sora', 'Inter', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;
  --t: 160ms cubic-bezier(.4,0,.2,1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(0,229,143,.10), transparent 60%),
    radial-gradient(900px 600px at 92% 4%, rgba(0,194,255,.10), transparent 62%),
    radial-gradient(700px 520px at 60% 112%, rgba(124,92,255,.08), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
[hidden] { display: none !important; }

/* ───────── login ───────── */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.login-card {
  width: min(404px, 100%);
  background: linear-gradient(180deg, rgba(21,31,44,.94), rgba(14,20,29,.97));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 34px 30px 28px;
  box-shadow: var(--sh-3), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
  animation: rise .38s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; }
.brand-lg { padding: 0 0 24px; gap: 16px; align-items: center; }
.brand-lg > div { display: grid; gap: 4px; min-width: 0; }
.brand-lg h1 { font-size: 21px; letter-spacing: -.015em; line-height: 1.15; }
.brand-lg p { color: #c3cddb; font-size: 12.5px; line-height: 1.4; }
.login-card > .hint { text-align: center; margin-top: 18px; color: #b3bfcf; }

/* ── login: marca no topo, cartão centralizado ── */
.login-brand { padding: 0 0 18px; gap: 14px; }
.login-brand .brand-mark { width: 52px; height: 52px; flex-basis: 52px; border-radius: 15px; }
.login-kicker {
  font-family: 'Sora', Inter, sans-serif; font-size: 10px; font-weight: 700;
  letter-spacing: .26em; text-transform: uppercase; color: var(--text-2); line-height: 1;
  margin-bottom: 5px;
}
.login-title { font-size: 20px; line-height: 1.2; letter-spacing: -.02em; margin: 0; }
.login-sub { color: #c9d5e4; font-size: 13px; line-height: 1.55; margin: 0 0 20px; }
.login-foot {
  text-align: center; margin: 18px 0 0; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  color: #9fb0c4; font-size: 12px; letter-spacing: .02em;
}
.login-foot b { color: #d7e3f1; font-weight: 600; }
#login-form .field { margin-bottom: 18px; }
#login-form .btn-block { margin-top: 2px; }
.brand-mark {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  display: grid; place-items: center; overflow: hidden;
  background: #04100b;
  border: 1px solid rgba(0,229,143,.26);
  box-shadow: 0 10px 24px -14px rgba(0,229,143,.7), inset 0 1px 0 rgba(255,255,255,.06);
}
.brand-mark img, .brand-mark svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-lg .brand-mark { width: 54px; height: 54px; flex-basis: 54px; border-radius: 16px; }
.brand-txt { display: grid; line-height: 1.25; }

.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--text); letter-spacing: .01em; }
input, select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text); font: inherit; font-size: 13.5px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
input::placeholder, textarea::placeholder { color: #5b6a7d; }
input:hover, select:hover, textarea:hover { border-color: #2c3d54; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: var(--ring); background: var(--surface-3);
}
textarea { min-height: 84px; resize: vertical; font-family: var(--mono); font-size: 12.5px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
label.check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
label.check input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
/* toggle em forma de cartão (higienização / ajustes avançados) */
label.check { padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: rgba(255,255,255,.012); transition: border-color var(--t), background var(--t); }
label.check:hover { border-color: rgba(148,163,184,.3); background: rgba(255,255,255,.03); }
label.check:has(input:checked) { border-color: rgba(0,229,143,.34); background: rgba(0,229,143,.055); }
label.check input:checked + span { color: var(--text); font-weight: 550; }
/* utilidades */
.ta-r { text-align: right; }
.ta-c { text-align: center; }

/* ───────── botões ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--r-sm);
  border: 1px solid rgba(148,163,184,.26);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 550;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  cursor: pointer; white-space: nowrap;
  transition: transform var(--t), background var(--t), border-color var(--t), box-shadow var(--t), color var(--t);
}
.btn:hover { background: var(--surface-3); border-color: #2e405a; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--grad);
  border-color: transparent; color: var(--brand-ink); font-weight: 700;
  box-shadow: 0 10px 26px -12px rgba(0,229,143,.75);
}
.btn-primary:hover { background: linear-gradient(150deg, #5cf5bd, var(--brand-cyan)); box-shadow: 0 12px 26px -10px var(--brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255,255,255,.055); color: var(--text); border-color: transparent; }
.btn-danger { color: #fecaca; border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10); }
.btn-danger:hover { background: rgba(239,68,68,.18); border-color: rgba(239,68,68,.55); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────── shell ───────── */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(16,23,34,.9), rgba(9,13,19,.96));
  border-right: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.nav { display: grid; gap: 2px; padding: 6px 10px; overflow-y: auto; flex: 1; align-content: start; }
.nav-group {
  margin: 14px 0 5px; padding: 0 11px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3, #64748b); opacity: .85;
}
.nav-group:first-child { margin-top: 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  text-decoration: none; position: relative;
  transition: background var(--t), color var(--t), transform var(--t);
}
.nav a .ico {
  width: 17px; height: 17px; flex: 0 0 17px;
  opacity: .68; color: currentColor;
  transition: opacity var(--t), color var(--t), transform var(--t);
}
.nav a:hover { background: rgba(255,255,255,.045); color: var(--text); text-decoration: none; }
.nav a:hover .ico { opacity: .95; transform: translateX(1px); }
.nav a.active {
  background: linear-gradient(90deg, rgba(0,229,143,.16), rgba(0,229,143,.03));
  color: #d7fbec;
}
.nav a.active::before {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; border-radius: 3px;
  background: var(--brand); box-shadow: 0 0 12px var(--brand);
}
.nav a.active .ico { opacity: 1; color: var(--brand-2); }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────── rodapé da barra lateral ───────── */
.sidebar-foot { padding: 12px; display: grid; gap: 9px; border-top: 1px solid var(--line-soft); }
.side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.side-stat {
  display: grid; gap: 1px; padding: 8px 10px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.side-stat .n { font-size: 15px; font-weight: 650; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.side-stat .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3, #7c8aa0); }
.side-stat.ok .n { color: var(--brand-2); }
.sidebar-foot .btn-block { justify-content: center; }
.side-version {
  text-align: center; font-size: 10.5px; letter-spacing: .04em;
  color: var(--text-3, #7c8aa0); font-variant-numeric: tabular-nums;
  padding: 2px 0 0; opacity: .85;
}

/* ───────── botões só-ícone e spinner ───────── */
.btn-icon { padding: 7px; line-height: 1; }
.btn-icon .ico { width: 16px; height: 16px; display: block; }
.btn .ico { width: 15px; height: 15px; flex: 0 0 auto; }
.btn { display: inline-flex; align-items: center; gap: 7px; }
.btn.spin .ico { animation: spin .7s linear; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.pill {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--text-2);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.pill.ok .dot { background: var(--brand); box-shadow: 0 0 0 3px rgba(0,229,143,.18); animation: pulse 2.4s infinite; }
.pill.bad .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 16px;
  padding: 15px 26px;
  background: rgba(8,11,17,.78);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
}
.topbar-title { min-width: 0; }
.topbar-title h2 { font-size: 17px; line-height: 1.25; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip {
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 550;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  white-space: nowrap;
}
.chip-ok { color: #b8f5d8; border-color: rgba(0,229,143,.38); background: rgba(0,229,143,.12); }
.chip-off { color: #fecaca; border-color: rgba(239,68,68,.32); background: rgba(239,68,68,.10); }
.view { padding: 22px 26px 60px; flex: 1; }

/* ───────── cards e grids ───────── */
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card {
  background: linear-gradient(180deg, rgba(21,31,44,.75), rgba(13,19,27,.85));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--sh-2), inset 0 1px 0 rgba(255,255,255,.025);
  position: relative; overflow: hidden;
}
.card.pad-0 { padding: 0; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .spacer { margin-left: auto; }
.card-sub { color: var(--muted); font-size: 12.5px; }
.subhead { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.subhead::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }

.stat { display: grid; gap: 6px; }
.stat .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat .d { font-size: 12px; color: var(--muted); }
.stat.accent .v { background: linear-gradient(120deg, var(--brand-2), #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ───────── central de ações (visão geral) ───────── */
.card.act-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px;
  background:
    radial-gradient(120% 220% at 0% 0%, rgba(34, 197, 148, .10), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0));
  border: 1px solid var(--line);
}
.card.act-bar .act-info { display: grid; gap: 3px; min-width: 220px; }
.card.act-bar .act-info strong { font-size: 13.5px; letter-spacing: -.01em; }
.card.act-bar .act-info .sub { font-size: 12px; color: var(--muted); }
.card.act-bar .btn-row { margin-left: auto; }
.card.act-bar .btn { white-space: nowrap; }
@media (max-width: 720px) {
  .card.act-bar .btn-row { margin-left: 0; width: 100%; }
  .card.act-bar .btn { flex: 1 1 auto; justify-content: center; }
}

/* ───────── tabelas ───────── */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 10px 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 650;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.015);
  white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr { transition: background var(--t); }
tbody tr:hover { background: rgba(255,255,255,.028); }
tbody tr:last-child td { border-bottom: none; }
td .title { font-weight: 600; }
td .sub { color: var(--muted); font-size: 12px; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 13px; }
.empty strong { display: block; color: var(--text-2); margin-bottom: 6px; font-size: 14px; }
.empty-act { margin-top: 14px; }

/* ───────── tabela de proxies (pool) ───────── */
.pxs-sum { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; }
.pxs-sum b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.pxs-sum b.ok { color: #7ef2c8; }
.pxs-table td { vertical-align: middle; }
.pxs-table tbody tr:hover { background: rgba(148,163,184,.06); }
.pxs-table th:last-child, .pxs-table td:last-child { padding-right: 14px; }
.px-name { font-weight: 650; color: var(--text); letter-spacing: .01em; font-size: 13.5px; white-space: nowrap; }
.px-meta {
  margin-top: 3px; font-family: var(--mono); font-size: 11px; letter-spacing: .02em;
  text-transform: uppercase; color: #b9c4d3;
}
.px-addr {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 9px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  font-family: var(--mono); font-size: 12px; color: #cfd9e6;
  white-space: nowrap; letter-spacing: .01em;
}
.px-addr b {
  padding: 1px 6px; border-radius: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #7ef2c8; background: rgba(0,229,143,.10); border: 1px solid rgba(0,229,143,.22);
}
.px-addr i { font-style: normal; color: var(--muted); font-size: 11px; }
.px-lat {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.px-lat.good { color: #86efc0; }
.px-lat.mid { color: #e9d39b; }
.px-lat.bad { color: #eda6a6; }
.px-lat.none { color: var(--muted); font-weight: 500; }
.px-who-list { display: inline-flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.px-who {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 6px;
  font-family: var(--mono); font-size: 11px;
  color: #dbe4f0; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
}
.px-who.more { color: var(--text-2); background: rgba(255,255,255,.04); }
.px-who.free {
  color: var(--muted); background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.08);
}
.px-acts { text-align: right; white-space: nowrap; }
.px-acts .btn + .btn { margin-left: 6px; }


/* ───────── badges ───────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: #7ef2c8; background: rgba(0,229,143,.12); border-color: rgba(0,229,143,.3); }
.badge.warn { color: #fcd34d; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); }
.badge.bad { color: #ffc4c4; background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.42); }
.badge.idle { color: #b3c0d1; background: rgba(148,163,184,.14); border-color: rgba(148,163,184,.32); }
.badge.info { color: #93c5fd; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.3); }
.badge.plain { color: var(--text-2); background: var(--surface-2); border-color: var(--line); }
.badge.plain::before { display: none; }

/* ───────── barras ───────── */
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-3), var(--brand-2)); transition: width .4s ease; }
.bar.warn > i { background: linear-gradient(90deg, #b45309, var(--amber)); }
.bar.bad > i { background: linear-gradient(90deg, #b91c1c, var(--red)); }

/* ───────── charts ───────── */
.spark { display: flex; align-items: flex-end; gap: 6px; height: 118px; padding-top: 8px; }
.spark .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; position: relative; }
.spark .col i { display: block; border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .5s cubic-bezier(.2,.8,.2,1); }
.spark .col i.out { background: linear-gradient(180deg, var(--brand-2), rgba(0,229,143,.35)); }
.spark .col i.in { background: linear-gradient(180deg, #60a5fa, rgba(59,130,246,.3)); }
.spark .col span { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }

/* ───────── modal ───────── */
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,7,11,.72); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 22px;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-card {
  width: min(620px, 100%); max-height: 90vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #141d29, #0e151e);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: rise .24s cubic-bezier(.2,.8,.2,1);
}
.modal-head { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 15px; }
.modal-head .btn { margin-left: auto; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ───────── toasts ───────── */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 9px; }
.toast {
  min-width: 240px; max-width: 380px;
  padding: 11px 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: var(--sh-2); font-size: 13px;
  animation: slidein .22s cubic-bezier(.2,.8,.2,1);
  border-left: 3px solid var(--brand);
}
.toast.err { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
@keyframes slidein { from { opacity: 0; transform: translateX(18px); } }

/* ───────── util ───────── */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.stack.tight { gap: 8px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }
.sep { height: 1px; background: var(--line-soft); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.secret-box {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: var(--r-sm);
  background: rgba(0,229,143,.07); border: 1px dashed rgba(0,229,143,.4);
  font-family: var(--mono); font-size: 12.5px; word-break: break-all;
}
.qr-box { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: var(--r); overflow: hidden; }
.qr-box img { width: min(250px, 100%); height: auto; image-rendering: pixelated; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  padding: 9px 14px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer;
  transition: color var(--t), border-color var(--t); white-space: nowrap;
}
.tabs button:hover { color: var(--text-2); }
.tabs button.active { color: var(--brand-2); border-bottom-color: var(--brand); }
.chk-list { display: grid; gap: 9px; }
.chk {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-soft);
}
.chk .mark { width: 19px; height: 19px; flex: 0 0 19px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; margin-top: 1px; }
.chk .body { min-width: 0; flex: 1 1 auto; }
.chk.ok .mark { background: rgba(0,229,143,.16); color: var(--brand-2); }
.chk.no .mark, .chk.bad .mark { background: rgba(239,68,68,.14); color: #fca5a5; }
.chk.warn .mark { background: rgba(245,158,11,.14); color: var(--amber); }
.chk.idle .mark { background: rgba(148,163,184,.14); color: var(--text-3); }
.chk .t { font-weight: 550; font-size: 13px; }
.chk .s { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; }
.chart-wrap { position: relative; }
.chart-empty {
  position: absolute; inset: 0; display: grid; gap: 3px; place-content: center; text-align: center;
  padding: 8px 20px; pointer-events: none;
}
.chart-empty strong { display: block; font-size: 13px; color: var(--text-2); }
.chart-empty span { display: block; font-size: 11.5px; color: var(--muted); max-width: 340px; }
.chart-wrap.empty { display: grid; place-items: center; min-height: 148px; }
.card-fill { display: flex; flex-direction: column; }
.card-fill .card-head { flex: 0 0 auto; }
.card-fill .chart-wrap { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: flex-end; }
.card-fill .chart-wrap.empty { justify-content: center; }
.chart-empty.static { position: static; inset: auto; }
.chart-empty.static strong { font-size: 13.5px; }
.only-mobile { display: none; }

/* ═══════════ polimento 2026 · barra lateral, botões e tabelas ═══════════ */
/* ícones da navegação viram "pastilhas" com brilho no item ativo */
.nav a .ico {
  width: 17px; height: 17px; padding: 5px; box-sizing: content-box;
  border-radius: 9px; background: rgba(148,163,184,.07);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav a:hover .ico { background: rgba(148,163,184,.14); transform: none; }
.nav a.active .ico {
  background: linear-gradient(150deg, rgba(0,229,143,.28), rgba(0,229,143,.10));
  color: #d7fbec; box-shadow: 0 0 0 1px rgba(0,229,143,.28) inset, 0 6px 16px -10px rgba(0,229,143,.9);
}
.nav a.active {
  background: linear-gradient(90deg, rgba(0,229,143,.16), rgba(0,229,143,.02) 78%);
  box-shadow: 0 0 0 1px rgba(0,229,143,.20) inset;
}
.nav a.active::before { box-shadow: 0 0 12px 1px rgba(0,229,143,.85); }
.nav a { border-radius: 10px; transition: background .16s ease, color .16s ease, box-shadow .16s ease; }
.nav a:focus-visible { outline: 2px solid rgba(0,229,143,.55); outline-offset: 2px; }
.nav-group { letter-spacing: .10em; }

/* botões: relevo, foco acessível e ícone alinhado */
.btn { font-weight: 560; letter-spacing: .01em; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.btn:focus-visible { outline: 2px solid rgba(0,229,143,.55); outline-offset: 2px; }
.btn-primary { box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 10px 22px -14px rgba(0,229,143,.95); }
.btn-sm { min-height: 27px; }
.btn-row { align-items: center; }
.btn-block { justify-content: center; }

/* cabeçalho de card com divisória sutil e ações alinhadas à direita */
.card-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-head .btn-row { margin-left: auto; }

/* tabelas: linha ativa e cabeçalho fixo ao rolar */
.table-wrap table tbody tr { transition: background .14s ease; }
.table-wrap table tbody tr:hover { background: rgba(148,163,184,.055); }
.table-wrap table tbody td { vertical-align: middle; }

/* barra lateral com profundidade e um fio de luz no topo */
.sidebar { background: linear-gradient(185deg, rgba(148,163,184,.055), transparent 42%), var(--surface-1, #0f172a); }
.brand { position: relative; }
.brand::after {
  content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, rgba(0,229,143,.42), transparent 72%);
}
.side-stat { transition: border-color .18s ease, background .18s ease; }
.side-stat:hover { border-color: rgba(0,229,143,.32); background: rgba(0,229,143,.06); }

/* barra de rolagem discreta em toda a interface */
.sidebar, .nav, .table-wrap, .modal-body { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.30) transparent; }
.sidebar::-webkit-scrollbar, .nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar, .modal-body::-webkit-scrollbar { width: 9px; height: 9px; }
.sidebar::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb, .modal-body::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.26); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box;
}
.sidebar::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,.42); background-clip: padding-box; }

/* ───────── avatar do chip (foto de perfil da instância) ───────── */
.chip-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(0,229,143,.28), transparent 55%),
    var(--surface-3);
  border: 2px solid rgba(0,229,143,.35);
  box-shadow: 0 4px 14px -4px rgba(0,229,143,.45), var(--sh-1);
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700; color: var(--brand-2);
  letter-spacing: .5px; text-transform: uppercase;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
tr:hover .chip-avatar { transform: scale(1.06); border-color: rgba(0,229,143,.6); box-shadow: 0 6px 20px -4px rgba(0,229,143,.6); }
.chip-avatar.chip-avatar--sm { width: 32px; height: 32px; font-size: 12px; border-width: 1.5px; }
.chip-avatar.chip-avatar-fallback {
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(0,229,143,.32), transparent 60%),
    linear-gradient(150deg, #0d3b2e 0%, #0b1017 100%);
  border-color: rgba(0,229,143,.28);
}

pre.code { margin: 12px 0 0; padding: 12px 14px; background: #060a0f; border: 1px solid var(--line); border-radius: var(--r-sm); font-family: var(--mono); font-size: 12px; line-height: 1.55; overflow-x: auto; white-space: pre; }

/* ───────── responsivo ───────── */
@media (max-width: 1080px) {
  .grid.c4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 272px;
    transform: translateX(-102%);
    transition: transform .24s cubic-bezier(.2,.8,.2,1);
    box-shadow: var(--sh-3);
  }
  .sidebar.open { transform: none; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px 16px 50px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 3px 0; }
  .kv dd { margin-bottom: 8px; }
  .chip { display: none; }
  .toasts { left: 14px; right: 14px; }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ───────── scanner de proxies ───────── */
.scan-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scan-controls select { width: auto; min-width: 150px; padding: 8px 30px 8px 11px; font-size: 12.5px; }
.scan-status {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px; margin-bottom: 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--text-2);
}
.scan-status .sub { color: var(--muted); }
.scan-status-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.scan-status-line .badge { flex: 0 0 auto; }
.scan-status-line .sub { flex: 1 1 auto; }
.scan-status-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* chips de estatística do scan */
.scan-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.scan-stats .stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-3); border: 1px solid var(--line-soft);
}
.scan-stats .stat b { font-family: var(--display); font-size: 17px; font-weight: 650; color: var(--text); letter-spacing: -.01em; }
.scan-stats .stat b.c-ok { color: var(--brand-2); }
.scan-stats .stat b.c-cyan { color: #7dd3fc; }
.scan-stats .stat b.c-warn { color: #fbbf24; }
.scan-stats .stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
/* barra de progresso viva do scan */
.scan-bar {
  width: 100%; height: 6px; margin-top: 2px; border-radius: 999px;
  background: var(--surface-3); overflow: hidden; position: relative;
}
.scan-bar-fill {
  height: 100%; border-radius: 999px;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(0,229,143,.55);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}
.scan-bar-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-100%);
  animation: scan-shimmer 1.6s linear infinite;
}
@keyframes scan-shimmer { to { transform: translateX(100%); } }
.scan-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.scan-table td { vertical-align: middle; }
.scan-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.scan-table th { white-space: nowrap; }
/* O scanner tem 10 colunas: a tabela rola no eixo X (table-wrap) em vez de
   espremer as células. Sem nowrap o nome do ISP quebrava em 3 linhas,
   desalinhava a linha inteira e empurrava a coluna Reputação para fora. */
.scan-table { white-space: nowrap; }
.scan-table td { white-space: nowrap; }
.scan-table .isp-name {
  display: inline-block; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; vertical-align: bottom;
}
/* 10 colunas precisam caber em 1280px: célula enxuta (fonte 12px, padding 8px)
   em vez de espremer o texto. O anonimato saiu da coluna Proxy e passou a
   acompanhar o Tipo, devolvendo ~60px para as outras colunas. */
.scan-table th, .scan-table td { padding: 8px 8px; font-size: 12px; }
.scan-table .isp-name { max-width: 132px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scan-table .asn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 132px; white-space: normal; }
.scan-table .badge { padding: 2px 6px; font-size: 10px; }
.scan-table .scan-score { width: 54px; }
/* anonimato e reputação como marcadores compactos: em 8 colunas o texto
   completo estourava a largura e cortava a última coluna */
.scan-table .anon-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-left: 4px; vertical-align: middle; background: var(--muted);
}
.scan-table .anon-dot.ok { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.6); }
.scan-table .anon-dot.bad { background: #ef4444; }
.scan-table .rep { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.scan-table .loc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 114px; white-space: normal; }
.scan-table td.mono { font-size: 11.5px; }
.scan-table .rep.ok { color: #22c55e; }
.scan-table .rep.warn { color: #eab308; }
.scan-table .rep.bad { color: #ef4444; }
/* busca livre do scanner */
.scan-search {
  width: 200px; min-width: 150px; padding: 8px 11px; font-size: 12.5px;
  background: var(--surface-3); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); color: var(--text);
}
.scan-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,229,143,.12); }
.scan-search::placeholder { color: var(--muted); }
.scan-precise {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12px; color: var(--text-2); white-space: nowrap;
  padding: 7px 10px; border-radius: var(--r-sm);
  background: var(--surface-3); border: 1px solid var(--line-soft);
  transition: border-color .18s ease, color .18s ease;
}
.scan-precise:hover { border-color: var(--brand); color: var(--text); }
.scan-precise input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
/* score 0-100 com micro-barra */
.scan-score {
  display: inline-block; vertical-align: middle; width: 46px; height: 5px;
  border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-right: 6px;
}
.scan-score i { display: block; height: 100%; border-radius: 999px; transition: width .3s ease; }
.scan-score.ok i { background: var(--brand); box-shadow: 0 0 8px rgba(0,229,143,.5); }
.scan-score.warn i { background: #f5b544; }
.scan-score.bad i { background: #f2586d; }
.scan-score-num { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* observação do scan (ex.: parado com resultados preservados) */
.scan-note {
  font-size: 12px; color: var(--text-2); padding: 8px 10px;
  border-radius: var(--r-sm); background: rgba(0,194,255,.07);
  border: 1px solid rgba(0,194,255,.18);
}
/* agrupamento dos controles: "Escanear" (alvo) x "Filtrar resultados" (visão) */
.scan-filters {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.scan-group-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); white-space: nowrap;
  padding-right: 2px;
}
/* linha honesta "mostrando X de Y vivos · filtro: ... " */
.scan-count {
  font-size: 12px; color: var(--text-2);
  margin: 8px 0 2px; display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap;
}
.scan-count b { color: var(--text); font-variant-numeric: tabular-nums; }
.flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  padding: 1px 6px; border-radius: 6px; margin-right: 6px;
  background: rgba(0,194,255,.12); color: #7dd3fc; border: 1px solid rgba(0,194,255,.28);
}
@media (max-width: 820px) {
  .scan-controls { width: 100%; }
  .scan-controls select { flex: 1 1 auto; min-width: 0; }
  .scan-controls .btn { flex: 1 1 auto; justify-content: center; }
  .scan-actions .btn { flex: 1 1 auto; justify-content: center; }
  .scan-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .scan-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------- p�gina Integra��o (#/docs) --------- */
.doc-hero { display: flex; align-items: flex-start; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
.doc-hero-main { max-width: 64ch; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.doc-hero-actions { margin-left: auto; }
.doc-desc { color: var(--text-2); font-size: 13px; line-height: 1.6; }

.doc-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.doc-link {
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color var(--t), box-shadow var(--t);
}
.doc-link:hover { border-color: rgba(0,229,143,.34); box-shadow: var(--sh-1); }
.doc-link-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.doc-link-value {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--brand-2);
  background: rgba(0,229,143,.07); border: 1px solid rgba(0,229,143,.18);
  border-radius: 8px; padding: 6px 9px; overflow-wrap: anywhere;
}
.doc-link-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.doc-link.is-bad .doc-link-value { color: var(--red); background: rgba(255,92,122,.08); border-color: rgba(255,92,122,.24); }

.doc-step {
  display: flex; flex-direction: column; min-width: 0; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color var(--t), box-shadow var(--t);
}
.doc-step:hover { border-color: rgba(0,229,143,.3); box-shadow: var(--sh-1); }
.doc-step-head { display: flex; gap: 12px; align-items: flex-start; }
.doc-step-n {
  flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; font-family: var(--display); font-size: 12.5px; font-weight: 700;
  color: var(--brand-ink); background: var(--grad);
  box-shadow: 0 4px 14px -6px rgba(0,229,143,.7);
}
.doc-step-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.doc-step-text h3 { font-size: 14px; }
.doc-code {
  margin: 12px 0 0; padding: 12px 14px; background: #060a0f;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 11.8px; line-height: 1.6; color: #c7d2e0;
  overflow-x: auto; white-space: pre;
}

@media (max-width: 900px) {
  .doc-links { grid-template-columns: 1fr; }
  .doc-hero-actions { margin-left: 0; width: 100%; }
  .doc-hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .doc-link, .doc-step { transition: none; }
}
