:root {
  --bg: #0b0e27;
  --bg2: #12163a;
  --card: #171c47;
  --card2: #1e2458;
  --line: #2a3170;
  --ink: #eef1ff;
  --muted: #a3acd6;
  --violet: #7b2ff7;
  --magenta: #ff2d95;
  --cyan: #00d4ff;
  --teal: #1799ae;
  --orange: #ff6a1a;
  --yellow: #f6b300;
  --green: #12c27a;
  --red: #e5174b;
  --grad: linear-gradient(135deg, #7b2ff7 0%, #ff2d95 55%, #ff6a1a 100%);
  --grad2: linear-gradient(135deg, #00d4ff 0%, #7b2ff7 100%);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
body.app { display: flex; min-height: 100vh; background: radial-gradient(1200px 600px at 100% -10%, rgba(123,47,247,.25), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(0,212,255,.15), transparent 60%), var(--bg); background-attachment: fixed; }
a { color: var(--cyan); }
h2 { font-size: 1.1rem; margin: 0 0 .9rem; }
h3 { font-size: .98rem; margin: 1.1rem 0 .6rem; color: #fff; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono { font-family: Consolas, "DejaVu Sans Mono", monospace; font-size: .85rem; word-break: break-all; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Barra lateral ---------- */
.side { width: 250px; flex: 0 0 250px; background: linear-gradient(180deg, #141a4d 0%, #0e1235 100%); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { display: block; background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.side .brand img { width: 100%; display: block; }
.product { margin: 14px 6px 18px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.product b { font-size: 1.25rem; letter-spacing: .04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: #cfd5f7; text-decoration: none; font-weight: 600; transition: .15s; }
.side nav a svg { width: 20px; height: 20px; fill: currentColor; opacity: .85; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(255,45,149,.35); }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.me small { display: block; color: var(--muted); font-size: .75rem; }
.me b { font-size: .88rem; }
.me form { margin-left: auto; }
.me button { background: rgba(255,255,255,.08); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
.me button:hover { background: var(--red); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad2); display: grid; place-items: center; font-weight: 800; }

.main { flex: 1; min-width: 0; padding: 22px 30px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.menu-btn { display: none; background: var(--card); color: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 1.2rem; }
.foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 30px 0 0; }

/* ---------- Componentes ---------- */
.card { background: linear-gradient(180deg, var(--card) 0%, #141943 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.card.glow { border: 0; position: relative; }
.card.glow::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius); padding: 1.5px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-hero { grid-template-columns: 340px minmax(0, 1fr); }
.center { text-align: center; }
.chart svg, .chart img { max-width: 100%; height: auto; }
.chart svg text { font-family: "Segoe UI", system-ui, Roboto, Arial, sans-serif; }

.kpi { border-radius: var(--radius); padding: 18px 20px; color: #fff; position: relative; overflow: hidden; box-shadow: 0 10px 28px rgba(0,0,0,.3); }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); }
.kpi .v { font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.kpi .l { font-size: .85rem; opacity: .92; font-weight: 600; }
.k1 { background: linear-gradient(135deg, #7b2ff7, #b14bff); }
.k2 { background: linear-gradient(135deg, #ff2d95, #ff6a8f); }
.k3 { background: linear-gradient(135deg, #00b8d9, #00d4ff); }
.k4 { background: linear-gradient(135deg, #ff6a1a, #f6b300); }
.k5 { background: linear-gradient(135deg, #12c27a, #00c2a8); }
.k6 { background: linear-gradient(135deg, #e5174b, #ff4f6d); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; color: #fff; background: var(--card2); border: 1px solid var(--line); transition: .15s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn.primary { background: var(--grad); border: 0; box-shadow: 0 8px 22px rgba(255,45,149,.35); }
.btn.cyan { background: var(--grad2); border: 0; }
.btn.danger { background: var(--red); border: 0; }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn.block { width: 100%; justify-content: center; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label.f { display: block; margin-bottom: 14px; font-weight: 600; font-size: .9rem; color: #dfe4ff; }
label.f small { display: block; font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #0e1236; color: #fff; font: inherit; outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(255,45,149,.25); }
.big-input { font-size: 1.35rem !important; padding: 16px 20px !important; font-weight: 700; letter-spacing: .02em; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .9rem; margin: 10px 0; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--magenta); }
.radio-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 16px; }
.radio-cards label { border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; background: #0e1236; display: block; }
.radio-cards input { display: none; }
.radio-cards label:has(input:checked) { border-color: var(--magenta); background: rgba(255,45,149,.12); box-shadow: 0 0 0 2px rgba(255,45,149,.35); }
.radio-cards b { display: block; margin-bottom: 4px; }
.radio-cards span { font-size: .82rem; color: var(--muted); }

.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: rgba(18,194,122,.15); border: 1px solid var(--green); }
.flash.err { background: rgba(229,23,75,.15); border: 1px solid var(--red); }
.flash.warn { background: rgba(246,179,0,.12); border: 1px solid var(--yellow); }

table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
table.t th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 12px; border-bottom: 1px solid rgba(42,49,112,.6); vertical-align: top; }
table.t tr:hover td { background: rgba(255,255,255,.03); }
.table-wrap { overflow-x: auto; }

.sev { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; color: #fff; background: var(--c); white-space: nowrap; }
.grade { display: inline-flex; align-items: baseline; gap: 4px; justify-content: center; min-width: 44px; padding: 4px 10px; border-radius: 12px; font-weight: 900; font-size: 1.25rem; color: #fff; background: var(--c); box-shadow: 0 4px 14px color-mix(in srgb, var(--c) 45%, transparent); }
.grade small { font-size: .72rem; font-weight: 700; opacity: .9; }
.grade.none { background: #3a4075; }
.grade.xl { font-size: 3rem; min-width: 90px; padding: 6px 18px; border-radius: 20px; }
.st { padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.st-done { background: rgba(18,194,122,.18); color: #3ff0a6; }
.st-running, .st-queued { background: rgba(0,212,255,.15); color: var(--cyan); }
.st-error { background: rgba(229,23,75,.18); color: #ff7896; }
.st-cancelled { background: rgba(138,148,176,.2); color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: .78rem; margin: 2px 4px 2px 0; }
.pill.cdn { background: rgba(0,212,255,.15); color: var(--cyan); }

.progress { height: 16px; border-radius: 999px; background: #0e1236; overflow: hidden; border: 1px solid var(--line); }
.progress > div { height: 100%; background: var(--grad); background-size: 200% 100%; animation: flow 2s linear infinite; transition: width .6s; }
@keyframes flow { to { background-position: -200% 0; } }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,212,255,.7); } 100% { box-shadow: 0 0 0 14px rgba(0,212,255,0); } }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { background: var(--card); color: #cfd5f7; border: 1px solid var(--line); border-radius: 12px; padding: 9px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.tabs button.on { background: var(--grad2); color: #fff; border-color: transparent; }
.tab { display: none; }
.tab.on { display: block; }

.finding { border-left: 5px solid var(--c); background: #10143c; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.finding summary { cursor: pointer; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; list-style: none; }
.finding summary::-webkit-details-marker { display: none; }
.finding summary b { flex: 1; min-width: 220px; }
.finding .body { margin-top: 12px; display: grid; gap: 8px; font-size: .9rem; }
.finding .body div span { color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; display: block; }
.fix { background: rgba(18,194,122,.1); border: 1px solid rgba(18,194,122,.4); border-radius: 10px; padding: 10px 12px; }

.cat-tile { border-radius: 14px; padding: 14px; background: #10143c; border-top: 4px solid var(--c); }
.cat-tile .n { font-size: 1.9rem; font-weight: 900; color: var(--c); }
.cat-tile .t { font-weight: 700; font-size: .9rem; }
.cat-tile .d { font-size: .78rem; color: var(--muted); }

.comp-row { display: grid; grid-template-columns: 90px 1fr 120px; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(42,49,112,.6); align-items: start; }
.comp-st { font-weight: 800; font-size: .78rem; padding: 4px 8px; border-radius: 8px; text-align: center; color: #fff; background: var(--c); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }

.hero-domain { font-size: 1.7rem; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; word-break: break-all; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.log { background: #070a1f; border-radius: 12px; padding: 14px; max-height: 360px; overflow: auto; font: 12px/1.5 Consolas, monospace; color: #9fe8ff; white-space: pre-wrap; }

/* ---------- Login ---------- */
body.guest { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(800px 500px at 15% 10%, rgba(123,47,247,.55), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(255,45,149,.45), transparent 60%), radial-gradient(600px 400px at 80% 10%, rgba(0,212,255,.35), transparent 60%), var(--bg); }
.guest-main { width: 100%; max-width: 440px; padding: 20px; }
.login { background: rgba(23,28,71,.85); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 24px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.login .logo { background: #fff; border-radius: 16px; padding: 14px 18px; margin-bottom: 20px; }
.login .logo img { width: 100%; display: block; }
.login h1 { margin: 0 0 4px; font-size: 1.5rem; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } .g-hero { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  body.app { display: block; }
  .side { position: fixed; z-index: 20; left: -270px; transition: .25s; }
  body.menu-open .side { left: 0; }
  .menu-btn { display: block; }
  .main { padding: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .radio-cards { grid-template-columns: 1fr; }
  .comp-row { grid-template-columns: 80px 1fr; }
  .comp-row > :last-child { grid-column: 1 / -1; }
}
