/* ═══════════════════════════════════════════════════════════════════════════════
   AXIS-FAVITECH · SOC RADAR — Professional Vulnerability Analysis Interface
   Design System: Dark Mode Cybersecurity Theme
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────────
   CSS RESET & BASE VARIABLES
───────────────────────────────────────────────────────────────────────────────── */

:root {
  /* Colors - Dark Mode Cyber Theme */
  --bg-dark: #0d1117;
  --bg-surface: #161b22;
  --bg-elevated: #21262d;
  --bg-hover: #30363d;
  --bg-active: #484f58;
  
  /* Accent Colors */
  --primary: #58a6ff;
  --primary-hover: #79b8ff;
  --accent-cyan: #39d4d4;
  --accent-green: #3fb950;
  --accent-yellow: #d29922;
  --accent-orange: #f0883e;
  --accent-red: #f85149;
  --accent-purple: #a371f7;
  
  /* Severity Colors */
  --severity-critical: #f85149;
  --severity-high: #f0883e;
  --severity-medium: #d29922;
  --severity-low: #3fb950;
  --severity-info: #58a6ff;
  
  /* Text */
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  
  /* Borders */
  --border-default: #30363d;
  --border-muted: #21262d;
  
  /* Effects */
  --glow-primary: 0 0 20px rgba(88, 166, 255, 0.3);
  --glow-danger: 0 0 20px rgba(248, 81, 73, 0.3);
  --glow-success: 0 0 20px rgba(63, 185, 80, 0.3);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  /* Fonts */
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  
  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-dark);
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

.txt-soft { color: var(--text-secondary); }
.txt-muted { color: var(--text-muted); }
.txt-primary { color: var(--primary); }
.txt-success { color: var(--accent-green); }
.txt-warning { color: var(--accent-yellow); }
.txt-danger { color: var(--severity-critical); }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   AUTH SCREEN
───────────────────────────────────────────────────────────────────────────────── */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(ellipse at top, rgba(88, 166, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(163, 113, 247, 0.05) 0%, transparent 50%),
    var(--bg-dark);
}

.auth-container {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: var(--space-2xl);
  padding: var(--space-xl);
}

@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
  .auth-hero { display: none; }
}

.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: var(--space-2xl);
}

.auth-logo {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.auth-logo .radar-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(88, 166, 255, 0.4); }
  50% { box-shadow: 0 0 40px rgba(88, 166, 255, 0.6); }
}

.auth-tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.auth-feature-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.auth-feature h4 {
  margin-bottom: 4px;
}

.auth-feature p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Auth Card */
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.auth-card-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-card-header .logo-sm {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

/* Free Scan Section */
.free-scan-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.free-scan-box h4 {
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.scan-input-row {
  display: flex;
  gap: var(--space-sm);
}

.scan-input-row .input {
  flex: 1;
}

#freeScanResult {
  margin-top: var(--space-md);
}

.scan-result-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.scan-result-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scan-result-header h4 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.scan-result-body {
  padding: var(--space-md);
}

.finding-preview {
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.finding-preview:last-child {
  margin-bottom: 0;
}

.finding-preview .finding-title {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.finding-preview .finding-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.scan-cta {
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-surface));
  padding: var(--space-md);
  text-align: center;
  border-top: 1px solid var(--border-default);
}

.scan-cta p {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-default);
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.auth-tab:hover {
  color: var(--text-primary);
}

.auth-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Auth forms */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: var(--space-md);
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.input.sm {
  padding: 8px 12px;
  font-size: 0.875rem;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: var(--glow-primary);
}

.btn.secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn.secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn.danger {
  background: var(--severity-critical);
  color: #fff;
}

.btn.danger:hover:not(:disabled) {
  box-shadow: var(--glow-danger);
}

.btn.success {
  background: var(--accent-green);
  color: #fff;
}

.btn.success:hover:not(:disabled) {
  box-shadow: var(--glow-success);
}

.btn.ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn.ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn.sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn.lg {
  padding: 14px 24px;
  font-size: 1rem;
}

.btn.block {
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   APP SHELL (SIDEBAR + TOPBAR)
───────────────────────────────────────────────────────────────────────────────── */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas: 
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: fixed;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-default);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar-logo .icon-radar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: 50%;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-elevated);
  color: var(--primary);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--severity-critical);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border-default);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.user-info:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-purple), var(--primary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-details {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-weight: 500;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.plan-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-badge.free { background: var(--bg-elevated); color: var(--text-secondary); }
.plan-badge.pro { background: var(--primary); color: #fff; }
.plan-badge.enterprise { background: var(--accent-purple); color: #fff; }

/* Topbar */
.topbar {
  grid-area: topbar;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  margin-left: var(--sidebar-width);
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--topbar-height);
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.view-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-btn {
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.topbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Main Content */
.main-content {
  grid-area: main;
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: var(--space-xl);
  min-height: calc(100vh - var(--topbar-height));
}

/* ─────────────────────────────────────────────────────────────────────────────────
   VIEWS & SECTIONS
───────────────────────────────────────────────────────────────────────────────── */

.view {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────────────────────
   METRICS CARDS
───────────────────────────────────────────────────────────────────────────────── */

.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.metric-card.accent-blue::before { background: var(--primary); }
.metric-card.accent-red::before { background: var(--severity-critical); }
.metric-card.accent-green::before { background: var(--accent-green); }
.metric-card.accent-yellow::before { background: var(--accent-yellow); }
.metric-card.accent-purple::before { background: var(--accent-purple); }

.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.metric-value.danger { color: var(--severity-critical); }
.metric-value.warning { color: var(--accent-yellow); }
.metric-value.success { color: var(--accent-green); }

.metric-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   RADAR PANELS
───────────────────────────────────────────────────────────────────────────────── */

.radar-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.panel-hdr {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-hdr h3 {
  font-size: 1rem;
}

.panel-bdy {
  padding: var(--space-lg);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   SEVERITY BARS & TAGS
───────────────────────────────────────────────────────────────────────────────── */

.severity-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.sev-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sev-label {
  width: 80px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
}

.sev-label.critical { color: var(--severity-critical); }
.sev-label.high { color: var(--severity-high); }
.sev-label.medium { color: var(--severity-medium); }
.sev-label.low { color: var(--severity-low); }
.sev-label.info { color: var(--severity-info); }

.sev-track {
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.sev-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.sev-fill.critical { background: var(--severity-critical); }
.sev-fill.high { background: var(--severity-high); }
.sev-fill.medium { background: var(--severity-medium); }
.sev-fill.low { background: var(--severity-low); }
.sev-fill.info { background: var(--severity-info); }

.sev-count {
  width: 40px;
  text-align: right;
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Severity Tags */
.sev-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.sev-tag.critical { background: rgba(248, 81, 73, 0.15); color: var(--severity-critical); }
.sev-tag.high { background: rgba(240, 136, 62, 0.15); color: var(--severity-high); }
.sev-tag.medium { background: rgba(210, 153, 34, 0.15); color: var(--severity-medium); }
.sev-tag.low { background: rgba(63, 185, 80, 0.15); color: var(--severity-low); }
.sev-tag.info { background: rgba(88, 166, 255, 0.15); color: var(--severity-info); }

/* ─────────────────────────────────────────────────────────────────────────────────
   TABLES
───────────────────────────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-muted);
}

.data-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.data-table tbody tr {
  transition: var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table td {
  font-size: 0.875rem;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   CARDS & GRIDS
───────────────────────────────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Project Cards */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-fast);
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.project-card h3 {
  margin-bottom: var(--space-xs);
}

.project-targets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.domain-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

/* Finding Cards */
.finding-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border-left: 4px solid var(--border-default);
}

.finding-card.critical { border-left-color: var(--severity-critical); }
.finding-card.high { border-left-color: var(--severity-high); }
.finding-card.medium { border-left-color: var(--severity-medium); }
.finding-card.low { border-left-color: var(--severity-low); }
.finding-card.info { border-left-color: var(--severity-info); }

/* ─────────────────────────────────────────────────────────────────────────────────
   SCAN VIEW
───────────────────────────────────────────────────────────────────────────────── */

.scan-form-container {
  max-width: 800px;
}

.scan-type-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.scan-type-option {
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.scan-type-option:hover {
  border-color: var(--text-muted);
}

.scan-type-option.selected {
  border-color: var(--primary);
  background: rgba(88, 166, 255, 0.1);
}

.scan-type-option .type-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.scan-type-option .type-name {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.scan-type-option .type-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.scan-type-option .type-plan {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: 0.65rem;
  padding: 2px 6px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* Scan History */
.scan-history {
  margin-top: var(--space-xl);
}

.scan-item {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.scan-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.scan-status.running {
  background: var(--accent-cyan);
  animation: pulse 1.5s infinite;
}

.scan-status.completed { background: var(--accent-green); }
.scan-status.failed { background: var(--severity-critical); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.scan-target {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.scan-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   COMPLIANCE VIEW
───────────────────────────────────────────────────────────────────────────────── */

.compliance-score-ring {
  width: 180px;
  height: 180px;
  margin: 0 auto var(--space-lg);
  position: relative;
}

.compliance-score-ring svg {
  transform: rotate(-90deg);
}

.compliance-score-ring .ring-bg {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 12;
}

.compliance-score-ring .ring-fill {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 110;
  transition: stroke-dashoffset 1s ease;
}

.compliance-score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  font-weight: 700;
}

.compliance-frameworks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.framework-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.framework-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.framework-name {
  font-weight: 600;
}

.framework-score {
  font-size: 1.5rem;
  font-weight: 700;
}

.framework-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.framework-bar-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   ENGAGEMENTS VIEW
───────────────────────────────────────────────────────────────────────────────── */

.engagement-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-fast);
}

.engagement-card:hover {
  border-color: var(--primary);
}

.engagement-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.engagement-name {
  font-size: 1.125rem;
  font-weight: 600;
}

.engagement-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.engagement-status.active {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent-green);
}

.engagement-status.completed {
  background: rgba(88, 166, 255, 0.15);
  color: var(--primary);
}

.engagement-stats {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-muted);
}

.engagement-stat {
  text-align: center;
}

.engagement-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.engagement-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   SETTINGS VIEW
───────────────────────────────────────────────────────────────────────────────── */

.detail-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.detail-list div {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.plan-display {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.plan-display .plan-badge {
  font-size: 1rem;
  padding: var(--space-sm) var(--space-md);
}

.plan-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
───────────────────────────────────────────────────────────────────────────────── */

#toastContainer {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--severity-critical); }
.toast.warn { border-left: 4px solid var(--accent-yellow); }
.toast.info { border-left: 4px solid var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─────────────────────────────────────────────────────────────────────────────────
   EMPTY STATES
───────────────────────────────────────────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   LOADER & SPINNER
───────────────────────────────────────────────────────────────────────────────── */

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-elevated);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────────────────────────────
   FORM UTILITIES
───────────────────────────────────────────────────────────────────────────────── */

.form-row {
  display: flex;
  gap: var(--space-md);
  align-items: flex-end;
}

.form-row .form-group.grow {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
───────────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .topbar,
  .main-content {
    margin-left: 0;
  }
  
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─────────────────────────────────────────────────────────────────────────────────
   SCROLLBAR STYLING
───────────────────────────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-hover);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-active);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   UTILITIES
───────────────────────────────────────────────────────────────────────────────── */

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }

.hidden { display: none !important; }
.visible { display: block !important; }
