* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f6f8fa;
  color: #1f2328;
}
.dashboard {
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header header"
    "main filters";
  min-height: 100vh;
}
.header {
  grid-area: header;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #e8ddd2 0%, #f0e6dc 100%);
  border-bottom: 1px solid #d4c4b5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}
.header-brand {
  flex-shrink: 0;
}
.header h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2328;
}
.subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: #656d76;
}
.header .summary-cards {
  margin: 0;
  margin-left: auto;
}
.filters-panel {
  grid-area: filters;
  padding: 0;
  background: linear-gradient(180deg, #e8ddd2 0%, #f0e6dc 100%);
  border-left: 1px solid #d4c4b5;
  overflow: hidden;
  box-shadow: -1px 0 2px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.filters-header {
  flex-shrink: 0;
  padding: 1rem;
  background: #e8ddd2;
  border-bottom: 1px solid #d4c4b5;
}

.filters-header .btn-apply {
  margin-bottom: 1rem;
}

.filters-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f0e6dc;
  border: 1px solid #d4c4b5;
  border-radius: 6px;
  margin: 0 1rem 1rem 1rem;
  max-height: calc(100vh - 400px);
}

.filter-group {
  margin-bottom: 0.75rem;
}
.filter-group label {
  display: block;
  font-size: 0.75rem;
  color: #656d76;
  margin-bottom: 0.25rem;
}
.filter-group select,
.filter-group input[type="date"] {
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  color: #1f2328;
  font-size: 0.875rem;
}

/* Multi-select styling */
.filter-group select[multiple] {
  min-height: 60px;
  max-height: 60px;
  padding: 0.25rem;
}

.filter-group select[multiple] option {
  padding: 0.25rem 0.4rem;
  border-radius: 3px;
  margin: 1px 0;
  font-size: 0.8rem;
}

.filter-group select[multiple] option:checked {
  background: linear-gradient(135deg, #0969da 0%, #0550ae 100%);
  color: white;
}

.filter-group select[multiple] option:hover {
  background: #eaeef2;
}
.filter-group select:hover,
.filter-group input[type="date"]:hover {
  border-color: #8c959f;
}
.filter-group select:focus,
.filter-group input[type="date"]:focus {
  outline: none;
  border-color: #0969da;
  box-shadow: 0 0 0 2px rgba(9, 105, 218, 0.2);
}
.date-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.date-range input { flex: 1; min-width: 0; }
.date-range span { font-size: 0.75rem; color: #656d76; }
.presets {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.presets button {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  color: #1f2328;
  cursor: pointer;
}
.presets button:hover {
  background: #eaeef2;
  border-color: #8c959f;
}
.btn-apply {
  width: 100%;
  padding: 0.6rem;
  background: #0969da;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin: 0;
}
.btn-apply:hover {
  background: #0550ae;
}
.main {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1rem;
  position: relative;
}
.summary-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d4c4b5;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  min-width: 120px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.card-label {
  display: block;
  font-size: 0.75rem;
  color: #656d76;
  margin-bottom: 0.25rem;
}
.card-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2328;
}
.map {
  flex: 1;
  min-height: 300px;
  border-radius: 8px;
  border: 1px solid #d0d7de;
  background: #e8edf2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.map-legend {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  border: 1px solid #d0d7de;
  color: #1f2328;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.map-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  border-radius: 8px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e8ddd2;
  border-top: 4px solid #0969da;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #656d76;
  font-weight: 500;
}

/* City markers with numbers */
.city-marker {
  background: transparent;
  border: none;
}

.marker-content {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #0969da;
  border-radius: 3px;
  padding: 0.15rem 0.3rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-size: 0.7rem;
  font-weight: 600;
  color: #1f2328;
  white-space: nowrap;
}
