/* ============================================================
   TEMECULA SNACKS ROUTE APP — STYLESHEET
   Dark / utilitarian / field-ready
   ============================================================ */

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

:root {
  --bg:        #111111;
  --surface:   #1c1c1c;
  --surface2:  #262626;
  --surface3:  #303030;
  --border:    #383838;
  --text:      #f0f0f0;
  --text-muted:#888888;
  --text-dim:  #555555;
  --accent:    #f97316;
  --accent-dk: #c2570e;
  --hot:       #e53e3e;
  --warm:      #ecc94b;
  --cold:      #669bbc;
  --blackno:   #1e1e1e;
  --blackno-border: #555;
  --won:       #48bb78;
  --danger:    #fc8181;
  --radius:    10px;
  --radius-sm: 6px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 20px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  height: 100%;
}
.screen.active { display: flex; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 54px;
  flex-shrink: 0;
  padding-top: max(14px, env(safe-area-inset-top));
}
.topbar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
}
.topbar-title span { color: var(--accent); }
.topbar-back {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 8px 8px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
}
.topbar-actions { display: flex; gap: 8px; }

/* ============================================================
   HOME DASHBOARD
   ============================================================ */
#screen-home {
  background: var(--bg);
  overflow-y: auto;
  padding-bottom: calc(20px + var(--safe-bottom));
}

.home-grid {
  padding: 16px;
  display: grid;
  gap: 10px;
  margin: auto 0;
}

.home-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.home-header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.home-header h1 span { color: var(--accent); }
.home-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn-full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s;
}
.btn-full:active { background: var(--accent-dk); }
.btn-full .btn-icon { font-size: 20px; }

/* 50% taller Go to Map button */
.btn-full-tall {
  padding: 27px 20px;
}

/* Full width nav button */
.btn-nav-full {
  width: 100%;
}

.btn-half-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  gap: 4px;
  position: relative;
}
.btn-nav:active { background: var(--surface2); }
.btn-nav .nav-icon { font-size: 20px; }
.btn-nav .nav-label { font-size: 13px; font-weight: 700; }
.btn-nav .nav-count {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}
.btn-nav .nav-count.zero { background: var(--surface3); color: var(--text-muted); }
.btn-nav .nav-count.alert { background: var(--hot); color: #fff; }

.home-divider {
  margin: 4px 16px;
  border: none;
  border-top: 1px solid var(--border);
}

/* ============================================================
   FOLLOWUP ALERT BANNER
   ============================================================ */
/* ============================================================
   MAP SCREEN
   ============================================================ */
#screen-map {
  position: relative;
}
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#leaflet-map {
  width: 100%;
  height: 100%;
  background: #1a1a2e;
}

/* Map controls — bottom right, filter LEFT of locate button */
.map-controls {
  position: absolute;
  bottom: 20px;
  right: 10px;
  z-index: 1000;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.map-controls > * { pointer-events: all; }

.map-filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  min-height: 44px;
}
.map-filter-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

.map-locate-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Map geocode status bar */
.map-status-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
}
.map-status-bar.hidden { display: none; }
.geocode-progress { color: var(--accent); font-weight: 600; }

/* Filter drawer — opens upward from bottom right */
.filter-drawer {
  position: absolute;
  bottom: 120px;
  right: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  z-index: 1001;
  min-width: 210px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  display: none;
}
.filter-drawer.open { display: block; }
.filter-drawer h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 12px;
  cursor: pointer;
}
.filter-row:last-child { border-bottom: none; }
.filter-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

/* Custom Leaflet marker styles */
.ts-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: opacity 0.2s, width 0.2s, height 0.2s;
  font-family: -apple-system, Arial, sans-serif;
}
.ts-marker.has-followup {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent), 0 2px 8px rgba(0,0,0,0.5);
}
.ts-marker.visited {
  opacity: 0.3 !important;
}
.ts-marker.status-hot    { background: var(--hot); }
.ts-marker.status-warm   { background: var(--warm); color: #333; }
.ts-marker.status-cold   { background: var(--cold); }
.ts-marker.status-blackno { background: var(--blackno); border: 2px solid var(--blackno-border); }
.ts-marker.status-won    { background: var(--won); }

/* ============================================================
   PROSPECT CARD MODAL
   ============================================================ */
#prospect-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  justify-content: flex-end;
}
#prospect-modal.open { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.modal-header {
  padding: 14px 16px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  flex: 1;
}
.modal-close {
  background: var(--surface2);
  border: none;
  color: var(--text);
  width: 60px; height: 60px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-meta {
  padding: 6px 16px 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-tier1 { background: #2d1b00; color: var(--accent); border: 1px solid var(--accent); }
.badge-tier2 { background: #1a2d1a; color: var(--won); border: 1px solid var(--won); }
.badge-tier3 { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-hot   { background: #2d0000; color: var(--hot); border: 1px solid var(--hot); }
.badge-warm  { background: #2d2200; color: var(--warm); border: 1px solid var(--warm); }
.badge-cold  { background: var(--surface2); color: var(--cold); border: 1px solid var(--cold); }
.badge-blackno { background: #111; color: #777; border: 1px solid #444; }
.badge-won   { background: #002d12; color: var(--won); border: 1px solid var(--won); }
.badge-seg   { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }

.modal-nav-btn {
  margin: 12px 16px;
  width: calc(100% - 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.modal-nav-btn:active { background: var(--accent-dk); }
.modal-nav-btn.no-geocode {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px dashed var(--border);
  cursor: default;
}

.modal-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-section:last-child { border-bottom: none; }
.modal-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.field-group { display: flex; flex-direction: column; gap: 10px; }

.field-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field-value {
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-value a {
  color: var(--accent);
  text-decoration: none;
}

/* Editable fields in modal */
.field-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  width: 100%;
  -webkit-appearance: none;
}
.field-input:focus {
  outline: none;
  border-color: var(--accent);
}
.field-input::placeholder { color: var(--text-dim); }

select.field-input option { background: var(--surface2); }

.status-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.status-btn {
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.1s;
}
.status-btn.active-hot    { background: var(--hot); color: #fff; border-color: var(--hot); }
.status-btn.active-warm   { background: var(--warm); color: #333; border-color: var(--warm); }
.status-btn.active-cold   { background: var(--cold); color: #fff; border-color: var(--cold); }
.status-btn.active-blackno { background: var(--blackno-border); color: #fff; border-color: var(--blackno-border); }
.status-btn.active-won    { background: var(--won); color: #000; border-color: var(--won); }

textarea.field-input {
  resize: none;
  min-height: 80px;
  line-height: 1.5;
}

.note-history {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 160px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.note-entry {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.note-entry:last-child { border-bottom: none; }
.note-date { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; }
.note-text { color: var(--text); line-height: 1.4; }
.no-notes { padding: 12px; text-align: center; font-size: 13px; color: var(--text-dim); }

.add-visit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toggle-switch {
  position: relative;
  width: 46px; height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--surface3);
  border-radius: 26px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #000;
}

.modal-update-btn {
  margin: 12px 16px 0;
  width: calc(100% - 32px);
  padding: 15px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.modal-update-btn:active { background: var(--surface3); }
.modal-update-btn.has-changes {
  background: var(--won);
  color: #000;
  border-color: var(--won);
}

/* ============================================================
   CONTACT LIST
   ============================================================ */
.list-screen-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.search-bar {
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
  -webkit-appearance: none;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }

.sort-bar {
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.sort-bar::-webkit-scrollbar { display: none; }
.sort-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.sort-chip.active { background: var(--accent); color: #000; border-color: var(--accent); }

.list-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.prospect-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 12px;
  transition: background 0.1s;
}
.prospect-row:active { background: var(--surface2); }

.prospect-row .row-pin {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
}
.prospect-row .row-pin.status-warm { color: #333; }

.prospect-row .row-info { flex: 1; min-width: 0; }
.prospect-row .row-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prospect-row .row-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prospect-row .row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.row-action-btn {
  background: var(--surface2);
  border: none;
  color: var(--text-muted);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.row-action-btn:active { background: var(--surface3); }
.row-action-btn.phone-btn { color: var(--won); }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; line-height: 1.5; }

/* ============================================================
   FOLLOW-UP LIST
   ============================================================ */
.followup-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.followup-row:active { background: var(--surface2); }
.followup-row.overdue .fu-date { color: var(--hot); }
.followup-row.due-today .fu-date { color: var(--warm); }

.fu-date-col {
  text-align: center;
  flex-shrink: 0;
  width: 50px;
}
.fu-date {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}
.fu-month { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }

.fu-info { flex: 1; min-width: 0; }
.fu-name { font-size: 14px; font-weight: 600; }
.fu-sub { font-size: 12px; color: var(--text-muted); }

.fu-add-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.fu-add-btn.added { background: var(--won); color: #000; border-color: var(--won); }

/* ============================================================
   TO VISIT LIST
   ============================================================ */
.visit-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  cursor: pointer;
  transition: background 0.1s;
}
.visit-row:active { background: var(--surface2); }

.visit-pin {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  color: #fff;
}

.visit-info { flex: 1; min-width: 0; }
.visit-name { font-size: 14px; font-weight: 600; }
.visit-sub  { font-size: 12px; color: var(--text-muted); }

.visit-nav-btn {
  background: var(--accent);
  border: none;
  color: #000;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.visit-remove-btn {
  background: var(--surface2);
  border: none;
  color: var(--text-dim);
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   ADD CONTACT / CSV UPLOAD SCREENS
   ============================================================ */
.form-screen {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(24px + var(--safe-bottom));
}

.form-section {
  margin-bottom: 20px;
}
.form-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.form-field {
  margin-bottom: 12px;
}
.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-weight: 600;
}
.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  -webkit-appearance: none;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }
select.form-input option { background: var(--surface2); }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-submit {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 8px;
}
.btn-submit:active { background: var(--accent-dk); }
.btn-submit:disabled { opacity: 0.4; cursor: default; }

/* CSV Upload */
.csv-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
  margin-bottom: 16px;
}
.csv-dropzone:hover, .csv-dropzone.dragover { border-color: var(--accent); }
.csv-dropzone .dz-icon { font-size: 36px; margin-bottom: 10px; }
.csv-dropzone .dz-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.csv-dropzone .dz-sub { font-size: 13px; color: var(--text-muted); }

.csv-template-btn {
  width: 100%;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}

.import-results {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.8;
}
.import-results .ok   { color: var(--won); }
.import-results .warn { color: var(--warm); }
.import-results .err  { color: var(--hot); }

.geocode-queue-section {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.geocode-queue-section h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.geocode-queue-section p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.btn-geocode {
  width: 100%;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-geocode:disabled { opacity: 0.4; cursor: default; }

.geocode-progress-bar {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
  display: none;
}
.geocode-progress-bar.visible { display: block; }
.geocode-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}

/* ============================================================
   TOAST
   ============================================================ */
#toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.success { border-color: var(--won); }
#toast.error   { border-color: var(--hot); }

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
#loading {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  gap: 16px;
}
#loading.hidden { display: none; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading p { color: var(--text-muted); font-size: 14px; }

/* ============================================================
   LEAFLET OVERRIDES
   ============================================================ */
.leaflet-container { background: #1a1a2e !important; }
.leaflet-control-zoom {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  margin-bottom: 20px !important;
  margin-left: 10px !important;
}
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
  width: 42px !important;
  height: 42px !important;
  line-height: 42px !important;
  font-size: 22px !important;
}
.leaflet-control-attribution {
  background: rgba(0,0,0,0.5) !important;
  color: #555 !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: #666 !important; }

/* ============================================================
   SCROLLBARS
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
