/**
 * =====================================================
 * RAUM+ PLATFORM - CENTRALIZED STYLESHEET
 * =====================================================
 * 
 * This file contains all CSS styles used across the Raum+ platform.
 * Organized by component and functionality for easy maintenance.
 * 
 * Sections:
 * 1. CSS Reset & Global Styles
 * 2. Typography
 * 3. Layout Components
 * 4. Navigation & Header
 * 5. Sidebar & Menu
 * 6. Map & Geographic Components  
 * 7. Forms & Input Elements
 * 8. Modals & Overlays
 * 9. Tables & Data Display
 * 10. Buttons & Interactive Elements
 * 11. Admin Interface
 * 12. Print Styles
 * 13. Utility Classes
 * 14. Responsive & Media Queries
 * 
 * =====================================================
 */

/* CSS Reset to ensure consistent styling across browsers */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =====================================================
   Z-INDEX MANAGEMENT SYSTEM
   =====================================================
   Centralized z-index values to prevent conflicts
   Higher numbers appear on top of lower numbers
*/
:root {
  /* Z-index values are now managed by constants.js - these are fallbacks only */
  --z-index-base: 1;
  --z-index-overlay: 100;
  --z-index-dropdown: 200;
  --z-index-modal: 300;
  --z-index-tooltip: 25000;
  --z-index-popup: 26000;
  --z-index-map-base: 1000;
  --z-index-map-mask: 1100;
  --z-index-map-highlight: 1200;
  --z-index-map-toolbar: 25000;
  --z-index-map-tools: 10000;
  /* Layer z-index values come from constants.js LAYER_DEFINITIONS, UI z-index values are defined here */
}

/* =====================================================
   DRAWING MODE VISUAL DIMMING
   =====================================================
   Dims and disables all background layers during drawing
   while keeping drawn features fully visible
*/
.map-drawing-mode .leaflet-tile-pane,
.map-drawing-mode .leaflet-shadow-pane,
.map-drawing-mode [class*="Pane"]:not(.leaflet-drawing-pane):not(.leaflet-overlay-pane):not(.leaflet-marker-pane):not(.leaflet-tooltip-pane):not(.leaflet-popup-pane) {
  opacity: 0.8 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease;
}

/* Ensure drawing pane and Leaflet.Draw UI stays fully visible and interactive */
.map-drawing-mode .leaflet-drawing-pane,
.map-drawing-mode .leaflet-overlay-pane,
.map-drawing-mode .leaflet-marker-pane,
.map-drawing-mode .leaflet-tooltip-pane,
.map-drawing-mode .leaflet-popup-pane {
  opacity: 1 !important;
  filter: none !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}

/* Ensure draw toolbar remains fully visible and interactive */
.map-drawing-mode .leaflet-draw,
.map-drawing-mode .leaflet-draw-toolbar,
.map-drawing-mode .leaflet-draw-section {
  opacity: 1 !important;
  filter: none !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}

/* Green circle vertices for drawing mode */
/* The icon container is now 30x30px (from iconSize), but we keep the visual circle smaller */
.green-vertex-icon {
  background: rgba(140, 255, 0, 0.562) !important;
  border: 3px solid #02ae02 !important;
  border-radius: 50% !important;
  width: 14px !important;  /* Visual size stays the same */
  height: 14px !important; /* Visual size stays the same */
  margin-left: -5px !important;  /* Center the 14px circle in the 30px container */
  margin-top: -5px !important;   /* Center the 14px circle in the 30px container */
  box-shadow: 0 0 4px rgba(0, 255, 0, 0.6) !important;
  cursor: pointer !important;
  /* The container itself (30x30px) is now the clickable area */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Touch-friendly larger vertices */
/* The icon container is now 40x40px (from iconSize), but we keep the visual circle larger for touch */
.green-vertex-icon.leaflet-touch-icon {
  width: 20px !important;  /* Visual size for touch */
  height: 20px !important;  /* Visual size for touch */
  margin-left: -20px !important;  /* Center the 20px circle in the 40px container */
  margin-top: -20px !important;   /* Center the 20px circle in the 40px container */
}

/* Force full width layout */
html, body, #root, .main-container, .sidebar, .map-container {
  max-width: none !important;
  width: auto !important;
}

/* Layer panel should maintain consistent narrow width */
.layer-panel {
  max-width: none !important;
  width: 200px !important;
  min-width: 200px !important;
}

html, body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto !important;
  max-width: none;
}

html.platform-root,
body.platform-root {
  zoom: 1 !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Ensure the page starts from the very top */
body {
  position: relative;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}
 /**=====================================================
 * Admin Activation - STYLESHEET
 * ===================================================== */
 body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
}
.main-container {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
}
.left-panel {
  flex: 2;
  background: white;
  border-radius: 0;
  box-shadow: none;
  padding: 30px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: calc(100vh - 120px) !important; /* Account for tab and padding */
  box-sizing: border-box !important;
  scrollbar-width: thin !important; /* Firefox thin scrollbars */
  -ms-overflow-style: auto !important; /* IE/Edge scrollbars */
}
.right-panel {
  flex: 1;
  background: white;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: fit-content;
}
.header {
  display: none !important; /* Hide the blue Add User header bar */
}

/* Also hide any header elements within the left-panel specifically */
.left-panel .header {
  display: none !important;
}

/* Hide the red "Add > User" header bar that overlaps the Save/Cancel buttons */
.right-header {
  display: none !important;
}

/* Enable scrollbars for form areas and make them visible but thin */
.left-panel, .right-panel, .sidebar, .map-container, #mapContainer, #mapView, #factSheetView, .content-area, .panel, .container, .main-container, .tab-content, #addUserContent, .user-management-container, .user-mgmt-table-container, .form-section, .form-group, .action-buttons {
  scrollbar-width: thin !important; /* Firefox - use thin scrollbars */
  -ms-overflow-style: auto !important; /* Internet Explorer 10+ - show scrollbars */
  overflow-y: auto !important; /* Allow vertical scrolling */
  overflow-x: hidden !important; /* Hide horizontal scrollbar */
}

/* Style scrollbars for WebKit browsers (Chrome, Safari, Edge) - make them thin and styled */
.left-panel::-webkit-scrollbar, 
.right-panel::-webkit-scrollbar, 
.sidebar::-webkit-scrollbar, 
.map-container::-webkit-scrollbar, 
#mapContainer::-webkit-scrollbar, 
#mapView::-webkit-scrollbar, 
#factSheetView::-webkit-scrollbar, 
.content-area::-webkit-scrollbar, 
.panel::-webkit-scrollbar, 
.container::-webkit-scrollbar, 
.main-container::-webkit-scrollbar,
.tab-content::-webkit-scrollbar,
#addUserContent::-webkit-scrollbar,
.user-management-container::-webkit-scrollbar,
.user-mgmt-table-container::-webkit-scrollbar,
.form-section::-webkit-scrollbar,
.form-group::-webkit-scrollbar,
.action-buttons::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

.left-panel::-webkit-scrollbar-track, 
.right-panel::-webkit-scrollbar-track, 
.sidebar::-webkit-scrollbar-track, 
.map-container::-webkit-scrollbar-track, 
#mapContainer::-webkit-scrollbar-track, 
#mapView::-webkit-scrollbar-track, 
#factSheetView::-webkit-scrollbar-track, 
.content-area::-webkit-scrollbar-track, 
.panel::-webkit-scrollbar-track, 
.container::-webkit-scrollbar-track, 
.main-container::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track,
#addUserContent::-webkit-scrollbar-track,
.user-management-container::-webkit-scrollbar-track,
.user-mgmt-table-container::-webkit-scrollbar-track,
.form-section::-webkit-scrollbar-track,
.form-group::-webkit-scrollbar-track,
.action-buttons::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
  border-radius: 4px !important;
}

.left-panel::-webkit-scrollbar-thumb, 
.right-panel::-webkit-scrollbar-thumb, 
.sidebar::-webkit-scrollbar-thumb, 
.map-container::-webkit-scrollbar-thumb, 
#mapContainer::-webkit-scrollbar-thumb, 
#mapView::-webkit-scrollbar-thumb, 
#factSheetView::-webkit-scrollbar-thumb, 
.content-area::-webkit-scrollbar-thumb, 
.panel::-webkit-scrollbar-thumb, 
.container::-webkit-scrollbar-thumb, 
.main-container::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb,
#addUserContent::-webkit-scrollbar-thumb,
.user-management-container::-webkit-scrollbar-thumb,
.user-mgmt-table-container::-webkit-scrollbar-thumb,
.form-section::-webkit-scrollbar-thumb,
.form-group::-webkit-scrollbar-thumb,
.action-buttons::-webkit-scrollbar-thumb {
  background: #c1c1c1 !important;
  border-radius: 4px !important;
}

.left-panel::-webkit-scrollbar-thumb:hover, 
.right-panel::-webkit-scrollbar-thumb:hover, 
.sidebar::-webkit-scrollbar-thumb:hover, 
.map-container::-webkit-scrollbar-thumb:hover, 
#mapContainer::-webkit-scrollbar-thumb:hover, 
#mapView::-webkit-scrollbar-thumb:hover, 
#factSheetView::-webkit-scrollbar-thumb:hover, 
.content-area::-webkit-scrollbar-thumb:hover, 
.panel::-webkit-scrollbar-thumb:hover, 
.container::-webkit-scrollbar-thumb:hover, 
.main-container::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover,
#addUserContent::-webkit-scrollbar-thumb:hover,
.user-management-container::-webkit-scrollbar-thumb:hover,
.user-mgmt-table-container::-webkit-scrollbar-thumb:hover,
.form-section::-webkit-scrollbar-thumb:hover,
.form-group::-webkit-scrollbar-thumb:hover,
.action-buttons::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8 !important;
}

/* REMOVED: Conflicting rule that was hiding scrollbars for #addUserContent
   The form needs visible scrollbars for proper navigation */

/* REMOVED: Conflicting scrollbar hiding rules for form areas
   Form areas need visible scrollbars for navigation */

/* Enhanced scrolling for Add User form */
#addUserContent .left-panel {
  scroll-behavior: smooth !important;
  padding-bottom: 60px !important; /* Extra space at bottom for easier scrolling */
  position: relative !important;
}

/* Specific improvements for the admin form container */
.main-container {
  display: flex !important;
  gap: 0 !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Force full repaint when switching to Map view – fixes white/unpainted areas across sidebar, map and layer panel (browser compositor bug) */
.main-container.platform-repaint-fix,
.sidebar.platform-repaint-fix,
.map-container.platform-repaint-fix,
.layer-panel.platform-repaint-fix,
#mapContainer.platform-repaint-fix {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Ensure form sections are properly spaced */
.form-section {
  margin-bottom: 25px !important;
  padding: 15px 0 !important;
}

/* Improve form group spacing */
.form-group {
  margin-bottom: 20px !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 15px !important;
}

/* Ensure form sections have proper spacing for scrolling */
.form-section:last-child {
  margin-bottom: 40px !important; /* Extra space at the end of the form */
}

/* Make sure action buttons are always visible and accessible */
.action-buttons {
  position: sticky !important;
  bottom: 0 !important;
  background: white !important;
  padding: 20px 0 !important;
  border-top: 1px solid #eee !important;
  margin-top: 20px !important;
  z-index: var(--z-index-overlay) !important;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
}

/* Ensure the last form section has enough space before buttons */
.form-section:last-of-type {
  margin-bottom: 50px !important;
  padding-bottom: 30px !important;
}

/* Adjust spacing for first sidebar section without title */
.sidebar .sidebar-section:first-child {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.sidebar .sidebar-section:first-child .sidebar-menu {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Enhanced Save Record and Cancel buttons - default (e.g. other pages) */
.btn-primary {
  background-color: #28a745 !important; /* Green color */
  color: white !important;
  padding: 15px 25px !important;
  font-size: 16px !important;
  font-weight: bold !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  min-width: 150px !important;
  height: 50px !important;
  transition: background-color 0.3s ease !important;
}

.btn-primary:hover {
  background-color: #218838 !important; /* Darker green on hover */
}

.btn-secondary {
  background-color: #dc3545 !important; /* Red color */
  color: white !important;
  padding: 15px 25px !important;
  font-size: 16px !important;
  font-weight: bold !important;
  border: none !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  min-width: 150px !important;
  height: 50px !important;
  transition: background-color 0.3s ease !important;
}

.btn-secondary:hover {
  background-color: #c82333 !important; /* Darker red on hover */
}

/* Add User tab: compact Save/Cancel to match other toolbar buttons and fix layout so only form scrolls */
#addUserContent .main-container {
  overflow: hidden !important;
  display: flex !important;
  flex: 1 !important;
  min-height: 0 !important;
  max-width: 720px !important;
  background: transparent !important;
}
#addUserContent .left-panel {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  flex: 2 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding-top: 0 !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  padding-bottom: 30px !important;
  background: transparent !important;
  box-shadow: none !important;
}
#addUserContent .form-group input,
#addUserContent .form-group select,
#addUserContent .form-group textarea,
#addUserContent .form-group .multi-select,
#addUserContent .form-group .timestamp,
#addUserContent .form-group > div {
  max-width: 420px !important;
  box-sizing: border-box !important;
}
#addUserContent .right-panel {
  overflow: visible !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  padding: 12px 16px !important;
  background: transparent !important;
  box-shadow: none !important;
}
#addUserContent .action-buttons {
  display: flex !important;
  gap: 10px !important;
  align-items: center !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  position: relative !important;
  flex-shrink: 0 !important;
  overflow: visible !important;
  background: transparent !important;
}
#addUserContent .btn-primary,
#addUserContent .btn-secondary {
  min-height: 36px !important;
  height: auto !important;
  padding: 8px 16px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  min-width: 0 !important;
  width: fit-content !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

/* Action buttons container styling */
.action-buttons {
  display: flex !important;
  gap: 15px !important;
  justify-content: flex-start !important;
  align-items: center !important;
  margin-top: 20px !important;
  margin-bottom: 20px !important;
}

/* Hide the Add User header specifically */
#addUserContent .header {
  display: none !important;
}

#addUserContent .form-section:first-child {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Hide the header within the admin panel */
.admin-activation .header,
.admin-activation .left-panel .header {
  display: none !important;
}

/* Force hide any header elements in the admin area */
body .header {
  display: none !important;
}

/* Fix scrolling issues for the admin panel */
.left-panel {
  overflow-y: auto !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  display: block !important;
  visibility: visible !important;
}

.main-container {
  overflow-y: auto !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
}

#addUserContent {
  overflow: hidden !important;
  height: calc(100vh - 60px) !important; /* Account for tab navigation height */
  min-height: calc(100vh - 60px) !important;
  max-height: calc(100vh - 60px) !important;
  padding: 0 20px 20px 20px !important; /* No top padding: form starts just after green area */
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  background: transparent !important;
}

/* Ensure WebKit browsers show scrollbars for Add User form */
#addUserContent::-webkit-scrollbar {
  width: 12px !important; /* Slightly wider for better visibility */
  display: block !important;
}

#addUserContent::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
  border-radius: 6px !important;
}

#addUserContent::-webkit-scrollbar-thumb {
  background: #888 !important;
  border-radius: 6px !important;
}

#addUserContent::-webkit-scrollbar-thumb:hover {
  background: #555 !important;
}

/* Also ensure left-panel within add user content has visible scrollbars */
#addUserContent .left-panel::-webkit-scrollbar {
  width: 10px !important;
  display: block !important;
}

#addUserContent .left-panel::-webkit-scrollbar-track {
  background: #f8f9fa !important;
  border-radius: 5px !important;
}

#addUserContent .left-panel::-webkit-scrollbar-thumb {
  background: #6c757d !important;
  border-radius: 5px !important;
}

#addUserContent .left-panel::-webkit-scrollbar-thumb:hover {
  background: #495057 !important;
}
.header h1 {
  display: none !important; /* Hide the Add User title */
}
.header p {
  margin: 10px 0 0 0;
  opacity: 0.9;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.stat-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
}
.stat-number {
  font-size: 32px;
  font-weight: bold;
  color: #003651;
}
.stat-label {
  color: #6c757d;
  margin-top: 5px;
}
.form-section {
  margin-bottom: 30px;
  position: relative;
  z-index: var(--z-index-base);
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.form-section h2 {
  color: #003651;
  margin-bottom: 20px;
  font-size: 20px;
}
.form-group {
  margin-bottom: 25px;
  display: flex !important;
  align-items: center;
  visibility: visible !important;
  opacity: 1 !important;
}
.form-group label {
  flex: 0 0 200px;
  font-weight: bold;
  color: #333;
  margin-right: 15px;
}
.form-group input,
.form-group select,
.form-group textarea {
  flex: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}
.form-group textarea {
  resize: vertical;
  min-height: 100px;
}
.help-icon {
  color: #007bff;
  margin-left: 5px;
  cursor: help;
}

/* Add User form: help icon visible and right after label text (e.g. "User Status ?") */
#addUserContent .form-group label .help-icon {
  display: inline;
  margin-left: 4px;
  color: #0056b3 !important;
  font-size: 14px !important;
  font-weight: bold !important;
  cursor: help;
  text-decoration: none;
}
.multi-select {
  height: 120px;
  overflow-y: auto;
}

/* Tab Navigation Styles */
.tab-navigation {
  display: flex;
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 0;
}

.tab-button {
  padding: 15px 25px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  color: #6c757d;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.tab-button:hover {
  background: #e9ecef;
  color: #495057;
}

.tab-button.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure only one admin tab is visible at a time */
#addUserContent:not(.active),
#userManagementContent:not(.active) {
  display: none !important;
  visibility: hidden !important;
}

.admin-content {
  display: flex;
  height: calc(100vh - 60px); /* Adjust for tab height */
}

/* User Management Styles */
.user-management-container {
  padding: 30px;
  background: #f8f9fa;
  min-height: 100vh;
}

.user-mgmt-header {
  background: #ffffff;
  padding: 20px 30px;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-mgmt-header h1 {
  font-size: 24px;
  color: #2c3e50;
  margin: 0;
}

.user-mgmt-header .subtitle {
  font-size: 14px;
  color: #6c757d;
  margin-top: 5px;
}

.user-mgmt-header .btn-add-user {
  flex-shrink: 0;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  border: none;
  background: #28a745;
  color: white;
  cursor: pointer;
  white-space: nowrap;
}
.user-mgmt-header .btn-add-user:hover {
  background: #218838;
}

.user-mgmt-toolbar {
  background: #ffffff;
  padding: 15px 30px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-section {
  display: flex;
  align-items: center;
  gap: 15px;
}

.search-tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid #bbdefb;
}

.filter-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 200px;
}

.export-section {
  display: flex;
  gap: 10px;
}

.btn-export {
  background: #007bff;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-export:hover {
  background: #0056b3;
}

.btn-print {
  background: #28a745;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-print:hover {
  background: #1e7e34;
}

.user-mgmt-table-container {
  background: #ffffff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.user-mgmt-table {
  width: 100%;
  border-collapse: collapse;
}

.user-mgmt-table th {
  background: #f8f9fa;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #e9ecef;
  font-size: 14px;
}

.user-mgmt-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e9ecef;
  font-size: 14px;
  vertical-align: middle;
}

.user-mgmt-table tbody tr:hover {
  background: #f8f9fa;
}

/* Dynamic form: field description on hover (keeps label column compact) */
.field-description-hint {
  display: inline-block;
  margin-left: 4px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #007acc;
  background: #e8f4fc;
  border-radius: 50%;
  cursor: help;
  vertical-align: middle;
  flex-shrink: 0;
}

.field-description-hint:focus {
  outline: 2px solid #007acc;
  outline-offset: 1px;
}

/* Dynamic feature form (#dynamicForm): left-aligned labels, compact control width */
#dynamicForm,
#dynamicFormModal #dynamicForm {
  max-width: 100%;
}

#dynamicForm div[style*="margin-bottom: 15px"][style*="display: flex"] {
  align-items: flex-start !important;
  gap: 12px !important;
  max-width: 100%;
  margin-left: 0 !important;
}

#dynamicForm div[style*="margin-bottom: 15px"][style*="display: flex"] > div:first-child {
  flex: 0 0 200px !important;
  min-width: 200px !important;
  max-width: 220px !important;
}

#dynamicForm div[style*="margin-bottom: 15px"][style*="display: flex"] > input[type="text"],
#dynamicForm div[style*="margin-bottom: 15px"][style*="display: flex"] > input[type="number"],
#dynamicForm div[style*="margin-bottom: 15px"][style*="display: flex"] > input[type="email"],
#dynamicForm div[style*="margin-bottom: 15px"][style*="display: flex"] > select,
#dynamicForm div[style*="margin-bottom: 15px"][style*="display: flex"] > textarea {
  flex: 0 1 400px !important;
  max-width: 400px !important;
  width: 100% !important;
  box-sizing: border-box;
}

#dynamicForm div[style*="margin-bottom: 15px"][style*="display: flex"] > div:last-child:not(:first-child) {
  flex: 0 1 480px !important;
  max-width: 480px !important;
  width: 100%;
  box-sizing: border-box;
}

#dynamicFormModal .form-group-section {
  max-width: 100%;
}

/* Feature list (dynamic-forms): rows edited during current browser session */
.feature-list-tabulator-shell {
  width: 100%;
}

.feature-list-tabulator-pagination-top {
  display: none;
  flex-shrink: 0;
  padding: 8px 12px;
  margin-bottom: 4px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px 4px 0 0;
  font-size: 14px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Single row: counter left, page size + buttons right (same as bottom footer) */
.feature-list-tabulator-pagination-top .feature-list-pagination-mirror-inner,
.feature-list-tabulator-pagination-top .tabulator-footer-contents,
.feature-list-tabulator-host .tabulator-footer,
.feature-list-tabulator-host .tabulator-footer .tabulator-footer-contents {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  box-sizing: border-box;
}

.feature-list-tabulator-pagination-top .feature-list-pagination-mirror-inner {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.feature-list-tabulator-pagination-top .tabulator-page-counter,
.feature-list-tabulator-host .tabulator-footer .tabulator-page-counter {
  flex: 0 1 auto;
  white-space: nowrap;
  margin: 0;
}

.feature-list-tabulator-pagination-top .tabulator-paginator,
.feature-list-tabulator-host .tabulator-footer .tabulator-paginator {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 10px;
  white-space: nowrap;
  margin: 0;
}

.feature-list-tabulator-pagination-top .tabulator-paginator > *,
.feature-list-tabulator-host .tabulator-footer .tabulator-paginator > * {
  flex-shrink: 0;
}

.feature-list-tabulator-pagination-top .tabulator-paginator button,
.feature-list-tabulator-host .tabulator-footer .tabulator-paginator button,
.feature-list-tabulator-pagination-top .tabulator-page,
.feature-list-tabulator-host .tabulator-footer .tabulator-page {
  min-width: 2.1rem !important;
  padding: 0.3rem 0.65rem !important;
  margin: 0 4px !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

.feature-list-tabulator-host {
  min-height: 320px;
}

.feature-list-tabulator-host .tabulator-footer {
  flex-shrink: 0;
}

/* fitDataFill leftover filler column — hide if any appears */
.feature-list-tabulator-host .tabulator-col.tabulator-col-group:last-child:empty,
.feature-list-tabulator-host .tabulator-tableholder .tabulator-frozen-rows-placeholder {
  display: none;
}

.feature-list-tabulator-host .tabulator-row.raum-feature-row-session-edited {
  background-color: var(--raum-feature-edited-bg, #d4edff) !important;
}

.feature-list-tabulator-host .tabulator-row.raum-feature-row-multiselect-selected {
  background-color: #e7f1ff !important;
}

.feature-list-tabulator-host .tabulator-row.raum-feature-row-multiselect-primary {
  background-color: #fff3cd !important;
  box-shadow: inset 3px 0 0 #ffc107;
}

.feature-list-tabulator-host .tabulator-row.raum-feature-row-multiselect-selected .feature-select-checkbox {
  accent-color: #007bff;
}

/* MultiEdit select-all header (green cell above row checkboxes) */
.feature-list-tabulator-host .tabulator-col.feature-list-select-col-header,
.feature-list-tabulator-host .tabulator-headers .tabulator-col[tabulator-field="_select"] {
  background: #28a745 !important;
}

.feature-list-tabulator-host .tabulator-col.feature-list-select-col-header .tabulator-col-content,
.feature-list-tabulator-host .tabulator-headers .tabulator-col[tabulator-field="_select"] .tabulator-col-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-list-tabulator-host .feature-select-all-checkbox {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #ffffff;
}

/* Map-only child tab: hide left navigation, show map + layer panel + map toolbars */
body.map-only-mode .main-container > .sidebar {
  display: none !important;
}

body.map-only-mode .main-container > .map-container {
  flex: 1 1 auto;
  min-width: 0;
}

body.map-only-mode #mapView,
body.map-only-mode #map {
  width: 100%;
  height: 100%;
}

/* Quick Edit: row grows with expanded form (Save/Cancel must stay visible) */
.feature-list-tabulator-host .tabulator-cell.feature-list-quickedit-col {
  white-space: normal !important;
  overflow: visible !important;
  vertical-align: top;
}

.feature-list-tabulator-host .tabulator-row.tabulator-row-quickedit-expanded {
  height: auto !important;
}

.feature-list-tabulator-host .tabulator-row.tabulator-row-quickedit-expanded .tabulator-cell {
  height: auto !important;
  overflow: visible !important;
  white-space: normal !important;
  vertical-align: top !important;
  align-items: flex-start;
}

.feature-list-tabulator-host .quickedit-cell-root,
.feature-list-tabulator-host .quickedit-expanded-view {
  overflow: visible;
  max-height: none;
}

.feature-list-tabulator-host .tabulator-cell .tabulator-cell-content {
  white-space: normal !important;
  overflow: visible !important;
  height: auto !important;
}

.feature-list-tabulator-host .tabulator-row.tabulator-row-quickedit-expanded .tabulator-cell .tabulator-cell-content {
  height: auto !important;
  overflow: visible !important;
}

#featureListTable.raum-platform-table tbody tr.raum-feature-row-session-edited > td {
  background-color: var(--raum-feature-edited-bg, #d4edff);
}

#featureListTable.raum-platform-table tbody tr.raum-feature-row-session-edited > td:first-child {
  border-left: none;
}

.user-mgmt-action-buttons {
  display: flex;
  gap: 5px;
}

.user-mgmt-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
}

.user-mgmt-btn-view {
  background: #e3f2fd;
  color: #1976d2;
}

.user-mgmt-btn-view:hover {
  background: #bbdefb;
}

.user-mgmt-btn-edit {
  background: #fff3e0;
  color: #f57c00;
}

.user-mgmt-btn-edit:hover {
  background: #ffe0b2;
}

.user-mgmt-btn-delete {
  background: #ffebee;
  color: #d32f2f;
}

.user-mgmt-btn-delete:hover {
  background: #ffcdd2;
}

.user-mgmt-status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.user-mgmt-status-administrator {
  background: #e8f5e8;
  color: #2e7d32;
}

.user-mgmt-status-region {
  background: #e3f2fd;
  color: #1976d2;
}

.user-mgmt-status-gemeente {
  background: #fff3e0;
  color: #f57c00;
}

.user-mgmt-status-gemeente-limited {
  background: #fce4ec;
  color: #c2185b;
}

.user-mgmt-status-active {
  background: #e8f5e8;
  color: #2e7d32;
}

.user-mgmt-status-inactive {
  background: #ffebee;
  color: #d32f2f;
}

.user-mgmt-date-cell {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  color: #6c757d;
  white-space: nowrap;
}

.user-mgmt-actions-cell {
  text-align: center;
  padding: 8px 4px;
  width: 120px;
}

.user-mgmt-action-buttons {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.user-mgmt-action-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.user-mgmt-action-btn:hover {
  background-color: #f0f0f0;
}

.user-mgmt-action-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.user-mgmt-loading, .user-mgmt-error, .user-mgmt-empty-state {
  text-align: center;
  padding: 40px;
  color: #6c757d;
}

.user-mgmt-error {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 4px;
  margin: 20px 0;
}

/* Language checkbox styling */
.language-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  transition: all 0.2s ease;
  background: #fafafa;
}

.checkbox-item:hover {
  background: #f0f8ff;
  border-color: #007bff;
}

.checkbox-item input[type="checkbox"] {
  margin: 0;
  transform: scale(1.2);
}

.checkbox-item input[type="checkbox"]:checked + label {
  color: #007bff;
  font-weight: 500;
}

.checkbox-item:has(input[type="checkbox"]:checked) {
  background: #e3f2fd;
  border-color: #007bff;
}
.right-header {
  background: #dc3545;
  color: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
  font-size: 16px;
}
.action-buttons {
  display: flex;
  flex-direction: row;
  gap: 15px;
  padding: 20px;
  margin-top: 0;
  margin-bottom: 0;
}
.btn-primary {
  background: #007bff;
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background: #0056b3;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.btn-secondary {
  background: #6c757d;
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}
.btn-secondary:hover {
  background: #545b62;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.timestamp {
  background: #f8f9fa;
  padding: 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #6c757d;
  font-family: monospace;
}
.user-list {
  margin-top: 20px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #dee2e6;
}

.dashboard-header h2 {
  margin: 0;
  color: #333;
}

.dashboard-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.export-btn, .print-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.export-btn {
  background: #28a745;
  color: white;
}

.export-btn:hover {
  background: #218838;
}

.print-btn {
  background: #ffc107;
  color: #212529;
}

.print-btn:hover {
  background: #e0a800;
}
.user-item {
  background: #f8f9fa;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 4px;
  border-left: 4px solid #007bff;
  position: relative;
}
.user-info {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.user-details {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #dee2e6;
  font-size: 11px;
  color: #6c757d;
}
.status-badge {
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  text-align: center;
}
.status-active {
  background: #28a745;
  color: white;
}
.status-inactive {
  background: #6c757d;
  color: white;
}

.status-pending {
  background: #17a2b8;
  color: white;
}
.action-buttons-small {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}
.action-buttons-small button {
  padding: 4px 8px;
  font-size: 11px;
  margin: 0;
}
.btn-success {
  background: #28a745;
  color: white;
}
.btn-success:hover {
  background: #1e7e34;
}
.btn-warning {
  background: #ffc107;
  color: #212529;
}
.btn-warning:hover {
  background: #e0a800;
}
.btn-danger {
  background: #dc3545;
  color: white;
}
.btn-danger:hover {
  background: #c82333;
}
.btn-info {
  background: #17a2b8;
  color: white;
}
.btn-info:hover {
  background: #138496;
}
.result {
  margin-top: 20px;
  padding: 15px;
  border-radius: 4px;
  font-family: monospace;
  white-space: pre-wrap;
}
.success {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}
.error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}
.info {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
}
.loading {
  text-align: center;
  padding: 10px;
  color: #6c757d;
  font-size: 13px;
}
.refresh-btn {
  float: right;
  margin-top: -35px;
  padding: 4px 8px;
  font-size: 12px;
}

.user-list h2 {
  margin: 0 0 15px 0;
  font-size: 18px;
}
.status-details {
  margin-top: 3px;
  padding: 4px 8px;
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 4px;
  color: #0c5460;
  font-size: 10px;
  display: inline-block;
  max-width: 100%;
}
.status-info {
  line-height: 1.3;
  white-space: nowrap;
}
.btn-secondary {
  background: #6c757d;
  color: white;
}
.btn-secondary:hover {
  background: #545b62;
}

/* Fixed notification system */
.notification-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-index-modal);
  display: none;
}

.notification {
  padding: 15px 20px;
  margin: 0;
  border-radius: 0;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease-out;
  position: relative;
}

.notification.success {
  background-color: #28a745;
  color: white;
  border-bottom: 3px solid #1e7e34;
}

.notification.error {
  background-color: #dc3545;
  color: white;
  border-bottom: 3px solid #c82333;
}

.notification.info {
  background-color: #17a2b8;
  color: white;
  border-bottom: 3px solid #138496;
}

.notification.warning {
  background-color: #ffc107;
  color: #212529;
  border-bottom: 3px solid #e0a800;
}

.notification-close {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.8;
}

.notification-close:hover {
  opacity: 1;
}

@keyframes slideDown {
  from {
      transform: translateY(-100%);
      opacity: 0;
  }
  to {
      transform: translateY(0);
      opacity: 1;
  }
}

/* Adjust body padding when notification is shown */
body.notification-shown {
  padding-top: 60px;
}

/* Auto-dismissing toast notifications (replaces blocking alert) */
.app-notification-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-index-modal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: min(92vw, 520px);
}

.app-notification {
  pointer-events: auto;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  cursor: default;
}

.app-notification--visible {
  opacity: 1;
  transform: translateY(0);
}

.app-notification--hiding {
  opacity: 0;
  transform: translateY(-8px);
}

.app-notification--success {
  background-color: #28a745;
  color: #fff;
}

.app-notification--error {
  background-color: #dc3545;
  color: #fff;
}

.app-notification--warning {
  background-color: #ffc107;
  color: #212529;
}

.app-notification--info {
  background-color: #17a2b8;
  color: #fff;
}

/**=====================================================
 * Data Model - STYLESHEET
 * ===================================================== */  
  body {
        font-family: Arial, Helvetica, sans-serif;
        margin: 0;
        padding: 10px;
        background-color: white;
        font-size: 10pt;
    }
    .data-model-container {
        background: white;
        width: 100%;
        height: 100%;
    }
    .data-model-header {
        background: white;
        color: black;
        padding: 10px;
        text-align: center;
        border-bottom: 2px solid #000;
    }
    .data-model-content {
        padding: 10px;
        overflow-x: auto;
    }
    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
        border: 2px solid #000;
        border-spacing: 0;
    }
    th, td {
        border: 1px solid #000 !important;
        padding: 6px;
        text-align: left;
        vertical-align: top;
        font-size: 10pt;
        border-collapse: collapse;
    }
    th {
        background-color: #f0f0f0;
        font-weight: bold;
        border: 1px solid #000 !important;
    }
    .data-model-container .field-number {
        width: 50px;
        text-align: center;
        font-weight: bold;
        background-color: #f8f8f8;
    }
    .data-model-container .field-name {
        width: 200px;
        font-weight: bold;
        background-color: #f8f8f8;
    }
    .data-model-container .field-description {
        width: 250px;
        background-color: #f8f8f8;
    }
    .data-model-container .field-value {
        width: 190px;
        background-color: white;
        display: table-cell;
        padding: 6px;
    }
    .data-model-container .field-explanation {
        width: auto;
        background-color: white;
        display: table-cell;
        padding: 6px;
    }
    .data-model-container .section-header {
        background-color: var(--theme-nav-button-bg, #4A90E2) !important;
        font-weight: bold !important;
        text-align: center !important;
        font-size: 11pt !important;
        color: var(--theme-nav-button-text-color, white) !important;
    }
    .data-model-container .section-header td {
        border: 1px solid #000 !important;
        background-color: var(--theme-nav-button-bg, #4A90E2) !important;
        color: var(--theme-nav-button-text-color, white) !important;
        font-weight: bold !important;
        text-align: center !important;
    }
    /* Additional specific rules to ensure styling */
    .data-model-container tr.section-header td {
        background-color: var(--theme-nav-button-bg, #4A90E2) !important;
        color: var(--theme-nav-button-text-color, white) !important;
        font-weight: bold !important;
        text-align: center !important;
    }
    em {
        font-style: italic;
    }
    sup {
        vertical-align: super;
        font-size: smaller;
    }
    /* Ensure all table cells have visible borders */
    table td, table th {
        border: 1px solid #000 !important;
    }
    /* Override any inherited border styles */
    * {
        box-sizing: border-box;
    }


/**=====================================================
 * Login Page - STYLESHEET
 * ===================================================== */ 

 body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
  min-height: 100vh;
}
    
/* Header styling - the blue bar at the top of the page */
.header {
  background-color: #003651;
  color: white;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: var(--z-index-modal);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  min-height: 60px;
  border-radius: 8px;
  margin: 0 10px;
}
    
.header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
    
/* Navigation links in the header */
.header-links {
  display: flex;
  gap: 25px;
}

.header-links a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.header-links a:hover {
  background-color: rgba(255,255,255,0.1);
  text-decoration: none;
}
    
/* Login page layout — no scrollbars; overrides global .container/.sidebar overflow rules */
html.login-page-root {
  overflow: hidden !important;
  height: 100%;
  max-height: 100vh;
}

body.login-page {
  overflow: hidden !important;
  height: 100vh;
  max-height: 100vh;
  padding: 0 !important;
  margin: 0;
  background: #f0f0f0;
}

body.login-page .container {
  padding: 24px 20px 72px;
  max-height: 100vh;
  height: 100vh;
  overflow: hidden !important;
  overflow-y: hidden !important;
  align-items: stretch;
  box-sizing: border-box;
}

body.login-page .login-page-logo-link {
  position: fixed;
  bottom: 20px;
  left: 24px;
  z-index: 20;
  display: inline-block;
  line-height: 0;
  cursor: pointer;
}

body.login-page .login-page-logo {
  max-height: 64px;
  width: auto;
  pointer-events: auto;
}

body.login-page .sidebar {
  max-height: none;
  height: auto;
  overflow: hidden !important;
  overflow-y: hidden !important;
}

body.login-page .main-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  height: auto;
  overflow: hidden !important;
  overflow-y: hidden !important;
}

body.login-page .login-subtitle {
  margin-bottom: 20px;
  flex-shrink: 0;
}

body.login-page .login-form,
body.login-page .forgot-password-form {
  flex-shrink: 0;
}

body.login-page .main-content > h2 {
  flex-shrink: 0;
}

body.login-page .notice-box {
  margin: 20px 0 0;
  width: 100%;
  flex-shrink: 0;
}

body.login-page .login-visual-slideshow {
  --login-slide-count: 3;
  --login-slide-duration: 15s;
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 6px;
  background: #dfe3e6;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

body.login-page .login-visual-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(240, 240, 240, 0.35) 0%, rgba(240, 240, 240, 0) 18%);
}

@keyframes login-slideshow-fade {
  0% {
    opacity: 0;
    z-index: 0;
  }
  4% {
    opacity: 1;
    z-index: 1;
  }
  29% {
    opacity: 1;
    z-index: 1;
  }
  33% {
    opacity: 0;
    z-index: 0;
  }
  100% {
    opacity: 0;
    z-index: 0;
  }
}

body.login-page .login-visual-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  animation: login-slideshow-fade var(--login-slide-duration) linear infinite;
}

body.login-page .login-visual-slideshow img:nth-child(1) {
  animation-delay: 0s;
}

body.login-page .login-visual-slideshow img:nth-child(2) {
  animation-delay: calc(var(--login-slide-duration) / var(--login-slide-count) * -1);
}

body.login-page .login-visual-slideshow img:nth-child(3) {
  animation-delay: calc(var(--login-slide-duration) / var(--login-slide-count) * -2);
}

body.login-page.login-forgot-open .login-visual-slideshow {
  display: none;
}

body.login-page .login-support-contact {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

body.login-page .login-support-contact .contact-link {
  color: #0066cc;
}

body.login-page #login-technical-email a,
body.login-page a.login-protected-mailto {
  color: #0066cc;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
}

body.login-page #login-technical-email a:hover,
body.login-page a.login-protected-mailto:hover {
  text-decoration: underline;
}

body.login-page .login-browser-support-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

body.login-page .login-browser-support-modal.is-open {
  display: flex;
}

body.login-page .login-browser-support-dialog {
  background: #fff;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 28px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  line-height: 1.55;
  color: #222;
}

body.login-page .login-browser-support-dialog h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 600;
  color: #8b274f;
}

body.login-page .login-browser-support-dialog ul {
  margin: 12px 0 16px;
  padding-left: 22px;
}

body.login-page .login-browser-support-dialog li {
  margin-bottom: 6px;
}

body.login-page .login-browser-support-dialog a.browser-vendor-link {
  color: #0066cc;
  text-decoration: underline;
}

body.login-page .browser-support-warning {
  background: #fff9c4;
  padding: 12px 14px;
  margin: 16px 0;
}

body.login-page .login-browser-support-close {
  margin-top: 18px;
  padding: 6px 16px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
}

body.login-page .login-browser-support-close:hover {
  background: #e4e4e4;
}

body.login-page .notice-box a {
  cursor: pointer;
}

body.login-page.login-forgot-open .main-content {
  max-height: calc(100vh - 100px);
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Main container that holds all content */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 100px; /* Increased top padding to account for header with spacing */
  display: flex;
  justify-content: space-between;
}
    
/* Main content area - holds the login form */
.main-content {
  width: 65%;
}
    
.main-content h2 {
  color: #333;
  font-size: 22px;
  margin-bottom: 10px;
}
    
.login-subtitle {
  color: #666;
  margin-bottom: 30px;
}
    
/* Login form styling */
.login-form {
  margin-top: 20px;
}
    
.form-group {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}
    
.form-group label {
  width: 100px;
  text-align: right;
  margin-right: 15px;
}
    
.form-group input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}
    
/* Login button styling */
.login-button {
  margin-left: 115px;
  padding: 6px 15px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
}
    
.login-button:hover {
  background-color: #e4e4e4;
}
    
/* Forgot password button styling */
.forgot-password-button {
  margin-left: 10px;
  padding: 6px 15px;
  background-color: #6c757d;
  color: white;
  border: 1px solid #545b62;
  border-radius: 3px;
  cursor: pointer;
}
    
.forgot-password-button:hover {
  background-color: #545b62;
}
    
/* Forgot password form styling */
.forgot-password-form {
  display: none;
  margin-top: 20px;
  padding: 20px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 5px;
}
    
.forgot-password-form.active {
  display: block;
}
    
.forgot-password-form h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  font-size: 18px;
}
    
.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}
    
.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}
    
.form-row .form-group label {
  width: auto;
  margin-right: 10px;
  min-width: 80px;
}
    
/* Centered language section */
.language-section {
  text-align: center;
  margin-bottom: 20px;
}
    
.language-section .language-options {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
  flex-direction: row;
}
    
.language-section .language-option {
  flex: 0 0 auto;
}
    
.forgot-password-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
    
.submit-reset {
  padding: 8px 20px;
  background-color: #007bff;
  color: white;
  border: 1px solid #0056b3;
  border-radius: 3px;
  cursor: pointer;
}
    
.submit-reset:hover {
  background-color: #0056b3;
}
    
.cancel-reset {
  padding: 8px 20px;
  background-color: #6c757d;
  color: white;
  border: 1px solid #545b62;
  border-radius: 3px;
  cursor: pointer;
}
    
.cancel-register:hover {
  background-color: #545b62;
}
    
/* Language selection styling */
.language-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
    
.language-option {
  display: flex;
  align-items: center;
}
    
.language-option input[type="radio"] {
  display: none;
}
    
.language-label {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  width: 100%;
  min-height: 50px;
  box-sizing: border-box;
  overflow: hidden;
}
    
.language-label:hover {
  border-color: #007acc;
  background: #f8f9fa;
}
    
.language-option input[type="radio"]:checked + .language-label {
  border-color: #007acc;
  background: #e3f2fd;
  box-shadow: 0 2px 8px rgba(0, 122, 204, 0.2);
}
    
.flag {
  font-size: 16px;
  font-weight: bold;
  min-width: 35px;
  color: #007acc;
  background: #e3f2fd;
  padding: 6px 10px;
  border-radius: 4px;
  text-align: center;
}
    
.lang-name {
  font-weight: bold;
  font-size: 16px;
  color: #333;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
    
.language-help {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}
    
/* Back to login button styling */
.back-to-login-button {
  margin-left: 10px;
  padding: 6px 15px;
  background-color: #6c757d;
  color: white;
  border: 1px solid #545b62;
  border-radius: 3px;
  cursor: pointer;
}
    
.back-to-login-button:hover {
  background-color: #545b62;
}
    
/* Help sidebar styling - appears on the right side */
.sidebar {
  width: 30%;
  background-color: #fff;
  border: 1px solid #ddd;
  padding: 15px;
}
    
.sidebar h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}
    
.sidebar p {
  margin-bottom: 15px;
  font-size: 14px;
}
    
.sidebar a {
  color: #0066cc;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}
    
.sidebar a::before {
  content: "» ";
  color: #0066cc;
}
    
/* Browser compatibility notice styling */
.notice-box {
  background-color: #e9f5fb;
  padding: 15px;
  margin: 30px auto;
  width: 80%;
  border-radius: 3px;
}
    
.notice-box p {
  margin: 0 0 10px 0;
}
    
.notice-box a {
  color: #0066cc;
  text-decoration: none;
}
    
.notice-box a::before {
  content: "» ";
  color: #0066cc;
}

/**=====================================================
 * Potenzial Edit Attributes - STYLESHEET
 * ===================================================== */
 body {
   font-family: -apple-system, BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
   background: #f5f5f5;
   margin: 0;
   padding: 0;
 }
 .main-header {
   background: #123469;
   color: #fff;
   padding: 12px 20px;
   font-size: 16px;
   font-weight: bold;
   position: relative;
 }
 .main-header::after {
   content: '';
   position: absolute;
   top: 0;
   right: 0;
   width: 100px;
   height: 100%;
   background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1));
 }
 .transfer-banner {
   background: #fff;
   border: 1px solid #e0e0e0;
   margin: 16px 20px;
   padding: 12px 16px;
   border-radius: 4px;
 }
 .transfer-banner a {
   color: #0066cc;
   text-decoration: underline;
   font-weight: 500;
 }
 .page-title {
   background: #fff;
   padding: 16px 20px;
   border-bottom: 1px solid #e0e0e0;
   font-size: 18px;
   font-weight: 600;
   color: #333;
   margin: 0 20px 20px;
 }
 .content-wrapper {
   display: flex;
   padding: 0 20px;
 }
 .main-content {
   flex: 1;
   margin-right: 20px;
 }
 /* Sidebar styling */
 .sidebar {
   width: 300px;
   background: #f8f9fa;
   border-left: 1px solid #d0d0d0;
   padding: 16px;
   height: 100vh;
   overflow-y: auto;
   position: sticky;
   top: 0;
 }
 .sidebar-section {
   margin-bottom: 20px;
 }
 .sidebar-header {
   background: #dc3545;
   color: white;
   padding: 8px 12px;
   font-size: 13px;
   font-weight: 500;
   border-radius: 3px 3px 0 0;
 }
 .sidebar-content {
   background: white;
   border: 1px solid #d0d0d0;
   border-top: none;
   padding: 12px;
   border-radius: 0 0 3px 3px;
 }
 .toggle-buttons {
   display: flex;
   gap: 6px;
 }
 .btn-toggle {
   padding: 4px 8px;
   font-size: 11px;
   border: 1px solid #ccc;
   border-radius: 3px;
   background: #f5f5f5;
   color: #666;
   cursor: pointer;
   white-space: nowrap;
 }
 .btn-toggle.active {
   border-color: #87ceeb;
   background: #e6f3ff;
   color: #0066cc;
 }
 .nav-section-title {
   font-size: 13px;
   font-weight: 600;
   color: #333;
   margin-bottom: 8px;
 }
 .nav-link {
   color: #0066cc;
   text-decoration: none;
   display: block;
   padding: 2px 0;
   font-size: 12px;
   line-height: 1.4;
 }
 .nav-link:hover {
   color: #0052a3;
   text-decoration: underline;
 }
 .action-buttons {
   display: flex;
   gap: 8px;
   margin-top: 16px;
 }
 .btn-primary {
   background: #0066cc;
   color: white;
   border: none;
   padding: 6px 12px;
   font-size: 12px;
   font-weight: 500;
   border-radius: 3px;
   cursor: pointer;
   display: inline-flex;
   align-items: center;
   gap: 6px;
 }
 .btn-secondary {
   background: #6c757d;
   color: white;
   border: none;
   padding: 6px 12px;
   font-size: 12px;
   font-weight: 500;
   border-radius: 3px;
   cursor: pointer;
   display: inline-flex;
   align-items: center;
   gap: 6px;
 }
 /* Form sections */
 .form-section {
   background: #fff;
   border: 1px solid #d0d0d0;
   border-radius: 4px;
   margin-bottom: 20px;
   overflow: hidden;
 }
 .section-header {
   background: #f8f9fa;
   padding: 10px 16px;
   border-bottom: 1px solid #d0d0d0;
   font-size: 14px;
   font-weight: 600;
   color: #333;
 }
 table.form-table {
   width: 100%;
   border-collapse: collapse;
 }
 table.form-table th,
 table.form-table td {
   padding: 8px 12px;
   border-bottom: 1px solid #e8e8e8;
   vertical-align: top;
   font-size: 13px;
   color: #333;
 }
 table.form-table th {
   width: 200px;
   background: #fafafa;
   color: #555;
   text-align: left;
 }
 .help-icon {
   margin-left: 4px;
   font-size: 12px;
   color: #666;
 }
 .clear-selection {
   display: block;
   margin-top: 4px;
   font-size: 12px;
   color: #0066cc;
   cursor: pointer;
   text-decoration: underline;
 }

 /**=====================================================
 * Potenzial View Attributes - STYLESHEET
 * ===================================================
 body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}
        
/* Header styling to match the original */
.main-header {
  background: linear-gradient(135deg, #2c5aa0 0%, #1e3a8a 100%);
  color: white;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  position: relative;
}
      
.main-header::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 100%);
}
      
/* Page title styling */
.page-title {
  background: white;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}
      
/* Form section styling to match original */
.form-section {
  background: white;
  border: 1px solid #d0d0d0;
  margin-bottom: 20px;
  border-radius: 4px;
  overflow: hidden;
}
      
.section-header {
  background: #f8f9fa;
  border-bottom: 1px solid #d0d0d0;
  padding: 10px 16px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}
      
/* Table-like field rows */
.field-row {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
  min-height: 36px;
}
      
.field-row:last-child {
  border-bottom: none;
}
      
.field-label {
  flex: 0 0 200px;
  padding: 8px 12px;
  background: #fafafa;
  border-right: 1px solid #e8e8e8;
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: center;
  position: relative;
}
      
.field-label .help-icon {
  color: #666;
  font-size: 12px;
  margin-left: 4px;
}
      
.field-value {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  display: flex;
  align-items: center;
  background: white;
}
      
.field-value.link {
  color: #0066cc;
  text-decoration: underline;
  cursor: pointer;
}
      
.field-value.link:hover {
  color: #0052a3;
}
      
.field-value.blue {
  color: #0066cc;
}
      
/* Sidebar styling */
.sidebar {
  width: 300px;
  background: #f8f9fa;
  border-left: 1px solid #d0d0d0;
  padding: 16px;
  height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}
      
.sidebar-section {
  margin-bottom: 20px;
}
      
.sidebar-header {
  background: #dc3545;
  color: white;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 3px 3px 0 0;
}
      
.sidebar-content {
  background: white;
  border: 1px solid #d0d0d0;
  border-top: none;
  padding: 12px;
  border-radius: 0 0 3px 3px;
}
      
.sidebar-content .description {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}
      
.toggle-buttons {
  display: flex;
  gap: 6px;
}
      
.btn-toggle {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #f5f5f5;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
}
      
.btn-toggle.active {
  border-color: #87ceeb;
  background: #e6f3ff;
  color: #0066cc;
}
      
/* Navigation links */
.nav-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}
      
.nav-link {
  color: #0066cc;
  text-decoration: none;
  display: block;
  padding: 2px 0;
  font-size: 12px;
  line-height: 1.4;
}
      
.nav-link:hover {
  color: #0052a3;
  text-decoration: underline;
}
      
/* Action buttons */
.action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 20px;
  position: relative;
  z-index: var(--z-index-base);
}
      
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
      
.btn-primary {
  background: #0066cc;
  color: white;
}
      
.btn-primary:hover {
  background: #0052a3;
}
      
.btn-secondary {
  background: #6c757d;
  color: white;
}
      
.btn-secondary:hover {
  background: #545b62;
}
      
/* Main layout */
.main-content {
  flex: 1;
  padding: 20px;
  max-width: calc(100% - 300px);
}
      
.content-wrapper {
  display: flex;
  min-height: calc(100vh - 80px);
}
      
/* Responsive adjustments */
@media (max-width: 1024px) {
  .content-wrapper {
      flex-direction: column;
  }
  
  .sidebar {
      width: 100%;
      height: auto;
      position: static;
  }
  
  .main-content {
      max-width: 100%;
  }
  
  .field-row {
      flex-direction: column;
  }
  
  .field-label {
      flex: none;
      border-right: none;
      border-bottom: 1px solid #e8e8e8;
  }
}
/**=====================================================
 * Raum Platform - STYLESHEET
 * =================================================== */
/* ----------------------
         GLOBAL STYLES
      ---------------------- */
      body {
        margin: 0;
        padding: 0;
        padding-top: 70px; /* Account for fixed navbar height */
        font-family: system-ui, -apple-system, sans-serif;
      }

      /* ----------------------
         Utility Classes
      ---------------------- */
      .hidden {
        display: none;
      }

      /* Search-result tab: hide map until preview basemap + results are ready (no Street flash) */
      html.search-result-map-pending #mapContainer,
      html.search-result-map-pending #mapView,
      html.search-result-map-pending #map,
      html.search-result-map-pending #factSheetView {
        visibility: hidden !important;
      }
      html.search-result-region-wide #areaSelect {
        display: none !important;
      }

      /* Sidebar Map: hidden until a municipality is selected (toggled in JS via .map-toggle-hidden) */
      #mapToggle.map-toggle-hidden {
        display: none !important;
      }

      /* ----------------------
         NAVIGATION BAR LAYOUT
      ---------------------- */
      /* CSS custom properties set from THEME_CONFIG via topBarTheme.js (100% constants-driven) */
      .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: var(--theme-navbar-bg);
        color: var(--theme-navbar-text-color);
        padding: 1rem;
        z-index: var(--z-index-modal);
      }
      .navbar-left {
        display: flex;
        align-items: center;
        gap: 2rem;
      }
      .navbar-cont {
        display: flex;
        gap: 1rem;
      }
      .navbar-right {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-left: auto;
      }
      .navbar-title {
        font-size: 1.25rem;
        font-weight: bold;
        margin: 0;
        cursor: pointer;
        user-select: none;
      }
      .navbar-title:hover,
      .navbar-title:focus-visible {
        opacity: 0.92;
        text-decoration: underline;
        outline: none;
      }
      .area-select, .Region {
        background-color: white;
        color: var(--theme-dropdown-text-color);
        padding: 0.5rem 1rem;
        border-radius: 0.25rem;
        border: none;
      }
      .navbar-button {
        background-color: var(--theme-nav-button-bg);
        border: none;
        color: var(--theme-nav-button-text-color);
        padding: 0.5rem 1rem;
        border-radius: 0.25rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }
      .navbar-button:hover {
        opacity: 0.9; /* Hover effect using opacity instead of hardcoded color */
      }
      
      /* Language Switcher Styles */
      .language-switcher {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-right: 15px;
        padding: 5px 10px;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 0.2);
      }
      
      .language-options-nav {
        display: flex;
        gap: 5px;
      }
      
      .language-option-nav {
        background-color: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 4px;
        padding: 4px 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        color: var(--theme-navbar-text-color);
        font-size: 12px;
        font-weight: bold;
      }
      
      .language-option-nav:hover {
        background-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
      }
      
      .language-option-nav.active {
        background-color: #007acc; /* Active state color - can be moved to THEME_CONFIG if needed */
        border-color: #007acc;
        box-shadow: 0 2px 4px rgba(0, 122, 204, 0.3);
      }
      
      .language-option-nav.disabled {
        opacity: 0.3;
        cursor: not-allowed;
      }
      
      .flag-nav {
        color: var(--theme-navbar-text-color);
        font-weight: bold;
      }
      


      /* ----------------------
         MAIN CONTAINER LAYOUT
      ---------------------- */
      /* Platform mode: prevent page-level scrolling; scrolling is handled inside map container only. */
      body:has(.navbar + .main-container),
      body:has(.navbar ~ .main-container) {
        overflow: hidden !important;
      }

      html:has(body .navbar + .main-container),
      html:has(body .navbar ~ .main-container) {
        overflow: hidden !important;
      }

      .main-container {
        display: flex;
        height: calc(100vh - 70px) !important; /* Account for fixed navbar */
        min-height: calc(100vh - 70px) !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        gap: 0;
        align-items: stretch;
        position: relative;
        left: 0;
        right: 0;
        transform: translateX(0);
        min-width: 0;
        overflow: hidden !important;
        box-sizing: border-box;
      }

      @supports (height: 100dvh) {
        body:has(.navbar + .main-container) .main-container,
        body:has(.navbar ~ .main-container) .main-container {
          height: calc(100dvh - 70px) !important;
          min-height: calc(100dvh - 70px) !important;
        }

        body:has(.navbar + .main-container) .sidebar,
        body:has(.navbar ~ .main-container) .sidebar {
          height: calc(100dvh - 70px) !important;
          min-height: calc(100dvh - 70px) !important;
          max-height: calc(100dvh - 70px) !important;
        }
      }

      /* ----------------------
         SIDEBAR STYLES (Left Panel)
      ---------------------- */
      .sidebar {
        width: 200px;
        min-width: 200px;
        background-color: white;
        border-right: 1px solid #a8a9aa;
        padding: 0.5rem;
        z-index: var(--z-index-overlay);
        display: flex;
        flex-direction: column;
        overflow-y: auto !important;
        margin: 0;
        flex-shrink: 0;
        box-sizing: border-box;
        height: calc(100vh - 70px) !important; /* Account for fixed navbar */
        min-height: calc(100vh - 70px) !important;
        max-height: calc(100vh - 70px) !important;
      }
      .sidebar-section {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #ccc;
      }
      .sidebar-title {
        font-weight: bold;
        margin-bottom: 0.5rem;
      }
      .sidebar-menu {
        list-style: none;
        padding: 0;
        margin: 0;
      }
      .sidebar-menu li {
        padding: 0.5rem 0.75rem;
        color: #333;
        cursor: pointer;
        margin: 0;
      }
      .sidebar-menu li:hover,
      .sidebar-menu > li.selected {
        background-color: #e74c3c;
        color: #fff;
      }
      .sidebar-menu li.end-line {
        border-bottom: 1px solid #ccc;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
      }
      .sidebar-submenu {
        background: #fafafa;
        margin: 0;
        padding: 4px 0;
        border-radius: 4px;
      }
      .sidebar-submenu li {
        padding: 8px 16px;
        position: relative;
        margin: 2px 4px;
        color: #6c757d;
        background: #ffffff;
        border-radius: 4px;
        border: 1px solid #f1f3f4;
        transition: all 0.2s ease;
        font-weight: 400;
        font-size: 13px;
      }
      .sidebar-submenu li::before {
        content: "";
      }
      .sidebar-submenu li::after {
        content: "";
      }
      .sidebar-submenu li:hover {
        background: #f8f9fa;
        color: #495057;
        transform: none;
        box-shadow: none;
        border-color: #dee2e6;
      }
      .sidebar-submenu li:hover::before {
        content: "";
      }
      .sidebar-submenu li:hover::after {
        content: "";
      }
      .sidebar-submenu li a {
        color: inherit;
        text-decoration: none;
        display: block;
        font-weight: 400;
      }

      /* ----------------------
         MAP CONTAINER STYLES (Center Panel)
         - Uses two inner containers: one for the map view and one for the fact-sheet.
      ---------------------- */
      .map-container {
        flex: 1;
        position: relative;
        margin: 0;
        padding: 0;
        min-width: 0;
        min-height: 0; /* flex child: allow shrink so overflow-y can scroll inside fixed-height main layout */
        box-sizing: border-box;
        background-color: #ffffff;
        overflow: hidden !important;
        scrollbar-width: none !important; /* Firefox */
        -ms-overflow-style: none !important; /* Internet Explorer 10+ */
      }
      
      /* Hide scrollbars for webkit browsers */
      .map-container::-webkit-scrollbar {
        display: none !important;
      }
      #mapContainer {
        height: 100%;
        width: 100%;
        min-height: 0; /* flex child: see .map-container */
        overflow: hidden !important;
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        scrollbar-width: none !important; /* Firefox */
        -ms-overflow-style: none !important; /* Internet Explorer 10+ */
      }
      
      /* Hide scrollbars for webkit browsers */
      #mapContainer::-webkit-scrollbar {
        display: none !important;
      }
      
      /* PDF Viewer Responsive Styles */
      #mapContainer > div[style*="width: 100%; height: 100%"] {
        box-sizing: border-box !important;
        overflow: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
      }
      
      /* Make sidebarContentDiv fit within container using flexbox */
      #mapContainer #sidebarContentDiv {
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
      }
      
      /* Inline form layout should keep navigation on the right */
      #mapContainer #sidebarContentDiv.inline-form-layout {
        flex-direction: row !important;
        align-items: flex-start !important;
      }
      
      /* Allow table area to scroll if content is too tall */
      #mapContainer #sidebarContentDiv > div > div[style*="overflow-y: auto"] {
        scrollbar-width: thin !important;
        -ms-overflow-style: auto !important;
      }
      
      #mapContainer #sidebarContentDiv > div > div[style*="overflow-y: auto"]::-webkit-scrollbar {
        width: 6px !important;
        height: 6px !important;
        display: block !important;
      }
      
      #mapContainer #sidebarContentDiv > div > div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
      }
      
      #mapContainer #sidebarContentDiv > div > div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
      }
      
      #mapContainer #sidebarContentDiv > div > div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
        background: #555;
      }
      
      /* Results container can scroll if needed */
      #mapContainer #searchResultsContainer {
        scrollbar-width: thin !important;
        -ms-overflow-style: auto !important;
      }
      
      #mapContainer #searchResultsContainer::-webkit-scrollbar {
        width: 6px !important;
        height: 6px !important;
      }

      /* Search page responsive layout */
      #mapContainer .search-layout-root {
        display: grid !important;
        grid-template-columns: minmax(420px, 1.25fr) minmax(320px, 1fr);
        gap: 10px;
        width: 100%;
        height: 100%;
      }

      #mapContainer .search-left-panel,
      #mapContainer .search-right-panel {
        min-width: 0;
        width: 100%;
      }

      #mapContainer .search-actions-row {
        flex-wrap: wrap;
      }

      #mapContainer .search-actions-row button {
        flex: 0 0 auto;
      }

      #mapContainer .search-map-panel #searchMapPreview {
        min-height: 260px !important;
        height: auto !important;
      }

      @media screen and (max-width: 1400px) {
        #mapContainer .search-layout-root {
          grid-template-columns: minmax(360px, 1fr) minmax(280px, 0.95fr);
        }
      }

      @media screen and (max-width: 1120px) {
        #mapContainer .search-layout-root {
          grid-template-columns: 1fr;
        }

        #mapContainer .search-right-panel {
          min-height: 320px;
        }
      }
      
      /* Ensure header stays full width at all zoom levels */
      @media screen and (min-width: 1px) {
        #mapContainer div[style*="background: #2c3e50"] {
          width: 100% !important;
          box-sizing: border-box !important;
          min-width: 100% !important;
          max-width: 100% !important;
          flex-shrink: 0 !important;
          position: relative !important;
        }
        
        /* initializeProfileEditUI is defined in the main script section below */
        /* Ensure PDF viewer container is responsive */
        #mapContainer iframe#pdfViewer {
          width: 100% !important;
          box-sizing: border-box !important;
          max-width: 100% !important;
        }
        
        /* General responsive fix for all content in mapContainer */
        #mapContainer * {
          box-sizing: border-box;
        }
      }
      /* Map view: holds the interactive map */
      #mapView {
        height: 100%;
        width: 100%;
        overflow: hidden !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
      }
      
      #mapView::-webkit-scrollbar {
        display: none !important;
      }
      
      /* Fact-Sheet view: displays fact-sheet content; hidden by default */
      /* NOTE: overflow is removed so scrolling is handled by mapContainer */
      #factSheetView {
        width: 100%;
        max-width: 100%;
        min-height: 100%; /* Allow content to expand beyond viewport */
        overflow-x: hidden;
        overflow-y: visible; /* No scrollbar here - mapContainer handles scrolling */
        position: relative;
        box-sizing: border-box;
      }
      
      /* When Fact Sheet is shown, make mapContainer scrollable */
      /* This class is added/removed dynamically by JavaScript */
      #mapContainer.factsheet-scrollable,
      .map-container.factsheet-scrollable {
        overflow-y: auto !important; /* Override default - allow scrolling */
        overflow-x: hidden !important;
        scrollbar-width: thin !important; /* Firefox: was none on #mapContainer */
        -ms-overflow-style: auto !important;
      }

      #mapContainer.factsheet-scrollable::-webkit-scrollbar,
      .map-container.factsheet-scrollable::-webkit-scrollbar {
        display: block !important;
        width: 10px;
        height: 10px;
      }

      #mapContainer.factsheet-scrollable::-webkit-scrollbar-track,
      .map-container.factsheet-scrollable::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
      }

      #mapContainer.factsheet-scrollable::-webkit-scrollbar-thumb,
      .map-container.factsheet-scrollable::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
      }

      #mapContainer.factsheet-scrollable::-webkit-scrollbar-thumb:hover,
      .map-container.factsheet-scrollable::-webkit-scrollbar-thumb:hover {
        background: #555;
      }
      
      /* When in map view, mapContainer should not scroll */
      #mapContainer:not(.factsheet-scrollable) {
        overflow-y: hidden !important; /* No scrolling for map view */
        overflow-x: hidden !important;
      }
      
      /* Allow scrolling for fact sheet content */
      #factSheetView .factsheet-wrapper {
        overflow: visible;
      }
      
      #factSheetView::-webkit-scrollbar {
        width: 8px;
        height: 8px;
      }
      
      #factSheetView::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
      }
      
      #factSheetView::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
      }
      
      #factSheetView::-webkit-scrollbar-thumb:hover {
        background: #555;
      }
      /* Use this class to hide any view */
      .hidden {
        display: none;
      }
      #map {
        height: 100%;
        width: 100%;
        background-color: white;
      }
      .scale-bar {
        display: none;
      }

      /* ----------------------
         LAYER PANEL STYLES (Right Panel)
      ---------------------- */
      .layer-panel {
        width: 300px !important;
        min-width: 200px !important;
        max-width: 400px !important;
        background-color: white;
        border-left: 1px solid #a4adab;
        padding: 0.5rem;
        overflow-y: auto;
        z-index: var(--z-index-overlay);
        margin: 0;
        flex-shrink: 0;
        box-sizing: border-box;
      }
      .layer-section {
        margin-bottom: 0.5rem;
      }
      .layer-title {
        font-weight: bold;
        margin-bottom: 0.5rem;
      }
      .layer-item {
        display: flex;
        align-items: center;
        gap: 0.3rem;
        margin-bottom: 0.3rem;
        cursor: pointer;
        padding: 0.2rem;
        border-radius: 0.25rem;
        transition: background-color 0.2s;
      }
      .layer-item:hover {
        background-color: rgba(0, 0, 0, 0.05);
      }
      .layer-item.disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }
      .layer-item.disabled input {
        cursor: not-allowed;
      }
      .layer-legend-toggle {
        flex: 0 0 auto;
        margin-left: 0.15rem;
        border: none;
        background: transparent;
        cursor: pointer;
        font-size: 0.75rem;
        line-height: 1;
        padding: 0.1rem 0.25rem;
        color: #555;
      }
      .layer-legend-toggle:hover {
        color: #111;
      }
      .color-box {
        width: 1.2rem;
        height: 1.2rem;
        border: 1px solid rgba(0, 0, 0, 0.3);
        border-radius: 2px;
        flex-shrink: 0;
      }

      /* ----------------------
         MAP TOOLS & CONTROLS STYLES
      ---------------------- */
      .map-tools {
        position: absolute;
        top: 1rem;
        left: 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        z-index: var(--z-index-modal);
      }
      .map-tool-button {
        background-color: white;
        border: 1px solid #ccc;
        border-radius: 0.25rem;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      }
      .map-tool-button:hover {
        background-color: #f5f5f5;
      }

      /* ----------------------
         PRINT CONTROLS STYLES
      ---------------------- */
      .print-section {
        margin-top: auto;
        padding-top: 1rem;
        border-top: 1px solid #e5e7eb;
      }
      .print-button {
        width: 100%;
        background-color: #e74c3c;
        color: white;
        border: none;
        padding: 0.75rem;
        border-radius: 0.25rem;
        cursor: pointer;
        font-weight: 500;
      }
      .print-button:hover {
        background-color: #c0392b;
      }
      .print-tip {
        margin-top: 0.5rem;
        font-size: 0.8rem;
        color: #666;
        text-align: center;
      }

      /* ----------------------
         COORDINATES DISPLAY STYLES
      ---------------------- */
      .coordinates {
        position: absolute;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        background-color: white;
        padding: 0.5rem;
        border-radius: 0.25rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        font-size: 0.875rem;
        z-index: var(--z-index-modal);
      }

      /* ----------------------
         ADDITIONAL COMPONENTS STYLES
      ---------------------- */
      .login-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: #f3f4f6;
        z-index: var(--z-index-map-toolbar);
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 2rem;
      }
      .login-box {
        background-color: white;
        padding: 2rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        width: 100%;
        max-width: 400px;
      }
      .login-title {
        font-size: 1.5rem;
        font-weight: bold;
        margin-bottom: 1.5rem;
        color: #1f2937;
      }
      .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: var(--z-index-map-toolbar);
      }
      .modal-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: white;
        padding: 2rem;
        border-radius: 0.5rem;
        width: 90%;
        max-width: 500px;
      }
      .form-group {
        margin-bottom: 1rem;
      }
      .form-label {
        display: block;
        margin-bottom: 0.5rem;
        color: #4b5563;
        font-weight: 500;
      }
      .form-input, .form-textarea {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid #d1d5db;
        border-radius: 0.25rem;
        font-size: 1rem;
      }
      .form-textarea {
        min-height: 150px;
        resize: vertical;
      }
      .modal-buttons {
        display: flex;
        justify-content: flex-end;
        gap: 1rem;
        margin-top: 1.5rem;
      }
      .modal-button {
        padding: 0.5rem 1rem;
        border-radius: 0.25rem;
        cursor: pointer;
        font-size: 1rem;
      }
      .modal-button.primary {
        background-color: var(--theme-navbar-bg);
        color: var(--theme-navbar-text-color);
        border: none;
      }
      .modal-button.secondary {
        background-color: #e5e7eb;
        border: none;
      }

      /* ----------------------
         PRINT LEGEND STYLES
      ---------------------- */
      .print-legend {
        display: none;
        position: fixed;
        top: 20px;
        right: 20px;
        background: white;
        padding: 15px;
        border: 1px solid #aa1414;
        border-radius: 4px;
        z-index: var(--z-index-modal);
      }
      .print-legend h3 {
        margin: 0 0 10px 0;
        font-size: 16px;
        font-weight: bold;
      }
      .print-legend-item {
        display: flex;
        align-items: center;
        margin-bottom: 8px;
      }
      .print-legend-color {
        width: 20px;
        height: 20px;
        margin-right: 10px;
        border: 1px solid #000;
        border-radius: 2px;
        flex-shrink: 0;
        display: inline-block;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
      }
      .print-legend-label {
        font-size: 14px;
      }
      /* ----------------------
         PRINT MEDIA QUERY
      ---------------------- */
      @media print {
        .navbar, .sidebar, .layer-panel, .leaflet-control-container,
        .custom-map-tools, #mapTopStatusCluster, #geometryEditTip, .print-button, .print-tip {
          display: none !important;
        }
        html, body { 
          height: 21cm !important; 
          width: 29.7cm !important;
          max-height: 21cm !important;
          max-width: 29.7cm !important;
          margin: 0 !important;
          padding: 0 !important;
          box-sizing: border-box !important;
          overflow: hidden !important;
          position: relative !important;
        }
        /* Removed conflicting main-container styles - using the fixed A4 dimensions version below */
        
        /* Do not zero padding/margin on Leaflet tiles — that clips the map in print. */
        body.map-print-mode {
          margin: 0 !important;
          padding: 0 !important;
          box-sizing: border-box !important;
        }
        /* Print header - exactly 2cm height */
        body::before {
          content: "Raum+ Platform Map Export - " attr(data-print-date) !important;
          display: block !important;
          text-align: center !important;
          font-size: 16px !important;
          font-weight: bold !important;
          padding: 0.5cm 0 !important;
          border-bottom: 2px solid #000 !important;
          height: 2cm !important;
          line-height: 1cm !important;
          position: absolute !important;
          top: 0 !important;
          left: 0 !important;
          right: 0 !important;
          z-index: 1002 !important;
          background: rgba(255, 255, 255, 0.9) !important;
          box-sizing: border-box !important;
        }
        /* ProRaum Consult logo and municipality: visible inside printable page (do not hide) */
        #print-logo {
          position: absolute !important;
          top: 0.2cm !important;
          left: 0.5cm !important;
          width: 2cm !important;
          height: 1.6cm !important;
          object-fit: contain !important;
          z-index: 1003 !important;
          display: block !important;
          -webkit-print-color-adjust: exact !important;
          print-color-adjust: exact !important;
        }
        #print-municipality-name {
          position: absolute !important;
          top: 2.5cm !important;
          left: 50% !important;
          transform: translateX(-50%) !important;
          font-size: 18px !important;
          font-weight: bold !important;
          color: #000 !important;
          text-align: center !important;
          z-index: 1002 !important;
          display: block !important;
          background: rgba(255, 255, 255, 0.9) !important;
          padding: 4px 8px !important;
          border-radius: 4px !important;
          border: 1px solid #000 !important;
        }
        /* Force single page layout with FULL A4 dimensions (no margins) */
        .main-container {
          display: block !important;
          height: 21cm !important;
          max-height: 21cm !important;
          width: 29.7cm !important;
          max-width: 29.7cm !important;
          padding: 0 !important;
          margin: 0 !important;
          box-sizing: border-box !important;
          overflow: hidden !important;
          position: absolute !important;
          top: 0 !important;
          left: 0 !important;
        }
        .map-container, #mapContainer {
          width: 29.7cm !important;
          height: 17cm !important;
          max-width: 29.7cm !important;
          max-height: 17cm !important;
          min-height: 17cm !important;
          overflow: hidden !important;
          display: block !important;
          border: 2px solid #000 !important;
          position: absolute !important;
          top: 2cm !important;
          left: 0 !important;
        }
        /* Ensure map is visible and fills entire container when printing */
        #mapView { 
          display: block !important; 
          width: 100% !important;
          height: 100% !important;
          margin: 0 !important;
          padding: 0 !important;
          position: absolute !important;
          top: 0 !important;
          left: 0 !important;
          right: 0 !important;
          bottom: 0 !important;
          overflow: hidden !important;
          box-sizing: border-box !important;
        }
        
        /* Ensure all Leaflet map elements fill the container completely */
        #mapView .leaflet-container {
          width: 100% !important;
          height: 100% !important;
          margin: 0 !important;
          padding: 0 !important;
          position: absolute !important;
          top: 0 !important;
          left: 0 !important;
          right: 0 !important;
          bottom: 0 !important;
        }

        /* During pan/zoom, skip vector hit-testing so hover/highlight cannot freeze the map. */
        .leaflet-container.map-view-busy .leaflet-pane {
          pointer-events: none !important;
        }
        
        #mapView .leaflet-map-pane {
          width: 100% !important;
          height: 100% !important;
          margin: 0 !important;
          padding: 0 !important;
        }
        
        #mapView .leaflet-tile-pane {
          width: 100% !important;
          height: 100% !important;
          margin: 0 !important;
          padding: 0 !important;
        }
        
        .print-legend {
          display: block !important;
          position: absolute !important;
          width: auto !important;
          max-width: 5.5cm !important;
          height: auto !important;
          min-height: 0 !important;
          max-height: none !important;
          top: 2.2cm !important;
          right: 0.4cm !important;
          background: rgba(255, 255, 255, 0.95) !important;
          border: 2px solid #000 !important;
          padding: 8px 10px !important;
          border-radius: 0 !important;
          box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3) !important;
          z-index: 1001 !important;
          overflow: visible !important;
          box-sizing: border-box !important;
        }
        #printLegendItems {
          display: flex !important;
          flex-direction: column !important;
          height: auto !important;
          max-height: none !important;
        }
        .print-legend-title {
          font-size: 16px !important;
          font-weight: bold !important;
          margin-bottom: 8px !important;
          text-align: center !important;
          border-bottom: 2px solid #000 !important;
          padding-bottom: 6px !important;
        }
        .print-legend-item {
          margin-bottom: 6px !important;
          display: flex !important;
          align-items: center !important;
        }
        .print-legend-item:last-child {
          margin-bottom: 0 !important;
        }
        .print-legend-label {
          font-size: 14px !important;
          line-height: 1.2 !important;
          margin-left: 10px !important;
        }
        .print-legend-color {
          -webkit-print-color-adjust: exact !important;
          print-color-adjust: exact !important;
        }
        /* Add page footer with company info */
        @page {
          @bottom-center {
            content: "© ProRaum Consult - www.raum.plus";
            font-size: 12px;
            font-weight: bold;
            margin-top: 10px;
          }
        }
        
        /* Page footer using body::after - exactly 2cm height */
        body::after {
          content: "© ProRaum Consult - https://www.pro-raum-consult.com/" !important;
          position: absolute !important;
          bottom: 0 !important;
          left: 0 !important;
          right: 0 !important;
          text-align: center !important;
          font-size: 16px !important;
          font-weight: bold !important;
          color: #000 !important;
          background: rgba(255, 255, 255, 0.9) !important;
          border-top: 2px solid #000 !important;
          padding: 0.5cm 0 !important;
          height: 2cm !important;
          line-height: 1cm !important;
          z-index: 1002 !important;
          box-sizing: border-box !important;
        }
        /* Ensure full printable content (not just the scrolled viewport) */
        #sidebarContentDiv,
        #userProfileDiv,
        #sidebarContentDiv *,
        #userProfileDiv *,
        .printable-content,
        .printable-content * {
          height: auto !important;
          max-height: none !important;
          overflow: visible !important;
          -webkit-print-color-adjust: exact;
          print-color-adjust: exact;
        }
        /* Ensure large content flows across multiple pages */
        #sidebarContentDiv { page-break-after: auto; }
        .section-block, .table, table { page-break-after: auto; }
        /* Friendlier page breaks for long tables/sections */
        table { page-break-inside: auto; break-inside: auto; width: 100% !important; }
        tr, td, th { page-break-inside: avoid; break-inside: avoid; }
        .section-block { page-break-inside: avoid; break-inside: avoid; }
        @page {
          size: A4 landscape;
          margin: 0 !important; /* NO margins - true edge-to-edge printing */
        }
        
        /* Force fit to one page - no scaling needed with zero margins */
        @media print {
          body {
            zoom: 1 !important; /* No scaling - using full page dimensions */
          }
        }
        
        /* Allow content to flow across multiple pages (prevents clipping/cut-off exports). */
        body:not(.map-print-mode) {
          height: auto !important;
          overflow: visible !important;
        }
        body.map-print-mode,
        html:has(body.map-print-mode) {
          height: 21cm !important;
          max-height: 21cm !important;
          overflow: hidden !important;
        }

        /* Keep only key wrappers unsplittable; avoid global * rule that clips long fact-sheet sections. */
        .main-container, .map-container, .print-legend {
          page-break-inside: auto !important;
          break-inside: auto !important;
          page-break-before: auto !important;
          page-break-after: auto !important;
        }

        /* Better pagination defaults for long fact-sheet exports. */
        .factsheet-wrapper,
        .factsheet-main,
        .factsheet-part-section,
        .visualization-item,
        .visualization-content {
          page-break-inside: auto !important;
          break-inside: auto !important;
          overflow: visible !important;
        }
        .visualization-item h1,
        .visualization-item h2,
        .visualization-item h3,
        .visualization-item h4 {
          page-break-after: avoid !important;
          break-after: avoid !important;
        }
        table tr,
        table th,
        table td {
          page-break-inside: avoid !important;
          break-inside: avoid !important;
        }
      }

      /* ----------------------
         EDIT TOOLBAR BUTTONS STYLES
      ---------------------- */
      .edit-toolbar {
        display: flex;
        gap: 0.5rem;
        z-index: var(--z-index-map-toolbar);
        position: relative;
      }
      
      .edit-toolbar-popup {
        z-index: var(--z-index-map-toolbar) !important;
      }
      
      .edit-toolbar-popup .leaflet-popup-content-wrapper {
        z-index: var(--z-index-map-toolbar) !important;
      }
      
      .edit-toolbar-popup .leaflet-popup-tip {
        z-index: var(--z-index-map-toolbar) !important;
      }
      
      .edit-toolbar-popup .leaflet-popup-close-button {
        z-index: var(--z-index-popup) !important;
        position: absolute !important;
        top: 5px !important;
        right: 5px !important;
        width: 20px !important;
        height: 20px !important;
        line-height: 18px !important;
        text-align: center !important;
        font-size: 14px !important;
        font-weight: bold !important;
        background: rgba(255, 255, 255, 0.9) !important;
        border: 1px solid #ccc !important;
        border-radius: 3px !important;
        cursor: pointer !important;
      }
      
      /* Ensure all Leaflet popups are on top */
      .leaflet-popup {
        z-index: var(--z-index-popup) !important;
        position: relative !important;
      }
      
      .leaflet-popup-content-wrapper {
        z-index: var(--z-index-popup) !important;
        position: relative !important;
      }
      
      .leaflet-popup-tip {
        z-index: var(--z-index-popup) !important;
        position: relative !important;
      }
      
      /* Specific toolbar popup styling */
      .edit-toolbar-popup {
        z-index: var(--z-index-map-toolbar) !important;
        position: fixed !important;
        pointer-events: auto !important;
      }
      
      .edit-toolbar-popup .leaflet-popup-content,
      .edit-toolbar-popup .leaflet-popup-content-wrapper,
      .edit-toolbar {
        pointer-events: auto !important;
      }
      
      .edit-toolbar button {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        cursor: pointer;
      }

      /* ----------------------
         Style the Leaflet scale bar
      ---------------------- */
      .leaflet-control-scale-line {
        background: white;
        border: 2px solid #444;
        color: #444;
        font-size: 14px;
        padding: 2px 4px;
        border-radius: 2px;
        line-height: 1.2;
        text-align: center;
      }

      /* ----------------------
         TOOLTIP STYLING FOR lfdnr LABEL
      ---------------------- */
      .leaflet-tooltip.lfdnr-tooltip {
        background: none;
        border: none;
        color: #000000;
        font-size: 1.25rem;
        font-weight: bold;
        text-shadow: 0 0 2px #ffffff;
        pointer-events: none;
      }
      
      /* New style for permanent lfdnr labels */
      .leaflet-tooltip.permanent-lfdnr-tooltip {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        color: #000000;
        font-weight: bold;
        text-shadow: 0 0 4px #ffffff, 0 0 3px #ffffff, 0 0 2px #ffffff, 0 0 5px #ffffff;
        pointer-events: none;
        transition: font-size 0.2s;
        padding: 0;
        text-align: center;
        width: auto;
        white-space: nowrap;
        margin: 0;
        transform: translate(-50%, -50%);
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
      }
      
      /* Generic permanent label styling */
      .leaflet-tooltip.permanent-label {
        font-weight: bold;
      }
      
      /* Override default Leaflet tooltip styles */
      .leaflet-tooltip-top:before,
      .leaflet-tooltip-bottom:before,
      .leaflet-tooltip-left:before,
      .leaflet-tooltip-right:before {
        display: none !important;
      }
      
      /* Additional override to remove any container */
      .leaflet-tooltip-pane .leaflet-tooltip {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
      }
      
      /* ----------------------
         POPUP AND TOOLTIP Z-INDEX FIX
         Use centralized z-index variables for consistency
      ---------------------- */
      .leaflet-popup-pane {
        z-index: var(--z-index-popup) !important;
      }
      
      .leaflet-tooltip-pane {
        z-index: var(--z-index-tooltip) !important;
      }
      
      .leaflet-popup {
        z-index: var(--z-index-popup) !important;
      }
      
      .leaflet-tooltip {
        z-index: var(--z-index-tooltip) !important;
      }
      
      /* === remove that black focus‐ring box around a clicked feature === */
      .leaflet-interactive:focus {
        outline: none !important;
      }
      
      /* === RULER TOOL STYLING === */
      .ruler-marker {
        z-index: var(--z-index-map-tools) !important;
      }
      
      .measurement-result {
        z-index: var(--z-index-map-tools) !important;
        pointer-events: none;
        position: relative !important;
      }
      
      .measurement-result div {
        z-index: var(--z-index-map-tools) !important;
        position: relative !important;
      }
      
      .measurement-result-overlay {
        position: absolute !important;
        z-index: var(--z-index-map-tools) !important;
        pointer-events: none !important;
      }
      
      .measurement-result-overlay div {
        z-index: var(--z-index-map-tools) !important;
        position: relative !important;
      }
      
      .custom-ruler-tool {
        transition: all 0.2s ease;
      }
      
      .custom-ruler-tool:hover {
        transform: scale(1.05);
      }
      
      /* Drawing cursor styles */
      .leaflet-container.drawing-mode {
        cursor: crosshair !important;
      }
      
      .leaflet-container.drawing-mode * {
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
      }
      
      /* === TOOLBAR ALIGNMENT === */
      .custom-zoom-control {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
      }
      
      .custom-zoom-control a {
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
      }



