/* ── Base ── */
* { box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; }

/* ── Nav links ── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: none;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.nav-link:hover { background: #1f2937; color: #f3f4f6; }
.nav-link.active { background: #312e81; color: #a5b4fc; font-weight: 600; }
.nav-link i { opacity: 0.75; font-size: 0.8rem; }

/* ── Cards ── */
.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 20px 24px;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

/* ── KPI Cards ── */
.kpi-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.kpi-card:hover { border-color: #4f46e5; }
.kpi-card .kpi-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.kpi-card .kpi-label { font-size: 0.75rem; color: #6b7280; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-card .kpi-value { font-size: 1.6rem; font-weight: 700; color: #f9fafb; margin: 4px 0; line-height: 1.2; }
.kpi-card .kpi-sub   { font-size: 0.75rem; color: #6b7280; }
.kpi-card .kpi-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; margin-top: 6px; }
.kpi-badge.up   { background: #064e3b; color: #34d399; }
.kpi-badge.down { background: #450a0a; color: #f87171; }
.kpi-badge.neutral { background: #1f2937; color: #9ca3af; }

/* ── Tables ── */
tbody tr { border-bottom: 1px solid #1f2937; transition: background 0.1s; }
tbody tr:hover { background: #1f2937; }
tbody td { padding: 10px 0; color: #d1d5db; }
tbody tr:last-child { border-bottom: none; }

/* ── Quality badges ── */
.badge-pass { background: #064e3b; color: #34d399; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }
.badge-fail { background: #450a0a; color: #f87171; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }
.badge-cat  { background: #1e1b4b; color: #a5b4fc; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: border-color 0.15s; }
.badge-cat.active { border-color: #6366f1; color: #c7d2fe; }

/* ── Cohort heatmap ── */
.cohort-table { border-collapse: collapse; }
.cohort-table th, .cohort-table td {
  padding: 3px 6px;
  text-align: center;
  white-space: nowrap;
}
.cohort-table th { color: #6b7280; font-weight: 500; font-size: 0.7rem; }
.cohort-table td { font-size: 0.7rem; border-radius: 3px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.3s ease forwards; }

section { animation: fadeIn 0.25s ease; }
