/* MODULE: Leads | FILE: styles.css */
/* Styles for the lead quality scoring page. */

.leads-page {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.leads-page__title {
  font-size: 24px;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 8px;
}

.leads-page__subtitle {
  font-size: 13px;
  color: #8b8fa3;
  margin-bottom: 24px;
}

.leads-loading {
  color: #8b8fa3;
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}

/* ─── KPI row ──────────────────────────────────────────────────────── */

.leads-kpis {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.leads-kpi {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 16px 22px;
  min-width: 140px;
  flex: 1;
}

.leads-kpi__label {
  font-size: 11px;
  color: #8b8fa3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.leads-kpi__value {
  font-size: 24px;
  font-weight: 700;
  color: #e0e0e0;
}

/* ─── Lead Table ───────────────────────────────────────────────────── */

.lead-table-wrap {
  overflow-x: auto;
  background: #1e2235;
  border-radius: 10px;
  border: 1px solid #2a2f4e;
  margin-bottom: 24px;
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.lead-table th {
  text-align: left;
  padding: 10px 14px;
  color: #8b8fa3;
  font-weight: 600;
  border-bottom: 1px solid #2a2f4e;
  white-space: nowrap;
  cursor: pointer;
}

.lead-table td {
  padding: 10px 14px;
  color: #c4c7d4;
  border-bottom: 1px solid #2a2f4e22;
  white-space: nowrap;
}

.lead-table tr:last-child td {
  border-bottom: none;
}

.lead-table tr:hover td {
  background: #252a40;
}

.lead-table tr.lead-table__row--selected td {
  background: #2a2f4e;
}

.lead-table__filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.lead-table__source-filter {
  padding: 0.35rem 0.65rem;
  background: #151929;
  border: 1px solid #2a2f4e;
  border-radius: 6px;
  color: #e2e4ec;
  font-size: 0.78rem;
}
.lead-table__source-tag {
  padding: 0.12rem 0.45rem;
  background: rgba(99,91,255,0.1);
  color: #635bff;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
}

.grade-badge {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}

.grade-badge--A {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.grade-badge--B {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.grade-badge--C {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.grade-badge--D {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.grade-badge--F {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ─── Score Gauge ──────────────────────────────────────────────────── */

.score-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.score-gauge-canvas {
  width: 200px;
  height: 120px;
}

.score-gauge-canvas canvas {
  width: 100%;
  height: 100%;
}

.score-gauge__value {
  font-size: 36px;
  font-weight: 700;
  color: #e0e0e0;
  margin-top: -10px;
}

.score-gauge__grade {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

/* ─── Score Breakdown ──────────────────────────────────────────────── */

.score-breakdown-wrap {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}

.score-breakdown-wrap__title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 16px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.breakdown-row:last-child {
  margin-bottom: 0;
}

.breakdown-row__label {
  width: 200px;
  font-size: 12px;
  color: #c4c7d4;
  flex-shrink: 0;
}

.breakdown-row__bar-wrap {
  flex: 1;
  height: 12px;
  background: #2a2f4e;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.breakdown-row__bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
  position: absolute;
}

.breakdown-row__bar--positive {
  background: #22c55e;
  left: 50%;
}

.breakdown-row__bar--negative {
  background: #ef4444;
  right: 50%;
}

.breakdown-row__center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #8b8fa3;
}

.breakdown-row__value {
  width: 60px;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

.breakdown-row__value--positive {
  color: #22c55e;
}

.breakdown-row__value--negative {
  color: #ef4444;
}

/* ─── Quality Trend ────────────────────────────────────────────────── */

.quality-trend-wrap {
  background: #1e2235;
  border: 1px solid #2a2f4e;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}

.quality-trend-wrap__title {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 12px;
}

.quality-trend-canvas {
  width: 100%;
  height: 200px;
}

.quality-trend-canvas canvas {
  width: 100%;
  height: 100%;
}

/* ─── Detail Panel (overlay) ───────────────────────────────────────── */

.lead-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: flex-end;
  z-index: 100;
}

.lead-detail-panel {
  width: 440px;
  max-width: 90vw;
  background: #161829;
  border-left: 1px solid #2a2f4e;
  padding: 24px;
  overflow-y: auto;
}

.lead-detail-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.lead-detail-panel__title {
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
}

.lead-detail-panel__close {
  background: transparent;
  border: none;
  color: #8b8fa3;
  font-size: 18px;
  cursor: pointer;
}
