:root {
  --bg: #f6f8fc;
  --bg-soft: #eef3fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #142033;
  --muted: #6d7c95;
  --accent: #f15a29;
  --accent-2: #ff9b71;
  --accent-dark: #b63d16;
  --success: #18b97f;
  --danger: #de4b4b;
  --shadow: 0 18px 50px rgba(31, 52, 86, 0.1);
}

html, body {
  height: 100%;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(241, 90, 41, 0.1), transparent 24%),
    radial-gradient(circle at 100% 8%, rgba(93, 135, 255, 0.08), transparent 20%),
    linear-gradient(180deg, #ffffff 0%, #f7f9fd 44%, #f2f6fb 100%);
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-2);
  margin-bottom: 10px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-brand { display: flex; align-items: center; }
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}
.brand strong {
  display: block;
  font-size: 17px;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff7a45 100%);
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(241, 90, 41, 0.25);
}
.topbar-nav { display: flex; align-items: center; gap: 10px; }
.nav-link {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  transition: 0.18s ease;
}
.nav-link:hover {
  color: var(--text);
  background: rgba(20, 32, 51, 0.04);
}
.page {
  padding: 28px;
  max-width: 1600px;
  margin: 0 auto;
}
.page-map {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
}
.hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 18px;
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(241, 90, 41, 0.08) 0%, transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 251, 255, 0.98) 100%);
  box-shadow: var(--shadow);
}
.hero-strip h1,
.panel-header h1,
.panel-header h2,
.auth-card h1 {
  margin: 0;
  font-family: "Sora", "Manrope", system-ui, sans-serif;
  letter-spacing: -0.03em;
}
.hero-strip h1 {
  font-size: clamp(2rem, 3vw, 3.1rem);
  line-height: 1.02;
  margin-bottom: 12px;
}
.hero-strip-compact {
  grid-template-columns: 1fr;
  padding: 24px 26px;
}
.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-self: stretch;
}
.hero-metrics.single {
  grid-template-columns: 1fr;
}
.metric-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.metric-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.metric-value {
  font-family: "Sora", "Manrope", system-ui, sans-serif;
  font-size: 2rem;
}
.metric-small {
  font-size: 1.2rem;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 390px 1fr;
  gap: 20px;
  align-items: start;
}
.sidebar, .stack { display: flex; flex-direction: column; gap: 16px; }
.panel, .subpanel, .auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.panel, .subpanel { padding: 20px; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-header h2 { font-size: 1.45rem; }
.map-panel { min-height: 760px; }
.map-canvas {
  height: 700px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.map-screen {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.map-canvas-full {
  position: absolute;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
}
.map-search-card {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 900;
  width: min(420px, 38vw);
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  transition: width 0.24s ease;
}
.map-screen-panel-boot .map-search-card,
.map-screen-panel-boot .map-draw-card-floating,
.map-screen-panel-boot .map-panel-toggle {
  transition: none !important;
}
.map-search-card-expanded {
  width: 50vw;
}
.map-draw-card,
.map-results-card,
.map-inline-notice {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(28, 48, 80, 0.16);
  backdrop-filter: blur(10px);
}
.map-draw-card {
  padding: 16px 18px;
}
.map-draw-card-hidden {
  display: none;
}
.map-draw-card-floating {
  position: absolute;
  top: 26px;
  left: calc(min(420px, 38vw) + 24px);
  z-index: 900;
  width: min(360px, calc(100vw - min(420px, 38vw) - 140px));
  transition: left 0.24s ease;
}
.map-draw-card-floating.map-draw-card-expanded-offset {
  left: calc(50vw + 24px);
  width: min(360px, calc(50vw - 140px));
}
.map-panel-toggle {
  position: absolute;
  top: 24px;
  left: calc(min(420px, 38vw) - 18px);
  z-index: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(28, 48, 80, 0.16);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: left 0.24s ease, transform 0.18s ease;
}
.map-panel-toggle:hover {
  transform: translateY(-1px);
}
.map-panel-toggle-expanded {
  left: calc(50vw - 18px);
}
.map-panel-toggle-icon {
  display: inline-block;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}
.map-draw-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.map-draw-header strong {
  display: block;
  font-size: 14px;
}
.map-draw-header span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.map-inline-notice {
  padding: 14px 16px;
  font-size: 14px;
  color: #8f411f;
}
.map-inline-notice-docked {
  margin: 0 0 14px;
  border-radius: 18px;
  box-shadow: none;
}
.map-results-card {
  padding: 18px 18px 10px;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
  box-shadow: 24px 0 60px rgba(28, 48, 80, 0.12);
}
.map-results-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.map-results-header h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}
.project-title-form {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}
.project-title-input {
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  font-family: "Sora", "Manrope", system-ui, sans-serif;
  font-size: 1.45rem;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  width: min(100%, 240px);
  transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  cursor: text;
}
.project-title-input:hover {
  color: #0b1324;
}
.project-title-input:focus {
  padding: 4px 10px;
  margin: -4px -10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(20, 32, 51, 0.08),
    0 0 0 4px rgba(241, 90, 41, 0.12);
  outline: none;
}
.project-title-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.project-title-status {
  min-width: 48px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.project-title-status[data-state="saving"] {
  color: #9a6b17;
}
.project-title-status[data-state="saved"] {
  color: var(--success);
}
.project-title-status[data-state="error"] {
  color: var(--danger);
}
.map-results-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.map-results-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.location-list-map {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding-right: 4px;
  overflow: auto;
}
.scrape-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.9) 100%);
  backdrop-filter: blur(8px);
}
.scrape-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 280px;
  padding: 24px 22px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(28, 48, 80, 0.16);
  text-align: center;
}
.scrape-loading-card strong {
  font-size: 15px;
  line-height: 1.35;
}
.scrape-loading-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.scrape-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(241, 90, 41, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
.scrape-loading-hidden {
  display: none;
}
.location-card-map {
  padding: 12px;
  border-radius: 18px;
  box-shadow: none;
}
.location-meta-inline span {
  padding: 7px 9px;
  font-size: 11px;
}
.map-close-stack {
  position: absolute;
  top: 26px;
  right: 18px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
}
.map-page-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(28, 48, 80, 0.16);
  backdrop-filter: blur(10px);
}
.map-page-nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease;
}
.map-page-nav-link:hover {
  background: rgba(20, 32, 51, 0.06);
  color: var(--text);
}
.map-page-nav-link-active {
  background: rgba(20, 32, 51, 0.08);
  color: var(--text);
}
.map-floating-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.map-floating-button {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  box-shadow: 0 18px 34px rgba(28, 48, 80, 0.16);
  font-size: 24px;
  cursor: pointer;
}
.map-floating-button-close {
  text-decoration: none;
  font-size: 28px;
}
.page-close-shell {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 50;
}
.page-close-button {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(20, 32, 51, 0.08);
  box-shadow: 0 18px 34px rgba(28, 48, 80, 0.16);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  backdrop-filter: blur(10px);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcff;
}
.map-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.map-hint {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-hint strong {
  font-size: 14px;
}
.map-hint span {
  font-size: 13px;
  color: var(--muted);
}
.location-list { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; overflow: auto; }
.location-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.location-card:hover {
  transform: translateY(-2px);
  border-color: rgba(241, 90, 41, 0.4);
}
.location-card.active {
  border-color: rgba(241, 90, 41, 0.8);
  box-shadow: 0 0 0 3px rgba(241, 90, 41, 0.14);
}
.location-card-shell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.location-card-main {
  flex: 1;
  min-width: 0;
}
.location-card-image {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #eef3fb;
  flex-shrink: 0;
}
.location-card-image img {
  display: block;
  width: 100%;
  object-fit: cover;
}
.location-card-image-square {
  width: 96px;
  height: 96px;
}
.location-card-image-square img {
  width: 96px;
  height: 96px;
}
.location-card-summary {
  margin-top: 10px;
}
.location-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.location-card h3 { margin: 0; font-size: 15px; }
.location-card h3 a {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.location-card p { margin: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.location-meta {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.location-meta span {
  display: block;
  padding: 8px 10px;
  border-radius: 14px;
  background: #f6f9fe;
  color: var(--muted);
  font-size: 11px;
}
.location-meta strong {
  color: var(--text);
  margin-right: 6px;
}
.card-actions { margin-top: 8px; display: flex; gap: 8px; }
.button {
  border: 0;
  background: linear-gradient(135deg, var(--accent) 0%, #ff7a45 100%);
  color: white;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(241, 90, 41, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(241, 90, 41, 0.26);
}
.button-secondary {
  background: #f5f7fb;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}
.button-danger { background: linear-gradient(135deg, #c73737 0%, #ff6b6b 100%); }
.button-small { padding: 7px 12px; font-size: 13px; }
.flash {
  padding: 14px 16px;
  border-radius: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}
.flash-success { background: rgba(24, 185, 127, 0.12); color: #8ff0c8; }
.flash-success { color: #137a57; }
.flash-error { background: rgba(255, 107, 107, 0.12); color: #ad2f2f; }
.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(241, 90, 41, 0.14);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}
.badge-muted { background: rgba(20, 32, 51, 0.08); color: var(--text); }
.badge-danger { background: rgba(255, 107, 107, 0.18); color: #ad2f2f; }
.badge-status-unreached { background: rgba(241, 90, 41, 0.14); color: #b44a20; }
.badge-status-called { background: rgba(255, 199, 89, 0.22); color: #9c6300; }
.badge-status-emailed { background: rgba(72, 137, 255, 0.16); color: #2359c6; }
.badge-status-met { background: rgba(157, 102, 255, 0.16); color: #6b34d6; }
.badge-status-deal-closed { background: rgba(28, 185, 127, 0.18); color: #0f7a54; }
.badge-status-unsuitable { background: rgba(255, 107, 107, 0.16); color: #b33a3a; }
.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(241, 90, 41, 0.1);
  border: 1px solid rgba(241, 90, 41, 0.18);
}
.muted { color: var(--muted); }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
  background: #ffffff;
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(241, 90, 41, 0.6);
  box-shadow: 0 0 0 4px rgba(241, 90, 41, 0.12);
}
.status-select {
  font-weight: 800;
}
.status-select[data-status="UNREACHED"] {
  background: rgba(241, 90, 41, 0.08);
  border-color: rgba(241, 90, 41, 0.22);
  color: #b44a20;
}
.status-select[data-status="CALLED"] {
  background: rgba(255, 199, 89, 0.14);
  border-color: rgba(255, 199, 89, 0.3);
  color: #9c6300;
}
.status-select[data-status="EMAILED"] {
  background: rgba(72, 137, 255, 0.1);
  border-color: rgba(72, 137, 255, 0.22);
  color: #2359c6;
}
.status-select[data-status="MET"] {
  background: rgba(157, 102, 255, 0.1);
  border-color: rgba(157, 102, 255, 0.24);
  color: #6b34d6;
}
.status-select[data-status="DEAL_CLOSED"] {
  background: rgba(28, 185, 127, 0.14);
  border-color: rgba(28, 185, 127, 0.24);
  color: #0f7a54;
}
.status-select[data-status="UNSUITABLE"] {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.24);
  color: #b33a3a;
}
.status-option-unreached { color: #b44a20; }
.status-option-called { color: #9c6300; }
.status-option-emailed { color: #2359c6; }
.status-option-met { color: #6b34d6; }
.status-option-deal-closed { color: #0f7a54; }
.status-option-unsuitable { color: #b33a3a; }
.stack-sm { gap: 12px; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(560px, 100%);
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(241, 90, 41, 0.08) 0%, transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 0.98) 100%);
}
.details-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 18px;
}
.form-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcff;
}
.location-image-preview {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #ffffff;
}
.location-image-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.page-detail {
  max-width: 1380px;
}
.lead-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
  gap: 26px;
  padding: 28px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 0% 0%, rgba(241, 90, 41, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 1) 100%);
  box-shadow: var(--shadow);
}
.lead-detail-hero-copy h1 {
  margin: 0;
  font-family: "Sora", "Manrope", system-ui, sans-serif;
  font-size: clamp(2.4rem, 4vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  max-width: 10ch;
}
.lead-detail-hero-copy p {
  max-width: 58ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--muted);
}
.lead-detail-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.lead-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(20, 32, 51, 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}
.lead-detail-hero-media {
  display: grid;
  gap: 16px;
}
.lead-detail-image {
  overflow: hidden;
  min-height: 320px;
  border-radius: 24px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  background: linear-gradient(180deg, #fff3ee 0%, #fde9df 100%);
  box-shadow: 0 18px 38px rgba(31, 52, 86, 0.1);
}
.lead-detail-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}
.lead-detail-image-empty {
  display: grid;
  place-items: center;
  color: #af5a3c;
  font-weight: 700;
}
.lead-detail-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.lead-summary-card {
  padding: 16px 18px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
}
.lead-summary-value {
  display: block;
  margin-top: 10px;
  font-family: "Sora", "Manrope", system-ui, sans-serif;
  font-size: 1.25rem;
}
.lead-summary-meta {
  display: block;
  margin-top: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}
.lead-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 420px);
  gap: 22px;
}
.lead-detail-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}
.lead-detail-panel-primary {
  padding: 26px;
}
.lead-form-block {
  display: grid;
  gap: 22px;
}
.lead-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}
.autosave-indicator {
  margin-left: auto;
  min-width: 64px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}
.autosave-indicator[data-state="saving"] {
  color: #9a6b17;
}
.autosave-indicator[data-state="saved"] {
  color: var(--success);
}
.autosave-indicator[data-state="error"] {
  color: var(--danger);
}
.lead-form-header h2,
.lead-side-header h2 {
  margin: 0;
  font-family: "Sora", "Manrope", system-ui, sans-serif;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}
.lead-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.lead-notes-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.lead-notes-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.lead-notes-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.lead-note-item {
  padding: 16px 18px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
.lead-note-time {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.lead-note-item p {
  margin: 0;
  line-height: 1.7;
  color: var(--text);
}
.lead-detail-panel-sidebar {
  display: grid;
  gap: 16px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.lead-side-block {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}
.lead-email-summary {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(20, 32, 51, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
.lead-email-summary strong {
  line-height: 1.55;
}
.lead-side-header {
  display: grid;
  gap: 6px;
}
.button-sent,
.button-sent:hover {
  background: #edf2f7;
  color: #5f6f86;
  border: 1px solid rgba(20, 32, 51, 0.1);
  box-shadow: none;
  transform: none;
}
.lead-detail-footer-note {
  margin-top: 18px;
  padding: 0 6px 8px;
}
.lead-detail-footer-note p {
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.75;
}
.form-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}
.history-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.table th, .table td {
  border-top: 1px solid var(--line);
  padding: 14px 12px;
  vertical-align: top;
}
.table thead th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.table tbody tr:hover {
  background: rgba(20, 32, 51, 0.03);
}
.inline-form, .actions-cell { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-batches .batch-row:hover {
  background: rgba(20, 32, 51, 0.03);
}
.batch-expand-cell {
  width: 1%;
  white-space: nowrap;
}
.batch-expand-button {
  border: 1px solid var(--line);
  background: #f5f7fb;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.batch-details-row td {
  padding-top: 0;
  border-top: 0;
}
.batch-details-card {
  margin-bottom: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcff;
}
.batch-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}
.batch-detail-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.batch-actions-panel {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.link-muted { color: var(--muted); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #3f5578;
  word-break: break-word;
}
.leaflet-container {
  background: #eaf0f8;
}
.page-map .flash {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  min-width: 280px;
}

@media (max-width: 980px) {
  .hero-strip,
  .dashboard-grid,
  .details-grid,
  .lead-detail-hero,
  .lead-detail-grid {
    grid-template-columns: 1fr;
  }
  .map-panel { min-height: auto; }
  .map-canvas { height: 440px; }
  .page-map .flash {
    left: 16px;
    right: 16px;
    transform: none;
    min-width: auto;
  }
  .map-search-card {
    top: 0;
    left: 0;
    right: auto;
    width: min(320px, 88vw);
    max-height: none;
  }
  .map-draw-card-floating {
    top: auto;
    right: 14px;
    left: 14px;
    bottom: 14px;
    width: auto;
  }
  .map-filter-grid {
    grid-template-columns: 1fr;
  }
  .map-close-stack {
    top: 18px;
    right: 14px;
  }
  .location-list-map {
    max-height: 240px;
    flex: none;
  }
  .map-toolbar,
  .map-toolbar-actions { flex-direction: column; align-items: start; }
  .topbar { flex-direction: column; align-items: start; gap: 12px; }
  .topbar-nav { flex-wrap: wrap; }
  .hero-metrics { grid-template-columns: 1fr; }
  .lead-form-grid,
  .lead-detail-summary {
    grid-template-columns: 1fr;
  }
  .lead-form-header {
    align-items: start;
    flex-direction: column;
  }
  .batch-details-grid {
    grid-template-columns: 1fr;
  }
}
