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

:root {
  --teal:        #1e9bd7;
  --teal-dark:   #1786bc;
  --teal-deeper: #0f6d9e;
  --header-h:    48px;
  --sidebar-w:   270px;
  --bg:          #f4f6f8;
  --border:      #dde2e8;
  --text:        #2d3748;
  --muted:       #718096;
  --select-bg:   #ffffff;
  --accent:      #f0a500;
  --pin-country: #1e9bd7;
  --pin-region:  #2ecc71;
  --pin-city:    #e74c3c;
  --radius:      6px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.10);
  --shadow-md:   0 4px 16px rgba(0,0,0,.14);
}

html, body {
  height: 100%; width: 100%;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text);
  overflow: hidden;
}

/* ── HEADER ─────────────────────────────────────────── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--teal);
  display: flex; align-items: center;
  padding: 0 16px; gap: 18px;
  z-index: 1100;
  box-shadow: 0 2px 8px rgba(0,0,0,.20);
}
.app-header .logo {
  font-size: 1.05rem; font-weight: 700;
  color: #fff; text-decoration: none; letter-spacing: .02em;
  white-space: nowrap;
}
.app-header .nav-link {
  font-size: .9rem; color: rgba(255,255,255,.88);
  text-decoration: none; cursor: pointer;
  padding: 4px 10px; border-radius: 4px;
  transition: background .18s;
}
.app-header .nav-link:hover { background: rgba(255,255,255,.18); }
.app-header .spacer { flex: 1; }
.app-header .pin-badge {
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff; font-size: .78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  font-family: 'Source Code Pro', monospace;
  white-space: nowrap;
}

/* ── LAYOUT ─────────────────────────────────────────── */
.app-body {
  display: flex;
  position: fixed;
  top: var(--header-h); bottom: 0; left: 0; right: 0;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,0,0,.06);
}
.sidebar-inner { padding: 16px 14px; display: flex; flex-direction: column; gap: 0; }

.filter-block { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.filter-block label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.filter-block select {
  width: 100%; padding: 8px 10px;
  font-size: .9rem; font-family: inherit;
  color: var(--text);
  background: var(--select-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.filter-block select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(30,155,215,.15);
}
.filter-block select:disabled {
  opacity: .45; cursor: not-allowed;
  background-color: #f5f7fa;
}

.divider { height: 1px; background: var(--border); margin: 4px 0 14px; }

/* Info card */
.info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px;
  margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: .82rem; color: var(--muted);
}
.info-card .info-row { display: flex; justify-content: space-between; align-items: center; }
.info-card .info-label { font-weight: 600; color: var(--text); }
.info-card .info-val {
  font-family: 'Source Code Pro', monospace;
  font-size: .78rem;
  background: rgba(30,155,215,.1);
  color: var(--teal-dark);
  padding: 1px 7px; border-radius: 10px;
  font-weight: 600;
}
.info-card .info-val.none { background: #f0f0f0; color: #aaa; }

/* Legend */
.legend { margin-bottom: 14px; }
.legend-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 8px;
}
.legend-items { display: flex; flex-direction: column; gap: 5px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .83rem; }
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0; border: 2px solid rgba(0,0,0,.15);
}

/* Reset button */
.btn-reset {
  width: 100%; padding: 9px 0;
  background: var(--teal); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: .88rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .18s, transform .12s;
  letter-spacing: .02em;
}
.btn-reset:hover { background: var(--teal-dark); }
.btn-reset:active { transform: scale(.98); }
.btn-reset:disabled { opacity: .4; cursor: not-allowed; }

/* ── MAP ─────────────────────────────────────────────── */
.map-wrap {
  flex: 1; position: relative; overflow: hidden;
}
#map { width: 100%; height: 100%; }

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  border-radius: 10px !important;
  box-shadow: var(--shadow-md) !important;
  padding: 0 !important;
  overflow: hidden;
}
.leaflet-popup-content { margin: 0 !important; }
.popup-inner { padding: 14px 16px; min-width: 180px; }
.popup-inner h3 { font-size: .95rem; font-weight: 700; margin-bottom: 4px; }
.popup-inner p { font-size: .82rem; color: var(--muted); margin: 0; }
.popup-inner .pop-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em;
  padding: 2px 8px; border-radius: 10px;
  color: #fff;
}

/* Zoom level indicator */
.zoom-indicator {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .75rem; font-weight: 600;
  font-family: 'Source Code Pro', monospace;
  color: var(--muted);
  z-index: 900;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* Hint bar */
.hint-bar {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: rgba(20,30,50,.75);
  color: rgba(255,255,255,.9);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: .8rem; font-weight: 500;
  z-index: 900;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  transition: opacity .3s;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }