/* Lead-specific styles */

/* ══════════════════════════════════════════════════════════════
   CSS VARIABLES
   ══════════════════════════════════════════════════════════════ */
:root {
  --navy-950:  #0b0f1a;
  --navy-900:  #111827;
  --navy-800:  #1a2236;
  --navy-700:  #1f2d47;
  --navy-600:  #263352;
  --blue-500:  #2563eb;
  --blue-400:  #3b82f6;
  --blue-300:  #93c5fd;
  --blue-glow: rgba(59,130,246,0.15);
  --amber-400: #fbbf24;
  --amber-100: #fef3c7;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --text-900:  #0f172a;
  --text-600:  #475569;
  --text-400:  #94a3b8;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --lead-badge-bg: #f1f5f9;
  --lead-badge-color: #475569;
  --lead-icon-size: 48px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12), 0 4px 14px rgba(0,0,0,.06);
  --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* ══════════════════════════════════════════════════════════════
   PAGE WRAPPER
   ══════════════════════════════════════════════════════════════ */
.leads-page {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  padding: 24px 0 32px;
  gap: 18px;
}

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER
   ══════════════════════════════════════════════════════════════ */
.leads-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.leads-title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.leads-title-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--blue-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.leads-title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--navy-900);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.leads-title span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-400);
  letter-spacing: 0;
  margin-top: 2px;
}

/* ── STATS PILLS ──────────────────────────────────────────── */
.leads-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-600);
}

.stat-pill strong {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy-900);
}

.stat-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-400);
}

/* ══════════════════════════════════════════════════════════════
   FILTER CARD
   ══════════════════════════════════════════════════════════════ */
.leads-filter-card {
  position: relative;
  z-index: 1;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.leads-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.filter-input-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
}

.filter-input-wrap .filter-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-400);
  font-size: 14px;
  pointer-events: none;
}

.leads-filters input[type="text"],
.leads-filters select {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-900);
  outline: none;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

.leads-filters select {
  padding-left: 12px;
  padding-right: 32px;
  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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.leads-filters input[type="text"]:focus,
.leads-filters select:focus {
  border-color: var(--blue-400);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.leads-filters input[type="text"]::placeholder {
  color: var(--text-400);
}

.filter-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* ══════════════════════════════════════════════════════════════
   BUTTON BASE
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  touch-action: manipulation;
  min-height: 44px;
}

.btn:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--blue-500);
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-600);
  border: 1.5px solid var(--border-2);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--blue-300);
  color: var(--blue-500);
}

.btn-export {
  background: #059669;
  color: #fff;
}

.btn-export:hover {
  background: #047857;
}

/* ══════════════════════════════════════════════════════════════
   COLUMN TOGGLER
   ══════════════════════════════════════════════════════════════ */
.col-toggler-wrap {
  position: relative;
  display: inline-block;
}

.col-toggler-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-2);
  background: var(--surface);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-600);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  touch-action: manipulation;
  min-height: 44px;
}

.col-toggler-btn:hover {
  border-color: var(--blue-300);
  color: var(--blue-500);
  transform: translateY(-1px);
}

.col-toggler-btn:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

/* ── Dropdown Columns ─────────────────────────────────── */
.col-toggler-panel,
.dropdown-columns {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1050;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 8px 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}

.col-toggler-panel.show,
.dropdown-columns.show {
  display: block;
}

.col-toggler-panel::-webkit-scrollbar,
.dropdown-columns::-webkit-scrollbar {
  width: 5px;
}

.col-toggler-panel::-webkit-scrollbar-track,
.dropdown-columns::-webkit-scrollbar-track {
  background: transparent;
}

.col-toggler-panel::-webkit-scrollbar-thumb,
.dropdown-columns::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 10px;
}

.col-toggler-panel::-webkit-scrollbar-thumb:hover,
.dropdown-columns::-webkit-scrollbar-thumb:hover {
  background: var(--text-400);
}

/* ── Flip upward if insufficient space below ─────────── */
@media (min-width: 769px) {
  .dropdown-columns.open-upward,
  .col-toggler-panel.open-upward {
    top: auto;
    bottom: calc(100% + 8px);
  }
}

.col-toggler-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.col-toggler-item:hover {
  background: var(--surface-2);
}

.col-toggler-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-500);
  cursor: pointer;
  flex-shrink: 0;
}

.col-toggler-item .col-label {
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-toggler-item .col-essential {
  font-size: 10px;
  color: var(--text-400);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   QUICK FILTER PILLS
   ══════════════════════════════════════════════════════════════ */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.qf-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 30px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-600);
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  touch-action: manipulation;
  white-space: nowrap;
}

.qf-pill:hover {
  border-color: var(--blue-300);
  color: var(--blue-500);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.qf-pill:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.pill-ptp {
  border-color: #fbbf24;
  color: #92400e;
  background: #fffbeb;
}

.pill-ptp:hover {
  border-color: #f59e0b;
  color: #78350f;
  background: #fef3c7;
}

.pill-high-dpd {
  border-color: #fca5a5;
  color: #991b1b;
  background: #fef2f2;
}

.pill-high-dpd:hover {
  border-color: #f87171;
  color: #7f1d1d;
  background: #fee2e2;
}

/* ── RESULTS STRIP ────────────────────────────────────────── */
.results-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.results-count {
  font-size: 12.5px;
  color: var(--text-400);
  font-weight: 500;
}

.results-count strong {
  color: var(--blue-500);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════════
   TABLE
   ══════════════════════════════════════════════════════════════ */
.table-card {
  overflow: hidden;
  flex: 1;
  margin-top: 16px;
}

.table-scroll-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 340px);
}

.table-scroll-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-scroll-wrapper::-webkit-scrollbar-track {
  background: var(--surface-2);
}

.table-scroll-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: 10px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-400);
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1500px;
}

.leads-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.leads-table thead tr {
  background: var(--navy-900);
}

.leads-table th {
  padding: 13px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid rgba(255,255,255,0.06);
  user-select: none;
}

.leads-table th:first-child {
  color: rgba(255,255,255,0.35);
  width: 48px;
}

.leads-table th:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

.leads-table tbody tr {
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease;
  border-bottom: 1px solid var(--border);
}

.leads-table tbody tr:last-child {
  border-bottom: none;
}

.leads-table tbody tr:nth-child(even) {
  background: var(--surface-2);
}

.leads-table tbody tr:hover {
  background: #eff6ff;
  box-shadow: inset 3px 0 0 var(--blue-400);
}

.leads-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-900);
  white-space: nowrap;
  vertical-align: middle;
}

.leads-table td:first-child {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-400);
}

.leads-table td:nth-child(2) {
  font-weight: 600;
  color: var(--navy-900);
  font-size: 13px;
}

.leads-table td:nth-child(7),
.leads-table td:nth-child(9),
.leads-table td:nth-child(10) {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.2px;
}

.leads-table td.dpd-critical { color: #dc2626; font-weight: 700; }
.leads-table td.dpd-high     { color: #ea580c; font-weight: 700; }
.leads-table td.dpd-medium   { color: #ca8a04; font-weight: 600; }

/* ── STATUS BADGES ────────────────────────────────────────── */
.lead-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.lead-status-partialpaid           { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
.lead-status-fulloutstandingamount { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.lead-status-settlementamount      { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.lead-status-waiveramount          { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.lead-status-emiplanamount         { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.lead-status-promowaiveramount     { background: #fce7f3; color: #9d174d; border: 1px solid #f9a8d4; }

/* ── DISPOSITION BADGES ───────────────────────────────────── */
.disp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disp-already-paid         { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.disp-promise-to-pay       { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.disp-broken-ptp           { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.disp-pay-later            { background: #fef9c3; color: #713f12; border: 1px solid #fde047; }
.disp-refused-to-pay       { background: #fce7f3; color: #831843; border: 1px solid #f9a8d4; }
.disp-dispute              { background: #f1f5f9; color: #334155; border: 1px solid #94a3b8; }
.disp-call-back            { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }
.disp-paid-during-call     { background: #d1fae5; color: #064e3b; border: 1px solid #6ee7b7; }
.disp-received-disconnected{ background: #ffedd5; color: #7c2d12; border: 1px solid #fdba74; }
.disp-customer-expired     { background: #f3e8ff; color: #581c87; border: 1px solid #d8b4fe; }
.disp-busy                 { background: #fefce8; color: #713f12; border: 1px solid #fde68a; }
.disp-call-disconnected    { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.disp-ringing              { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.disp-switched-off         { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.disp-not-reachable        { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.disp-wrong-number         { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }
.disp-left-message         { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.disp-ivr-bot              { background: #f0f9ff; color: #0369a1; border: 1px solid #7dd3fc; }

/* ── AGENT CHIP ───────────────────────────────────────────── */
.agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-600);
}

.agent-chip .agent-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: white;
  font-weight: 700;
}

/* ── NO RESULTS ───────────────────────────────────────────── */
.no-results-row td {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-400);
}

.no-results-row td::before {
  content: '';
  display: block;
  font-size: 32px;
  margin-bottom: 10px;
}

.no-results-row td span {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-600);
  margin-bottom: 4px;
}

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  margin-top: 16px;
}

.pagination-info {
  font-size: 12.5px;
  color: var(--text-400);
}

.pagination-info strong {
  color: var(--text-900);
  font-weight: 600;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  border: 1.5px solid transparent;
}

.pagination a {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-600);
}

.pagination a:hover {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: white;
}

.pagination .active {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: white;
  font-weight: 700;
}

.pagination .disabled {
  color: var(--text-400);
  background: var(--surface-2);
  border-color: var(--border);
  pointer-events: none;
  opacity: 0.55;
}

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.leads-page > * {
  animation: fadeInUp 0.35s ease both;
}

.leads-page > *:nth-child(1) { animation-delay: 0s; }
.leads-page > *:nth-child(2) { animation-delay: 0.06s; }
.leads-page > *:nth-child(3) { animation-delay: 0.1s; }
.leads-page > *:nth-child(4) { animation-delay: 0.14s; }
.leads-page > *:nth-child(5) { animation-delay: 0.18s; }

.leads-table tbody tr {
  animation: fadeInUp 0.22s ease both;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — FILTER SECTION
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .leads-filters {
    grid-template-columns: 1fr 1fr;
  }
  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .leads-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .filter-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .filter-actions .btn,
  .filter-actions .col-toggler-btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — BUTTON GROUP
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .filter-actions {
    flex-wrap: wrap;
  }
  .filter-actions .btn,
  .filter-actions .col-toggler-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .filter-actions .btn,
  .filter-actions .col-toggler-btn {
    flex: 1 1 100%;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — QUICK FILTER PILLS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .quick-filters {
    gap: 5px;
  }
  .qf-pill {
    padding: 6px 12px;
    font-size: 11px;
    min-height: 44px;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — COLUMN TOGGLER
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .dropdown-columns,
  .col-toggler-panel {
    width: 320px;
  }
}

@media (max-width: 768px) {
  .dropdown-columns,
  .col-toggler-panel {
    position: fixed;
    top: auto;
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    max-height: 70vh;
    border-radius: 14px 14px 14px 14px;
    z-index: 9999;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
  }
}

@media (max-width: 480px) {
  .dropdown-columns,
  .col-toggler-panel {
    right: 4px;
    left: 4px;
    bottom: 4px;
    max-height: 80vh;
  }
}

/* ── Mobile backdrop for column dropdown ──────────────── */
@media (max-width: 768px) {
  .col-toggler-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 9998;
  }
  .col-toggler-backdrop.show {
    display: block;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — PAGE LAYOUT
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .leads-page {
    padding: 16px 0 24px;
    gap: 14px;
  }
}

@media (max-width: 768px) {
  .leads-page {
    padding: 12px 0 20px;
    gap: 12px;
  }
  .leads-title {
    font-size: 18px;
  }
  .leads-title span {
    font-size: 11px;
  }
  .leads-title-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .stat-pill strong {
    font-size: 13px;
  }
  .leads-header {
    flex-direction: column;
  }
  .leads-stats {
    width: 100%;
    justify-content: flex-start;
  }
  .table-card {
    margin-top: 10px;
  }
  .results-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .leads-page {
    padding: 8px 0 16px;
    gap: 10px;
  }
  .leads-title {
    font-size: 16px;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLE → CARDS (Mobile)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .table-scroll-wrapper {
    overflow-x: visible;
    max-height: none;
  }

  .leads-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
  }

  .leads-table,
  .leads-table tbody,
  .leads-table tr,
  .leads-table td {
    display: block;
  }

  .leads-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
  }

  .leads-table tr:hover {
    box-shadow: 0 2px 12px rgba(59,130,246,0.12);
    border-color: var(--blue-300);
  }

  .leads-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    white-space: normal;
    word-break: break-word;
  }

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

  .leads-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-400);
    margin-right: 12px;
    flex-shrink: 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT OVERRIDE — reduce container padding for leads page
   (parent .container has padding: 2rem / 32px per side;
    this reclaims that space while keeping a small gutter)
   ══════════════════════════════════════════════════════════════ */
.main-content:has(.leads-page) {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

  .leads-table td:first-child {
    font-size: 12px;
  }

  .leads-table td:nth-child(2) {
    font-weight: 700;
    font-size: 15px;
    color: var(--navy-900);
  }

  .leads-table tr:nth-child(even) {
    background: var(--surface);
  }

  .no-results-row td {
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — PAGINATION
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .pagination-wrap {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
  }
  .pagination-info {
    text-align: center;
  }
  .pagination {
    justify-content: center;
  }
  .pagination a,
  .pagination span {
    min-width: 40px;
    height: 40px;
    font-size: 13px;
  }
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL RESPONSIVE TABLE RULE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  table.responsive-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
  }
  table.responsive-cards,
  table.responsive-cards tbody,
  table.responsive-cards tr,
  table.responsive-cards td {
    display: block;
  }
  table.responsive-cards td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
  }
  table.responsive-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-400);
    margin-right: 12px;
    flex-shrink: 0;
  }
}
