:root {
  --bg: #0b0f0b;
  --surface: #11160f;
  --text: #e8eae6;
  --muted: #9aa39a;
  --accent: #9ae600;
  --border: #1e271a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.95rem;
}

.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 24px;
}

.case-card h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: var(--accent);
}

.case-card .narrativa p {
  margin: 0 0 10px;
}

.case-card .narrativa b {
  color: var(--text);
}

.aviso {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(154, 230, 0, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.btn:hover { border-color: var(--accent); }

.btn.active {
  background: var(--accent);
  color: #0b0f0b;
  border-color: var(--accent);
  font-weight: 600;
}

#map {
  height: 520px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Legend */
.legend {
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 1.6;
  font-size: 0.82rem;
}

.legend .legend-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--accent);
}

.legend .legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  width: 18px;
  height: 14px;
  display: inline-block;
  border-radius: 3px;
  opacity: 0.85;
}

/* Popup overrides for dark theme */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.leaflet-popup-content {
  margin: 12px 14px;
  font-size: 0.9rem;
}

.leaflet-popup-content b { color: var(--accent); }

.popup-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
