﻿/* GovCare Management Heatmap — scoped dashboard styles */
.gc-heatmap-page {
  --gc-hm-navy-950: #061d31;
  --gc-hm-navy-900: #0b2e4a;
  --gc-hm-blue-700: #145da0;
  --gc-hm-blue-600: #1d6fb8;
  --gc-hm-gold-500: #c8962e;
  --gc-hm-border: var(--gc-border, #dbe5ee);
  --gc-hm-text: var(--gc-text, #102033);
  --gc-hm-muted: var(--gc-text-secondary, #6a7a8d);
  --gc-hm-bg: var(--gc-bg, #f3f7fb);
  --gc-hm-shadow: 0 10px 30px rgba(11, 46, 74, 0.08);
  --gc-hm-shadow-lg: 0 16px 40px rgba(11, 46, 74, 0.12);
}

* {
  box-sizing: border-box;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.gc-heatmap-page {
  min-height: auto;
  padding: 0;
  font-family: var(--gc-font-ui, "Expo Arabic", Arial, sans-serif);
  background: transparent;
}

.gc-hm-toolbar,
.gc-hm-kpi-grid,
.gc-hm-map-shell,
.gc-hm-analysis-grid {
  max-width: 1540px;
  margin-inline: auto;
}

.gc-hm-icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gc-hm-border);
  border-radius: 13px;
  background: white;
  color: var(--gc-hm-navy-900);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.gc-hm-icon-button:hover {
  transform: translateY(-1px);
  border-color: #a9c9e8;
  box-shadow: 0 6px 16px rgba(20, 93, 160, 0.1);
}

.gc-hm-bell span {
  position: absolute;
  inset-inline-start: -4px;
  top: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  color: white;
  background: #dc2626;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  border: 2px solid white;
}

.gc-hm-section-title span,
.gc-hm-card-heading span,
.gc-hm-area-panel-head span {
  color: var(--gc-hm-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── Toolbar ── */
.gc-hm-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--gc-hm-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: var(--gc-hm-shadow);
}

.gc-hm-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gc-hm-toolbar-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.gc-hm-primary-button,
.gc-hm-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gc-hm-primary-button {
  border: 1px solid var(--gc-hm-navy-900);
  background: linear-gradient(135deg, var(--gc-hm-navy-900) 0%, #123a5c 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(11, 46, 74, 0.22);
}

.gc-hm-primary-button.has-filters {
  box-shadow: 0 4px 14px rgba(11, 46, 74, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.gc-hm-primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(11, 46, 74, 0.28);
}

.gc-hm-filter-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: #dc2626;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.gc-hm-date-group {
  display: inline-flex;
  padding: 3px;
  border-radius: 11px;
  background: #eef2f6;
  gap: 2px;
}

.gc-hm-date-chip {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gc-hm-muted);
  font-weight: 800;
  font-size: 12px;
  transition: background 0.15s ease, color 0.15s ease;
}

.gc-hm-date-chip.is-active {
  background: white;
  color: var(--gc-hm-navy-900);
  box-shadow: 0 2px 6px rgba(11, 46, 74, 0.08);
}

.gc-hm-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px dashed #c7352d;
  border-radius: 11px;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 800;
  font-size: 12px;
}

.gc-hm-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 1540px;
  margin: -6px auto 14px;
}

.gc-hm-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 99px;
  background: white;
  border: 1px solid var(--gc-hm-border);
  box-shadow: var(--gc-hm-shadow);
  font-size: 12px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-filter-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, var(--gc-hm-blue-700));
}

.gc-hm-filter-chip button {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef2f6;
  color: var(--gc-hm-muted);
}

.gc-hm-filter-result {
  font-size: 12px;
  color: var(--gc-hm-muted);
  font-weight: 700;
}

.gc-hm-empty,
.gc-hm-table-empty {
  padding: 20px;
  text-align: center;
  color: var(--gc-hm-muted);
  font-size: 13px;
  font-weight: 700;
}

.gc-hm-map-empty {
  min-height: 580px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 40px;
  text-align: center;
  background: linear-gradient(180deg, #e8eef3, #dce4ec);
}

.gc-hm-map-empty i {
  width: 48px;
  height: 48px;
  color: var(--gc-hm-muted);
}

.gc-hm-map-empty strong {
  font-size: 16px;
  color: var(--gc-hm-navy-900);
}

.gc-hm-map-empty span {
  color: var(--gc-hm-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.gc-hm-secondary-button {
  border: 1px solid var(--gc-hm-border);
  background: white;
  color: var(--gc-hm-navy-900);
}

.gc-hm-secondary-button:hover {
  border-color: #a9c9e8;
  background: #f7fbff;
}

.gc-hm-secondary-button.is-active {
  border-color: var(--gc-hm-blue-700);
  background: linear-gradient(180deg, #eef6ff 0%, #e4f0fb 100%);
  color: var(--gc-hm-blue-700);
  box-shadow: inset 0 0 0 1px rgba(20, 93, 160, 0.12);
}

.gc-hm-select {
  min-width: 165px;
  min-height: 42px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--gc-hm-border);
  border-radius: 11px;
  background: white;
  color: var(--gc-hm-muted);
  transition: border-color 0.15s ease;
}

.gc-hm-select:focus-within {
  border-color: var(--gc-hm-blue-700);
  box-shadow: 0 0 0 3px rgba(20, 93, 160, 0.1);
}

.gc-hm-select span {
  font-size: 11px;
  font-weight: 800;
}

.gc-hm-select .gc-sel-wrap { min-width: 0; }
.gc-hm-select .gc-sel-trigger {
  width: 100%; border: 0; outline: 0; background: transparent; padding: 0;
  color: var(--gc-hm-text); font-weight: 800; box-shadow: none;
}
.gc-hm-select .gc-sel-trigger:focus { box-shadow: none; }
.gc-hm-select .gc-sel-dropdown { min-width: 200px; }

.gc-hm-live-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 99px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.gc-hm-live-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
  animation: gc-hm-pulse 2s ease-in-out infinite;
}

@keyframes gc-hm-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15); }
  50% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0.06); }
}

/* ── KPI Cards ── */
.gc-hm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.gc-hm-kpi-card {
  min-height: 132px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid var(--gc-hm-border);
  border-radius: 18px;
  background: white;
  box-shadow: var(--gc-hm-shadow);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gc-hm-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--gc-hm-shadow-lg);
}

.gc-hm-kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: currentColor;
  border-radius: 0 4px 4px 0;
}

.gc-hm-kpi-glow {
  position: absolute;
  inset-inline-end: -20px;
  top: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.06;
  pointer-events: none;
}

.gc-hm-kpi-copy {
  display: grid;
  gap: 5px;
  position: relative;
  z-index: 1;
}

.gc-hm-kpi-label {
  color: var(--gc-hm-muted);
  font-size: 12px;
  font-weight: 800;
}

.gc-hm-kpi-copy strong {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--gc-hm-text);
  line-height: 1.2;
}

.gc-hm-kpi-copy small {
  color: var(--gc-hm-muted);
  font-size: 12px;
}

.gc-hm-kpi-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: color-mix(in srgb, currentColor 10%, white);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.gc-hm-tone-blue { color: #145da0; }
.gc-hm-tone-red { color: #dc2626; }
.gc-hm-tone-green { color: #16a34a; }
.gc-hm-tone-gold { color: #c8962e; }

/* ── Map Shell ── */
.gc-hm-map-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 580px;
  border: 1px solid var(--gc-hm-border);
  border-radius: 22px;
  background: white;
  box-shadow: var(--gc-hm-shadow-lg);
  overflow: hidden;
  margin-bottom: 18px;
}

.gc-hm-hot-list {
  padding: 20px;
  border-inline-end: 1px solid var(--gc-hm-border);
  background:
    linear-gradient(165deg, #ffffff 0%, #f4f9fd 55%, #eef5fb 100%);
  z-index: 3;
}

.gc-hm-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.gc-hm-section-title h2 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-section-title i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #fef2f2, #fff7ed);
  color: #dc2626;
}

.gc-hm-hot-items {
  display: grid;
  gap: 10px;
}

.gc-hm-hot-item {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr 12px;
  gap: 10px;
  align-items: center;
  text-align: right;
  padding: 14px;
  border: 1px solid var(--gc-hm-border);
  border-radius: 15px;
  background: white;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.gc-hm-hot-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--hm-accent, transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gc-hm-hot-item:hover,
.gc-hm-hot-item.is-selected {
  transform: translateY(-2px);
  border-color: #a9c9e8;
  box-shadow: 0 8px 22px rgba(20, 93, 160, 0.1);
}

.gc-hm-hot-item.is-selected::before {
  opacity: 1;
}

.gc-hm-rank {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef4f9;
  color: var(--gc-hm-blue-700);
  font-weight: 900;
  font-size: 13px;
}

.gc-hm-rank.is-gold {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  box-shadow: 0 2px 8px rgba(198, 154, 46, 0.3);
}

.gc-hm-rank.is-silver {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: #475569;
}

.gc-hm-rank.is-bronze {
  background: linear-gradient(135deg, #ffedd5, #fed7aa);
  color: #9a3412;
}

.gc-hm-city-tag,
.gc-hm-city-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
}

.gc-hm-city-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gc-hm-hot-item-body {
  min-width: 0;
}

.gc-hm-hot-item strong,
.gc-hm-hot-item small {
  display: block;
}

.gc-hm-hot-item strong {
  font-size: 13px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-hot-item small {
  margin-top: 3px;
  color: var(--gc-hm-muted);
  font-size: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.gc-hm-hot-bar {
  height: 4px;
  margin-top: 8px;
  border-radius: 99px;
  background: #edf2f6;
  overflow: hidden;
}

.gc-hm-hot-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease;
}

.gc-hm-level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gc-hm-view-all {
  width: 100%;
  margin-top: 14px;
  height: 44px;
  border: 1px dashed #9bb9d4;
  border-radius: 13px;
  background: linear-gradient(180deg, #f7fbff, #eef6ff);
  color: var(--gc-hm-blue-700);
  font-weight: 900;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gc-hm-view-all:hover {
  background: #e4f0fb;
  border-color: var(--gc-hm-blue-700);
}

/* ── Map ── */
.gc-hm-map-wrap {
  min-width: 0;
  position: relative;
  background: #c8d4de;
}

.gc-hm-map-stage {
  position: relative;
  height: 100%;
  min-height: 580px;
}

.gc-hm-map {
  height: 100%;
  min-height: 580px;
  background: #c8d4de;
  z-index: 1;
}

.gc-hm-map-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 450;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 18%),
    linear-gradient(0deg, rgba(11, 46, 74, 0.08) 0%, transparent 22%),
    radial-gradient(ellipse at center, transparent 55%, rgba(11, 46, 74, 0.06) 100%);
}

.gc-hm-map-controls {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 520;
}

.gc-hm-color-mode {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(219, 229, 238, 0.95);
  box-shadow: 0 8px 24px rgba(11, 46, 74, 0.12);
}

.gc-hm-color-mode > span {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 800;
  color: var(--gc-hm-muted);
}

.gc-hm-color-mode > div {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: #eef2f6;
}

.gc-hm-color-mode button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  background: transparent;
  color: var(--gc-hm-muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.gc-hm-color-mode button.is-active {
  background: white;
  color: var(--gc-hm-navy-900);
  box-shadow: 0 2px 8px rgba(11, 46, 74, 0.08);
}

/* Heat layers & pins */
.gc-hm-heat-outer.is-selected,
.gc-hm-heat-mid.is-selected,
.gc-hm-heat-core.is-selected {
  animation: gc-hm-heat-pulse 2.4s ease-in-out infinite;
}

@keyframes gc-hm-heat-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

.gc-hm-pin-wrap {
  background: transparent !important;
  border: 0 !important;
}

.gc-hm-pin {
  position: relative;
  width: 32px;
  height: 32px;
}

.gc-hm-pin-city-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--city-ring, #145da0);
  opacity: 0.75;
}

.gc-hm-pin-ring {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 2px solid var(--hm-pin, #dc2626);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 3px var(--hm-glow, rgba(220, 38, 38, 0.3));
}

.gc-hm-pin-dot {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--hm-pin, #dc2626);
}

.gc-hm-pin.is-selected .gc-hm-pin-ring {
  animation: gc-hm-pin-pulse 1.8s ease-in-out infinite;
}

@keyframes gc-hm-pin-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--hm-glow); transform: scale(1); }
  50% { box-shadow: 0 0 0 8px transparent; transform: scale(1.08); }
}

.gc-hm-map-wrap .leaflet-control-zoom a {
  border-radius: 10px !important;
  border: 1px solid var(--gc-hm-border) !important;
  color: var(--gc-hm-navy-900) !important;
  font-weight: 800;
}

.gc-hm-map-wrap .leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 6px 18px rgba(11, 46, 74, 0.12) !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.gc-hm-map-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(219, 229, 238, 0.92);
  box-shadow: 0 6px 18px rgba(11, 46, 74, 0.1);
  font-size: 12px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-map-label {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.gc-hm-map-label::before {
  display: none !important;
}

.gc-hm-map-label div {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--gc-hm-navy-900);
  text-shadow: none;
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 18px rgba(11, 46, 74, 0.14);
  border: 1px solid var(--gc-hm-border);
  border-top: 3px solid var(--tip-city, var(--gc-hm-blue-700));
}

.gc-hm-map-label strong {
  font-size: 12px;
  font-weight: 800;
}

.gc-hm-map-label small {
  font-size: 10px;
  color: var(--gc-hm-muted);
  font-weight: 700;
}

.gc-hm-map-label span {
  min-width: 40px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--gc-hm-navy-900);
  color: white;
  box-shadow: none;
  text-shadow: none;
  font-weight: 900;
  font-size: 11px;
}

.gc-hm-popup {
  display: grid;
  gap: 6px;
  min-width: 160px;
}

.gc-hm-popup-city,
.gc-hm-popup-density {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
}

.gc-hm-popup span,
.gc-hm-popup small {
  color: var(--gc-hm-muted);
}

/* City labels on map */
.gc-hm-city-label-wrap {
  background: transparent !important;
  border: 0 !important;
}

.gc-hm-city-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--city-color, #145da0);
  box-shadow: 0 8px 22px rgba(11, 46, 74, 0.14);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gc-hm-city-label:hover,
.gc-hm-city-label.is-active {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(11, 46, 74, 0.18);
}

.gc-hm-city-label-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--city-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--city-color) 22%, transparent);
  flex-shrink: 0;
}

.gc-hm-city-label strong,
.gc-hm-city-label small {
  display: block;
  text-align: right;
  line-height: 1.3;
}

.gc-hm-city-label strong {
  font-size: 12px;
  font-weight: 900;
  color: var(--gc-hm-navy-900);
}

.gc-hm-city-label small {
  font-size: 10px;
  color: var(--gc-hm-muted);
  font-weight: 700;
}

/* Legends */
.gc-hm-legend,
.gc-hm-city-legend,
.gc-hm-area-panel {
  position: absolute;
  z-index: 500;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(219, 229, 238, 0.95);
  box-shadow: 0 12px 32px rgba(11, 46, 74, 0.14);
}

.gc-hm-city-legend {
  inset-inline-start: 14px;
  bottom: 14px;
  width: 240px;
  max-height: 220px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 16px;
}

.gc-hm-city-legend h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-city-legend button {
  width: 100%;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: right;
  transition: background 0.15s ease;
}

.gc-hm-city-legend button:hover,
.gc-hm-city-legend button.is-active {
  background: #f1f6fa;
}

.gc-hm-city-legend button.is-active {
  box-shadow: inset 3px 0 0 var(--gc-hm-blue-700);
}

.gc-hm-city-legend button > span {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 4px;
}

.gc-hm-legend-density {
  top: 14px;
  inset-inline-end: 14px;
  width: 210px;
  padding: 14px;
  border-radius: 16px;
}

.gc-hm-legend h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-legend button {
  width: 100%;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: right;
  transition: background 0.15s ease;
}

.gc-hm-legend button:hover,
.gc-hm-legend button.is-active {
  background: #f1f6fa;
}

.gc-hm-legend button.is-active {
  box-shadow: inset 3px 0 0 var(--gc-hm-blue-700);
}

.gc-hm-legend button > span {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 4px;
}

.gc-hm-legend strong,
.gc-hm-legend small {
  display: block;
}

.gc-hm-legend strong {
  font-size: 12px;
  font-weight: 800;
}

.gc-hm-legend small {
  margin-top: 2px;
  color: var(--gc-hm-muted);
  font-size: 10px;
}

.gc-hm-area-panel {
  inset-inline-end: 14px;
  bottom: 14px;
  width: 300px;
  padding: 0 0 16px;
  border-radius: 18px;
  overflow: hidden;
  animation: gc-hm-slide-up 0.3s ease;
}

@keyframes gc-hm-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.gc-hm-area-panel-strip {
  height: 4px;
  width: 100%;
}

.gc-hm-area-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 0;
}

.gc-hm-area-panel-head h3 {
  margin: 3px 0 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-area-panel-head small {
  display: block;
  margin-top: 2px;
  color: var(--gc-hm-muted);
  font-size: 11px;
}

.gc-hm-area-panel-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  color: var(--hm-accent, var(--gc-hm-blue-700));
}

.gc-hm-area-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 16px;
}

.gc-hm-area-panel-grid div {
  padding: 11px 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbfe, #f0f5fa);
  border: 1px solid #edf2f6;
}

.gc-hm-area-panel-grid span,
.gc-hm-area-panel-grid strong {
  display: block;
  text-align: center;
}

.gc-hm-area-panel-grid span {
  color: var(--gc-hm-muted);
  font-size: 10px;
  font-weight: 700;
}

.gc-hm-area-panel-grid strong {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 900;
}

.gc-hm-area-panel-grid strong.is-warn { color: #dc2626; }
.gc-hm-area-panel-grid strong.is-ok { color: #16a34a; }

.gc-hm-area-panel-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
  border-top: 1px solid var(--gc-hm-border);
  padding-top: 12px;
  font-size: 12px;
}

.gc-hm-area-panel-meta span {
  display: block;
  color: var(--gc-hm-muted);
  font-size: 10px;
  font-weight: 700;
}

.gc-hm-area-panel-meta strong {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-area-panel-meta strong.is-up { color: #dc2626; }
.gc-hm-area-panel-meta strong.is-down { color: #16a34a; }

/* ── Analysis Grid ── */
.gc-hm-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.85fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.gc-hm-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--gc-hm-border);
  border-radius: 20px;
  background: white;
  box-shadow: var(--gc-hm-shadow);
  transition: box-shadow 0.2s ease;
}

.gc-hm-card:hover {
  box-shadow: var(--gc-hm-shadow-lg);
}

.gc-hm-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.gc-hm-card-heading h2 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--gc-hm-navy-900);
}

.gc-hm-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #edf2f6;
}

.gc-hm-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.gc-hm-table-wrap th,
.gc-hm-table-wrap td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf2f6;
  text-align: right;
  font-size: 12px;
}

.gc-hm-table-wrap th {
  color: var(--gc-hm-muted);
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  text-transform: none;
  letter-spacing: 0;
}

.gc-hm-table-wrap tbody tr {
  transition: background 0.15s ease;
}

.gc-hm-table-wrap tbody tr:hover {
  background: #f8fbfe;
}

.gc-hm-table-wrap tbody tr.is-selected {
  background: linear-gradient(90deg, rgba(20, 93, 160, 0.06), transparent);
  box-shadow: inset 3px 0 0 var(--gc-hm-blue-700);
}

.gc-hm-table-area {
  border: 0;
  background: transparent;
  color: var(--gc-hm-navy-900);
  font-weight: 900;
  transition: color 0.15s ease;
}

.gc-hm-table-area:hover {
  color: var(--gc-hm-blue-700);
}

.gc-hm-density-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  font-weight: 900;
  font-size: 11px;
}

.gc-hm-density-pill i,
.gc-hm-density-row-head i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gc-hm-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 99px;
}

.gc-hm-trend.is-up {
  color: #dc2626;
  background: #fef2f2;
}

.gc-hm-trend.is-down {
  color: #16a34a;
  background: #f0fdf4;
}

.gc-hm-density-bars {
  display: grid;
  gap: 20px;
}

.gc-hm-density-row {
  display: grid;
  gap: 8px;
}

.gc-hm-density-row-head,
.gc-hm-density-row-head > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.gc-hm-density-row-head strong {
  font-size: 13px;
  font-weight: 800;
}

.gc-hm-density-row-head span {
  font-weight: 900;
  font-size: 14px;
  color: var(--gc-hm-navy-900);
}

.gc-hm-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf2f6;
}

.gc-hm-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background-image: linear-gradient(90deg, currentColor, color-mix(in srgb, currentColor 70%, white));
  transition: width 0.5s ease;
}

.gc-hm-density-row small {
  color: var(--gc-hm-muted);
  font-size: 11px;
}

.gc-hm-insights-card {
  display: grid;
  align-content: start;
}

.gc-hm-insight {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 10px;
  border-inline-start: 4px solid transparent;
  transition: transform 0.15s ease;
}

.gc-hm-insight:hover {
  transform: translateX(-2px);
}

.gc-hm-insight i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.gc-hm-insight strong,
.gc-hm-insight span {
  display: block;
}

.gc-hm-insight strong {
  font-weight: 800;
  font-size: 13px;
}

.gc-hm-insight span {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.7;
  opacity: 0.9;
}

.gc-hm-insight.is-danger {
  background: linear-gradient(135deg, #fef2f2, #fff5f5);
  color: #b91c1c;
  border-inline-start-color: #dc2626;
}

.gc-hm-insight.is-warning {
  background: linear-gradient(135deg, #fffbeb, #fffdf5);
  color: #a16207;
  border-inline-start-color: #f59e0b;
}

.gc-hm-insight.is-success {
  background: linear-gradient(135deg, #f0fdf4, #f7fef9);
  color: #15803d;
  border-inline-start-color: #16a34a;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  .gc-hm-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gc-hm-analysis-grid {
    grid-template-columns: 1fr 1fr;
  }

  .gc-hm-ranking-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .gc-hm-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .gc-hm-toolbar-end {
    justify-content: space-between;
  }

  .gc-hm-map-shell {
    grid-template-columns: 1fr;
  }

  .gc-hm-hot-list {
    border-inline-end: 0;
    border-bottom: 1px solid var(--gc-hm-border);
  }

  .gc-hm-hot-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gc-hm-analysis-grid {
    grid-template-columns: 1fr;
  }

  .gc-hm-ranking-card {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .gc-hm-kpi-grid,
  .gc-hm-hot-items {
    grid-template-columns: 1fr;
  }

  .gc-hm-filter-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .gc-hm-date-group {
    width: 100%;
    justify-content: stretch;
  }

  .gc-hm-date-chip {
    flex: 1;
  }

  .gc-hm-select,
  .gc-hm-primary-button,
  .gc-hm-secondary-button {
    width: 100%;
  }

  .gc-hm-legend-density {
    width: 180px;
    top: auto;
    bottom: 240px;
  }

  .gc-hm-city-legend {
    width: calc(100% - 28px);
    max-height: 160px;
  }

  .gc-hm-map-controls {
    position: relative;
    inset: auto;
    margin: 10px;
  }

  .gc-hm-color-mode > div {
    flex-direction: column;
  }

  .gc-hm-color-mode button {
    width: 100%;
    text-align: center;
  }

  .gc-hm-area-panel {
    width: calc(100% - 32px);
  }

  .gc-hm-map,
  .gc-hm-map-shell {
    min-height: 670px;
  }
}
