*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sun: #f59e0b;
  --sun-dark: #d97706;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --sidebar: 340px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--dark);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── TOP BAR ── */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--dark-2);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  z-index: 200;
}
.back-btn {
  color: var(--muted); text-decoration: none;
  font-size: 0.85rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.3rem;
  transition: color 0.15s; white-space: nowrap;
}
.back-btn:hover { color: var(--text); }
.topbar-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 800; font-size: 1rem; letter-spacing: -0.02em;
}
.logo-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  object-fit: cover;
}
.topbar-sep { color: var(--dark-3); }
.topbar-title { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.client-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.7rem; border-radius: 20px;
  border: 1px solid currentColor; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.03em; opacity: 0.9;
}
.client-badge::before { content: '●'; font-size: 0.5rem; }
.stat-chip {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.2);
  color: var(--sun);
  font-size: 0.78rem; font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}
.stat-chip-ca {
  background: rgba(22,163,74,0.12);
  border-color: rgba(22,163,74,0.25);
  color: #4ade80;
}
.btn-export {
  background: linear-gradient(135deg, var(--sun), var(--sun-dark));
  color: var(--dark);
  font-weight: 700; font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 8px; border: none; cursor: pointer;
  transition: opacity 0.2s;
}
.btn-export:hover { opacity: 0.88; }

/* ── MAIN LAYOUT ── */
.main { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar); min-width: var(--sidebar);
  background: var(--dark-2);
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-head h2 {
  font-size: 0.85rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}
.search-box {
  display: flex; align-items: center;
  background: var(--dark-3);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 9px;
  padding: 0 0.75rem; gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.search-box span { font-size: 0.9rem; color: var(--muted); }
.search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 0.88rem; padding: 0.55rem 0;
  font-family: inherit;
}
.search-box input::placeholder { color: var(--muted); }

.filter-row { display: flex; gap: 0.5rem; }
.filter-btn {
  flex: 1; background: var(--dark-3);
  border: 1px solid rgba(255,255,255,0.07);
  color: var(--muted);
  font-size: 0.78rem; font-weight: 600;
  padding: 0.4rem 0; border-radius: 8px;
  cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.filter-btn.active, .filter-btn:hover {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.35);
  color: var(--sun);
}

/* Sidebar drag target */
.sidebar.drop-target {
  border-right-color: rgba(245,158,11,0.6);
  background: rgba(245,158,11,0.04);
  transition: background 0.15s, border-right-color 0.15s;
}
.sidebar.drop-target .sidebar-empty { color: var(--sun); }

/* Advanced filter panel */
.adv-filters {
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.adv-filters-toggle {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 1.25rem;
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); transition: color 0.15s;
}
.adv-filters-toggle:hover { color: var(--sun); }
.filter-toggle-right { display: flex; align-items: center; gap: 0.5rem; }
.filter-reset-btn {
  font-size: 0.68rem; font-weight: 700;
  color: var(--sun); background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 5px; padding: 0.1rem 0.45rem;
  cursor: pointer; transition: all 0.15s;
}
.filter-reset-btn:hover { background: rgba(245,158,11,0.22); }
.adv-filters-body {
  padding: 0 1.25rem 0.9rem;
  display: flex; flex-direction: column; gap: 1rem;
  max-height: 320px; overflow-y: auto;
}
.adv-filters-body::-webkit-scrollbar { width: 3px; }
.adv-filters-body::-webkit-scrollbar-thumb { background: var(--dark-3); border-radius: 3px; }
.adv-filter-section { display: flex; flex-direction: column; gap: 0.5rem; }
.adv-filter-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted);
}
.sector-toggle-all {
  font-size: 0.66rem; font-weight: 600; background: none;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 4px;
  color: var(--muted); cursor: pointer; padding: 0.1rem 0.4rem;
  font-family: inherit; transition: all 0.15s;
}
.sector-toggle-all:hover { border-color: var(--sun); color: var(--sun); }

/* Range sliders */
.range-row { display: flex; flex-direction: column; gap: 0.35rem; }
.range-input-row { display: flex; align-items: center; gap: 0.5rem; }
.range-lbl { font-size: 0.68rem; color: var(--muted); width: 22px; flex-shrink: 0; }
.range-val { font-size: 0.72rem; font-weight: 700; color: var(--sun); width: 60px; text-align: right; flex-shrink: 0; white-space: nowrap; }
.range-input-row input[type=range] {
  flex: 1; height: 4px; appearance: none;
  background: var(--dark-3); border-radius: 2px; outline: none; cursor: pointer;
}
.range-input-row input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--sun); border: 2px solid var(--dark-2); cursor: pointer;
}
.range-input-row input[type=range]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--sun); border: 2px solid var(--dark-2); cursor: pointer;
}

/* Sector checkboxes */
.sector-list {
  display: flex; flex-direction: column; gap: 0.2rem;
  max-height: 140px; overflow-y: auto;
}
.sector-list::-webkit-scrollbar { width: 3px; }
.sector-list::-webkit-scrollbar-thumb { background: var(--dark-3); border-radius: 3px; }
.sector-check {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; color: var(--text); cursor: pointer;
  padding: 0.15rem 0; user-select: none;
}
.sector-check input[type=checkbox] { accent-color: var(--sun); cursor: pointer; width: 13px; height: 13px; }
.sector-check:hover span { color: var(--sun); }

/* Lead list */
.lead-list { flex: 1; overflow-y: auto; padding: 0.5rem 0; }
.lead-list::-webkit-scrollbar { width: 4px; }
.lead-list::-webkit-scrollbar-track { background: transparent; }
.lead-list::-webkit-scrollbar-thumb { background: var(--dark-3); border-radius: 4px; }

.lead-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.85rem 1.25rem; cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.lead-item:hover { background: rgba(255,255,255,0.04); }
.lead-item.selected {
  background: rgba(245,158,11,0.08);
  border-left: 3px solid var(--sun);
  padding-left: calc(1.25rem - 3px);
}
.lead-score {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.82rem;
}
.score-q4 { background: rgba(22,163,74,0.18);   color: #4ade80; }
.score-q3 { background: rgba(74,222,128,0.12);  color: #86efac; }
.score-q2 { background: rgba(134,239,172,0.1);  color: #a7f3d0; }
.score-q1 { background: rgba(148,163,184,0.1);  color: var(--muted); }

.lead-info { flex: 1; min-width: 0; }
.lead-name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

/* ── MAP ── */
.map-wrap { flex: 1; position: relative; }
#map { width: 100%; height: 100%; background: var(--dark); }

/* ── DETAIL PANEL ── */
.detail-panel {
  position: absolute; top: 1rem; bottom: 1rem; right: 1rem;
  width: 340px; background: var(--dark-2);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 16px; z-index: 500;
  display: none; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); overflow: hidden;
}
.detail-panel.visible { display: flex; }

.detail-head {
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.detail-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 1.1rem; padding: 0.25rem;
}
.detail-close:hover { color: var(--text); }
.detail-tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--sun); margin-bottom: 0.4rem;
}
.detail-name { font-size: 0.95rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.35rem; padding-right: 1.5rem; }
.detail-address { font-size: 0.78rem; color: var(--muted); }
.detail-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.6rem; }
.badge-naf { background: rgba(56,189,248,0.12); color: #38bdf8; font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 5px; }
.badge-proprietaire { background: rgba(34,197,94,0.12); color: #22c55e; font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 5px; }
.lead-badge-proprietaire { display: inline-block; background: rgba(34,197,94,0.12); color: #22c55e; font-size: 0.65rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 4px; margin-left: 0.35rem; vertical-align: middle; }

.detail-body { flex: 1; overflow-y: auto; padding: 0.85rem 1.1rem; }
.detail-body::-webkit-scrollbar { width: 3px; }
.detail-body::-webkit-scrollbar-thumb { background: var(--dark-3); border-radius: 3px; }

.detail-section { margin-bottom: 1rem; }
.detail-section-eco { background: rgba(22,163,74,0.07); border: 1px solid rgba(22,163,74,0.18); border-radius: 8px; padding: 0.65rem 0.75rem 0.5rem; margin-bottom: 1rem; }
.detail-section-eco .detail-section-title { color: #4ade80; }
.detail-section-eco .detail-field-val { color: #4ade80; font-size: 1rem; font-weight: 700; }
.detail-section-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.detail-grid.cols-1 { grid-template-columns: 1fr; }
.detail-field { background: var(--dark-3); border-radius: 8px; padding: 0.55rem 0.7rem; }
.detail-field-label { font-size: 0.68rem; color: var(--muted); margin-bottom: 0.15rem; }
.detail-field-val { font-size: 0.85rem; font-weight: 700; word-break: break-word; }
.detail-field-val a { color: #38bdf8; text-decoration: none; font-weight: 600; font-size: 0.8rem; }
.detail-field-val a:hover { text-decoration: underline; }

.detail-footer {
  padding: 0.75rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; gap: 0.5rem; flex-shrink: 0;
}
.detail-btn {
  flex: 1; font-size: 0.8rem; font-weight: 700;
  padding: 0.5rem; border-radius: 8px; border: none;
  cursor: pointer; transition: opacity 0.15s; font-family: inherit;
}
.detail-btn:hover { opacity: 0.85; }
.detail-btn.primary { background: linear-gradient(135deg, var(--sun), var(--sun-dark)); color: var(--dark); }
.detail-btn.secondary { background: rgba(255,255,255,0.07); color: var(--text); }
.detail-btn.save-btn { background: rgba(255,255,255,0.05); color: var(--muted); border: 1px solid rgba(255,255,255,0.08); }
.detail-btn.save-btn.saved { background: rgba(245,158,11,0.15); color: var(--sun); border-color: rgba(245,158,11,0.3); }

/* ── Bouton principal surface ── */
.detail-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  background: var(--dark-3);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.detail-card:hover { border-color: rgba(245,158,11,0.55); background: rgba(245,158,11,0.06); }
.detail-card.active { border-color: rgba(245,158,11,0.7); background: rgba(245,158,11,0.12); }
.detail-card.active .detail-card-title { color: var(--sun); }
.detail-card-icon  { font-size: 1.3rem; flex-shrink: 0; }
.detail-card-text  { flex: 1; min-width: 0; }
.detail-card-title { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.detail-card-sub   { font-size: 0.72rem; color: var(--muted); margin-top: 0.1rem; }
.detail-card-caret { font-size: 1.1rem; color: var(--sun); font-weight: 700; flex-shrink: 0; }

/* ── Actions secondaires ── */
.detail-actions-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.detail-action {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0.3rem;
  background: var(--dark-3);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.detail-action:hover { color: var(--text); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.04); }

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(10,15,28,0.92); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.lightbox.open { opacity: 1; pointer-events: all; }

/* Two-column container */
.lb-inner {
  display: flex; align-items: stretch;
  /* width adapts to lb-left content — no fixed width needed */
  transition: width 0.25s ease;
}

/* lb-left drives the image size.
   The image is square, so its side = min(max-size, vw, vh-minus-bar).
   --bar is the approximate height of the info bar below the image. */
.lb-left {
  flex: none;
  width: min(600px, 92vw, calc(90vh - 130px));
  display: flex; flex-direction: column;
}
/* When sizer is open, image column shrinks a bit to leave room */
.lb-inner.sizer-open .lb-left {
  width: min(480px, 50vw, calc(90vh - 130px));
}

.lightbox-img-wrap {
  position: relative; overflow: hidden; flex-shrink: 0;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  border-radius: 16px 16px 0 0;
}
.lb-inner.sizer-open .lightbox-img-wrap { border-radius: 16px 0 0 0; }
.lightbox-img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--dark-3); }
.thumb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.lightbox-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: rgba(15,23,42,0.8); border: none;
  color: var(--text); font-size: 1.1rem;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(15,23,42,1); }

.lightbox-bar {
  background: var(--dark-2); border: 1px solid rgba(245,158,11,0.2);
  border-top: none; border-radius: 0 0 16px 16px;
  padding: 0.8rem 1rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
}
.lb-inner.sizer-open .lightbox-bar { border-radius: 0 0 0 16px; }

.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 0.88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.15rem; }
.lb-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 0.3rem; }
.lb-contacts { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.25rem; }
.lb-contact-link { font-size: 0.72rem; color: var(--muted); text-decoration: none; transition: color 0.15s; }
.lb-contact-link:hover { color: var(--sun); }

.lb-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem; flex-shrink: 0; }
.lb-score { background: rgba(245,158,11,0.15); color: var(--sun); font-size: 0.78rem; font-weight: 800; padding: 0.25rem 0.55rem; border-radius: 8px; white-space: nowrap; }
.lb-sizer-btn {
  background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25);
  color: var(--sun); font-size: 0.75rem; font-weight: 700;
  padding: 0.3rem 0.75rem; border-radius: 8px;
  cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap;
}
.lb-sizer-btn:hover, .lb-sizer-btn.active {
  background: rgba(245,158,11,0.22); border-color: rgba(245,158,11,0.5);
}
.lb-save { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); color: var(--muted); font-size: 0.75rem; font-weight: 700; padding: 0.3rem 0.75rem; border-radius: 8px; cursor: pointer; font-family: inherit; transition: all 0.15s; white-space: nowrap; }
.lb-save:hover { color: var(--text); }
.lb-save.saved { background: rgba(245,158,11,0.15); color: var(--sun); border-color: rgba(245,158,11,0.3); }

/* ── Sizing panel ── */
.lb-sizer {
  width: 320px; min-width: 320px;
  background: var(--dark-2); border: 1px solid rgba(245,158,11,0.2);
  border-left: none; border-radius: 0 16px 16px 0;
  display: none; flex-direction: column; overflow: hidden;
}
.lb-inner.sizer-open .lb-sizer { display: flex; }
.sizer-head {
  padding: 0.7rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--sun); flex-shrink: 0;
}
.sizer-body {
  flex: 1; overflow-y: auto; padding: 0.85rem 1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.sizer-body::-webkit-scrollbar { width: 3px; }
.sizer-body::-webkit-scrollbar-thumb { background: var(--dark-3); border-radius: 3px; }
.sizer-field { display: flex; flex-direction: column; gap: 0.25rem; }
.sizer-label { font-size: 0.7rem; color: var(--muted); font-weight: 600; }
.sizer-input-row { display: flex; align-items: center; gap: 0.4rem; }
.sizer-input-row input[type=number] {
  flex: 1; background: var(--dark-3);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 7px;
  padding: 0.35rem 0.6rem; color: var(--text);
  font-size: 0.88rem; font-family: inherit; outline: none;
}
.sizer-input-row input[type=number]:focus { border-color: rgba(245,158,11,0.4); }
.sizer-unit { font-size: 0.7rem; color: var(--muted); white-space: nowrap; min-width: 40px; }
.sizer-range {
  width: 100%; appearance: none; height: 4px;
  background: var(--dark-3); border-radius: 2px; outline: none; cursor: pointer; margin-top: 0.2rem;
}
.sizer-range::-webkit-slider-thumb {
  appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--sun); border: 2px solid var(--dark-2); cursor: pointer;
}
.sizer-range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--sun); border: 2px solid var(--dark-2); cursor: pointer;
}
.sizer-results {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 0.75rem; margin-top: 0.25rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.sizer-result-title {
  font-size: 0.67rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted); margin-bottom: 0.15rem;
}
.sizer-kpi-row { display: flex; gap: 0.5rem; }
.sizer-kpi {
  flex: 1; background: rgba(245,158,11,0.07);
  border: 1px solid rgba(245,158,11,0.18); border-radius: 8px; padding: 0.5rem 0.6rem;
}
.sizer-kpi-label { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.sizer-kpi-val { font-size: 1.05rem; font-weight: 800; color: var(--sun); margin-top: 0.1rem; }
.sizer-result-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.76rem;
}
.sizer-result-row span:first-child { color: var(--muted); }
.sizer-result-row span:last-child  { color: var(--text); font-weight: 600; }
.sizer-proposal-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; margin-top: 1.2rem; padding: 0.7rem 1rem;
  background: transparent; border: 1.5px solid var(--sun); border-radius: 8px;
  color: var(--sun); font-family: Inter, sans-serif; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.sizer-proposal-btn:hover { background: var(--sun); color: #1f2937; }

/* ── PASSWORD GATE ── */
.gate { position: fixed; inset: 0; z-index: 9999; background: var(--dark); display: flex; align-items: center; justify-content: center; }
.gate.hidden { display: none; }
.gate-card { background: var(--dark-2); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 2.5rem 2.5rem 2rem; width: 340px; text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,0.6); }
.gate-logo { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; margin: 0 auto 1.25rem; display: block; }
.gate-card h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.35rem; }
.gate-card p  { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.gate-input { width: 100%; background: var(--dark-3); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; color: var(--text); font-size: 0.95rem; font-family: inherit; padding: 0.7rem 1rem; outline: none; text-align: center; letter-spacing: 0.08em; margin-bottom: 0.75rem; transition: border-color 0.15s; }
.gate-input:focus { border-color: rgba(245,158,11,0.5); }
.gate-input.error { border-color: #f87171; animation: shake 0.3s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.gate-btn { width: 100%; background: linear-gradient(135deg, var(--sun), var(--sun-dark)); color: var(--dark); font-weight: 700; font-size: 0.95rem; font-family: inherit; border: none; border-radius: 10px; padding: 0.75rem; cursor: pointer; transition: opacity 0.15s; }
.gate-btn:hover { opacity: 0.88; }
.gate-error { font-size: 0.78rem; color: #f87171; margin-top: 0.6rem; min-height: 1rem; }

/* ── DROP OVERLAY ── */
.drop-overlay { position: absolute; inset: 0; z-index: 1000; background: rgba(15,23,42,0.88); backdrop-filter: blur(4px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.drop-overlay.active { opacity: 1; pointer-events: all; }
.drop-box { border: 2px dashed var(--sun); border-radius: 20px; padding: 3rem 4rem; text-align: center; }
.drop-box .drop-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.drop-box h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
.drop-box p { font-size: 0.88rem; color: var(--muted); }

/* ── EMPTY STATE ── */
.empty-state { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; pointer-events: none; transition: opacity 0.3s; }
.empty-state.hidden { opacity: 0; }
.empty-hint { background: rgba(15,23,42,0.75); backdrop-filter: blur(8px); border: 1.5px dashed rgba(245,158,11,0.4); border-radius: 20px; padding: 2.5rem 3.5rem; text-align: center; }
.empty-hint .e-icon { font-size: 2.8rem; margin-bottom: 0.75rem; }
.empty-hint h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.4rem; }
.empty-hint p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.empty-hint code { color: var(--sun); font-size: 0.8rem; }

.sidebar-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; padding: 2rem; text-align: center; color: var(--muted); }
.sidebar-empty .se-icon { font-size: 2rem; margin-bottom: 0.25rem; }
.sidebar-empty p { font-size: 0.82rem; line-height: 1.6; }

/* ── TOAST ── */
.toast { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); background: var(--dark-2); border: 1px solid rgba(245,158,11,0.3); border-radius: 10px; padding: 0.65rem 1.25rem; font-size: 0.85rem; font-weight: 600; z-index: 600; white-space: nowrap; box-shadow: 0 4px 20px rgba(0,0,0,0.4); opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ── LEAFLET OVERRIDES ── */
.leaflet-popup-content-wrapper { background: var(--dark-2); color: var(--text); border: 1px solid rgba(245,158,11,0.2); border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.5); padding: 0; }
.leaflet-popup-content { margin: 0; }
.leaflet-popup-tip { background: var(--dark-2); }

/* Layer control – dark theme, collapsé par défaut */
.leaflet-control-layers {
  background: rgba(15,23,42,0.88) !important;
  border: 1px solid rgba(245,158,11,0.2) !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45) !important;
  color: var(--text) !important;
  font-family: Inter, sans-serif !important;
  font-size: 0.8rem !important;
}
/* Bouton toggle (icône couches) – discret */
.leaflet-control-layers-toggle {
  width: 30px !important;
  height: 30px !important;
  background-size: 16px 16px !important;
  opacity: 0.75;
}
.leaflet-control-layers-toggle:hover { opacity: 1; }
/* Panel ouvert */
.leaflet-control-layers-expanded { padding: 8px 12px !important; }
.leaflet-control-layers label { color: var(--text) !important; display: flex; align-items: center; gap: 6px; margin: 4px 0; cursor: pointer; }
.leaflet-control-layers-separator { border-color: rgba(245,158,11,0.2) !important; }
.leaflet-control-layers input[type="radio"],
.leaflet-control-layers input[type="checkbox"] { accent-color: #f59e0b; }
.popup-inner { padding: 0.9rem 1.1rem; }
.popup-inner strong { font-size: 0.95rem; display: block; margin-bottom: 0.35rem; }
.popup-inner .pop-meta { font-size: 0.8rem; color: var(--muted); }
.popup-inner .pop-score { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.5rem; font-size: 0.8rem; font-weight: 700; color: #4ade80; }

