/* ============================================================
   AIN Scanner – Theme & Base Styles
   ============================================================ */

/* ---- CSS Custom Properties (Light Theme – default) ---- */
:root {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-input: #f1f5f9;
  --bg-hover: #e2e8f0;
  --bg-sidebar: #ffffff;
  --bg-nav: rgba(255,255,255,0.85);
  --bg-card: #ffffff;
  --bg-badge: #e0f2fe;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-link: #2563eb;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;

  --critical: #7f1d1d;
  --critical-bg: #fecaca;
  --high: #dc2626;
  --high-bg: #fee2e2;
  --medium: #d97706;
  --medium-bg: #fef3c7;
  --low: #16a34a;
  --low-bg: #dcfce7;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

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

  --transition: 0.2s ease;
  --sidebar-width: 260px;
  --nav-height: 64px;

  --scrollbar-bg: #e2e8f0;
  --scrollbar-thumb: #94a3b8;
}

/* ---- Dark Theme ---- */
[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-secondary: #131c31;
  --bg-tertiary: #182237;
  --bg-input: #1e293b;
  --bg-hover: #1e293b;
  --bg-sidebar: #0f1729;
  --bg-nav: rgba(15,23,42,0.9);
  --bg-card: #131c31;
  --bg-badge: #1e3a5f;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-link: #60a5fa;
  --text-inverse: #0f172a;

  --border-color: #1e293b;
  --border-focus: #3b82f6;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: #1e3a5f;

  --success: #4ade80;
  --success-bg: #052e16;
  --warning: #fbbf24;
  --warning-bg: #422006;
  --error: #f87171;
  --error-bg: #450a0a;
  --info: #60a5fa;
  --info-bg: #172554;

  --critical: #fca5a5;
  --critical-bg: #450a0a;
  --high: #f87171;
  --high-bg: #450a0a;
  --medium: #fbbf24;
  --medium-bg: #422006;
  --low: #4ade80;
  --low-bg: #052e16;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.6), 0 8px 10px -6px rgba(0,0,0,0.4);

  --scrollbar-bg: #1e293b;
  --scrollbar-thumb: #475569;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

::selection { background: var(--accent); color: var(--text-inverse); }

/* ============================================================
   Auth Page
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  background: var(--bg-primary);
}

.auth-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37,99,235,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(99,102,241,0.08) 0%, transparent 50%);
  pointer-events: none;
}

[data-theme="dark"] .auth-page::before {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59,130,246,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(99,102,241,0.1) 0%, transparent 50%);
}

.auth-theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.auth-theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
}
.auth-theme-toggle svg { width: 18px; height: 18px; }

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.auth-header {
  text-align: center;
  padding: 2rem 2rem 1rem;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.auth-logo svg,
.auth-logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  color: var(--accent);
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin: 0 2rem;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  user-select: none;
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Auth Forms */
.auth-body { padding: 1.5rem 2rem 2rem; }

.auth-form { display: none; }
.auth-form.active { display: block; }

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-input-password {
  position: relative;
}
.form-input-password .form-input {
  padding-right: 2.75rem;
}
.form-input-password .toggle-pw {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
}
.form-input-password .toggle-pw:hover { color: var(--text-secondary); }
.form-input-password .toggle-pw svg { width: 18px; height: 18px; }

.form-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  outline: none;
  user-select: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  width: 100%;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); box-shadow: var(--shadow-md); }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) { background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-link);
  padding: 0.375rem 0.75rem;
}
.btn-ghost:hover { background: var(--accent-light); }

.btn-danger {
  background: var(--error);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) { opacity: 0.9; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-icon { padding: 0.5rem; }

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.auth-switch a, .auth-switch button {
  color: var(--text-link);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.auth-switch a:hover, .auth-switch button:hover { text-decoration: underline; }

.auth-info {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  font-size: 0.8125rem;
  color: var(--info);
}
.auth-info svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.verify-header {
  text-align: center;
  margin-bottom: 1.25rem;
}
.verify-header .verify-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.verify-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.verify-header p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.resend-row {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.resend-row button {
  color: var(--text-link);
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.pw-requirements {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  list-style: none;
}
.pw-requirements li { padding: 0.125rem 0; display: flex; align-items: center; gap: 0.375rem; }
.pw-requirements li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--border-color); display: inline-block; flex-shrink: 0; }
.pw-requirements li.met { color: var(--success); }
.pw-requirements li.met::before { background: var(--success); }

/* Toast / Alert */
.toast-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 90vw;
  width: 400px;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.8125rem;
  animation: toastIn 0.3s ease;
  border: 1px solid transparent;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }

.toast-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.toast-error { background: var(--error-bg); color: var(--error); border-color: var(--error); }
.toast-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.toast-info { background: var(--info-bg); color: var(--info); border-color: var(--info); }

.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-msg { flex: 1; line-height: 1.5; }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: 0.6; padding: 0; display: flex;
}
.toast-close:hover { opacity: 1; }
.toast-close svg { width: 16px; height: 16px; }

@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-12px); } }

/* ============================================================
   Dashboard Layout
   ============================================================ */
.dashboard { display: none; min-height: 100vh; }
.dashboard.active { display: flex; }

/* Top Nav */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 50;
  transition: background var(--transition);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: var(--radius-sm);
}
.nav-hamburger:hover { background: var(--bg-hover); }
.nav-hamburger svg { width: 24px; height: 24px; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}
.nav-brand svg,
.nav-brand img { width: 28px; height: 28px; object-fit: contain; color: var(--accent); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.nav-user:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.nav-theme-btn, .nav-logout-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  transition: all var(--transition);
}
.nav-theme-btn:hover, .nav-logout-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-theme-btn svg, .nav-logout-btn svg { width: 18px; height: 18px; }

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 40;
  transition: transform 0.3s ease, background var(--transition);
  padding: 1rem 0;
}

.sidebar-section {
  padding: 0 0.75rem;
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-item.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-badge);
  color: var(--accent);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-top: var(--nav-height);
  overflow-x: hidden;
  min-width: 0;
  padding: 1.5rem;
  min-height: calc(100vh - var(--nav-height));
  transition: margin var(--transition);
}

.page { display: none; max-width: 100%; overflow-x: hidden; }
.page.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 39;
}

/* ============================================================
   Scanner UI Components
   ============================================================ */

/* Page Header */
.page-header {
  margin-bottom: 1.5rem;
}
.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Scan Form */
.scan-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.scan-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.scan-form-group {
  flex: 1;
  min-width: 200px;
}

.scan-form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.scan-form-group input,
.scan-form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: all var(--transition);
  outline: none;
}
.scan-form-group input:focus,
.scan-form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.scan-form-group select { cursor: pointer; }

.scan-btn {
  padding: 0.5rem 1.5rem;
  white-space: nowrap;
}

/* Results Container */
.results-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.results-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-actions { display: flex; gap: 0.5rem; }

.results-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-word;
}

.results-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-tertiary);
}
.results-empty svg { width: 48px; height: 48px; margin: 0 auto 0.75rem; opacity: 0.4; }
.results-empty p { font-size: 0.9rem; }

/* Streaming Output */
.stream-output {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
}

/* Markdown Output */
.md-output {
  font-size: 0.875rem;
  line-height: 1.7;
}
.md-output h1 { font-size: 1.5rem; font-weight: 700; margin: 1.5rem 0 0.75rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.md-output h2 { font-size: 1.25rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
.md-output h3 { font-size: 1.1rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.md-output h4 { font-size: 1rem; font-weight: 600; margin: 0.75rem 0 0.375rem; }
.md-output p { margin-bottom: 0.75rem; }
.md-output ul, .md-output ol { margin-bottom: 0.75rem; padding-left: 1.5rem; }
.md-output li { margin-bottom: 0.25rem; }
.md-output table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.8125rem; }
.md-output th, .md-output td { padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); text-align: left; }
.md-output th { background: var(--bg-tertiary); font-weight: 600; }
.md-output tr:nth-child(even) { background: var(--bg-tertiary); }
.md-output code { font-family: var(--font-mono); background: var(--bg-input); padding: 0.125rem 0.375rem; border-radius: 4px; font-size: 0.8125rem; }
.md-output pre { background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; margin: 0.75rem 0; }
.md-output pre code { background: none; padding: 0; font-size: 0.8125rem; }
.md-output blockquote { border-left: 3px solid var(--accent); padding: 0.5rem 1rem; margin: 0.75rem 0; background: var(--bg-tertiary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.md-output hr { border: none; border-top: 1px solid var(--border-color); margin: 1.5rem 0; }

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-bar {
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.loading-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6366f1, var(--accent));
  background-size: 200% 100%;
  animation: loadingSlide 1.5s ease infinite;
  border-radius: 2px;
}
@keyframes loadingSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }

/* CVE Table */
.cve-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.cve-table th, .cve-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.cve-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  position: sticky;
  top: 0;
}
.cve-table tr:hover td { background: var(--bg-hover); }

.severity-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.severity-critical { background: var(--critical-bg); color: var(--critical); }
.severity-high { background: var(--high-bg); color: var(--high); }
.severity-medium { background: var(--medium-bg); color: var(--medium); }
.severity-low { background: var(--low-bg); color: var(--low); }
.severity-unknown { background: var(--bg-input); color: var(--text-tertiary); }

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stat-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 0.375rem;
}
.stat-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.quick-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  font-family: var(--font-sans);
}
.quick-action:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  flex-shrink: 0;
}
.quick-action-icon svg { width: 20px; height: 20px; }
.quick-action-text h4 { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.125rem; }
.quick-action-text p { font-size: 0.75rem; color: var(--text-tertiary); line-height: 1.4; }

/* Progress Steps */
.scan-progress {
  padding: 1rem 0;
}
.scan-progress-step {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.scan-progress-step .step-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.scan-progress-step.active { color: var(--accent); font-weight: 600; }
.scan-progress-step.done { color: var(--success); }
.scan-progress-step.done .step-icon svg { color: var(--success); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .sidebar-overlay.active { display: block; }
  .main-content { margin-left: 0; }
  .nav-hamburger { display: flex; }
}

@media (max-width: 768px) {
  .auth-card { max-width: 100%; }
  .auth-body { padding: 1.25rem 1.25rem 1.5rem; }
  .auth-header { padding: 1.5rem 1.25rem 0.75rem; }
  .auth-tabs { margin: 0 1.25rem; }

  .scan-form-row { flex-direction: column; }
  .scan-form-group { min-width: 100%; }
  .scan-btn { width: 100%; }

  .main-content { padding: 1rem; }
  .page-header h2 { font-size: 1.25rem; }

  .results-body { padding: 1rem; max-height: 60vh; }

  .quick-actions { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .top-nav { padding: 0 1rem; }
  .nav-user-name { display: none; }

  .cve-table { display: block; overflow-x: auto; }
}

@media (max-width: 480px) {
  .auth-theme-toggle span { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .nav-brand span { display: none; }
  .results-header { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
}

/* ============================================================
   Account Page
   ============================================================ */
.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.account-avatar-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.account-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}

.account-avatar-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.125rem;
}

.account-avatar-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.account-details {
  padding: 0.5rem 0;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}
.account-row:last-child { border-bottom: none; }

.account-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.account-label svg { color: var(--text-tertiary); flex-shrink: 0; }

.account-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
}

.account-value-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.account-badge {
  display: inline-block;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.account-badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.account-badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.account-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .account-avatar-section { padding: 1.25rem; }
  .account-row { padding: 0.875rem 1.25rem; flex-direction: column; align-items: flex-start; gap: 0.375rem; }
  .account-value { text-align: left; }
}

/* ---- Plan badges & subscription UI ---- */
.nav-plan-badge { margin-left: 0.5rem; }
.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}
.plan-badge-free {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.plan-badge-premium {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: var(--text-inverse);
}

.account-upgrade-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.account-upgrade-section h4 { margin: 0 0 0.5rem 0; }
.account-upgrade-section > p { margin: 0 0 1rem 0; color: var(--text-secondary); font-size: 0.9rem; }

.pricing-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.pricing-card {
  flex: 1;
  min-width: 140px;
  padding: 1.25rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  position: relative;
}
.pricing-card-featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.pricing-badge {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: white;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}
.pricing-card h5 { margin: 0 0 0.5rem 0; font-size: 1rem; }
.pricing-amount { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.pricing-amount .currency { font-size: 1rem; }
.pricing-amount .period { font-size: 0.85rem; font-weight: 400; color: var(--text-secondary); }
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  text-align: left;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.pricing-features li {
  padding: 0.25rem 0;
  padding-left: 1.25rem;
  position: relative;
}
.pricing-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.pricing-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  text-align: center;
}

.limit-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}
.limit-badge-free { background: var(--accent-light); color: var(--accent); }
.limit-badge-premium { background: var(--success-bg); color: var(--success); }
.limit-badge-exhausted { background: var(--error-bg); color: var(--error); }
.limit-upgrade-link {
  color: var(--error);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.limit-upgrade-link:hover { opacity: 0.8; }

.limit-reached-card {
  text-align: center;
  padding: 2rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.limit-reached-icon { font-size: 2.5rem; margin-bottom: 0.5rem; color: var(--warning); }
.limit-reached-card h4 { margin: 0 0 0.5rem 0; }
.limit-reached-card p { margin: 0 0 1rem 0; color: var(--text-secondary); font-size: 0.9rem; }

/* ============================================================
   Utility Classes
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.w-full { width: 100%; }

/* ============================================================
   Scan Timer
   ============================================================ */
.scan-timer-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3rem 1rem; gap: 1rem;
}
.scan-pulse-ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid var(--accent); position: relative;
  animation: pulseRing 1.8s ease-in-out infinite;
}
.scan-pulse-dot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 12px var(--accent);
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35); }
  50% { transform: scale(1.15); opacity: 0.85; box-shadow: 0 0 0 12px rgba(59, 130, 246, 0); }
}
@keyframes pulseDot {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
}
.scan-elapsed {
  font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text-primary); letter-spacing: 0.05em;
}
.scan-status-label { color: var(--text-tertiary); font-size: 0.875rem; }

/* ============================================================
   Scan Result Cards
   ============================================================ */
.scan-result-cards { display: flex; flex-direction: column; gap: 1rem; max-width: 100%; overflow: hidden; }

.stat-row {
  display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem;
}
.stat-chip {
  display: flex; flex-direction: column; align-items: center; padding: 0.75rem 1.25rem;
  background: var(--bg-tertiary); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); min-width: 80px;
}
.stat-chip.stat-critical { border-color: var(--error); background: rgba(239,68,68,0.08); }
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.stat-critical .stat-num { color: var(--error); }
.stat-label { font-size: 0.75rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }

.result-table-wrap { overflow-x: auto; max-width: 100%; }
.result-table {
  width: 100%; border-collapse: collapse; font-size: 0.875rem;
  table-layout: fixed;
}
.result-table th, .result-table td {
  padding: 0.625rem 0.75rem; text-align: left;
  border-bottom: 1px solid var(--border-color);
  overflow-wrap: break-word; word-break: break-word;
}
.result-table th {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-tertiary); background: var(--bg-tertiary);
}
.result-table tbody tr:hover { background: var(--bg-tertiary); }

/* CVE Cards */
.cve-cards { display: flex; flex-direction: column; gap: 0.625rem; }
.cve-card {
  padding: 0.875rem; border: 1px solid var(--border-color);
  border-radius: var(--radius-md); background: var(--bg-secondary);
  overflow: hidden; word-break: break-word;
}
.cve-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.375rem; }
.cve-score { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.cve-desc { font-size: 0.8125rem; color: var(--text-secondary); margin: 0.25rem 0; line-height: 1.5; }
.cve-mitigation { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.375rem; padding-top: 0.375rem; border-top: 1px solid var(--border-color); }

/* Security Headers */
.sec-headers { margin-top: 0.5rem; }
.sec-headers h4 { margin: 0 0 0.5rem 0; font-size: 0.875rem; }
.header-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.header-item {
  display: flex; align-items: center; gap: 0.375rem; padding: 0.5rem;
  border-radius: var(--radius-sm); font-size: 0.8125rem; background: var(--bg-tertiary);
  overflow: hidden; min-width: 0;
}
.header-item strong { font-weight: 600; overflow-wrap: break-word; min-width: 0; }
.header-icon { font-size: 0.875rem; }
.header-ok .header-icon { color: var(--success); }
.header-warn .header-icon { color: var(--warning); }
.header-item span:last-child { color: var(--text-tertiary); font-size: 0.75rem; margin-left: auto; word-break: break-all; }

/* Findings list */
.findings-list h4 { margin: 0 0 0.5rem 0; font-size: 0.875rem; }
.finding-item {
  padding: 0.5rem 0.75rem; border-left: 3px solid var(--warning);
  margin-bottom: 0.375rem; font-size: 0.8125rem;
  background: var(--bg-tertiary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  overflow: hidden; word-break: break-word;
}

/* IP Info Grid */
.ip-info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.625rem;
}
.ip-field {
  display: flex; flex-direction: column; padding: 0.75rem;
  background: var(--bg-tertiary); border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.ip-field-warn { border-color: var(--error); }
.ip-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 0.25rem; }
.ip-value { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); word-break: break-all; }
.ip-field-warn .ip-value { color: var(--error); }

/* AI Report Expandable */
.ai-report-section {
  margin-top: 0.75rem; border: 1px solid var(--border-color);
  border-radius: var(--radius-md); overflow: hidden;
}
.ai-report-section summary {
  cursor: pointer; padding: 0.75rem 1rem; font-weight: 600; font-size: 0.875rem;
  background: var(--bg-tertiary); color: var(--text-primary);
  list-style: none; display: flex; align-items: center; gap: 0.5rem;
}
.ai-report-section summary::before { content: "▸"; transition: transform 0.2s; }
.ai-report-section[open] summary::before { transform: rotate(90deg); }
.ai-report-body {
  padding: 1rem; font-size: 0.875rem; line-height: 1.7; color: var(--text-secondary);
  overflow-x: auto; word-break: break-word;
}
.ai-report-body h1, .ai-report-body h2, .ai-report-body h3 { color: var(--text-primary); margin-top: 1rem; }
.ai-report-body ul, .ai-report-body ol { padding-left: 1.25rem; }
.ai-report-body code { background: var(--bg-tertiary); padding: 0.125rem 0.375rem; border-radius: 3px; font-size: 0.8125rem; }
.ai-report-body pre { background: var(--bg-tertiary); padding: 0.75rem; border-radius: var(--radius-sm); overflow-x: auto; }

/* Metadata grid */
.scan-metadata { margin-bottom: 1rem; }
.scan-metadata h4 { margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--text-secondary); }
.metadata-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.5rem;
}
.metadata-item {
  display: flex; flex-direction: column; padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary); border-radius: var(--radius-sm);
}
.metadata-label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.metadata-value { font-size: 0.875rem; font-weight: 500; color: var(--text-primary); overflow-wrap: break-word; word-break: break-word; }
.status-badge { font-size: 0.75rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 999px; display: inline-block; }
.status-up { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-down { background: rgba(239,68,68,0.15); color: #ef4444; }
.status-unknown { background: rgba(156,163,175,0.15); color: #9ca3af; }
.status-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.status-failed { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Vulnerability cards */
.vulns-section { margin-top: 1rem; }
.vulns-section h4 { margin: 0 0 0.5rem; font-size: 0.9375rem; color: var(--text-primary); }
.vuln-cards { display: flex; flex-direction: column; gap: 0.5rem; }
.vuln-card {
  background: var(--bg-tertiary); border-radius: var(--radius-sm); padding: 0.625rem 0.75rem;
  border-left: 3px solid var(--text-muted); overflow: hidden; word-break: break-word;
}
.vuln-card-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
.vuln-score { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.vuln-card-meta { display: flex; gap: 0.75rem; margin-top: 0.25rem; font-size: 0.75rem; color: var(--text-muted); flex-wrap: wrap; }
.vuln-state { font-weight: 600; color: #ef4444; }
.vuln-count-badge {
  display: inline-block; background: rgba(239,68,68,0.15); color: #ef4444;
  font-size: 0.75rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 999px;
}

/* Nikto findings */
.nikto-findings { margin-top: 0.5rem; }
.nikto-group { margin-bottom: 1rem; }
.nikto-group-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; margin: 0 0 0.5rem; }
.nikto-item {
  padding: 0.5rem 0.75rem; margin-bottom: 0.375rem; border-radius: var(--radius-sm);
  background: var(--bg-tertiary); border-left: 3px solid var(--text-muted);
  overflow: hidden; word-break: break-word;
}
.nikto-high { border-left-color: #ef4444; }
.nikto-medium { border-left-color: #f59e0b; }
.nikto-low { border-left-color: #3b82f6; }
.nikto-info { border-left-color: #6b7280; }
.nikto-item-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.nikto-ref { font-weight: 600; font-size: 0.8125rem; color: var(--accent); }
.nikto-type { font-size: 0.6875rem; text-transform: uppercase; padding: 0.125rem 0.375rem; border-radius: 3px; background: var(--bg-secondary); color: var(--text-muted); }
.nikto-path { font-size: 0.8125rem; color: var(--text-secondary); word-break: break-all; }
.nikto-desc { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.4; word-break: break-word; }

/* Pentest result blocks */
.pentest-result-block { margin-bottom: 1rem; padding: 0.75rem; border-radius: var(--radius-md); background: var(--bg-secondary); overflow: hidden; word-break: break-word; }
.pentest-cmd-title { margin: 0 0 0.5rem; font-size: 0.875rem; display: flex; align-items: center; gap: 0.5rem; }

/* Severity info badge */
.severity-info { background: rgba(107,114,128,0.15); color: #6b7280; }

/* Abuse section */
.abuse-section { margin-top: 1rem; }
.abuse-section h4 { margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--text-secondary); }

/* Scan History */
.scan-history-section {
  margin-top: 1.5rem; padding: 1.25rem; border-radius: var(--radius-lg);
  background: var(--bg-secondary); border: 1px solid var(--border);
}
.scan-history-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;
}
.scan-history-header h4 { margin: 0; font-size: 1rem; color: var(--text-primary); }
.scan-history-table td, .scan-history-table th { vertical-align: middle; }
.scan-type-badge {
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.125rem 0.5rem; border-radius: 999px;
  background: rgba(99,102,241,0.12); color: var(--accent);
}
.history-actions { display: flex; gap: 0.375rem; }
.btn-xs { font-size: 0.75rem; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); }
.btn-sm { font-size: 0.8125rem; padding: 0.375rem 0.75rem; }

.scan-history-detail { margin-top: 0.5rem; }
.scan-history-detail-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem;
  flex-wrap: wrap; gap: 0.5rem;
}

/* AI Premium Gate */
.ai-premium-gate {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(99,102,241,0.02));
  border: 1px dashed rgba(99,102,241,0.3);
  border-radius: var(--radius);
  margin-top: 1rem;
}
.ai-premium-gate .ai-premium-icon {
  color: var(--accent);
  margin-bottom: 0.75rem;
  opacity: 0.7;
}
.ai-premium-gate h4 {
  margin: 0 0 0.5rem; font-size: 1.125rem; color: var(--text);
}
.ai-premium-gate p {
  margin: 0 0 1.25rem; color: var(--text-secondary); font-size: 0.9rem; max-width: 420px; margin-left: auto; margin-right: auto;
}

/* PDF accent button in history table */
.btn-accent {
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.btn-accent:hover { opacity: 0.85; }
.btn-accent:disabled { opacity: 0.4; cursor: not-allowed; }

/* Mobile responsive */
@media (max-width: 640px) {
  .stat-row { gap: 0.5rem; }
  .stat-chip { min-width: 60px; padding: 0.5rem 0.75rem; }
  .stat-num { font-size: 1.25rem; }
  .header-grid { grid-template-columns: 1fr; }
  .ip-info-grid { grid-template-columns: 1fr; }
  .result-table { font-size: 0.75rem; }
  .result-table th, .result-table td { padding: 0.375rem 0.5rem; font-size: 0.75rem; }
  .cve-card { padding: 0.625rem; }
  .cve-header { font-size: 0.8125rem; }
  .cve-desc, .cve-mitigation { font-size: 0.75rem; }
  .scan-elapsed { font-size: 1.5rem; }
  .metadata-grid { grid-template-columns: 1fr; }
  .vuln-card { padding: 0.5rem 0.625rem; }
  .vuln-card-header { font-size: 0.8125rem; }
  .vuln-card-meta { font-size: 0.6875rem; }
  .nikto-item-header { font-size: 0.75rem; }
  .nikto-desc { font-size: 0.75rem; }
  .scan-history-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .history-actions { flex-direction: column; }
  .header-item { flex-wrap: wrap; }
  .header-item span:last-child { margin-left: 0; }
  .pentest-result-block { padding: 0.5rem; }
  .ai-report-body { padding: 0.75rem; font-size: 0.8125rem; }
}
