/* vuls checker - main styles */

:root {
  --color-immediate: #dc2626;
  --color-oob: #ea580c;
  --color-scheduled: #ca8a04;
  --color-defer: #16a34a;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8fafc;
}

/* ── Layout ── */
#app { min-height: 100vh; }

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: #0f172a;
  color: #cbd5e1;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid #1e293b;
}

.sidebar-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.025em;
}

.sidebar-logo span {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav { padding: 12px 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #94a3b8;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover { background: #1e293b; color: #e2e8f0; }
.nav-item.active { background: #1e40af; color: #fff; }
.nav-item i { width: 16px; text-align: center; }

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* ── Header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Summary badges ── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.summary-card {
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid transparent;
}

.summary-card .count { font-size: 2rem; font-weight: 800; line-height: 1; }
.summary-card .label { font-size: 0.75rem; font-weight: 500; margin-top: 4px; opacity: 0.8; }

.summary-immediate { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.summary-oob       { background: #ffedd5; border-color: #fdba74; color: #9a3412; }
.summary-scheduled { background: #fef9c3; border-color: #fde047; color: #854d0e; }
.summary-defer     { background: #dcfce7; border-color: #86efac; color: #14532d; }
.summary-total     { background: #f1f5f9; border-color: #cbd5e1; color: #0f172a; }
.summary-kev       { background: #fdf4ff; border-color: #e879f9; color: #701a75; }

/* ── SSVC badges ── */
.ssvc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.ssvc-Immediate  { background: #fee2e2; color: #dc2626; }
.ssvc-Out-of-Band { background: #ffedd5; color: #ea580c; }
.ssvc-Scheduled  { background: #fef9c3; color: #ca8a04; }
.ssvc-Defer      { background: #dcfce7; color: #16a34a; }

/* ── CVSS badges ── */
.cvss-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.cvss-CRITICAL { background: #7f1d1d; color: #fff; }
.cvss-HIGH     { background: #dc2626; color: #fff; }
.cvss-MEDIUM   { background: #f97316; color: #fff; }
.cvss-LOW      { background: #eab308; color: #fff; }
.cvss-NONE     { background: #94a3b8; color: #fff; }

/* ── KEV badge ── */
.kev-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #fdf4ff;
  color: #a21caf;
  border: 1px solid #e879f9;
}

/* ── Table ── */
.findings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.findings-table th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.findings-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.findings-table tr:hover td { background: #f8fafc; }

.pkg-name { font-weight: 600; color: #0f172a; }
.pkg-ver  { font-size: 0.75rem; color: #64748b; }
.cve-id   { font-family: monospace; font-size: 0.8rem; color: #2563eb; }

/* ── File drop zone ── */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: #3b82f6;
  background: #eff6ff;
}

.drop-zone i { font-size: 2rem; color: #94a3b8; margin-bottom: 12px; }
.drop-zone p { color: #64748b; font-size: 0.875rem; }

/* ── File chips ── */
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #1d4ed8;
  margin: 4px;
}

.file-chip button {
  background: none; border: none; cursor: pointer;
  color: #93c5fd; padding: 0; font-size: 0.75rem;
}
.file-chip button:hover { color: #dc2626; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }

.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }

.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 6px; }

.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-input::placeholder { color: #9ca3af; }

.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: monospace;
  color: #111827;
  background: #fff;
  outline: none;
  resize: vertical;
  min-height: 120px;
}
.form-textarea:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: #64748b;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  border-radius: 6px 6px 0 0;
}

.tab-btn:hover { color: #0f172a; background: #f8fafc; }
.tab-btn.active { color: #2563eb; border-bottom-color: #2563eb; background: #eff6ff; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warn    { background: #fff7ed; color: #9a3412; border: 1px solid #fdba74; }

/* ── Auth page ── */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
}

.auth-logo .subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
}

/* ── Loading spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.spinner-dark {
  border-color: rgba(37,99,235,0.2);
  border-top-color: #2563eb;
}

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

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── DB Status ── */
.db-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.db-status-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
}

.db-status-card .source { font-weight: 600; font-size: 0.875rem; color: #0f172a; }
.db-status-card .meta { font-size: 0.75rem; color: #64748b; margin-top: 4px; }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-ok      { background: #22c55e; }
.status-pending { background: #f59e0b; }
.status-error   { background: #ef4444; }

/* ── Sort controls ── */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sort-btn {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  transition: all 0.15s;
}

.sort-btn:hover { background: #f1f5f9; }
.sort-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ── Scrollable table wrapper ── */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid #e2e8f0; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: #94a3b8;
}

.empty-state i { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: #64748b; margin-bottom: 8px; }
.empty-state p  { font-size: 0.875rem; }

/* ── Progress bar ── */
.progress-bar {
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ── Tooltip ── */
.tooltip-wrap { position: relative; display: inline-block; }
.tooltip-wrap .tooltip-text {
  visibility: hidden;
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 100;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}
.tooltip-wrap:hover .tooltip-text { visibility: visible; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { padding: 16px; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}
