/* =========================================================
   Arsenal AI — style.css
   Dark terminal theme: black/slate bg, red accent, mono font
   ========================================================= */

/* ── Google Fonts loaded in HTML ── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:         #0a0a0a;
  --bg1:        #111111;
  --bg2:        #161616;
  --bg3:        #1a1a1a;
  --border:     #242424;
  --border2:    #2e2e2e;

  --text0:      #f0f0f0;
  --text1:      #d0d0d0;
  --text2:      #888888;
  --text3:      #555555;

  --red:        #ef4444;
  --red-dim:    #991b1b;
  --red-glow:   rgba(239,68,68,0.15);
  --orange:     #f97316;
  --orange-dim: #c2410c;
  --green:      #22c55e;
  --green-dim:  #15803d;
  --yellow:     #eab308;
  --yellow-dim: #92400e;
  --blue:       #3b82f6;
  --cyan:       #06b6d4;

  --term-green: #00ff41;
  --term-cyan:  #00d4ff;
  --term-bg:    #050505;
  --term-text:  #c8ffc8;

  --sidebar-w:  240px;
  --topbar-h:   52px;
  --radius:     8px;
  --radius-lg:  12px;

  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  --transition: 0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text1);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange); }

input, select, button, textarea { font-family: inherit; font-size: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  line-height: 1;
}

.btn-red {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-red:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--text1);
  border-color: var(--border2);
}
.btn-outline:hover { border-color: var(--red); color: var(--red); background: var(--red-glow); }

.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 11px 24px; font-size: 14px; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* =========================================================
   FORMS
   ========================================================= */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-row    { display: flex; gap: 12px; }
.flex-1      { flex: 1; }

.form-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text2);
  font-family: var(--font-mono);
}

.form-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text0);
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.form-input:focus { border-color: var(--red); }
.form-input-lg  { padding: 11px 14px; font-size: 14px; }
.form-input-mono{ font-family: var(--font-mono); font-size: 12px; }
.form-input::placeholder { color: var(--text3); }

.form-select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text0);
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.form-select:focus { border-color: var(--red); }

/* Input icon wrap */
.input-wrap { position: relative; }
.input-wrap .form-input { padding-left: 36px; }
.input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.input-icon-left .form-input { padding-left: 36px; }
.input-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 2px;
  transition: color var(--transition);
}
.input-toggle-pw:hover { color: var(--text1); }

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.card-header-left { display: flex; align-items: center; gap: 8px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--text0); }
.card-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}
.card-badge-red   { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.card-badge-green { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.card-link { font-size: 12px; color: var(--text2); }
.card-link:hover { color: var(--red); }

.card-body { padding: 18px; }
.card-body.p0 { padding: 0; }

/* =========================================================
   APP LAYOUT (sidebar + main)
   ========================================================= */
body.app-page { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.logo-triangle {
  color: var(--red);
  font-size: 18px;
  line-height: 1;
}
.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--text0);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  flex: 1;
}

.snav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
}
.snav-item:hover { color: var(--text0); background: var(--bg3); }
.snav-item.active {
  color: var(--text0);
  background: rgba(239,68,68,0.1);
  font-weight: 600;
}
.snav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px; bottom: 4px;
  width: 3px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
}
.snav-inactive { opacity: 0.45; pointer-events: none; }
.snav-soon {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text3);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
}
.snav-logout:hover { color: var(--red) !important; background: var(--red-glow) !important; }
.sidebar-bottom { padding: 10px; border-top: 1px solid var(--border); }

/* ── Mobile topbar ── */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 99;
}
.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 4px;
  display: flex;
}
.mobile-menu-btn:hover { color: var(--text0); }
.mobile-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text0);
}
.mobile-logo { color: var(--red); }

/* ── Main content ── */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text0); line-height: 1.2; }
.page-sub   { font-size: 13px; color: var(--text2); margin-top: 3px; }
.page-header-status {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  white-space: nowrap;
}
.status-label { font-size: 12px; font-weight: 500; color: var(--text2); font-family: var(--font-mono); }

/* ── Status dots ── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-online  { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.6); animation: pulse-green 2s infinite; }
.status-running { background: var(--yellow); box-shadow: 0 0 6px rgba(234,179,8,0.6); animation: pulse-yellow 1.2s infinite; }
.status-complete{ background: var(--green); }
.status-failed  { background: var(--red); }
.status-queued  { background: var(--text3); }

@keyframes pulse-green  { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes pulse-yellow { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* =========================================================
   SCAN LAUNCHER (dashboard)
   ========================================================= */
.scan-launcher .card-body { display: flex; flex-direction: column; gap: 14px; }

/* Auth toggle */
.auth-section { display: flex; flex-direction: column; gap: 10px; }
.auth-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  width: fit-content;
}
.auth-toggle:hover { border-color: var(--border2); color: var(--text1); }
.auth-fields {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-fields.open { display: flex; }

/* Flag toggles */
.flags-row { display: flex; flex-wrap: wrap; gap: 10px; }
.flag-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.flag-toggle input[type=checkbox] { display: none; }
.flag-slider {
  width: 32px;
  height: 18px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 9px;
  position: relative;
  transition: all var(--transition);
  flex-shrink: 0;
}
.flag-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--text3);
  border-radius: 50%;
  transition: all var(--transition);
}
.flag-toggle input:checked ~ .flag-slider { background: rgba(239,68,68,0.2); border-color: var(--red); }
.flag-toggle input:checked ~ .flag-slider::after { background: var(--red); left: 16px; }
.flag-label { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; font-family: var(--font-mono); color: var(--text2); }
.flag-toggle input:checked ~ .flag-label { color: var(--red); }

/* Launch row */
.scan-launch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.scan-launch-info { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text2); }
.btn-launch { padding: 11px 24px; font-size: 13px; }
.launch-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  color: var(--red);
  padding: 10px 14px;
  font-size: 13px;
}

/* Recent scans */
.table-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 18px;
  color: var(--text2);
  font-size: 13px;
}

/* =========================================================
   SCAN TABLE (used in history + recent scans)
   ========================================================= */
.scans-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.scans-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text3);
  font-family: var(--font-mono);
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.scans-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text1);
}
.scans-table tr:last-child td { border-bottom: none; }
.scans-table tr:hover td { background: var(--bg2); }
.scans-table a { color: var(--cyan); font-family: var(--font-mono); font-size: 12px; }
.scans-table a:hover { color: var(--text0); }

.table-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text3);
  font-size: 13px;
}
.table-empty a { color: var(--red); }

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}
.pill-complete { background: rgba(34,197,94,0.12); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.pill-running  { background: rgba(234,179,8,0.12); color: var(--yellow); border: 1px solid rgba(234,179,8,0.25); }
.pill-failed   { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.pill-queued   { background: rgba(136,136,136,0.12); color: var(--text3); border: 1px solid var(--border); }

/* RCE badge in table */
.rce-badge-yes { color: var(--red); font-weight: 700; font-family: var(--font-mono); font-size: 12px; }
.rce-badge-no  { color: var(--text3); font-family: var(--font-mono); font-size: 12px; }

/* =========================================================
   SCAN PAGE — TOPBAR
   ========================================================= */
.scan-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  gap: 12px;
  flex-wrap: wrap;
}
.scan-topbar-left  { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.scan-topbar-right { display: flex; align-items: center; gap: 12px; }
.scan-target-wrap  { display: flex; align-items: center; gap: 6px; }
.scan-target-url   { font-family: var(--font-mono); font-size: 13px; color: var(--cyan); font-weight: 500; word-break: break-all; }
.scan-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text1);
}
.scan-elapsed { display: flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 12px; color: var(--text2); }

/* =========================================================
   SCAN PAGE — LIVE LAYOUT (terminal + findings)
   ========================================================= */
.scan-live-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  min-height: 480px;
}

/* ── Panel shared ── */
.terminal-panel,
.findings-panel {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  gap: 8px;
  flex-shrink: 0;
}
.panel-header-left { display: flex; align-items: center; gap: 7px; }
.panel-title       { font-size: 12px; font-weight: 600; color: var(--text1); font-family: var(--font-mono); letter-spacing: 0.04em; }
.panel-dot         { width: 11px; height: 11px; border-radius: 50%; }
.panel-dot-red     { background: #ef4444; }
.panel-dot-yellow  { background: #f59e0b; }
.panel-dot-green   { background: #22c55e; }

.autoscroll-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
}
.autoscroll-toggle input { accent-color: var(--red); }

/* ── Terminal feed ── */
.terminal-feed {
  flex: 1;
  overflow-y: auto;
  background: var(--term-bg);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--term-text);
  min-height: 320px;
}
.term-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.term-ts    { color: var(--text3); flex-shrink: 0; }
.term-icon  { flex-shrink: 0; }
.term-phase { color: var(--cyan); font-weight: 600; flex-shrink: 0; }
.term-msg   { color: var(--term-text); word-break: break-word; }
.term-green { color: var(--term-green); }
.term-blue  { color: var(--term-cyan); }
.term-red   { color: var(--red); }
.term-yellow{ color: var(--yellow); }
.term-init-msg { color: var(--text3); }
.term-prompt { margin-bottom: 6px; }
.term-ps1    { color: var(--term-green); }
.term-sep    { color: var(--text3); }
.term-dir    { color: var(--term-cyan); }
.term-cur    { color: var(--text2); }
.term-cmd    { color: var(--text0); }
.term-cursor { display: inline-block; width: 8px; height: 13px; background: var(--term-green); animation: blink 1.1s step-end infinite; vertical-align: middle; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.terminal-complete-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(34,197,94,0.08);
  border-top: 1px solid rgba(34,197,94,0.2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* ── Findings panel ── */
.findings-count { font-size: 11px; font-family: var(--font-mono); color: var(--text2); }
.finding-section { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.finding-section:last-child { border-bottom: none; }
.finding-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text3);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}
.finding-section-title-red    { color: var(--red-dim); }
.finding-section-title-yellow { color: var(--yellow-dim); }

.status-badges-row { display: flex; flex-wrap: wrap; gap: 5px; }
.status-badge-item {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.07em;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.status-badge-gray   { background: var(--bg3); border-color: var(--border); color: var(--text3); }
.status-badge-red    { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: var(--red); }
.status-badge-green  { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.4); color: var(--green); }
.status-badge-yellow { background: rgba(234,179,8,0.15); border-color: rgba(234,179,8,0.4); color: var(--yellow); }

.finding-empty { font-size: 11px; color: var(--text3); font-style: italic; }
.finding-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text1);
  border-bottom: 1px solid var(--border);
}
.finding-item:last-child { border-bottom: none; }
.finding-item-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: var(--red); }
.finding-item-dot.yellow { background: var(--yellow); }

/* Quick stats */
.quick-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qs-item { text-align: center; background: var(--bg2); border-radius: var(--radius); padding: 8px 4px; border: 1px solid var(--border); }
.qs-num  { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text0); line-height: 1; }
.qs-label{ font-size: 10px; color: var(--text3); margin-top: 2px; }

/* =========================================================
   SCAN PAGE — REPORT SECTION
   ========================================================= */
.report-section {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.report-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-wrap: wrap;
}
.report-title { font-size: 16px; font-weight: 700; color: var(--text0); }
.report-gen-time { font-size: 11px; color: var(--text3); font-family: var(--font-mono); margin-left: auto; }

/* Report tabs */
.report-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  overflow-x: auto;
}
.rtab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}
.rtab:hover { color: var(--text1); }
.rtab.active { color: var(--red); border-bottom-color: var(--red); }

.report-content { padding: 0; }
.rtab-content { display: none; padding: 20px; flex-direction: column; gap: 16px; }
.rtab-content.active { display: flex; }

/* Report card */
.report-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.report-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  font-family: var(--font-mono);
  letter-spacing: 0.07em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.report-card > :not(.report-card-title) { padding: 12px 14px; }

.report-pre {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text1);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.report-text { font-size: 13px; color: var(--text1); }
.report-empty { font-size: 12px; color: var(--text3); font-style: italic; }
.report-kv-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.report-kv-k { font-family: var(--font-mono); font-size: 11px; color: var(--text3); font-weight: 600; letter-spacing: 0.06em; }
.report-kv-v { font-size: 12px; color: var(--text0); word-break: break-all; }

/* Vuln item */
.vuln-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.vuln-item:last-child { margin-bottom: 0; }
.vuln-type { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--red); margin-bottom: 4px; }
.vuln-detail { font-size: 12px; color: var(--text2); font-family: var(--font-mono); word-break: break-all; }

/* Subdomain chips */
.subdomain-chip {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--cyan);
  margin: 2px;
}

/* Sensitive box */
.sensitive-box-wrap { position: relative; display: flex; flex-direction: column; gap: 6px; }
.sensitive-box {
  background: var(--term-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--term-green);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.5;
}
.payload-box { color: var(--term-cyan); }
.copy-btn {
  align-self: flex-end;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 10px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.06em;
}
.copy-btn:hover { border-color: var(--green); color: var(--green); }
.copy-btn.copied { border-color: var(--green); color: var(--green); }

.payload-item { margin-bottom: 14px; }
.payload-item:last-child { margin-bottom: 0; }
.payload-label { font-size: 11px; font-weight: 700; color: var(--text3); font-family: var(--font-mono); letter-spacing: 0.07em; margin-bottom: 4px; }

/* AI chain output */
.ai-chain-output {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--text1);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Persistence list */
.persist-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--font-mono);
}
.persist-item:last-child { border-bottom: none; }
.persist-type { color: var(--orange); font-weight: 700; flex-shrink: 0; }
.persist-val  { color: var(--text1); word-break: break-all; }

/* =========================================================
   HISTORY PAGE
   ========================================================= */
.history-filters .card-body { padding: 12px 16px; }
.filter-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group-search { flex: 1; min-width: 160px; }

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.pagination-info { font-size: 12px; color: var(--text3); font-family: var(--font-mono); }

/* =========================================================
   SPINNER
   ========================================================= */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(239,68,68,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(239,68,68,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.login-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(239,68,68,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 380px;
  padding: 20px;
}
.login-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.login-logo .logo-triangle { font-size: 24px; }
.login-logo .logo-text     { font-size: 18px; }

.login-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  color: var(--red);
  padding: 10px 14px;
  font-size: 13px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-submit { padding: 12px; font-size: 14px; }
.login-footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text3);
}

/* Shake animation */
@keyframes shake {
  0%,100%{ transform: translateX(0); }
  20%    { transform: translateX(-8px); }
  40%    { transform: translateX(8px); }
  60%    { transform: translateX(-6px); }
  80%    { transform: translateX(6px); }
}
.shake { animation: shake 0.5s ease-in-out; }

/* =========================================================
   LANDING PAGE
   ========================================================= */
body.landing {
  background: var(--bg);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
.navbar.scrolled { background: rgba(10,10,10,0.98); }
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 20px;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--red);
  text-decoration: none;
}
.nav-logo:hover { color: var(--orange); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text0); }
.nav-btn-login {
  background: var(--red) !important;
  color: #fff !important;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-weight: 600 !important;
}
.nav-btn-login:hover { background: #dc2626 !important; }
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span { display: block; width: 20px; height: 2px; background: var(--text2); border-radius: 1px; }
.nav-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  background: var(--bg1);
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-menu a {
  padding: 14px 24px;
  font-size: 14px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}
.nav-mobile-menu a:last-child { border-bottom: none; }
.nav-mobile-menu a:hover { color: var(--text0); background: var(--bg2); }

/* ── Hero ── */
.hero { padding: 130px 0 80px; }
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text1);
  margin-bottom: 20px;
  font-family: var(--font-mono);
}
.badge-dot { width: 7px; height: 7px; background: var(--red); border-radius: 50%; animation: pulse-green 1.5s infinite; }
.hero-title {
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 800;
  color: var(--text0);
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero-title-red { color: var(--red); }
.hero-sub {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-trust {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

/* ── Hero terminal ── */
.terminal-window {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(239,68,68,0.06);
}
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green  { background: #22c55e; }
.terminal-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  margin-left: 8px;
}
.terminal-body {
  background: var(--term-bg);
  padding: 14px 16px;
  min-height: 260px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}
.term-lines { display: flex; flex-direction: column; gap: 0; }
.term-line-anim {
  color: var(--term-text);
  opacity: 0;
  animation: fadeInLine 0.2s ease forwards;
}
@keyframes fadeInLine { from{opacity:0;transform:translateY(3px)} to{opacity:1;transform:translateY(0)} }

/* ── Stats bar ── */
.stats-bar { background: var(--bg1); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.stat-item { text-align: center; flex: 1; }
.stat-num {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--text0);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-num::after { content: attr(data-suffix); font-size: 14px; color: var(--red); }
.stat-text { font-size: 28px; }
.stat-label { font-size: 12px; color: var(--text3); letter-spacing: 0.04em; }
.stat-divider { width: 1px; background: var(--border); height: 50px; flex-shrink: 0; }

/* ── Section shared ── */
.section-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--red);
  margin-bottom: 12px;
  background: rgba(239,68,68,0.08);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(239,68,68,0.2);
}
.section-title { font-size: clamp(24px, 3vw, 36px); font-weight: 800; color: var(--text0); margin-bottom: 12px; }
.section-sub   { font-size: 15px; color: var(--text2); max-width: 520px; margin: 0 auto; line-height: 1.7; }

/* ── Features section ── */
.features-section { padding: 80px 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feat-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.feat-card:hover {
  border-color: var(--border2);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.feat-card-highlight {
  border-color: rgba(239,68,68,0.3);
  background: linear-gradient(135deg, #130d0d 0%, var(--bg1) 100%);
}
.feat-badge {
  position: absolute;
  top: -1px; right: 16px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  padding: 3px 8px;
  border-radius: 0 0 6px 6px;
  font-family: var(--font-mono);
}
.feat-icon  { font-size: 28px; margin-bottom: 12px; line-height: 1; }
.feat-title { font-size: 16px; font-weight: 700; color: var(--text0); margin-bottom: 8px; }
.feat-desc  { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 14px; }
.feat-tags  { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text3);
  letter-spacing: 0.04em;
}
.tag-red { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--red); }

/* ── How it works ── */
.hiw-section { padding: 80px 0; background: var(--bg1); }
.hiw-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  justify-content: center;
}
.hiw-step {
  flex: 1;
  max-width: 280px;
  text-align: center;
  padding: 0 24px;
}
.hiw-step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  margin-bottom: 12px;
  opacity: 0.6;
}
.hiw-step-icon {
  width: 64px;
  height: 64px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.hiw-step-title { font-size: 18px; font-weight: 700; color: var(--text0); margin-bottom: 8px; }
.hiw-step-desc  { font-size: 13px; color: var(--text2); line-height: 1.6; }
.hiw-connector {
  display: flex;
  align-items: center;
  gap: 0;
  padding-top: 32px;
  flex-shrink: 0;
}
.hiw-line { width: 30px; height: 1px; background: var(--border2); }

/* ── CTA section ── */
.cta-section { padding: 80px 0; }
.cta-card {
  position: relative;
  background: var(--bg1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
  overflow: hidden;
}
.cta-glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(239,68,68,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.cta-content { position: relative; z-index: 1; }
.cta-title { font-size: 36px; font-weight: 800; color: var(--text0); margin-bottom: 12px; }
.cta-sub   { font-size: 15px; color: var(--text2); margin-bottom: 28px; }

/* ── Footer ── */
.footer { background: var(--bg1); border-top: 1px solid var(--border); padding: 24px 0; }
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-logo { font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--red); }
.footer-copy { font-size: 12px; color: var(--text3); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 12px; color: var(--text3); text-decoration: none; }
.footer-links a:hover { color: var(--text1); }

/* ── Hero terminal animation lines ── */
.hero-scroll-hint {
  text-align: center;
  margin-top: 48px;
  font-size: 12px;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(4px)} }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  /* App layout: hide sidebar, show topbar */
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
  .sidebar.sidebar-open { transform: translateX(0); }
  .mobile-topbar { display: flex; }
  .app-main { margin-left: 0; padding: 20px 16px; padding-top: calc(var(--topbar-h) + 20px); }

  .scan-live-layout { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-right { display: none; }
  .hiw-steps { flex-direction: column; align-items: center; }
  .hiw-connector { padding-top: 0; transform: rotate(90deg); margin: 8px 0; }
}

@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }
  .stats-inner { flex-wrap: wrap; gap: 20px; }
  .stat-item { flex: none; width: 45%; }
  .stat-divider { display: none; }
  .scan-launch-row { flex-direction: column; align-items: flex-start; }
  .form-row { flex-direction: column; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .page-header { flex-direction: column; }
  .report-tabs { -webkit-overflow-scrolling: touch; }
  .hiw-step { padding: 0 8px; }
  .cta-card { padding: 32px 20px; }
  .cta-title { font-size: 26px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* =========================================================
   MOBILE RESPONSIVE — EXPANDED
   All pages: sidebar pages, RE tools, dashboard, chat
   ========================================================= */

@media (max-width: 900px) {
  /* ── Sidebar: slide-out drawer ── */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }
  .sidebar.sidebar-open { transform: translateX(0); }
  .mobile-topbar { display: flex !important; }
  .app-main {
    margin-left: 0 !important;
    padding: 20px 14px !important;
    padding-top: calc(var(--topbar-h) + 20px) !important;
  }

  /* ── Sidebar overlay backdrop ── */
  .sidebar-open ~ .sidebar-overlay { display: block; }

  /* ── Scan live layout ── */
  .scan-live-layout { grid-template-columns: 1fr !important; }

  /* ── History filter row ── */
  .filter-row { flex-direction: column; align-items: stretch; }

  /* ── Page header ── */
  .page-header { flex-direction: column; align-items: flex-start; }

  /* ── Scan topbar ── */
  .scan-topbar { flex-direction: column; align-items: flex-start; }
  .scan-topbar-right { width: 100%; justify-content: flex-end; }

  /* ── Tables — horizontal scroll wrapper ── */
  .scans-table-wrap,
  .card-body.p0 > div {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .scans-table { min-width: 540px; }

  /* ── Report KV grid ── */
  .report-kv-grid { grid-template-columns: 1fr !important; }

  /* ── Scan page report tabs scrollable ── */
  .report-tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* ── Landing hero (already in style.css, reinforce) ── */
  .hero-inner { grid-template-columns: 1fr !important; }
  .hero { padding: 100px 0 48px !important; }

  /* ── Features grid ── */
  .features-grid { grid-template-columns: 1fr 1fr !important; }

  /* ── How it works ── */
  .hiw-steps { flex-direction: column; align-items: center; }
  .hiw-connector { padding-top: 0; transform: rotate(90deg); margin: 8px 0; }
}

@media (max-width: 600px) {
  /* ── Extra small ── */
  .app-main { padding: 12px 10px !important; padding-top: calc(var(--topbar-h) + 14px) !important; }

  .features-grid { grid-template-columns: 1fr !important; }

  .stats-inner { flex-wrap: wrap; gap: 20px; }
  .stat-item { flex: none; width: 45%; }
  .stat-divider { display: none; }

  .scan-launch-row { flex-direction: column; align-items: flex-start; }
  .form-row { flex-direction: column; }
  .filter-row { flex-direction: column; align-items: stretch; }

  .page-header { flex-direction: column; }

  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .footer-inner { flex-direction: column; text-align: center; }

  .cta-card { padding: 32px 20px !important; }
  .cta-title { font-size: 26px !important; }

  /* ── Login ── */
  .login-wrap { padding: 12px !important; }
  .login-card { padding: 24px 16px !important; }

  /* ── Tables ── */
  .scans-table { min-width: 480px; font-size: 11px; }
  .scans-table th, .scans-table td { padding: 8px 10px; }

  /* ── Quick-stats grid on scan ── */
  .quick-stats-grid { grid-template-columns: 1fr 1fr; }

  /* ── Report tabs ── */
  .report-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rtab { padding: 8px 12px; font-size: 11px; }

  /* ── Terminal font ── */
  .terminal-feed { font-size: 11px !important; }

  /* ── Full-width inputs ── */
  .form-input, .form-select {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ── History page ── */
  .history-filters .filter-row { flex-direction: column; gap: 8px; }
  .filter-group, .filter-group-search { width: 100%; }

  /* ── Vuln item ── */
  .vuln-detail { word-break: break-word; }
}
