.leads-body {
  background:
    linear-gradient(135deg, rgba(8, 5, 16, 0.96), rgba(18, 10, 28, 0.98)),
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.14), transparent 32%),
    radial-gradient(circle at 85% 20%, rgba(236, 72, 153, 0.12), transparent 34%);
}

.leads-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  width: min(1480px, 94vw);
  margin: 0 auto;
  padding: 30px 0 80px;
}

.leads-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  background: rgba(12, 8, 23, .86);
  box-shadow: 0 20px 50px rgba(0,0,0,.36);
}

.leads-side-link {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 800;
  padding: 12px 14px;
  border-radius: 14px;
}

.leads-side-link.active,
.leads-side-link:hover {
  color: #fff;
  background: linear-gradient(90deg, rgba(124,58,237,.28), rgba(236,72,153,.2), rgba(249,115,22,.15));
}

.leads-content {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.leads-hero,
.leads-panel,
.lead-card,
.market-lead,
.campaign-card,
.appointment-card {
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(20, 14, 36, .84);
  box-shadow: 0 20px 55px rgba(0,0,0,.3);
}

.leads-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: end;
  padding: 34px;
  border-radius: 28px;
}

.leads-kicker {
  display: inline-flex;
  color: #fb923c;
  font-family: var(--font-accent);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.leads-hero h1 {
  font-family: var(--font-accent);
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: 1;
  max-width: 900px;
  margin-bottom: 16px;
}

.leads-hero p {
  max-width: 820px;
  color: var(--text-muted);
  font-size: 1.12rem;
}

.leads-guardrail {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: 18px;
  background: rgba(34, 197, 94, .08);
  border: 1px solid rgba(34, 197, 94, .22);
}

.leads-guardrail i {
  color: #22c55e;
  font-size: 1.6rem;
}

.leads-guardrail strong,
.leads-guardrail span {
  display: block;
}

.leads-guardrail span {
  color: var(--text-muted);
  font-size: .9rem;
}

.leads-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.time-filter,
.feature-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.time-chip,
.feature-flags span,
.panel-action {
  border: 1px solid rgba(255,255,255,.13);
  color: #fff;
  background: rgba(255,255,255,.07);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 900;
}

.time-chip {
  cursor: pointer;
}

.time-chip.active,
.panel-action {
  background: var(--gradient-btn);
  border-color: transparent;
}

.feature-flags span {
  color: var(--text-muted);
  font-size: .76rem;
}

.feature-flags .flag-on {
  color: #22c55e;
}

.lead-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.lead-metric {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  min-height: 116px;
}

.lead-metric strong {
  display: block;
  font-family: var(--font-accent);
  font-size: 1.65rem;
}

.lead-metric span {
  display: block;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.25;
}

.leads-panel {
  border-radius: 24px;
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  font-family: var(--font-accent);
  line-height: 1.16;
}

.panel-heading.compact h2 {
  font-size: 1.35rem;
}

.funnel-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 10px;
}

.funnel-step {
  position: relative;
  padding: 16px;
  min-height: 108px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}

.funnel-step strong {
  display: block;
  font-family: var(--font-accent);
  font-size: 1.5rem;
}

.funnel-step span {
  color: var(--text-muted);
  font-size: .82rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 360px);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
}

.search-box input {
  width: 100%;
  color: #fff;
  background: transparent;
  border: 0;
  outline: none;
  font: inherit;
}

.lead-inbox-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 18px;
}

.lead-list {
  display: grid;
  gap: 12px;
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.lead-card {
  display: grid;
  gap: 10px;
  text-align: left;
  color: #fff;
  width: 100%;
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
}

.lead-card.active {
  border-color: rgba(249, 115, 22, .65);
  background: rgba(249, 115, 22, .08);
}

.lead-card-top,
.lead-badges,
.detail-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.lead-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 42px;
  border-radius: 16px;
  background: rgba(34,197,94,.12);
  color: #22c55e;
  font-family: var(--font-accent);
  font-weight: 900;
}

.intent-high { color: #22c55e; }
.intent-medium { color: #fbbf24; }
.intent-low { color: #fb7185; }

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: var(--text-muted);
  font-size: .74rem;
  font-weight: 800;
}

.lead-detail {
  min-height: 520px;
  border-radius: 20px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.09);
  padding: 22px;
}

.detail-grid,
.economics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.detail-item,
.economics-item {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.045);
}

.detail-item span,
.economics-item span {
  display: block;
  color: var(--text-muted);
  font-size: .78rem;
}

.detail-item strong,
.economics-item strong {
  display: block;
  font-size: 1rem;
}

.detail-message {
  padding: 16px;
  border-left: 4px solid var(--primary-magenta);
  background: rgba(236,72,153,.08);
  border-radius: 14px;
  color: #f8fafc;
}

.detail-actions button,
.market-lead button,
.buyer-form button {
  cursor: pointer;
}

.leads-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.campaign-list,
.marketplace-list,
.appointment-list,
.analytics-breakdown,
.settings-list {
  display: grid;
  gap: 12px;
}

.campaign-card,
.market-lead,
.appointment-card,
.analytics-row,
.settings-list div {
  border-radius: 18px;
  padding: 16px;
}

.analytics-row,
.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
}

.analytics-row span,
.settings-list span,
.campaign-card p,
.market-lead p,
.appointment-card p {
  color: var(--text-muted);
}

.buyer-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.buyer-form label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 800;
  font-size: .82rem;
}

.buyer-form input {
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  background: rgba(0,0,0,.28);
  color: #fff;
  padding: 11px 12px;
}

.buyer-form .toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buyer-form .toggle-row input {
  width: auto;
}

@media (max-width: 1120px) {
  .leads-shell,
  .leads-hero,
  .lead-inbox-layout,
  .leads-grid-2 {
    grid-template-columns: 1fr;
  }

  .leads-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .leads-side-link {
    white-space: nowrap;
  }

  .lead-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .funnel-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .leads-shell {
    width: min(100% - 20px, 1480px);
    gap: 16px;
    padding-top: 18px;
  }

  .leads-hero,
  .leads-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .lead-metrics,
  .funnel-flow,
  .detail-grid,
  .economics-grid,
  .buyer-form {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .leads-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-action,
  .search-box {
    width: 100%;
    justify-content: center;
  }

  .dash-user-menu {
    gap: 10px;
  }
}
