:root {
  --bg: #0b0f14;
  --panel: #121821;
  --muted: #a8b3c7;
  --text: #e6edf3;
  --accent: #7aa2ff;
  --accent-soft: #1b2a4b;
  --border: #253041;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #0b1118 0%, #0b0f14 100%);
  color: var(--text);
}

.app-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(18,24,33,0.65);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.brand .title {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.subtle {
  color: var(--muted);
  font-size: 12.5px;
}

#map {
  height: calc(100vh - 64px);
  width: 100%;
}

/* Leaflet popup theming */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.leaflet-popup-content {
  margin: 10px 12px;
  min-width: 260px;
}
.info-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.info-card .name {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}
.info-card .property {
  color: var(--muted);
  font-size: 13px;
}
.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.kv div {
  font-size: 13px;
}
.kv .key {
  color: var(--muted);
}
.kv .val {
  color: var(--text);
}

/* MarkerCluster tone */
.marker-cluster-small { background-color: rgba(122,162,255,0.25); }
.marker-cluster-small div { background-color: rgba(122,162,255,0.75); color: #0b0f14; }
.marker-cluster-medium { background-color: rgba(122,162,255,0.3); }
.marker-cluster-medium div { background-color: rgba(122,162,255,0.85); color: #0b0f14; }
.marker-cluster-large { background-color: rgba(122,162,255,0.35); }
.marker-cluster-large div { background-color: rgba(122,162,255,0.95); color: #0b0f14; }


/* ==== Modernized Pins, Clusters, Chips ==== */
.brand-pin { }
.brand-pin .pin {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  padding: 6px;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 18px rgba(0,0,0,.45), inset 0 0 0 2px rgba(122,162,255,.15);
  display: grid;
  place-items: center;
}
.brand-pin .pin img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}
.brand-pin .pin::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--panel);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
}

/* Cluster badges */
.cluster-wrapper { }
.cluster {
  width: 40px; height: 40px;
  border-radius: 999px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  background: radial-gradient(60% 60% at 50% 50%, rgba(122,162,255,0.9) 0%, rgba(122,162,255,0.5) 60%, rgba(27,42,75,0.6) 100%);
  box-shadow: 0 10px 22px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,255,255,.1);
  color: #0b0f14;
  font-weight: 700;
}
.cluster.medium { width: 46px; height: 46px; }
.cluster.large  { width: 54px; height: 54px; }
.cluster span { transform: translateY(1px); }

/* Status chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.chip {
  font-size: 11.5px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
}
.chip.ok { background: rgba(46, 204, 113, 0.12); color: #8be28b; border-color: rgba(46, 204, 113, 0.35); }
.chip.warn { background: rgba(241, 196, 15, 0.12); color: #ffdd7a; border-color: rgba(241, 196, 15, 0.35); }
.chip.info { background: rgba(122,162,255,0.15); color: #aecdff; border-color: rgba(122,162,255,0.35); }
