/* ==========================================================================
   CEMRCB-RIVER Web GIS Portal - Components Stylesheet
   Sidebar TOC, Legend, Attribute Drawer, Modals, Popups, Tooltips, Print Layout
   ========================================================================== */

/* ------------------- STRICT LEAFLET PANE Z-INDEX HIERARCHY ------------------- */
.leaflet-pane.leaflet-pane_risk_map-pane {
  z-index: 250 !important;
}
.leaflet-pane.leaflet-pane_district-pane {
  z-index: 480 !important;
}
.leaflet-pane.leaflet-pane_waterbody-pane {
  z-index: 510 !important;
}
.leaflet-pane.leaflet-pane_road_network-pane {
  z-index: 520 !important;
}
.leaflet-pane.leaflet-pane_evacuation_route-pane {
  z-index: 535 !important;
}
.leaflet-pane.leaflet-pane_boundary-pane {
  z-index: 540 !important;
}
.leaflet-pane.leaflet-pane_community_boundary-pane {
  z-index: 550 !important;
}
.leaflet-pane.leaflet-pane_railline-pane {
  z-index: 560 !important;
}
.leaflet-pane.leaflet-pane_point_feature-pane {
  z-index: 570 !important;
}
.leaflet-pane.leaflet-pane_bridge_culvert-pane {
  z-index: 580 !important;
}
.leaflet-pane.leaflet-pane_assembly_point-pane {
  z-index: 590 !important;
}
.leaflet-pane.leaflet-pane_flood_shelter-pane {
  z-index: 600 !important;
}
.leaflet-pane.leaflet-pane_highlight-pane {
  z-index: 620 !important;
}
.leaflet-pane.leaflet-pane_labels-pane {
  z-index: 650 !important;
  pointer-events: none !important;
}

/* ------------------- MODAL OVERLAYS & DIALOGS (CRITICAL FIX) ------------------- */
.gis-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 9999 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

.gis-modal-dialog {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopAnim 0.22s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes modalPopAnim {
  0% { opacity: 0; transform: scale(0.94) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  background: #005d52;
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.stats-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.stat-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.2;
}

.stat-lbl {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Boundary Shapefile Demographic Stat Cards (Exact Match to User Reference) */
.demo-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
  gap: 8px;
}

.demo-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.demo-stat-card:hover {
  transform: translateY(-2px);
  border-color: #005d52;
}

.demo-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #005d52;
  line-height: 1.2;
}

.demo-stat-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 4px;
}

#analytics-risk-visual-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 20px;
  align-items: center;
}

/* ------------------- STATISTICAL SUMMARY RESPONSIVE PANEL ------------------- */
.analytics-modal-dialog {
  max-width: 920px;
  max-height: 94vh;
  width: 95vw;
}

.analytics-modal-header {
  background: #005d52;
  color: #ffffff;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.analytics-header-title {
  font-size: 1.02rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.analytics-filter-bar {
  background: #f1f5f9;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid #005d52;
  margin-bottom: 14px;
}

.analytics-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr auto auto;
  gap: 8px;
  align-items: center;
}

.analytics-filter-grid .filter-select {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.80rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1e293b;
}

.analytics-filter-grid .btn-filter-apply {
  padding: 6px 12px;
  font-size: 0.75rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.analytics-filter-grid .btn-filter-reset {
  padding: 6px 10px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.analytics-waterbody-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.analytics-waterbody-names-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: stretch;
}

.wb-name-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wb-name-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wb-name-badge {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  white-space: nowrap;
}

.wb-name-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

/* Hydrological Profile Summary Status Cards (Rivers: 136, Khals: 203, Beels: 94) */
.analytics-waterbody-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: stretch;
}

.wb-summary-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wb-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.wb-card-river {
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
}

.wb-card-khal {
  border: 1px solid #99f6e4;
  border-left: 4px solid #0d9488;
}

.wb-card-beel {
  border: 1px solid #a5f3fc;
  border-left: 4px solid #0891b2;
}

.wb-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.wb-summary-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
}

.wb-summary-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.wb-summary-val {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
}

.wb-summary-sub {
  font-size: 0.70rem;
  color: #64748b;
  margin-top: 3px;
  font-weight: 500;
}

.wb-hint-strip {
  margin-top: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wb-filtered-header {
  display: none !important;
}

.wb-col-count-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

@media (max-width: 680px) {
  .analytics-waterbody-names-grid,
  .analytics-waterbody-summary-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

.analytics-table-scroll-wrapper {
  max-height: 240px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile & Tablet Auto-Adjustment (Phones & Tablets) */
@media (max-width: 768px) {
  #analytics-modal.gis-modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .analytics-modal-dialog {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100% !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
  }

  .analytics-modal-body {
    padding: 10px 12px !important;
    max-height: calc(100dvh - 54px) !important;
    -webkit-overflow-scrolling: touch;
  }

  .analytics-modal-header {
    padding: 10px 12px !important;
    gap: 6px;
  }

  .analytics-header-title {
    font-size: 0.88rem !important;
  }

  .analytics-header-actions {
    gap: 4px;
  }

  .analytics-header-actions .btn-ai-report span {
    display: none;
  }

  .analytics-header-actions .btn-ai-report {
    padding: 5px 8px !important;
    font-size: 0.82rem !important;
  }

  .analytics-filter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .analytics-filter-grid #analytics-shelter-select {
    grid-column: 1 / -1;
  }

  .analytics-filter-grid .btn-filter-apply,
  .analytics-filter-grid .btn-filter-reset {
    justify-content: center;
    text-align: center;
    width: 100%;
  }

  .stats-grid-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .stat-card {
    padding: 8px 6px !important;
  }

  .stat-val {
    font-size: 1.18rem !important;
  }

  .stat-lbl {
    font-size: 0.65rem !important;
  }

  .demo-stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .demo-stat-card {
    padding: 6px 8px !important;
  }

  .demo-stat-val {
    font-size: 1.05rem !important;
  }

  .demo-stat-lbl {
    font-size: 0.62rem !important;
  }

  #analytics-facilities-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 6px !important;
    padding: 8px !important;
    max-height: 200px !important;
  }

  #analytics-risk-visual-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  #chart-risk-pie-wrapper {
    max-width: 230px !important;
    height: 200px !important;
    margin: 0 auto !important;
  }
}

/* Small Smartphone Screen Adjustments (e.g., iPhone SE, Galaxy S, 320px-440px) */
@media (max-width: 440px) {
  .analytics-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-waterbody-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  .demo-stat-grid {
    grid-template-columns: 1fr !important;
  }

  .stats-grid-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .stat-val {
    font-size: 1.05rem !important;
  }

  #analytics-community-title {
    font-size: 0.85rem !important;
  }
}

/* Statistical Summary Modal Fullscreen Mode */
.gis-modal-dialog.modal-fullscreen {
  max-width: 98vw !important;
  width: 98vw !important;
  max-height: 96vh !important;
  height: 96vh !important;
  border-radius: 12px !important;
  margin: auto !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gis-modal-dialog.modal-fullscreen .modal-body {
  max-height: calc(96vh - 56px) !important;
  padding: 16px 24px !important;
}

/* Print / PDF Export Optimization for Statistical Summary */
@media print {
  html, body {
    width: 100% !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
    position: static !important;
    background: #ffffff !important;
  }

  /* Hide all background application elements */
  body > *:not(#analytics-modal),
  #app-container,
  #app-loading-overlay,
  .gis-header-bar,
  .gis-toolbar,
  #map,
  .leaflet-control-container,
  .gis-sidebar-drawer {
    display: none !important;
  }

  /* Reset modal overlay for clean paper rendering */
  #analytics-modal {
    position: static !important;
    display: block !important;
    background: #ffffff !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    z-index: auto !important;
  }

  #analytics-modal .gis-modal-dialog {
    position: static !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #analytics-modal .modal-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 10px 0 !important;
  }

  /* Hide interactive buttons during print */
  #btn-analytics-print,
  #btn-analytics-fullscreen,
  #analytics-modal .sidebar-btn-close,
  #btn-analytics-focus-community,
  #btn-analytics-reset-all {
    display: none !important;
  }

  /* Ensure colors and charts print accurately */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Prevent page breaks inside cards and tables */
  .stat-card,
  .demo-stat-card,
  .chart-box-card,
  table,
  #analytics-facilities-container,
  #analytics-waterbody-container,
  #analytics-demographic-container {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  #analytics-facilities-grid {
    max-height: none !important;
    overflow: visible !important;
  }

  #analytics-risk-visual-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ------------------- SIDEBAR COMPONENTS ------------------- */
.sidebar-header-banner {
  background: #004d40;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #80cbc4;
}

.sidebar-btn-close {
  background: transparent;
  border: none;
  color: #b2dfdb;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.sidebar-btn-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Sidebar Navigation Tabs */
.sidebar-tabs-bar {
  display: flex;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-tab-btn {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.sidebar-tab-btn:hover {
  color: var(--primary-color);
  background: rgba(0, 93, 82, 0.04);
}

.sidebar-tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: #ffffff;
}

/* Tab Content Areas */
.sidebar-content-area {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.sidebar-tab-content {
  display: none;
  padding: 12px;
  height: 100%;
}

.sidebar-tab-content.active {
  display: block;
}

/* Layer Search in Sidebar */
.sidebar-search-bar {
  position: relative;
  margin-bottom: 10px;
}

.sidebar-search-bar input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  background: #ffffff;
  transition: var(--transition-fast);
}

.sidebar-search-bar input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 93, 82, 0.15);
}

.sidebar-search-bar i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Layer Tree Header Controls */
.toc-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 10px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.toc-title-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.toc-quick-btns {
  display: flex;
  gap: 6px;
}

.btn-toc-tool {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-toc-tool:hover {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* ------------------- LAYER TREE (TOC) ITEMS ------------------- */
.toc-layers-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-layer-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}

.toc-layer-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.toc-layer-item.expanded {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.toc-layer-header {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  gap: 8px;
}

/* Custom Checkbox */
.toc-checkbox-label {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toc-checkbox-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.toc-custom-checkbox {
  width: 17px;
  height: 17px;
  background: #ffffff;
  border: 1.8px solid #94a3b8;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: var(--transition-fast);
}

.toc-checkbox-label input:checked ~ .toc-custom-checkbox {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.toc-checkbox-label input:checked ~ .toc-custom-checkbox:after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.toc-layer-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.toc-layer-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Per-Layer Label ON/OFF Toggle Button */
.toc-btn-label-toggle {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: var(--transition-fast);
  user-select: none;
}

.toc-btn-label-toggle:hover {
  background: #e2e8f0;
}

.toc-btn-label-toggle.active {
  background: #005d52;
  border-color: #004d40;
  color: #ffffff;
}

.toc-btn-label-toggle.off {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  opacity: 0.6;
}

.toc-layer-badge {
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

/* Hide count badge for layers in Data Layers panel */
#layer-tree-container .toc-layer-badge {
  display: none !important;
}

.toc-btn-expand {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.75rem;
  transition: transform var(--transition-fast);
}

.toc-layer-item.expanded .toc-btn-expand {
  transform: rotate(180deg);
  color: var(--primary-color);
}

/* Expanded Layer Details */
.toc-layer-details {
  padding: 8px 12px 10px 12px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}

.toc-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.toc-control-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 50px;
}

.toc-opacity-slider {
  flex: 1;
  accent-color: var(--primary-color);
  height: 4px;
  cursor: pointer;
}

.toc-opacity-val {
  font-size: 0.75rem;
  color: var(--text-dark);
  font-weight: 600;
  width: 35px;
  text-align: right;
}

.toc-control-actions {
  display: flex;
  gap: 8px;
}

.toc-btn-action {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.toc-btn-action:hover {
  background: #f1f5f9;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ------------------- SWATCHES & ICONS ------------------- */
.legend-swatch-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.legend-swatch-box {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  display: inline-block;
}

.legend-swatch-box-hollow {
  width: 14px;
  height: 14px;
  border: 2.5px solid;
  border-radius: 2px;
  display: inline-block;
}

.legend-swatch-box-dashed {
  width: 14px;
  height: 14px;
  border: 2px dashed;
  border-radius: 2px;
  display: inline-block;
}

.legend-swatch-line {
  width: 16px;
  border-radius: 2px;
  display: inline-block;
}

.legend-swatch-rail {
  width: 16px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #111 0px, #111 3px, #fff 3px, #fff 6px);
  border: 1px solid #111;
  display: inline-block;
}

.legend-swatch-split {
  display: inline-flex;
  gap: 2px;
}

.legend-swatch-split span {
  width: 6px;
  height: 12px;
  border-radius: 2px;
}

.legend-swatch-multi {
  display: inline-flex;
  gap: 1px;
}

.legend-swatch-multi span {
  width: 3px;
  height: 12px;
  border-radius: 1px;
}

/* ------------------- LEGEND PANEL TAB ------------------- */
.legend-group {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.legend-group:last-child {
  border-bottom: none;
}

.legend-group-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-group-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #e0f2f1;
  color: var(--primary-color);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 50%;
}

.legend-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 10px;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.legend-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #334155;
}

.legend-box {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-line {
  width: 18px;
  flex-shrink: 0;
}

.legend-line-rail {
  width: 18px;
  height: 4px;
  background: repeating-linear-gradient(90deg, #111 0px, #111 4px, #fff 4px, #fff 8px);
  border: 1px solid #111;
  flex-shrink: 0;
}

.legend-poi-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.legend-icon-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* ------------------- FILTER PANEL ------------------- */
.filter-form-group {
  margin-bottom: 12px;
}

.filter-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.filter-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  background: #ffffff;
}

.filter-select:focus {
  border-color: var(--primary-color);
}

.filter-btns-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-filter-apply {
  flex: 1;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-filter-apply:hover {
  background: var(--primary-dark);
}

.btn-filter-reset {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.community-summary-box {
  margin-top: 14px;
  background: #f8fafc;
  border: 1.5px solid #005d52;
  border-radius: var(--radius-md);
  padding: 12px;
}

.summary-box-header {
  font-size: 0.92rem;
  color: #005d52;
  margin-bottom: 2px;
}

.summary-box-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.summary-box-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.btn-view-comm-analytics {
  width: 100%;
  background: #005d52;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

/* ------------------- BOTTOM ATTRIBUTE TABLE DRAWER ------------------- */
#attribute-table-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 360px;
  background: #ffffff;
  border-top: 3px solid var(--primary-color);
  box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  z-index: 1500;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#attribute-table-drawer.open {
  transform: translateY(0);
}

.drawer-drag-handle-bar {
  display: none;
  width: 100%;
  padding: 8px 0 4px 0;
  background: #1e293b;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.drawer-drag-handle-pill {
  width: 38px;
  height: 4px;
  background: #64748b;
  border-radius: 2px;
  transition: background 0.2s;
}

.drawer-drag-handle-bar:hover .drawer-drag-handle-pill {
  background: #cbd5e1;
}

.drawer-header {
  background: #1e293b;
  color: #ffffff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.drawer-title {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.drawer-count-badge {
  font-size: 0.75rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  white-space: nowrap;
}

.drawer-header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.drawer-layer-select {
  background: #334155;
  border: 1px solid #475569;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
  max-width: 210px;
}

.drawer-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.drawer-search-icon {
  position: absolute;
  left: 10px;
  color: #94a3b8;
  font-size: 0.75rem;
  pointer-events: none;
}

.drawer-search-input {
  background: #334155;
  border: 1px solid #475569;
  color: #ffffff;
  padding: 5px 10px 5px 28px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  outline: none;
  width: 170px;
  transition: width 0.2s ease, border-color 0.2s ease;
}

.drawer-search-input:focus {
  border-color: #00796b;
  width: 200px;
}

.drawer-btn-csv {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.drawer-btn-csv:hover {
  background: #059669;
}

.drawer-header-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.drawer-btn-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.drawer-btn-close:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

/* Mobile Responsiveness for Attribute Table Drawer */
@media (max-width: 768px) {
  #attribute-table-drawer {
    height: min(480px, 72vh) !important;
    max-height: 82vh !important;
    z-index: 2000 !important;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45) !important;
  }

  .drawer-drag-handle-bar {
    display: flex !important;
  }

  .drawer-header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "left right"
      "center center" !important;
    padding: 6px 12px 10px 12px !important;
    gap: 8px !important;
    background: #1e293b !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
  }

  .drawer-header-left {
    grid-area: left !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
  }

  .drawer-title {
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .drawer-count-badge {
    font-size: 0.7rem !important;
    padding: 1px 6px !important;
  }

  .drawer-header-right {
    grid-area: right !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
  }

  .drawer-btn-close {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    border-radius: var(--radius-pill) !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45) !important;
    cursor: pointer !important;
    min-height: 32px !important;
  }

  .drawer-btn-close:active {
    background: #b91c1c !important;
    transform: scale(0.96) !important;
  }

  .drawer-header-center {
    grid-area: center !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    padding-bottom: 2px !important;
    justify-content: flex-start !important;
  }

  .drawer-layer-select {
    flex: 1 1 auto !important;
    min-width: 115px !important;
    max-width: 150px !important;
    font-size: 0.75rem !important;
    padding: 5px 6px !important;
  }

  .drawer-search-wrapper {
    flex: 1 1 auto !important;
    min-width: 95px !important;
  }

  .drawer-search-input {
    width: 100% !important;
    font-size: 0.75rem !important;
    padding: 5px 8px 5px 26px !important;
  }

  .drawer-search-input:focus {
    width: 100% !important;
  }

  .drawer-btn-csv {
    flex-shrink: 0 !important;
    padding: 5px 10px !important;
    font-size: 0.74rem !important;
  }

  .btn-csv-text {
    display: none !important;
  }

  .drawer-footer {
    padding: 6px 12px !important;
    font-size: 0.74rem !important;
  }

  .btn-page {
    padding: 4px 10px !important;
  }
}

.drawer-table-wrapper {
  flex: 1;
  overflow: auto;
}

.gis-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.gis-data-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-bottom: 2px solid var(--border-color);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  user-select: none;
}

.gis-data-table th.sortable-col {
  cursor: pointer;
}

.gis-data-table th.sortable-col:hover {
  background: #e2e8f0;
}

.gis-data-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gis-data-table tr:hover {
  background: #f1f5f9;
}

.btn-table-zoom {
  background: #e0f2f1;
  border: 1px solid #80cbc4;
  color: var(--primary-color);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.btn-table-zoom:hover {
  background: var(--primary-color);
  color: #ffffff;
}

.btn-table-analyze {
  background: #005d52;
  border: 1px solid #004d40;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.btn-table-analyze:hover {
  background: #00453d;
}

.btn-table-edit {
  background: #f39c12;
  border: 1px solid #d68910;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.btn-table-edit:hover {
  background: #d68910;
}

.drawer-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-page {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ------------------- CUSTOM POPUPS ------------------- */
.leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.leaflet-popup-content {
  margin: 0;
  width: 100% !important;
}

.gis-popup-container {
  display: flex;
  flex-direction: column;
}

.gis-popup-header {
  background: #005d52;
  color: #ffffff;
  padding: 10px 14px;
  cursor: grab;
  user-select: none;
}

.gis-popup-header:active {
  cursor: grabbing;
}

.gis-popup-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.gis-popup-badges {
  margin-top: 4px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.popup-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  color: #ffffff;
}

.gis-popup-body {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 12px;
}

.gis-props-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.gis-props-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f1f5f9;
}

.gis-props-table .prop-key {
  color: var(--text-muted);
  width: 40%;
  font-weight: 500;
}

.gis-props-table .prop-val {
  color: var(--text-dark);
}

.gis-popup-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.popup-btn-action {
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ------------------- IDENTIFY TOOL POPUP CONTROLS ------------------- */
.identify-pager-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.identify-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.70rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-identify-nav {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.70rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-identify-nav:hover {
  background: #ffffff;
  color: #005d52;
}

/* ------------------- GPS COORDINATE & IDENTIFY POPUP STYLING ------------------- */
.custom-identify-popup {
  max-width: min(290px, calc(100vw - 20px)) !important;
}

.custom-identify-popup .leaflet-popup-content-wrapper {
  border-radius: 9px;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(0, 93, 82, 0.25);
}

.custom-identify-popup .leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.35;
}

.custom-coord-popup {
  max-width: min(270px, calc(100vw - 20px)) !important;
}

.coord-dd-card {
  background: #f0fdfa;
  border: 1.5px solid #a7f3d0;
  border-radius: 7px;
  padding: 8px 10px;
  text-align: center;
}

.coord-dd-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0f766e;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.coord-dd-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.95rem;
  font-weight: 800;
  color: #005d52;
  letter-spacing: 0.3px;
  user-select: all;
}

.custom-identify-popup .gis-props-table td {
  padding: 3px 6px !important;
  font-size: 0.75rem !important;
  line-height: 1.3 !important;
}

.custom-identify-popup .gis-props-table .prop-key {
  font-size: 0.74rem !important;
  color: #475569 !important;
  font-weight: 600 !important;
}

.custom-identify-popup .popup-btn-action {
  padding: 3px 8px !important;
  font-size: 0.72rem !important;
  height: 24px !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.popup-btn-action.btn-copy-coord {
  background: #0284c7;
  transition: all 0.2s ease;
}

.popup-btn-action.btn-copy-coord:hover {
  background: #0369a1;
}

.popup-btn-action.btn-gmaps-link {
  background: #475569;
  color: #ffffff !important;
  text-decoration: none;
  transition: all 0.2s ease;
}

.popup-btn-action.btn-gmaps-link:hover {
  background: #334155;
}

.popup-btn-edit {
  background: #e67e22;
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ------------------- HIGHLIGHTED SHELTER LABELS (Red) - North & Center Alignment ------------------- */
.gis-map-label {
  background: transparent;
  border: none;
  pointer-events: none;
}

.gis-map-label span {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%) scale(var(--gis-label-scale, 1));
  transform-origin: center center;
  text-align: center;
  transition: transform 0.12s ease-out;
}

/* North and Center Alignment for Shelter Labels */
.gis-label-shelter-highlight {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  pointer-events: none !important;
}

.gis-label-shelter-highlight .shelter-highlight-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  transform: translate(-50%, calc(-100% - 18px)) scale(var(--gis-label-scale, 1)) !important;
  transform-origin: bottom center !important;
  transition: transform 0.12s ease-out;
  white-space: nowrap !important;
  background: #b71c1c !important;
  color: #ffffff !important;
  font-size: 0.80rem !important;
  font-weight: 700 !important;
  border: 2px solid #ffd700 !important;
  border-radius: 6px !important;
  padding: 3px 8px !important;
  box-shadow: 0 0 10px rgba(211, 47, 47, 0.8), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
  animation: shelterGlowAnim 2.5s infinite alternate !important;
  position: relative !important;
  gap: 5px !important;
  line-height: 1.2 !important;
}

/* Downward anchor arrow pointing directly to the Shelter marker */
.gis-label-shelter-highlight .shelter-highlight-badge::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #ffd700;
}

@keyframes shelterGlowAnim {
  0% { box-shadow: 0 0 6px rgba(211, 47, 47, 0.6); }
  100% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.9); }
}

/* ------------------- EVACUATION ROUTE NAME LABELS ------------------- */
.gis-label-evac-route {
  pointer-events: none !important;
  background: transparent !important;
  border: none !important;
}

/* ------------------- ASSEMBLY POINT GREEN TARGET SYMBOL ------------------- */
.custom-svg-assembly-icon {
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.custom-svg-assembly-icon svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  will-change: transform;
}

.custom-svg-assembly-icon:hover {
  z-index: 9999 !important;
}

.custom-svg-assembly-icon:hover svg {
  transform: scale(1.28);
  filter: drop-shadow(0 0 8px rgba(0, 230, 118, 0.95)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.75));
}

.legend-swatch-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* ------------------- FLOATING QUICK SEARCH POPOVER (Tools Panel) ------------------- */
.map-floating-search-popover {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: 440px;
  max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 93, 82, 0.2);
  z-index: 950;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: searchPopoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchPopoverFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

.floating-search-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.floating-search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.floating-search-icon {
  position: absolute;
  left: 10px;
  color: var(--primary-color);
  font-size: 0.95rem;
  pointer-events: none;
}

#floating-search-input {
  width: 100%;
  padding: 8px 32px 8px 34px;
  font-size: 0.88rem;
  font-family: inherit;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-pill);
  outline: none;
  background: #f8fafc;
  color: #1e293b;
  transition: all 0.2s ease;
}

#floating-search-input:focus {
  border-color: var(--primary-color);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 93, 82, 0.15);
}

.btn-clear-floating-search {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear-floating-search:hover {
  color: #ef4444;
}

.btn-close-floating-search {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-floating-search:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.floating-search-categories {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.search-category-chip {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.search-category-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: #e0f2f1;
}

.search-category-chip.active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 1px 4px rgba(0, 93, 82, 0.3);
}

.floating-search-results-dropdown {
  max-height: 380px;
  overflow-y: auto;
  background: #ffffff;
}

.search-result-item.keyboard-active {
  background: #e0f2f1;
  border-left: 3px solid var(--primary-color);
}

@media (max-width: 768px) {
  .map-floating-search-popover {
    top: auto;
    bottom: 74px;
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    transform: none;
  }
}

/* Floating Bottom-Right Logo on Map */
.map-floating-logo-badge {
  position: absolute;
  bottom: 28px;
  right: 14px;
  z-index: 500;
  background: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: transform 0.2s ease;
}

.map-floating-logo-badge:hover {
  transform: scale(1.04);
}

.map-floating-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

/* ------------------- POINT FEATURE (POI) LABELS - 100% Shade-Free / Transparent Halo Style ------------------- */
.gis-label-poi {
  pointer-events: none !important;
  white-space: normal !important;
}

.gis-label-poi .poi-label-badge {
  display: inline-flex !important;
  align-items: flex-start !important;
  gap: 4px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 0.73rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  max-width: 140px !important;
  min-width: 40px !important;
  background: transparent !important;
  background-color: transparent !important;
  color: #0f172a !important;
  border: none !important;
  border-left: none !important;
  box-shadow: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  position: relative !important;
  box-sizing: border-box !important;
  text-align: left !important;
  transition: transform 0.12s ease !important;
}

/* Category Icon with crisp white outline glow */
.gis-label-poi .poi-label-badge i {
  margin-top: 1.5px !important;
  flex-shrink: 0 !important;
  font-size: 0.72rem !important;
  filter: drop-shadow(0 0 1.5px #ffffff) drop-shadow(0 0 2px #ffffff) !important;
}

/* Pure Text with Crisp White Halo Outline - 100% Shade-Free, Maximum Readability */
.gis-label-poi .poi-label-badge .poi-label-text {
  flex: 1 1 auto !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  display: block !important;
  color: #0f172a !important;
  font-weight: 750 !important;
  letter-spacing: 0.15px !important;
  text-shadow:
    -1.5px -1.5px 0 #ffffff,
     1.5px -1.5px 0 #ffffff,
    -1.5px  1.5px 0 #ffffff,
     1.5px  1.5px 0 #ffffff,
    -1.5px  0     0 #ffffff,
     1.5px  0     0 #ffffff,
     0     -1.5px 0 #ffffff,
     0      1.5px 0 #ffffff,
     0 0 4px #ffffff,
     0 0 6px #ffffff !important;
}

/* Remove all box pointer arrows since there is no box shade */
.gis-label-poi .poi-label-badge::after {
  display: none !important;
  content: none !important;
  border: none !important;
}

/* 1. North-East Position (Default) */
.gis-label-poi.pos-ne .poi-label-badge,
.gis-label-poi:not([class*="pos-"]) .poi-label-badge {
  transform: translate(10px, calc(-100% - 2px)) scale(var(--gis-label-scale, 1)) !important;
  transform-origin: bottom left !important;
}

/* 2. North-West Position */
.gis-label-poi.pos-nw .poi-label-badge {
  transform: translate(calc(-100% - 10px), calc(-100% - 2px)) scale(var(--gis-label-scale, 1)) !important;
  transform-origin: bottom right !important;
}

/* 3. South-East Position */
.gis-label-poi.pos-se .poi-label-badge {
  transform: translate(10px, 10px) scale(var(--gis-label-scale, 1)) !important;
  transform-origin: top left !important;
}

/* 4. South-West Position */
.gis-label-poi.pos-sw .poi-label-badge {
  transform: translate(calc(-100% - 10px), 10px) scale(var(--gis-label-scale, 1)) !important;
  transform-origin: top right !important;
}

/* 5. North-Center Position */
.gis-label-poi.pos-n .poi-label-badge {
  transform: translate(-50%, calc(-100% - 12px)) scale(var(--gis-label-scale, 1)) !important;
  transform-origin: bottom center !important;
}

/* 6. South-Center Position */
.gis-label-poi.pos-s .poi-label-badge {
  transform: translate(-50%, 12px) scale(var(--gis-label-scale, 1)) !important;
  transform-origin: top center !important;
}

/* ------------------- ENHANCED HIGH-VISIBILITY POI MARKER BADGES ------------------- */
.custom-poi-div-icon {
  background: transparent !important;
  border: none !important;
}

.custom-poi-marker-badge {
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  font-size: 11px !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 0, 0, 0.3) !important;
  cursor: pointer !important;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease !important;
  position: relative !important;
}

.custom-poi-marker-badge i {
  color: #ffffff !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)) !important;
  line-height: 1 !important;
  font-size: 11.5px !important;
}

.custom-poi-marker-badge.badge-culvert,
.custom-poi-marker-badge.badge-bridge {
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 0 1.5px #ffd700 !important;
}

.custom-poi-div-icon:hover .custom-poi-marker-badge,
.custom-poi-marker-badge:hover {
  transform: scale(1.35) !important;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.8), 0 0 0 2.5px #ffd700 !important;
  z-index: 10000 !important;
}

/* Dynamic Marker Icon Scaling when Zoom > 18 */
.custom-svg-shelter-icon svg,
.custom-poi-div-icon .custom-poi-marker-badge,
.custom-bridge-div-icon .custom-bridge-badge {
  transform: scale(var(--gis-zoom-scale, 1)) !important;
  transform-origin: center center !important;
  transition: transform 0.12s ease-out;
}

/* ------------------- OTHER MAP LABELS ------------------- */
.gis-label-boundary span {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0f172a !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 4px !important;
  border: 1.2px solid #334155 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
  white-space: nowrap !important;
}

.gis-label-road span {
  background: rgba(142, 68, 173, 0.92) !important;
  color: #ffffff !important;
  font-size: 0.70rem !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
  white-space: nowrap !important;
}

.gis-label-evac-route span {
  background: rgba(213, 0, 0, 0.92) !important;
  color: #ffffff !important;
  font-size: 0.70rem !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
  white-space: nowrap !important;
}

.gis-label-waterbody span {
  background: rgba(41, 128, 185, 0.90) !important;
  color: #ffffff !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 3px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
  white-space: nowrap !important;
}

.gis-label-district span {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0f172a !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  padding: 3px 9px !important;
  border-radius: 4px !important;
  border: 1.8px solid #0f172a !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) !important;
  white-space: nowrap !important;
}

/* ------------------- ADMIN MODALS (Item 3) ------------------- */
.admin-login-box {
  padding: 20px;
}

.admin-input-group {
  margin-bottom: 14px;
}

.admin-input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #334155;
}

.admin-input-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  outline: none;
}

.admin-input-group input:focus {
  border-color: var(--primary-color);
}

.btn-admin-submit {
  width: 100%;
  background: var(--primary-color);
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 14px;
}

.edit-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.edit-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.edit-field-input {
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
}

.admin-logged-in {
  background: #10b981 !important;
  color: #ffffff !important;
}

/* ------------------- CARTOGRAPHIC PRINT / PDF LAYOUT ------------------- */
.cartographic-sheet-container {
  width: 900px;
  max-width: 96vw;
  background: #ffffff;
  border: 2px solid #000000;
  padding: 16px;
  box-shadow: var(--shadow-xl);
  max-height: 92vh;
  overflow-y: auto;
}

.carto-title-banner {
  text-align: center;
  border-bottom: 2px solid #000000;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.carto-main-heading {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #000000;
}

.carto-sub-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333333;
  margin-top: 2px;
}

.carto-map-frame {
  border: 2px solid #000000;
  height: 440px;
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}

.carto-footer-grid {
  display: grid;
  grid-template-columns: 200px 180px 1fr 140px;
  gap: 8px;
  border: 2px solid #000000;
  border-top: none;
  padding: 8px;
  background: #ffffff;
  font-size: 0.72rem;
}

.carto-inset-box {
  border: 1px solid #000000;
  padding: 4px;
  text-align: center;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.carto-scale-box {
  border: 1px solid #000000;
  padding: 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.carto-legend-box {
  border: 1px solid #000000;
  padding: 6px;
  font-size: 0.68rem;
  max-height: 120px;
  overflow-y: auto;
}

.carto-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.carto-prepared-box {
  border: 1px solid #000000;
  padding: 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Print CSS */
@media print {
  body * {
    visibility: hidden;
  }
  #cartographic-print-modal, #cartographic-print-modal * {
    visibility: visible;
  }
  #cartographic-print-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: block !important;
  }
  .cartographic-sheet-container {
    width: 100% !important;
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
  }
  .no-print {
    display: none !important;
  }
}

.text-red { color: #d32f2f; }
.text-yellow { color: #f1c40f; }

/* ------------------- COMMUNITY FILTER & HIGHLIGHT STYLES ------------------- */
.community-summary-box {
  background: #ffffff;
  border: 1.5px solid #005d52;
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  box-shadow: 0 2px 8px rgba(0, 93, 82, 0.12);
  animation: fadeIn 0.25s ease-out;
}

.summary-box-header {
  font-size: 0.92rem;
  font-weight: 700;
  color: #005d52;
  margin-bottom: 4px;
}

.summary-box-sub {
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 6px;
}

.btn-view-comm-analytics {
  width: 100%;
  background: #005d52;
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  font-size: 0.80rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.18s ease;
}

.btn-view-comm-analytics:hover {
  background: #00423a;
}

.focused-shelter-tooltip {
  background: #d32f2f !important;
  color: #ffffff !important;
  border: 1.5px solid #ffd700 !important;
  font-weight: 700 !important;
  font-size: 0.76rem !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
  padding: 3px 8px !important;
}

.focused-shelter-tooltip::before {
  border-top-color: #d32f2f !important;
}

/* ------------------- GIS STAFF & ADMIN AUTHENTICATION & FIELD NOTES ------------------- */
.header-auth-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header-auth {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 0.80rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-header-auth:hover {
  background: #ffffff;
  color: #005d52;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-lang-toggle {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-lang-toggle i {
  color: #ffd700;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.btn-lang-toggle:hover {
  background: #ffffff;
  color: #005d52;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.btn-lang-toggle:hover i {
  color: #005d52;
}

.user-status-pill {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border: 2px solid #27ae60;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-logout-mini {
  background: #e74c3c;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.15s ease;
}

.btn-logout-mini:hover {
  background: #c0392b;
}

/* Auth Modal Card */
.gis-auth-modal-card {
  max-width: 420px;
  width: 90%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.auth-modal-header {
  background: #005d52;
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-header-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-welcome-text {
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid #005d52;
}

.gis-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-field-group label {
  font-size: 0.80rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-field-group input,
.auth-field-group textarea,
.note-select-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  background: #ffffff;
  color: #1e293b;
  transition: border-color 0.15s ease;
}

.auth-field-group input:focus,
.auth-field-group textarea:focus,
.note-select-input:focus {
  border-color: #005d52;
  box-shadow: 0 0 0 3px rgba(0, 93, 82, 0.12);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 38px;
}

.btn-toggle-pwd {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  font-size: 0.88rem;
}

.btn-submit-auth {
  width: 100%;
  background: #005d52;
  color: #ffffff;
  border: none;
  padding: 11px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.18s ease;
  margin-top: 6px;
}

.btn-submit-auth:hover {
  background: #00453d;
}

/* Field Note Card */
.gis-field-note-card {
  max-width: 520px;
  width: 92%;
  border-radius: 12px;
  overflow: hidden;
}

.note-meta-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f1f5f9;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #334155;
}

.btn-submit-note {
  background: #005d52;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.btn-submit-note:hover {
  background: #00453d;
}

.btn-note-cancel {
  background: #e2e8f0;
  color: #475569;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Field Note Map Marker Styles */
.custom-field-note-div-icon {
  background: transparent !important;
  border: none !important;
}

.field-note-pin-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.field-note-icon {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f59e0b;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  border: 2px solid #ffffff;
}

.field-note-icon i {
  transform: rotate(45deg);
  font-size: 0.76rem;
  color: #1e293b;
}

.field-note-pulse {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.6);
  opacity: 0.7;
  animation: notePulse 2s infinite ease-out;
  z-index: 1;
}

@keyframes notePulse {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.note-marker-yellow .field-note-icon,
.note-marker-normal .field-note-icon,
.note-marker-warning .field-note-icon,
.note-marker-critical .field-note-icon {
  background: #f59e0b;
  border: 2px solid #ffffff;
}

.note-marker-yellow .field-note-pulse,
.note-marker-normal .field-note-pulse,
.note-marker-warning .field-note-pulse,
.note-marker-critical .field-note-pulse {
  background: rgba(245, 158, 11, 0.65);
}

/* Field Note Popup */
.field-note-popup .field-note-header,
.field-note-popup .field-note-header.yellow-theme {
  background: #005d52;
  border-bottom: 2px solid #f59e0b;
}

.field-note-comment-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 4px;
}

.btn-delete-note-admin {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #f87171;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-delete-note-admin:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Admin Manage Notes Table */
.manage-notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.80rem;
}

.manage-notes-table thead {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 2;
}

.manage-notes-table th {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  color: #475569;
  font-weight: 700;
}

.manage-notes-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.note-sev-pill {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sev-critical {
  background: #fee2e2;
  color: #b91c1c;
}
.sev-warning {
  background: #fef3c7;
  color: #b45309;
}
.sev-normal {
  background: #e0f2fe;
  color: #0369a1;
}

.note-cat-pill {
  background: #f1f5f9;
  color: #334155;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.btn-action-view {
  background: #0ea5e9;
  color: #ffffff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  margin-right: 4px;
}

.btn-action-del {
  background: #ef4444;
  color: #ffffff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-export-notes-csv {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Toast Notifications */
#gis-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gis-toast {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  color: #ffffff;
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info { background: #0284c7; }

/* ------------------- THEME & LANGUAGE TOGGLES ------------------- */
.header-toggles-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.22);
  padding: 3px 6px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.header-toggle-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 14px;
  font-size: 0.80rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  transition: all 0.2s ease;
}

.header-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-ai-report {
  background: linear-gradient(135deg, #059669, #047857) !important;
  color: #ffffff !important;
  border: 1px solid #10b981 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 0.80rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.btn-ai-report:hover {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

/* ------------------- DARK MODE THEME ------------------- */
body.dark-mode {
  --primary-color: #0f4c42;
  --bg-dark: #090d16;
  --bg-light: #0f172a;
  --bg-panel: #1e293b;
  --text-dark: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --border-dark: #475569;
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
}

body.dark-mode #gis-header {
  background-color: #092e28 !important;
  border-bottom: 1px solid #1e3a34;
}

body.dark-mode #gis-sidebar,
body.dark-mode .sidebar-header-banner,
body.dark-mode .gis-modal-dialog,
body.dark-mode .modal-body,
body.dark-mode .chart-box-card,
body.dark-mode .stat-card,
body.dark-mode .demo-stat-card,
body.dark-mode #attribute-table-container,
body.dark-mode .search-results-dropdown {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

body.dark-mode .stat-val {
  color: #2dd4bf !important;
}

body.dark-mode .stat-lbl,
body.dark-mode .demo-stat-lbl {
  color: #94a3b8 !important;
}

body.dark-mode input,
body.dark-mode select {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

body.dark-mode table {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

body.dark-mode th {
  background-color: #0f172a !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
}

body.dark-mode td {
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

body.dark-mode tr:nth-child(even) {
  background-color: #162032 !important;
}

body.dark-mode #analytics-facilities-grid,
body.dark-mode #analytics-waterbody-content,
body.dark-mode #analytics-demographic-content {
  background-color: #0f172a !important;
}

body.dark-mode .wb-name-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

body.dark-mode .wb-name-badge {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

body.dark-mode .wb-summary-card {
  background: #1e293b !important;
}

body.dark-mode .wb-card-river {
  border-color: #0284c7 !important;
}

body.dark-mode .wb-card-khal {
  border-color: #0d9488 !important;
}

body.dark-mode .wb-card-beel {
  border-color: #0891b2 !important;
}

body.dark-mode .wb-summary-lbl {
  color: #cbd5e1 !important;
}

body.dark-mode .wb-summary-sub {
  color: #94a3b8 !important;
}

body.dark-mode .wb-hint-strip {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

body.dark-mode .map-left-zoom-widget,
body.dark-mode .gis-vertical-toolbar {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}

body.dark-mode .map-left-zoom-widget .map-tool-btn,
body.dark-mode .map-left-zoom-widget .map-left-zoom-btn,
body.dark-mode .gis-vertical-toolbar .map-tool-btn {
  background: #1e293b;
  color: #f1f5f9;
}

body.dark-mode .map-left-zoom-widget .map-tool-btn:hover,
body.dark-mode .map-left-zoom-widget .map-left-zoom-btn:hover,
body.dark-mode .gis-vertical-toolbar .map-tool-btn:hover {
  background: var(--primary-color, #00796b);
  color: #ffffff;
}

body.dark-mode .map-left-zoom-widget .toolbar-v-divider,
body.dark-mode .gis-vertical-toolbar .toolbar-v-divider {
  background: #334155;
}

body.dark-mode .map-left-zoom-widget .btn-unselect-community,
body.dark-mode .gis-vertical-toolbar .btn-unselect-community {
  color: #94a3b8 !important;
}

body.dark-mode .map-left-zoom-widget .btn-unselect-community:hover,
body.dark-mode .gis-vertical-toolbar .btn-unselect-community:hover {
  background: #7f1d1d !important;
  color: #fca5a5 !important;
}

body.dark-mode .map-left-zoom-widget .btn-unselect-community.has-active-focus,
body.dark-mode .gis-vertical-toolbar .btn-unselect-community.has-active-focus {
  background: #ef4444 !important;
  color: #ffffff !important;
}

/* ------------------- STEALTH / PRIVATE DEVELOPER CHANNEL ------------------- */
.btn-stealth-contact {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill, 9999px);
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 2px;
  outline: none;
}

.btn-stealth-contact:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-stealth-contact:active {
  transform: scale(0.95);
}

/* Light & Clean Portal Theme - Feedback or Recommendation Modal */
.stealth-modal-dialog {
  max-width: 470px;
  width: 92vw;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  color: #1e293b;
  animation: stealthModalPop 0.2s ease-out forwards;
  font-family: 'Inter', sans-serif;
}

@keyframes stealthModalPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.stealth-modal-header {
  background: #005d52; /* CEMRCB-RIVER Portal Brand Color */
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  position: relative;
}

.stealth-header-text {
  flex: 1;
  min-width: 0;
}

.stealth-title {
  font-size: 1.0rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
}

.stealth-subtitle {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.82);
  margin: 2px 0 0 0;
  font-weight: 400;
}

.stealth-modal-close {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: all 0.15s ease;
}

.stealth-modal-close:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.stealth-modal-body {
  padding: 14px 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Feedback Hero Profile Card - Clean & Inconspicuous */
.feedback-hero-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.feedback-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #e6f4f1;
  border: 1px solid #b2dfdb;
  color: #005d52;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.feedback-hero-details {
  flex: 1;
  min-width: 0;
}

.feedback-role-pill {
  display: inline-block;
  background: #e6f4f1;
  color: #005d52;
  border: 1px solid #b2dfdb;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.feedback-expert-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 1px 0;
}

.feedback-expert-desc {
  font-size: 0.73rem;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

/* Channels List */
.stealth-channels-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Dual App Icons & Action Buttons */
.dual-app-icon-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.dual-action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Channel Card - Clean Light Portal Styling */
.stealth-channel-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.stealth-channel-card:hover {
  border-color: #cbd5e1;
  background: #fcfcfc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.stealth-channel-card.is-revealed {
  border-color: #b2dfdb;
  background: #fbfdfc;
}

/* Clickable App Icons (Button) */
.stealth-channel-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.15s ease;
}

.stealth-channel-icon:hover {
  transform: scale(1.08);
}

.stealth-channel-icon:active {
  transform: scale(0.96);
}

.stealth-channel-icon.phone-icon {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.stealth-channel-icon.whatsapp-icon {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.stealth-channel-icon.telegram-icon {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.stealth-channel-icon.google-icon {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* Info Column */
.stealth-channel-info {
  flex: 1;
  min-width: 0;
  user-select: none;
}

.channel-label-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
}

.channel-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.channel-tag {
  font-size: 0.60rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.channel-tag.tag-direct {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.channel-tag.tag-instant {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.channel-tag.tag-verified {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Masked vs Revealed Values */
.channel-value-wrapper {
  min-height: 20px;
  display: flex;
  align-items: center;
}

.channel-masked-val {
  font-size: 0.80rem;
  letter-spacing: 2px;
  color: #94a3b8;
  font-weight: 600;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.channel-revealed-val {
  font-size: 0.88rem;
  font-family: 'Consolas', 'Courier New', monospace;
  color: #005d52;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  display: none;
  cursor: pointer;
  user-select: all;
  transition: all 0.15s ease;
}

.channel-revealed-val:hover {
  text-decoration: underline;
  color: #0f766e;
}

/* Masked vs Revealed Visibility Logic */
.stealth-channel-card.is-masked .channel-revealed-val,
.stealth-channel-card.is-masked .channel-revealed-actions {
  display: none !important;
}

.stealth-channel-card.is-masked .channel-masked-val,
.stealth-channel-card.is-masked .btn-channel-reveal {
  display: inline-flex !important;
}

.stealth-channel-card.is-revealed .channel-masked-val,
.stealth-channel-card.is-revealed .btn-channel-reveal {
  display: none !important;
}

.stealth-channel-card.is-revealed .channel-revealed-val {
  display: block !important;
  animation: revealFadeIn 0.18s ease-out;
}

.stealth-channel-card.is-revealed .channel-revealed-actions {
  display: flex !important;
  animation: revealFadeIn 0.18s ease-out;
}

@keyframes revealFadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Action Buttons */
.stealth-channel-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-channel-reveal {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 0.70rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-channel-reveal:hover {
  background: #005d52;
  color: #ffffff;
  border-color: #005d52;
}

.channel-revealed-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-channel-action {
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.70rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
}

.btn-channel-action.btn-call {
  background: #005d52;
  border: 1px solid #005d52;
  color: #ffffff;
}

.btn-channel-action.btn-call:hover {
  background: #004d40;
  border-color: #004d40;
}

.btn-channel-action.btn-whatsapp {
  background: #16a34a;
  border: 1px solid #16a34a;
  color: #ffffff;
}

.btn-channel-action.btn-whatsapp:hover {
  background: #15803d;
  border-color: #15803d;
}

.btn-channel-action.btn-telegram {
  background: #0284c7;
  border: 1px solid #0284c7;
  color: #ffffff;
}

.btn-channel-action.btn-telegram:hover {
  background: #0369a1;
  border-color: #0369a1;
}

.btn-channel-action.btn-google {
  background: #dc2626;
  border: 1px solid #dc2626;
  color: #ffffff;
}

.btn-channel-action.btn-google:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-channel-action.btn-copy {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.btn-channel-action.btn-copy:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-channel-action.btn-copy.copied {
  background: #005d52 !important;
  color: #ffffff !important;
  border-color: #005d52 !important;
}

.btn-channel-action.btn-hide-single {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  padding: 4px 6px;
}

.btn-channel-action.btn-hide-single:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-toggle-all-contacts {
  background: #e6f4f1;
  border: 1px solid #b2dfdb;
  color: #005d52;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-toggle-all-contacts:hover {
  background: #005d52;
  color: #ffffff;
}

.stealth-footer-note {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 0.70rem;
  color: #64748b;
  padding-top: 2px;
  text-align: center;
}

/* ------------------- INTERACTIVE MEASUREMENT TOOLBAR & POPUP ------------------- */
.tool-instruction-banner {
  position: absolute;
  top: calc(var(--header-height, 54px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 0 12px rgba(14, 165, 233, 0.2);
  color: #f8fafc;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 1000;
  display: flex;
  align-items: center;
  max-width: 95vw;
  width: auto;
  animation: bannerSlideDown 0.2s ease-out;
}

@keyframes bannerSlideDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Ultra-Compact Measurement Floating Toolbar */
.measure-compact-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.measure-compact-tag {
  background: rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.measure-compact-select, .measure-card-select {
  background: #1e293b;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.measure-compact-select:hover, .measure-card-select:hover {
  border-color: #38bdf8;
  background: #24344d;
}

.measure-compact-val-box {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
}

.measure-compact-val {
  font-size: 0.82rem;
  color: #4ade80;
  font-weight: 800;
  font-family: 'Consolas', monospace;
  letter-spacing: 0.2px;
}

.btn-measure-mini {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  transition: all 0.15s ease;
}

.btn-measure-mini:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: scale(1.05);
}

.btn-measure-mini.btn-measure-info.active {
  background: rgba(14, 165, 233, 0.3);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.btn-measure-mini.btn-measure-close {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-measure-mini.btn-measure-close:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ------------------- FIXED MEASUREMENT INFORMATION CARD ------------------- */
/* Fixed in one designated place so map drawing / clicking is NEVER obstructed */
.measure-fixed-card {
  position: absolute;
  bottom: 76px;
  right: 16px;
  width: 295px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(14, 165, 233, 0.2);
  z-index: 950;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  color: #f8fafc;
  animation: fadeInCard 0.2s ease-out;
}

@keyframes fadeInCard {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.measure-fixed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: rgba(30, 41, 59, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: move;
  user-select: none;
}

.measure-fixed-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.measure-card-drag-handle {
  color: #64748b;
  font-size: 0.72rem;
  cursor: grab;
  padding: 2px;
}

.measure-card-drag-handle:active {
  cursor: grabbing;
}

.measure-card-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.measure-fixed-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.measure-card-btn-action {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.measure-card-btn-action:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.measure-fixed-body {
  padding: 10px 12px;
}

.measure-card-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.measure-card-main-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #4ade80;
  font-family: 'Consolas', monospace;
  text-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
  word-break: break-word;
}

.measure-card-hint-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.measure-card-conversions {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
  max-height: 180px;
  overflow-y: auto;
}

.measure-popup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #94a3b8;
}

.measure-popup-row strong {
  color: #e2e8f0;
  font-family: 'Consolas', monospace;
}

.measure-card-footer-hint {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 6px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Fallback identify popup styling */
.measure-tooltip .leaflet-popup-content-wrapper {
  background: #0f172a !important;
  color: #f8fafc !important;
  border: 1.5px solid rgba(56, 189, 248, 0.4) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
  padding: 0 !important;
  overflow: hidden;
}

.measure-tooltip .leaflet-popup-tip {
  background: #0f172a !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
}

@media (max-width: 768px) {
  .tool-instruction-banner {
    max-width: 96vw;
    padding: 3px 6px;
    top: calc(var(--header-height, 50px) + 6px);
  }
  .measure-compact-tag-text {
    display: none;
  }
  .measure-fixed-card {
    width: calc(100vw - 32px);
    max-width: 310px;
    right: 16px;
    bottom: 60px;
  }
}

/* ------------------- FLOOD SHELTER PHOTO COMPARISON POPUP ------------------- */
.shelter-popup-container {
  width: 440px;
  max-width: 92vw;
}

.shelter-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 12px 6px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.shelter-photo-card {
  display: flex;
  flex-direction: column;
}

.shelter-photo-card-label {
  font-size: 0.70rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.label-before {
  color: #0369a1;
}

.label-after {
  color: #0d9488;
}

.shelter-photo-frame {
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #0f172a;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shelter-photo-frame.before-frame {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.shelter-photo-frame.before-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.shelter-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-expand-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.70);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.shelter-photo-frame.after-blank-frame {
  background: #f1f5f9;
  border: 2px dashed #94a3b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
}

.blank-frame-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.blank-frame-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
}

.blank-frame-sub {
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.2;
}

.shelter-photo-frame.photo-missing-frame {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #94a3b8;
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ------------------- COMMUNITY BOUNDARY STATISTICAL SUMMARY ------------------- */
.comm-cat-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03), 0 1px 2px rgba(0,0,0,0.02);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.comm-cat-header {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #f1f5f9;
}

.comm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.comm-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: all 0.15s ease;
}

.comm-stat-card:hover {
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.comm-stat-card.card-accent-primary { border-left: 4px solid #005d52; }
.comm-stat-card.card-accent-info { border-left: 4px solid #0284c7; }
.comm-stat-card.card-accent-warning { border-left: 4px solid #f59e0b; }
.comm-stat-card.card-accent-danger { border-left: 4px solid #dc2626; }
.comm-stat-card.card-accent-purple { border-left: 4px solid #7c3aed; }
.comm-stat-card.card-accent-green { border-left: 4px solid #16a34a; }

.comm-stat-lbl {
  font-size: 0.67rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.comm-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  letter-spacing: -0.2px;
}

.comm-stat-sub {
  font-size: 0.69rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 3px;
  line-height: 1.35;
}

.comm-sub-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
}

.comm-sub-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.comm-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.comm-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comm-chip strong {
  color: #005d52;
}

.comm-progress-bar-wrapper {
  background: #e2e8f0;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  display: flex;
  margin: 6px 0 4px 0;
}

.comm-progress-segment {
  height: 100%;
}

.comm-desc-box {
  background: #f8fafc;
  border-left: 3px solid #005d52;
  border-radius: 0 6px 6px 0;
  padding: 8px 12px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #334155;
  margin-top: 6px;
}




/* ==================== POWER BI STYLE ANALYTICS UPGRADE ==================== */

/* Smooth GPU-accelerated animations */
.analytics-modal-body {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

/* Power BI KPI Card Style */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border-left: 4px solid #005d52;
  background: linear-gradient(135deg, #ffffff 0%, #f8fffe 100%);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #005d52, #00897b, #26a69a);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 93, 82, 0.15);
  border-color: #00897b;
}

.stat-val {
  background: linear-gradient(135deg, #004d40, #00897b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* Power BI Section Cards with glassmorphism */
.analytics-section-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 93, 82, 0.12);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.analytics-section-card:hover {
  box-shadow: 0 4px 20px rgba(0, 93, 82, 0.12);
  border-color: rgba(0, 93, 82, 0.25);
}

.analytics-section-header {
  background: linear-gradient(135deg, #005d52 0%, #00796b 100%);
  color: #ffffff;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: 0.3px;
}

.analytics-section-header .section-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.analytics-section-body {
  padding: 16px;
  background: linear-gradient(180deg, #fafffe 0%, #ffffff 100%);
}

/* Power BI Community Stat Cards */
.comm-cat-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  border-left: 4px solid #005d52;
}

.comm-cat-section:hover {
  box-shadow: 0 4px 16px rgba(0, 93, 82, 0.1);
}

.comm-cat-header {
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #f8fffe 0%, #f1f5f9 100%);
  letter-spacing: 0.2px;
}

.comm-stat-grid {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.comm-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.comm-stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #005d52, transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.comm-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: #005d52;
}

.comm-stat-card:hover::after {
  opacity: 1;
}

.card-accent-primary { border-left: 3.5px solid #005d52; }
.card-accent-info { border-left: 3.5px solid #0284c7; }
.card-accent-green { border-left: 3.5px solid #16a34a; }
.card-accent-purple { border-left: 3.5px solid #7c3aed; }
.card-accent-warning { border-left: 3.5px solid #d97706; }
.card-accent-danger { border-left: 3.5px solid #dc2626; }

.comm-stat-lbl {
  font-size: 0.65rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.comm-stat-val {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.comm-stat-sub {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 2px;
}

.comm-sub-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 14px 10px;
}

.comm-sub-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comm-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comm-chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.comm-chip:hover {
  transform: scale(1.03);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Power BI Smooth Number Counter Animation */
@keyframes pbi-countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-val, .comm-stat-val, .demo-stat-val, .wb-summary-val {
  animation: pbi-countUp 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

/* Power BI Smooth Fade-in for sections */
@keyframes pbi-fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.comm-cat-section,
.analytics-section-card {
  animation: pbi-fadeInUp 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.comm-cat-section:nth-child(1) { animation-delay: 0.05s; }
.comm-cat-section:nth-child(2) { animation-delay: 0.1s; }
.comm-cat-section:nth-child(3) { animation-delay: 0.15s; }
.comm-cat-section:nth-child(4) { animation-delay: 0.2s; }
.comm-cat-section:nth-child(5) { animation-delay: 0.25s; }
.comm-cat-section:nth-child(6) { animation-delay: 0.3s; }
.comm-cat-section:nth-child(7) { animation-delay: 0.35s; }

/* Power BI Title Bar Gradient */
#analytics-community-title {
  font-size: 0.95rem;
  font-weight: 800;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 50%, #faf5ff 100%);
  border: 1px solid #e2e8f0;
  border-left: 5px solid #005d52;
  border-radius: 10px;
  margin-bottom: 14px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
  box-shadow: 0 2px 8px rgba(0, 93, 82, 0.06);
}

/* Power BI Analytics Filter Bar Enhancement */
.analytics-filter-bar {
  background: linear-gradient(135deg, #f0fdf4 0%, #f1f5f9 100%);
  border: 1.5px solid #005d52;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 93, 82, 0.08);
  padding: 12px 16px;
}

.analytics-filter-grid .filter-select {
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
  background: #ffffff;
}

.analytics-filter-grid .filter-select:focus {
  border-color: #005d52;
  box-shadow: 0 0 0 3px rgba(0, 93, 82, 0.12);
  outline: none;
}

/* Power BI Facilities Grid Enhancement */
#analytics-facilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  padding: 12px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #005d52 #f1f5f9;
}

#analytics-facilities-grid::-webkit-scrollbar {
  width: 5px;
}

#analytics-facilities-grid::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#analytics-facilities-grid::-webkit-scrollbar-thumb {
  background: #005d52;
  border-radius: 3px;
}

/* Power BI Chart Container Enhancement */
.chart-box-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
}

.chart-box-card:hover {
  box-shadow: 0 4px 16px rgba(0, 93, 82, 0.1);
}

/* Power BI Smooth Modal Transitions */
#analytics-modal .gis-modal-dialog {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Smooth scrollbar for analytics modal body */
#analytics-modal .modal-body {
  scrollbar-width: thin;
  scrollbar-color: #005d52 #f1f5f9;
}

#analytics-modal .modal-body::-webkit-scrollbar {
  width: 6px;
}

#analytics-modal .modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#analytics-modal .modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #005d52, #00897b);
  border-radius: 3px;
}

/* Power BI Header Enhancement */
.analytics-modal-header {
  background: linear-gradient(135deg, #004d40 0%, #00695c 50%, #00796b 100%);
  padding: 14px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.analytics-header-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* Power BI Button Styles */
.btn-ai-report {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3) !important;
}

.btn-ai-report:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

.btn-analytics-action {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-analytics-action:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* Power BI Evacuation Routes Table Enhancement */
#analytics-evac-routes-tbody tr {
  transition: all 0.15s ease;
}

#analytics-evac-routes-tbody tr:hover {
  background: #f0fdf4 !important;
  transform: scale(1.002);
}

/* Power BI Loading Shimmer Effect */
@keyframes pbi-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.pbi-loading-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: pbi-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

/* Responsive Power BI adjustments */
@media (max-width: 768px) {
  .comm-stat-grid {
    gap: 6px !important;
    padding: 8px 10px !important;
  }
  
  .comm-stat-val {
    font-size: 1.05rem !important;
  }
  
  .comm-cat-header {
    font-size: 0.76rem !important;
    padding: 8px 10px !important;
  }
  
  .comm-sub-box {
    margin: 0 8px 8px !important;
    padding: 8px 10px !important;
  }

  #analytics-community-title {
    font-size: 0.82rem !important;
    padding: 8px 12px !important;
  }
}
