/* ── Base layout ──────────────────────────────────────────────────────────── */

#map {
  height: calc(100vh - 200px);
  width: 100%;
}

#view-table {
  height: calc(100vh - 200px);
  overflow-y: auto;
}

/* ── Pillar explanation cards ─────────────────────────────────────────────── */

.explain-card {
  font-size: 13.5px;
  line-height: 1.5;
  box-sizing: border-box;
}

.explain-card strong { font-size: 15px; }

/* ── Pillar tabs ──────────────────────────────────────────────────────────── */

#pillarTabs .nav-link {
  font-weight: 500;
  color: #495057;
  border-bottom: 2px solid transparent;
  padding-bottom: 10px;
}

#pillarTabs .nav-link.active {
  color: #212529;
  border-bottom: 2px solid #212529;
  background: none;
}

#pillarTabs .nav-link:hover:not(.active) { color: #0d6efd; }

/* ── Slide-in detail panel ────────────────────────────────────────────────── */

.detail-panel {
  position: fixed;
  top: 0;
  right: -490px;
  width: 470px;
  height: 100vh;
  background: #fff;
  z-index: 2000;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
}

.detail-panel.open { right: 0; }

.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 1999;
}

.detail-overlay.open { display: block; }

#detail-body {
  flex: 1;
  overflow-y: auto;
}

/* ── Pillar colors ────────────────────────────────────────────────────────── */

.bg-orange        { background-color: #fd7e14 !important; color: #fff !important; }
.bg-orange-subtle { background-color: #fff0e0 !important; }
.text-orange      { color: #fd7e14 !important; }
.bg-purple        { background-color: #6f42c1 !important; color: #fff !important; }
.bg-purple-subtle { background-color: #f0e8ff !important; }
.text-purple      { color: #6f42c1 !important; }

/* ── Status badges ────────────────────────────────────────────────────────── */

.status-badge { display:inline-block; padding:3px 10px; border-radius:12px; font-size:12px; font-weight:600; white-space:nowrap; }
.status-New           { background:#e9ecef; color:#495057; }
.status-Called        { background:#34a853; color:#fff; }
.status-Voicemail     { background:#fbbc04; color:#111; }
.status-Interested    { background:#1a73e8; color:#fff; }
.status-Not-Interested{ background:#ea4335; color:#fff; }

/* ── Score badges ─────────────────────────────────────────────────────────── */

.score-hot  { background: #dc3545; color: #fff; }
.score-warm { background: #ffc107; color: #000; }
.score-cold { background: #6c757d; color: #fff; }

/* ── Leaflet popup ────────────────────────────────────────────────────────── */

.leaflet-popup-content { font-size: 13px; min-width: 220px; }
.popup-score { font-size: 18px; font-weight: bold; }

/* ── Mobile lead cards ────────────────────────────────────────────────────── */

.lead-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 10px 10px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.lead-card:active { box-shadow: 0 2px 8px rgba(0,0,0,.15); }

.lead-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.lead-card-address {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  flex: 1;
  padding-right: 8px;
}

.lead-card-sub {
  font-size: 13px;
  color: #555;
  margin-bottom: 10px;
}

.lead-card-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.lead-card-btn {
  flex: 1;
  min-width: 70px;
  padding: 8px 4px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn-Called         { background: #34a853; color: #fff; }
.btn-Voicemail      { background: #fbbc04; color: #111; }
.btn-Interested     { background: #1a73e8; color: #fff; }
.btn-Not-Interested { background: #ea4335; color: #fff; }

/* ── Mobile overrides ─────────────────────────────────────────────────────── */

@media (max-width: 767px) {

  /* Full-screen detail panel on mobile */
  .detail-panel {
    width: 100%;
    right: -100%;
    top: 0;
  }

  /* Hide desktop table on mobile */
  .desktop-only { display: none !important; }

  /* Show card list on mobile */
  #view-table {
    height: auto;
    overflow-y: visible;
    padding-top: 8px;
    padding-bottom: 80px;
  }

  /* Compact header stats */
  .navbar { flex-wrap: wrap; row-gap: 4px; }

  /* Hide explanation text on mobile — just show the title */
  .explain-card p { display: none; }
  .explain-card { min-height: unset; padding: 8px 12px !important; }

  /* Filters stack vertically */
  .filters-bar { flex-direction: column !important; align-items: stretch !important; }
  .filters-bar select,
  .filters-bar input { width: 100% !important; }

  /* Map full height */
  #map { height: calc(100vh - 160px); }
}
