/* Palette, radii, fonts and keyframes below are matched directly from
   FocoemSEC's own computed styles (inspected live, with the user's
   authorization, against their own darwinseguros.com report — see
   session notes). Not a framework theme; intentionally this specific
   product's visual language. */
:root {
  --bg: #08080A; --surface: #121218; --surface-2: #1D1D27; --surface-3: #1A1A1F;
  --fg: #F4F4F7; --fg-2: #C7C7D1; --muted: #A1A1B0; --muted-2: #8A8A99;
  --border: #24242E; --border-strong: #2E2E3A;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Consolas, Menlo, monospace;

  --accent: #E11D2A; --accent-dark: #A8121C; --accent-ink: #FF525F; --accent-soft: rgba(255,59,70,.14);
  --ok: #22C55E; --ok-soft: rgba(34,197,94,.15); --ok-text: #46A758;
  --warn: #D99E00; --warn-soft: rgba(255,197,49,.14); --warn-border: rgba(255,197,49,.32);
  --crit: #FF2E3A; --crit-soft: rgba(255,46,58,.15);
  --high: #FF7A1A; --high-soft: rgba(255,122,26,.15);
  --med: #D99E00; --med-soft: rgba(255,197,49,.16);
  --low: #34D399; --low-soft: rgba(52,211,153,.15);
  --info: #8A8A99; --info-soft: rgba(138,138,153,.16);

  --r-card: 16px; --r-box: 13px; --r-btn: 11px; --r-pill: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
}

@keyframes lvpulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes sweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadepulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-ui); line-height: 1.5; font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); }

/* ---------- App shell: sidebar + content ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: none; background: var(--bg);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: var(--space-5) var(--space-3); position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-family: var(--font-mono); font-size: 13px;
}
.brand .word { font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--fg); }
.brand .word a { color: inherit; }
.sidebar .brand { margin-bottom: var(--space-6); padding: 0 var(--space-2); }
.sidebar .nav-section-label {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  color: var(--muted-2); padding: 0 var(--space-2); margin: var(--space-5) 0 var(--space-2);
}
.sidebar .nav-section-label:first-of-type { margin-top: 0; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 9.5px 13px; border-radius: var(--r-btn);
  color: var(--fg-2); font-size: 13.5px; font-weight: 550; text-decoration: none;
  border-left: 3px solid transparent; transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: var(--surface-3); color: var(--fg); text-decoration: none; }
.sidebar nav a.active { color: #fff; border-left-color: var(--accent); }
.sidebar nav a.active .dot { background: var(--accent); }
.sidebar nav a .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; flex: none; }
.sidebar-spacer { flex: 1; }
.sidebar-footer { border-top: 1px solid var(--border); padding-top: var(--space-4); margin-top: var(--space-4); }
.sidebar-footer button {
  width: 100%; background: transparent; border: 1px solid var(--border-strong); color: var(--muted);
  font-size: 13px; padding: 8px 12px; border-radius: var(--r-btn); cursor: pointer; font-family: inherit;
}
.sidebar-footer button:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }

.content { flex: 1; min-width: 0; padding: var(--space-6) var(--space-6) 60px; max-width: 1180px; }
.content h2 { font-size: 17px; font-weight: 700; margin: var(--space-6) 0 var(--space-3); letter-spacing: -.01em; }
.content > h2:first-child { margin-top: 0; }

/* Standalone (login) layout: no sidebar, grid + glow backdrop */
.standalone {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-5);
  background-color: var(--bg);
  background-image:
    radial-gradient(600px 320px at 50% -10%, rgba(225,29,42,.16), transparent 70%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
}
.standalone .box { width: 100%; max-width: 380px; }
.standalone .eyebrow {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink);
  font-weight: 700; text-align: center; margin-bottom: 8px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 20px 22px; margin-bottom: var(--space-4); box-shadow: 0 12px 34px rgba(0,0,0,.5);
}

/* ---------- Hero: active target (mirrors FocoemSEC's report header) ---------- */
.hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 22px 24px; margin-bottom: var(--space-4); position: relative; overflow: hidden;
}
.hero.is-running::before {
  content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 2.6s linear infinite;
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; }
.hero-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-title h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -.01em; font-family: var(--font-mono); }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: 5px 12px; font-size: 12px; font-weight: 650;
}
.status-pill .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: lvpulse 1.8s infinite; }
.status-pill.ok { color: var(--ok); }
.status-pill.muted { color: var(--muted); }

.badge-outline {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .02em;
  padding: 2px 9px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink);
}

.meta-grid { display: flex; gap: var(--space-6); flex-wrap: wrap; margin-top: 18px; }
.meta-grid .item .label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin-bottom: 4px; }
.meta-grid .item .value { font-size: 13.5px; font-family: var(--font-mono); color: var(--fg-2); }

.hero-stats { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.mini-stat {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-box);
  padding: 14px 18px; min-width: 118px; text-align: center;
}
.mini-stat .icon { font-size: 16px; margin-bottom: 4px; }
.mini-stat .n { font-size: 24px; font-weight: 800; font-family: var(--font-mono); line-height: 1; }
.mini-stat .n.crit { color: var(--crit); } .mini-stat .n.ok { color: var(--ok); }
.mini-stat .sub { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); margin-top: 6px; font-weight: 700; }
.mini-stat .sub2 { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.mini-stat.score-stat .n { font-size: 32px; }
.mini-stat.score-stat .n.good { color: var(--ok-text); }
.mini-stat.score-stat .n.warn { color: var(--warn); }
.mini-stat.score-stat .n.crit { color: var(--crit); }
.mini-stat.placeholder { color: var(--muted); border-style: dashed; }

.target-row { margin-top: var(--space-4); }
.target-row .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin-bottom: 8px; font-weight: 700; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: var(--font-mono); font-size: 12.5px; padding: 5px 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--fg-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.allow { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.chip.deny { color: var(--crit); background: var(--crit-soft); border-color: transparent; }
.chip.empty { color: var(--muted); font-style: italic; font-family: var(--font-ui); background: transparent; border-style: dashed; }

/* ---------- Live progress card (mirrors FocoemSEC's "Pentest em andamento") ---------- */
.progress-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 20px 22px; margin-bottom: var(--space-4);
}
.progress-top { display: flex; align-items: flex-start; gap: 14px; }
.progress-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; flex: none; font-size: 17px;
}
/* State-coded icon badge: green=concluído, laranja=erro/interrompido,
   vermelho piscando=em execução, vermelho estático=ainda sem pipeline rodado. */
.progress-icon-wrap.icon-done { background: var(--ok-soft); color: var(--ok); }
.progress-icon-wrap.icon-error { background: var(--high-soft); color: var(--high); }
.progress-icon-wrap.icon-running { background: var(--crit-soft); color: var(--crit); animation: fadepulse 1.2s ease-in-out infinite; }
.progress-icon-wrap.icon-idle { background: var(--crit-soft); color: var(--crit); }
.progress-info { flex: 1; min-width: 0; }
.progress-title { font-size: 16px; font-weight: 700; }
.progress-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.progress-sub .accent { color: var(--accent-ink); font-family: var(--font-mono); }
.progress-sub b { color: var(--fg-2); }
.progress-timer { text-align: right; flex: none; }
.progress-timer .timer-value { font-family: var(--font-mono); font-size: 20px; font-weight: 800; color: var(--fg); }
.progress-timer .timer-label { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; margin-top: 2px; }

.phase-tracker { display: flex; align-items: flex-start; margin: 22px 4px 6px; position: relative; }
.phase-tracker::before {
  content: ""; position: absolute; top: 7px; left: 7%; right: 7%; height: 2px; background: var(--border-strong); z-index: 0;
}
.phase-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
.phase-dot { width: 15px; height: 15px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border-strong); margin-bottom: 8px; }
.phase-step.done .phase-dot { background: var(--accent); border-color: var(--accent); }
.phase-step.current .phase-dot { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.phase-name { font-size: 12px; color: var(--muted); font-weight: 550; }
.phase-step.done .phase-name, .phase-step.current .phase-name { color: var(--fg); font-weight: 700; }

.tool-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.tool-pill {
  font-size: 11.5px; font-family: var(--font-mono); color: var(--fg-2); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px 11px;
  transition: background .2s, border-color .2s, color .2s;
}
.tool-pill.tool-done { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.tool-pill.tool-current { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); animation: fadepulse 1.4s ease-in-out infinite; }
.progress-link { display: inline-block; margin-top: 16px; font-size: 12.5px; font-weight: 650; color: var(--accent-ink); }

.progress-bar-row { display: flex; align-items: center; gap: 10px; margin: 16px 4px 0; }
.progress-bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); transition: width .6s ease; border-radius: var(--r-pill); }
.progress-bar-label { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--fg-2); flex: none; min-width: 34px; text-align: right; }

.subdomain-row { margin: 18px 4px 0; }
.subdomain-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 700; margin-bottom: 8px; }

.target-list { margin-top: 18px; }
details.target-card summary { justify-content: flex-start; gap: 14px; }
.target-name { font-family: var(--font-mono); font-size: 13px; color: var(--fg); }
.target-meta { margin-left: auto; display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); font-weight: 500; }

/* ---------- Severity breakdown row ---------- */
.sev-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.sev-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-box);
  padding: 16px; text-align: center;
}
.sev-box .badge { margin-bottom: 10px; }
.sev-box .sev-n { font-size: 26px; font-weight: 800; font-family: var(--font-mono); color: var(--fg); }
@media (max-width: 760px) { .sev-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Tables ---------- */
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted-2); background: var(--surface-2); font-weight: 700;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ---------- Badges ---------- */
.badge {
  font-family: var(--font-ui); font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 3px 10px;
  border-radius: var(--r-pill); display: inline-block; white-space: nowrap; text-transform: uppercase;
}
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.warn { color: var(--med); background: var(--med-soft); }
.badge.crit { color: var(--crit); background: var(--crit-soft); }
.badge.high { color: var(--high); background: var(--high-soft); }
.badge.low { color: var(--low); background: var(--low-soft); }
.badge.info { color: var(--info); background: var(--info-soft); }
.badge.muted { color: var(--muted); background: var(--surface-2); }
form.inline { display: inline; }

/* ---------- Security score (used on the metrics/list contexts) ---------- */
.score-ring {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 800; font-size: 21px; flex: none;
  border: 3px solid var(--border-strong); background: var(--surface);
}
.score-ring.ok { color: var(--ok-text); border-color: var(--ok); }
.score-ring.warn { color: var(--warn); border-color: var(--warn); }
.score-ring.crit { color: var(--crit); border-color: var(--crit); }
.score-row { display: flex; align-items: center; gap: 16px; margin: 4px 0; }
.score-row .label { font-size: 13px; color: var(--muted); }
.score-row .label b { display: block; font-size: 16px; color: var(--fg); margin-top: 2px; font-weight: 700; }

/* ---------- Stat cards (metrics page) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-4); margin-bottom: 4px; }
.stat-card { text-align: left; padding: 18px 20px; margin-bottom: 0; }
.stat-value { font-family: var(--font-mono); font-size: 30px; font-weight: 800; line-height: 1; }
.stat-value.ok { color: var(--ok-text); }
.stat-value.warn { color: var(--warn); }
.stat-value.crit { color: var(--crit); }
.stat-label { margin-top: 8px; font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* ---------- Assessment cards ---------- */
details.assess-card {
  border: 1px solid var(--border); border-radius: var(--r-box); padding: 13px 16px;
  margin-bottom: 9px; background: var(--surface);
}
details.assess-card summary {
  cursor: pointer; font-weight: 650; list-style: none; display: flex;
  align-items: baseline; gap: 10px; justify-content: space-between; font-family: var(--font-mono); font-size: 13px;
}
details.assess-card summary::-webkit-details-marker { display: none; }
details.assess-card summary::before { content: "▸ "; color: var(--accent-ink); }
details.assess-card[open] summary::before { content: "▾ "; }
details.assess-card summary .count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
details.assess-card p.desc { margin: 8px 0 0; font-size: 13.5px; color: var(--fg-2); font-family: var(--font-ui); }
details.assess-card pre {
  margin: 10px 0 0; padding: 12px 14px; background: var(--surface-2); border-radius: 8px;
  font-size: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--border);
}

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; color: var(--fg-2); margin: 12px 0 5px; font-weight: 550; }
input[type=text], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface-2); color: var(--fg); font-family: inherit; font-size: 14px; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { font-family: var(--font-mono); font-size: 12.5px; min-height: 72px; }
.row { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.row > div { flex: 1; min-width: 200px; }
button, .btn {
  font-family: inherit; font-size: 13.5px; font-weight: 650; padding: 10px 20px; letter-spacing: .02em;
  border-radius: var(--r-btn); border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; cursor: pointer; text-decoration: none; display: inline-block; margin-top: 12px;
  transition: filter .12s, transform .05s;
}
button:hover, .btn:hover { filter: brightness(1.1); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary {
  background: transparent; color: var(--fg-2); border: 1px solid var(--border-strong);
}
button.secondary:hover, .btn.secondary:hover { border-color: var(--accent); color: var(--accent-ink); }

.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); font-style: italic; padding: 10px 0; font-size: 13.5px; }
.flash {
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 10px;
  padding: 11px 15px; margin-bottom: var(--space-4); font-size: 13.5px; color: var(--accent-ink);
}
.flash.error { background: var(--crit-soft); border-color: var(--crit); color: var(--crit); }
.downloads a {
  margin-right: 8px; font-size: 12.5px; font-family: var(--font-mono); padding: 6px 12px;
  border: 1px solid var(--border-strong); border-radius: 8px; color: var(--fg-2); display: inline-block; margin-bottom: 6px;
}
.downloads a:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
code.hash { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; align-items: center; padding: var(--space-3) var(--space-4); }
  .sidebar .brand { margin-bottom: 0; }
  .sidebar .nav-section-label { display: none; }
  .sidebar nav { flex-direction: row; margin-left: auto; }
  .sidebar-spacer { display: none; }
  .sidebar-footer { border-top: none; margin: 0; padding: 0; margin-left: 8px; width: auto; }
  .sidebar-footer button { width: auto; }
  .content { padding: var(--space-4); }
  .sev-grid { grid-template-columns: repeat(2, 1fr); }
}
