/* ═══════════════════════════════════════════════════════
   Građevinske dozvole — Zagreb
   Premium Design System · Dark Mode First
   ═══════════════════════════════════════════════════════ */

/* ── Custom Properties ─────────────────────────────── */
:root {
  /* Colors */
  --bg:                #0a0c14;
  --bg-gradient:       linear-gradient(135deg, #0a0c14 0%, #0f1119 50%, #0a0c14 100%);
  --surface:           rgba(26, 29, 39, 0.85);
  --surface-elevated:  rgba(30, 34, 48, 0.90);
  --surface-hover:     rgba(40, 44, 60, 0.92);
  --text-primary:      #e8eaed;
  --text-secondary:    #9aa0a6;
  --text-muted:        #5f6368;
  --accent:            #6366f1;
  --accent-hover:      #818cf8;
  --accent-glow:       rgba(99, 102, 241, 0.25);
  --accent-gradient:   linear-gradient(135deg, #6366f1 0%, #818cf8 50%, #a78bfa 100%);
  --marker-large:      #ef4444;
  --marker-medium:     #f59e0b;
  --marker-small:      #3b82f6;
  --border:            rgba(255, 255, 255, 0.08);
  --border-focus:      rgba(99, 102, 241, 0.5);
  --success:           #22c55e;
  --danger:            #ef4444;

  /* Spacing */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg:  0 10px 30px rgba(0, 0, 0, 0.5), 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow:   0.3s ease;
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-xs:   0.6875rem;  /* 11px */
  --font-sm:   0.75rem;    /* 12px */
  --font-base: 0.875rem;   /* 14px */
  --font-md:   1rem;       /* 16px */
  --font-lg:   1.25rem;    /* 20px */
  --font-xl:   1.5rem;     /* 24px */
  --font-2xl:  2rem;       /* 32px */

  /* Layout */
  --sidebar-width:     320px;
  --header-height:     56px;
  --footer-height:     36px;

  /* Blur */
  --blur-sm:  8px;
  --blur-md:  16px;
  --blur-lg:  24px;
}

/* ── Reset & Base ──────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color-scheme: dark;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  background-image: var(--bg-gradient);
  min-height: 100vh;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

::selection {
  background: var(--accent);
  color: #fff;
}

/* ── Scrollbar Styling ─────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* ── Animations ────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes countUp {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
  50%      { box-shadow: 0 0 20px var(--accent-glow); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.animate-slide-in {
  animation: slideInLeft 0.3s ease forwards;
}

.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ── App Layout ────────────────────────────────────── */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ── Sidebar ───────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  animation: slideInLeft 0.4s ease;
  overflow: hidden;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-lg);
  padding-bottom: var(--space-2xl);
}

/* ── Sidebar Header ────────────────────────────────── */
.sidebar-header {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-header h1 {
  font-size: var(--font-lg);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.sidebar-header .subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.sidebar-header .subtitle::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

/* ── Stats Section ─────────────────────────────────── */
.stats-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--surface-elevated);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all var(--transition-normal);
  animation: fadeIn 0.4s ease forwards;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:nth-child(3) {
  grid-column: 1 / -1;
}

.stat-card .stat-label {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.stat-card .stat-number {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  animation: countUp 0.3s ease;
}

.stat-card .stat-number.accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Filter Section ────────────────────────────────── */
.filter-section {
  margin-bottom: var(--space-lg);
}

.filter-section-title {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.filter-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.filter-group {
  margin-bottom: var(--space-md);
}

.filter-group label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.filter-group .date-range {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.filter-group .date-range span {
  color: var(--text-muted);
  font-size: var(--font-sm);
}

/* Input Styles */
input[type="date"],
input[type="number"],
select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  transition: all var(--transition-normal);
  outline: none;
}

input[type="date"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.06);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

/* Range Slider */
.range-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.range-wrapper input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.range-wrapper input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.range-wrapper input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-wrapper input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: pointer;
}

.range-value {
  min-width: 28px;
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  padding: var(--space-sm) 0;
}

.checkbox-wrapper input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  flex-shrink: 0;
}

.checkbox-wrapper input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.checkbox-wrapper input[type="checkbox"]:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.checkbox-wrapper span {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

/* ── Reset Button ──────────────────────────────────── */
.btn-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-reset:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-reset:active {
  transform: scale(0.98);
}

/* ── Live Counter ──────────────────────────────────── */
.live-counter {
  padding: var(--space-md);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  text-align: center;
  line-height: 1.5;
}

.live-counter strong {
  color: var(--accent);
  font-weight: 600;
}

/* ── Legend ─────────────────────────────────────────── */
.legend {
  margin-bottom: var(--space-lg);
}

.legend-title {
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-sm);
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.legend-dot.large  { background: var(--marker-large);  color: var(--marker-large); }
.legend-dot.medium { background: var(--marker-medium); color: var(--marker-medium); }
.legend-dot.small  { background: var(--marker-small);  color: var(--marker-small); }

/* ── View Toggle ───────────────────────────────────── */
.view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.toggle-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.toggle-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ── Map Container ─────────────────────────────────── */
.map-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  height: 100vh;
  position: relative;
}

#map {
  width: 100%;
  height: calc(100vh - var(--footer-height));
  background: var(--bg);
}

/* ── Table Container ───────────────────────────────── */
.table-container {
  display: none;
  flex: 1;
  margin-left: var(--sidebar-width);
  height: calc(100vh - var(--footer-height));
  overflow: auto;
  background: var(--bg);
}

.table-container.visible {
  display: block;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--font-sm);
}

.table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.table th {
  background: var(--surface-elevated);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  padding: var(--space-md) var(--space-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.table th:hover {
  color: var(--accent);
}

.table th .sort-indicator {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.5;
}

.table th.sort-active {
  color: var(--accent);
}

.table th.sort-active .sort-indicator {
  opacity: 1;
}

.table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  transition: background var(--transition-fast);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table tbody tr {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--surface-hover);
}

.table tbody tr:hover td {
  color: #fff;
}

/* ── Badge ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  line-height: 1.6;
}

.badge.large {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge.small {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ── Leaflet Popup Overrides ───────────────────────── */
.leaflet-popup-content-wrapper {
  background: var(--surface-elevated) !important;
  backdrop-filter: blur(var(--blur-lg)) !important;
  -webkit-backdrop-filter: blur(var(--blur-lg)) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--text-primary) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  font-family: var(--font-family) !important;
  font-size: var(--font-base) !important;
  line-height: 1.5 !important;
  min-width: 260px;
}

.leaflet-popup-tip {
  background: var(--surface-elevated) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.leaflet-popup-close-button {
  color: var(--text-secondary) !important;
  font-size: 20px !important;
  top: 8px !important;
  right: 10px !important;
  width: 24px !important;
  height: 24px !important;
  transition: color var(--transition-fast) !important;
}

.leaflet-popup-close-button:hover {
  color: var(--text-primary) !important;
}

/* Popup Content */
.popup-content {
  padding: var(--space-lg);
}

.popup-type {
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.popup-title {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.popup-stats {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.popup-stat {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.popup-stat strong {
  color: var(--text-primary);
  margin-right: 4px;
  font-weight: 600;
}

.popup-location {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.popup-dates {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

.popup-duration {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--font-xs);
  margin-left: 4px;
}

.popup-klasa {
  font-size: var(--font-xs);
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  word-break: break-all;
}

/* ── Footer ────────────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--footer-height);
  background: var(--surface);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-md);
  font-size: var(--font-xs);
  color: var(--text-muted);
  z-index: 500;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--accent);
}

/* ── Mobile Toggle ─────────────────────────────────── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 1100;
  width: 44px;
  height: 44px;
  background: var(--surface-elevated);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 20px;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
}

.mobile-toggle:hover {
  background: var(--surface-hover);
  transform: scale(1.05);
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ── Leaflet Controls Theme ────────────────────────── */
.leaflet-control-zoom a {
  background: var(--surface-elevated) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
  transition: all var(--transition-fast) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--surface-hover) !important;
  color: var(--accent) !important;
}

.leaflet-control-attribution {
  background: rgba(10, 12, 20, 0.7) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
}

.leaflet-control-attribution a {
  color: var(--text-secondary) !important;
}

/* Marker hover effect */
.marker-hover {
  filter: brightness(1.3);
  transition: filter 0.15s ease;
}

/* ── Loading State ─────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: var(--space-md);
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

/* ── Empty State ───────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state-text {
  font-size: var(--font-base);
}

/* ── Responsive: Tablet ────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 280px;
  }

  .stat-card .stat-number {
    font-size: var(--font-lg);
  }
}

/* ── Responsive: Mobile ────────────────────────────── */
@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    width: 300px;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .map-wrapper,
  .table-container,
  .footer {
    margin-left: 0;
    left: 0;
  }

  .footer {
    font-size: 9px;
    padding: 0 var(--space-sm);
  }
}

/* ── Responsive: Small Mobile ──────────────────────── */
@media (max-width: 480px) {
  .sidebar {
    width: 100%;
  }

  .popup-stats {
    flex-direction: column;
  }
}

