:root {
  --bg-app: #0f172a;
  --bg-panel: #111c33;
  --bg-card: #172542;
  --bg-card-hover: #1e3156;
  --border-subtle: rgba(148, 163, 184, 0.18);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --amber: #f59e0b;
  --sky: #0ea5e9;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.agm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge-free { background: rgba(148,163,184,0.2); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.35); }
.badge-pro { background: rgba(14,165,233,0.18); color: #38bdf8; border: 1px solid rgba(56,189,248,0.4); }
.badge-ent { background: rgba(245,158,11,0.18); color: #fbbf24; border: 1px solid rgba(251,191,36,0.45); }
.badge-gov { background: rgba(16,185,129,0.2); color: #34d399; border: 1px solid rgba(52,211,153,0.45); }
.badge-danger { background: rgba(239,68,68,0.2); color: #f87171; border: 1px solid rgba(248,113,113,0.45); }

.basemap-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.basemap-card:hover { background: var(--bg-card-hover); }
.basemap-card.active {
  border-color: var(--emerald);
  box-shadow: 0 0 0 1px var(--emerald) inset;
  background: rgba(16, 185, 129, 0.12);
}
.basemap-card.locked { opacity: 0.68; }

.sovereign-label {
  background: rgba(15, 23, 42, 0.86);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.6);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.prov-count-pill {
  background: rgba(16, 185, 129, 0.92);
  color: #042f2e;
  font-weight: 800;
  font-size: 11px;
  border-radius: 999px;
  padding: 1px 6px;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.4);
  white-space: nowrap;
}

.leaflet-popup-content-wrapper {
  background: #0f172a;
  color: #f1f5f9;
  border: 1px solid rgba(148,163,184,0.3);
  border-radius: 10px;
}
.leaflet-popup-tip { background: #0f172a; }
.leaflet-container { background: #0b192c; }
.leaflet-interactive:focus,
.leaflet-interactive:focus-visible,
.leaflet-container path:focus,
.leaflet-container svg:focus {
  outline: none !important;
  box-shadow: none !important;
}

.dock-circle-btn {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  background: #ffffff;
}
.dock-circle-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.45);
}
.dock-circle-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn-primary {
  background: var(--emerald);
  color: #022c22;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.92; }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}
.btn-outline:hover { background: var(--bg-card-hover); }

.input-dark {
  width: 100%;
  background: #0b1324;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.input-dark:focus { outline: none; border-color: var(--emerald); }

.tab-pill {
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border-top: none; border-left: none; border-right: none;
}
.tab-pill.active { color: #34d399; border-bottom-color: #10b981; }
