/* Layer Control Styling */
.leaflet-control-layers {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 35px !important;
  height: 35px !important;
  overflow: hidden !important;
  transition: none !important;
}

/* Nur wenn expanded Klasse gesetzt ist, Größe ändern */
.leaflet-control-layers.leaflet-control-layers-expanded {
  width: auto !important;
  height: auto !important;
  padding: 12px !important;
}

/* Verhindere Hover-Expansion - nur per Klick */
.leaflet-control-layers-list {
  display: none !important;
}

.leaflet-control-layers-expanded .leaflet-control-layers-list {
  display: block !important;
}

.leaflet-control-layers-toggle {
  border-radius: 8px;
  backdrop-filter: blur(10px);
  width: 35px !important;
  height: 35px !important;
  min-width: 35px !important;
  min-height: 35px !important;
}

.leaflet-control-layers-expanded {
  padding: 12px;
}

.leaflet-control-layers-list {
  margin: 0;
}

.leaflet-control-layers label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin: 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.leaflet-control-layers input[type="radio"] {
  margin-right: 8px;
  accent-color: #667eea;
}

.leaflet-control-layers label:hover {
  color: #667eea;
}

#kml-files-list .file-group-line { font-size: 0.9em; color: #333; margin-top: 4px; margin-bottom: 8px; }
#kml-files-list .file-group-line.muted { color: #777; }
/* Language Blocker (Vollbild, vor Kartenansicht) */
#language-blocker {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* identischer Hintergrund wie Login */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
#language-blocker-content {
  background: #fff;
  border-radius: 12px; /* wie login-box */
  width: min(420px, 92vw);
  max-height: 80vh;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  padding: 28px;
}
#language-blocker-header {
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}
#language-blocker-body {
  padding-top: 16px;
  overflow: auto;
}
#language-blocker-list button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin: 8px 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
  font-size: 16px;
}
#language-blocker-list button:hover {
  background: #f3f4f6;
}

/* Session Expired Modal */
#session-expired-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
}
#session-expired-modal-content {
  background: #fff;
  border-radius: 12px;
  width: min(420px, 92vw);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  padding: 28px;
  text-align: center;
}
#session-expired-modal-header h2 {
  margin: 0 0 16px 0;
  color: #dc3545;
  font-size: 22px;
}
#session-expired-modal-body p {
  margin: 0 0 24px 0;
  font-size: 16px;
  color: #333;
}
#session-expired-ok-btn {
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(to right, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
}
#session-expired-ok-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#user-info .menu-btn {
  /* Variante 1 übernehmen (siehe Vorschläge): */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 44px;
  padding: 0 16px; /* zurück auf normal */
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color:#fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.35);
  white-space: nowrap; /* kein Zeilenumbruch des Labels */
}

#user-info .menu-btn:hover { filter: brightness(0.97); }

/* Icon entfernt */

#user-info .menu-btn .menu-label {
  display: inline-flex;
  align-items: center;   /* vertikale Zentrierung des Textes */
  line-height: 1;        /* keine Baseline-Verschiebung */
  margin: 0;
}

#menu-modal-content {
  background: #fff;
  width: 94%;
  max-width: 440px;
  max-height: 75vh;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#menu-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

#menu-modal-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

#menu-actions {
  display: grid;
  gap: 12px;
}

#menu-actions button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  background: #fafafa;
  transition: background 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}

#menu-actions button:hover {
  background: #f0f6ff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

#menu-actions button:active {
  transform: translateY(1px);
}

#menu-actions #menu-logout-btn {
  background: #fff1f1;
  border-color: #ffd7d7;
}

#menu-actions #menu-logout-btn:hover {
  background: #ffe3e3;
}

#menu-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  z-index: 10001;
}

#menu-modal-content {
  background: #fff;
  width: 90%;
  max-width: 420px;
  max-height: 75vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#menu-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

#menu-modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

#menu-actions {
  display: grid;
  gap: 10px;
}

#menu-actions button {
  padding: 10px 12px;
}

/* Temp Suggestions Modal – entfernt */

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f4f4;
  /* Mobile Touch-Optimierungen */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

/* Touch-Zonen für bessere mobile Bedienung */
button, .popup-btn, li {
  min-height: 44px; /* Apple empfohlene Touch-Zielgröße */
  min-width: 44px;
}

/* Verbesserung der Button-Touch-Interaktionen */
button:active, .popup-btn:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}
#main-container {
  display: flex;
  height: 90vh;
  margin: 20px;
  position: relative;
}



/* Flächenfortschritt in der Auswertung */
.area-progress {
  background-color: #28a745 !important; /* Grün für Flächen-Progress */
}

.user-area-info {
  color: #666;
  margin-top: 4px;
}

#map {
  flex: 2;
  height: calc(100% - 4px);
  min-width: 400px;
  border: 2px solid #ccc;
  border-radius: 8px;
}
#sidebar {
  flex: 1;
  margin-left: 20px;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  min-width: 260px;
  max-width: 350px;
  max-height: 100%;
  overflow: hidden; /* Ändern von auto zu hidden */
}
#sidebar h2 {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 1.1em;
}

#file-info {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

#file-list {
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fafbfc;
}

.file-item {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9em;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item .file-meta {
  font-size: 0.8em;
  color: #666;
  margin-left: 8px;
}

.file-item .archive-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  margin-left: 8px;
}

.no-files {
  padding: 15px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Alte Map-Controls-Leiste wurde entfernt; Regel bleibt nur als Referenz auskommentiert
.map-controls {
  padding: 10px 0;
  margin-bottom: 5px;
  border-bottom: 1px solid #eee;
}
*/

/* Nach Entfernen der Map-Controls: oberes Spacing im Listenbereich reduzieren */
#list-container {
  margin-top: 0;
  padding-top: 0;
}

/* Hide Completed Toggle Container */
.hide-completed-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}

.hide-completed-label {
  font-size: 0.9em;
  font-weight: 500;
  color: #495057;
  user-select: none;
  cursor: pointer;
}

/* Toggle Switch Styling */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #28a745;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

/* Listenüberschriften ohne oberen Abstand in allen Tab-Panels */
#list-container .list-tab-content h2 {
  margin-top: 0;
}

.map-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  cursor: pointer;
}

/* Controls Row für nebeneinander angeordnete Elemente */
.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle-points-label {
  flex: 0 0 auto;
  margin: 0;
}

/* Header mit Toggle neben der Listenüberschrift */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.list-header h2 {
  margin: 0;
}
.toggle-points-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9em;
  font-weight: normal;
}

/* Standort-Controls - nicht mehr verwendet */
.location-controls {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
}

#locate-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  margin-bottom: 8px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s;
}

#locate-btn:hover:not(:disabled) {
  background: #0056b3;
}

#locate-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
}

.location-icon {
  font-size: 1em;
}

/* Standort-Button im aktiven Zustand - entfernt da nicht mehr benötigt */

#sidebar form {
  margin-bottom: 10px;
}
/* Tab-Buttons für Flächen/Punkte/Linien */
#list-tab-buttons {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #dee2e6;
}
.list-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: #f8f9fa;
  color: #495057;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-right: 1px solid #dee2e6;
}
.list-tab-btn:last-child {
  border-right: none;
}
.list-tab-btn:hover {
  background: #e9ecef;
}
.list-tab-btn.active {
  background: #007bff;
  color: #fff;
}

#list-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#list-container > .list-tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#list-container > .list-tab-content.active {
  display: flex;
}
#point-list, #polygon-list, #line-list {
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0;
  min-height: 0; /* Wichtig damit flex + overflow funktioniert */
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fafbfc;
}
/* Tab-Panel Flex-Ausrichtung */
#list-container .list-tab-content { justify-content: flex-start; }
.panel-header { margin-bottom: 6px; }
#point-list li, #polygon-list li, #line-list li {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  background: #f8f9fa; /* Leichtes Grau */
}
#point-list li:hover, #point-list li.active, #polygon-list li:hover, #polygon-list li.active, #line-list li:hover, #line-list li.active {
  background: #cce5ff;
}

/* Hervorhebung für ausgewählte Marker auf der Karte */
.leaflet-marker-icon.highlighted {
  filter: hue-rotate(0deg) saturate(2) brightness(1.2);
  transform: scale(1.05);
  transition: all 0.3s ease;
  z-index: 1000 !important;
}

/* Animation für Marker-Klicks */
.leaflet-marker-icon.clicked {
  animation: markerBounce 0.6s ease;
}

@keyframes markerBounce {
  0% { transform: translateY(0px) scale(1); }
  25% { transform: translateY(-6px) scale(1.06); }
  50% { transform: translateY(-3px) scale(1.03); }
  100% { transform: translateY(0px) scale(1); }
}

/* Login Interface */
#login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#login-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  min-width: 350px;
  text-align: center;
}

#login-box h1 {
  margin-bottom: 30px;
  color: #333;
  font-size: 1.8em;
}

#login-form div {
  margin-bottom: 20px;
  text-align: left;
}

#login-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

#login-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  box-sizing: border-box;
}

#login-form button {
  width: 100%;
  padding: 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}

#login-form button:hover {
  background: #5a67d8;
}



/* Header */
#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 0;
}

#header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

#header h1 {
  margin: 0;
  color: #333;
  font-size: 1.5em;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: none; /* Standardmäßig ausgeblendet */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.mobile-menu-btn:hover {
  background-color: #f0f0f0;
}

.mobile-menu-btn.active {
  background-color: #007bff;
}

.mobile-menu-btn.active .hamburger-line {
  background-color: white;
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background-color: #333;
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 1px;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

#user-info {
  display: flex;
  align-items: center;
  gap: 10px; /* etwas kleiner, damit Button näher am Namen ist */
}

#user-display {
  font-weight: bold;
  color: #555;
}

#logout-btn, #admin-panel-btn, #kml-panel-btn, #auswertung-panel-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#logout-btn {
  background: #e53e3e;
  color: white;
}

#logout-btn:hover {
  background: #c53030;
}

#admin-panel-btn, #kml-panel-btn, #auswertung-panel-btn {
  background: #3182ce;
  color: white;
}

#admin-panel-btn:hover, #kml-panel-btn:hover, #auswertung-panel-btn:hover {
  background: #2b77c4;
}

/* Admin Panel Modal */
#admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#admin-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Settings Modal (nur für Superadmin) */
#settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#settings-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

#settings-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #1f2937;
}

#settings-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

#settings-modal-close:hover {
  color: #374151;
}

#settings-modal-body {
  padding: 20px;
}

#settings-location-timeout h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: #1f2937;
}

#settings-location-timeout p {
  color: #6b7280;
  margin-bottom: 15px;
}

#settings-location-timeout-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
}

#location-timeout-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 8px;
}

#location-timeout-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#settings-location-timeout-form button[type="submit"],
#settings-location-sharing-form button[type="submit"] {
  background: #667eea;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

#settings-location-timeout-form button[type="submit"]:hover,
#settings-location-sharing-form button[type="submit"]:hover {
  background: #5568d3;
}

#settings-timeout-message,
#settings-sharing-message {
  padding: 10px;
  border-radius: 4px;
  font-size: 0.95rem;
}

#admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

#admin-modal-header h2 {
  margin: 0;
  color: #333;
}

#admin-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
}

#admin-modal-close:hover {
  color: #333;
}

#admin-modal-body {
  padding: 20px;
}

#add-user-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

#add-user-form div {
  margin-bottom: 15px;
}

#add-user-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

#add-user-form input, #add-user-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

#add-user-form button {
  background: #38a169;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#add-user-form button:hover {
  background: #2f855a;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #f9f9f9;
}

.user-details {
  flex: 1;
}

.user-details strong {
  color: #333;
  font-size: 1.1em;
}

.user-role {
  display: inline-block;
  background: #e2e8f0;
  color: #2d3748;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  margin-left: 10px;
}

.user-role.superadmin {
  background: #fed7d7;
  color: #c53030;
}

.user-role.admin {
  background: #bee3f8;
  color: #2b77c4;
}

.user-role.user {
  background: #c6f6d5;
  color: #2f855a;
}

.user-actions {
  display: flex;
  gap: 10px;
}

.user-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.edit-user-btn {
  background: #3182ce;
  color: white;
}

.edit-user-btn:hover {
  background: #2b77c4;
}

.delete-user-btn {
  background: #e53e3e;
  color: white;
}

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

/* KML Management Modal */
#kml-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

/* Gruppenadministration Modal (Superadmin) */
#group-admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#group-admin-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#group-admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

#group-admin-modal-header h2 { margin: 0; color: #333; }

#group-admin-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
}

#group-admin-modal-close:hover { color: #333; }

#group-admin-modal-body { padding: 20px; }

.group-modal-section { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eee; }

#add-group-section { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eee; }
#add-group-form div { margin-bottom: 12px; }
#add-group-form label { display: block; margin-bottom: 6px; font-weight: 600; color: #333; }
#add-group-form input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; box-sizing: border-box; }
#add-group-form button { background: #3182ce; color: #fff; border: none; padding: 10px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; }
#add-group-form button:hover { background: #2b77c4; }

.group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #f9f9f9;
}

.group-details { flex: 1; }
.group-actions { display: flex; gap: 10px; }
.group-actions button { padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; background: #3182ce; color: #fff; }
.group-actions button:hover { background: #2b77c4; }
.group-actions button.danger { background: #e53e3e; }
.group-actions button.danger:hover { background: #c53030; }
.group-actions .group-admin-select { min-width: 220px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }

/* Gruppenverwaltung Modal (Gruppen-Admins) */
#group-manage-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#group-manage-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#group-manage-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

#group-manage-modal-header h2 { margin: 0; color: #333; }

#group-manage-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
}

#group-manage-modal-close:hover { color: #333; }

#group-manage-modal-body { padding: 20px; }

#my-groups-section { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eee; }

#group-members-list .user-item { display: flex; justify-content: flex-start; align-items: center; gap: 10px; padding: 10px; border: 1px solid #eee; border-radius: 6px; margin: 8px 0; background: #fafafa; }

#group-members-section label { display: inline-block; margin: 0 8px 8px 0; font-weight: 600; color: #333; }
#group-members-section .group-members-actions { display:flex; gap:10px; margin-bottom: 10px; }
#group-members-section .group-members-actions button { padding: 8px 14px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; background: #3182ce; color: #fff; }
#group-members-section .group-members-actions button:hover { background: #2b77c4; }
#group-members-section .group-members-actions .danger { background: #e53e3e; }
#group-members-section .group-members-actions .danger:hover { background: #c53030; }


#kml-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#kml-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

#kml-modal-header h2 {
  margin: 0;
  color: #333;
}

#kml-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
}

#kml-modal-close:hover {
  color: #333;
}

#kml-archive-open-btn {
  background: #3182ce;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  margin-left: auto;
}

#kml-archive-open-btn:hover {
  background: #2b77c4;
}

#kml-modal-body {
  padding: 20px;
}
/* KML Archiv Modal */
#kml-archive-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#kml-archive-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#kml-archive-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

#kml-archive-modal-header h2 {
  margin: 0;
}

#kml-archive-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

#kml-archive-modal-close:hover {
  color: #333;
}

#kml-archive-modal-body {
  padding: 16px 20px;
  overflow: auto;
}

#kml-archive-list .file-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

#kml-archive-list .file-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#kml-archive-list .file-header .file-name { flex: 1 1 auto; }
#kml-archive-list .file-header .file-actions { flex: 0 0 auto; margin-left: 8px; }

#kml-archive-list .file-name {
  font-weight: bold;
}

#kml-archive-list .file-meta {
  font-size: 0.85em;
  color: #666;
}

#kml-archive-list .file-actions button {
  background: #3182ce;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
}

#kml-archive-list .file-actions button:hover {
  background: #2b77c4;
}

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
}

.pagination button {
  padding: 6px 10px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.pagination button.active {
  background: #3182ce;
  color: white;
  border-color: #3182ce;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* KML Downloader Modal */
#kml-downloader-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#kml-downloader-modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#kml-downloader-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

#kml-downloader-modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.2em;
}

#kml-downloader-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 0;
  width: 28px;
  height: 28px;
}

#kml-downloader-modal-close:hover {
  color: #333;
}

#kml-downloader-modal-body {
  padding: 16px;
}

#kml-downloader-modal-body > p {
  margin: 0 0 12px 0;
  color: #666;
  font-size: 0.85em;
  line-height: 1.4;
}

#kml-downloader-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kml-download-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kml-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.kml-download-btn:active {
  transform: translateY(0);
}

.kml-download-icon {
  font-size: 1.4em;
}

#kml-download-progress {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}

#kml-download-status {
  margin: 0 0 8px 0;
  font-size: 0.85em;
  color: #333;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

#kml-upload-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

#kml-upload-form div {
  margin-bottom: 15px;
}

#kml-upload-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

#kml-upload-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

#kml-upload-form button {
  background: #3182ce;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#kml-upload-form button:hover {
  background: #2c5282;
}

#kml-files-list .file-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px; border: 1px solid #eee; border-radius: 6px; margin-bottom: 15px; background: #f9f9f9; }
#kml-files-list .file-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; align-self: center; padding-left: 0; }
#kml-files-list .file-stats-right { flex: 0 0 320px; max-width: 40%; }

#kml-files-list .file-header { display: block !important; margin-bottom: 6px; width: 100%; padding-left: 0; }
#kml-files-list .file-header .file-name { display: block; width: 100%; word-break: break-word; padding-left: 0; }
#kml-files-list .file-actions-row { display: flex; gap: 8px; margin-bottom: 10px; width: 100%; justify-content: flex-start; padding-left: 0; }

.file-actions-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

#kml-files-list .file-name { font-weight: bold; color: #333; font-size: 1.1em; display: block; }

.file-stats {
  margin-top: 8px;
}

.stats-row {
  margin-bottom: 6px;
}

.total-features {
  color: #666;
  font-size: 0.9em;
}

/* Neue Styles für Feature-Type-Sections */
.feature-type-section {
  margin: 12px 0;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fafafa;
}

.feature-type-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
}

.feature-type-icon {
  font-size: 1.1em;
}

.feature-type-label {
  flex: 1;
  font-size: 0.95em;
}

.feature-type-count {
  font-size: 0.9em;
  color: #6b7280;
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
}

.feature-type-stats {
  margin-left: 22px;
}

.no-features {
  color: #9ca3af;
  font-style: italic;
  text-align: center;
  padding: 16px;
  font-size: 0.9em;
  font-weight: bold;
}

.status-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85em;
}

.status-open {
  color: #fd7e14;
  font-weight: 500;
}

.status-finished {
  color: #28a745;
  font-weight: 500;
}

.status-unassigned {
  color: #666;
  font-weight: 500;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #28a745, #20c997);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.8em;
  font-weight: bold;
  color: #28a745;
  min-width: 60px;
  text-align: right;
}

#kml-files-list .archive-btn,
#kml-files-list .restore-btn {
  background: #3182ce;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
}

#kml-files-list .archive-btn:hover,
#kml-files-list .restore-btn:hover {
  background: #2b77c4;
}

#kml-files-list .assign-group-btn {
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  margin-left: 0;
}

#kml-files-list .assign-group-btn:hover {
  background: #545b62;
}

#kml-files-list .file-item.archived {
  opacity: 0.8;
}

#kml-files-list .badge-archived {
  display: inline-block;
  margin-left: 8px;
  background: #718096;
  color: white;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 4px;
}

#file-list .archive-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

#kml-files-list .no-files {
  text-align: center;
  color: #666;
  padding: 20px;
  font-style: italic;
}

/* Anpassungen für das neue Layout */
#main-container {
  height: calc(100vh - 80px);
  margin: 0 20px 20px 20px;
}

/* Assignment Modal */
#assignment-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
}

#assignment-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90%;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#assignment-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

#assignment-modal-header h2 {
  margin: 0;
  color: #333;
}

#assignment-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
}

#assignment-modal-close:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.05);
}

#assignment-modal-body {
  padding: 20px;
}

#feature-info-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

#feature-info-display {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  border-left: 4px solid #007bff;
}

#assignment-form div {
  margin-bottom: 15px;
}

#assignment-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

#assignment-form select, #assignment-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

#assignment-form textarea {
  resize: vertical;
  min-height: 80px;
}

#assignment-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

#assignment-form-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#save-assignment-btn, #update-assignment-btn {
  background: #28a745;
  color: white;
}

#save-assignment-btn:hover, #update-assignment-btn:hover {
  background: #218838;
}

#delete-assignment-btn {
  background: #dc3545;
  color: white;
}

#delete-assignment-btn:hover {
  background: #c82333;
}

/* Status-Badges für Features */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
  margin-left: 8px;
}

.status-unfinished {
  background: #ffc107;
  color: #212529;
}

.status-finished {
  background: #28a745;
  color: black;
}

/* Assignment-Informationen in Listen */
.feature-assignment {
  font-size: 0.8em;
  color: #666;
  margin-top: 0;
}

.assignment-user {
  font-weight: bold;
  color: #495057;
}

/* Zuordnungs-Button in Listen */
#assign-feature-btn, #edit-assignment-btn {
  background: #17a2b8;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.8em;
  cursor: pointer;
}

.assign-btn {
  background: #17a2b8;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.75em;
  cursor: pointer;
  margin-left: 8px;
}

.assign-btn:hover {
  background: #138496;
}

/* Erweiterte Listendarstellung */
#point-list li, #polygon-list li {
  padding: 5px 8px 0px 8px;
  position: relative;
}

.feature-title {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 0.95em;
}

.feature-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Feature Details Section */
#feature-details {
  /* Desktop: Abstand zwischen Listen und Details reduzieren, damit Listen mehr Platz haben */
  margin-top: 12px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  flex-shrink: 0;
  max-height: 35vh;
  overflow-y: auto;
  font-size: 0.9em;
}

#feature-details h2 {
  margin-top: 0;
  margin-bottom: 8px;
  color: #333;
  font-size: 1em;
}

#feature-details h3 {
  margin-top: 8px;
  margin-bottom: 5px;
  color: #555;
  font-size: 0.9em;
}

#feature-basic-info {
  background: white;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  border-left: 3px solid #007bff;
  font-size: 0.85em;
  line-height: 1.3;
}

#assignment-details {
  background: white;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 0.85em;
  line-height: 1.3;
}

#assignment-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#status-quick-change {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: white;
  border-radius: 4px;
  flex-wrap: wrap;
  font-size: 0.85em;
}

#status-quick-change label {
  font-weight: bold;
  color: #555;
  font-size: 0.8em;
}

#status-quick-change select {
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.8em;
}

#update-status-btn {
  padding: 3px 8px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8em;
}

#update-status-btn:hover {
  background: #218838;
}

/* Status-basierte Farben für Listen */
.status-unfinished {
  border-left: 4px solid #8b5cf6;
  background: #e5dbff;
}

.status-finished {
  background: #d4edda;
  border-left: 4px solid #28a745;
}

.status-my-assignment {
  border-left: 4px solid #fd7e14;
  background: #ffecb3;
}

/* Überschreibung der normalen Hintergrundfarbe für Status-Features */
#point-list li.status-unfinished, #polygon-list li.status-unfinished, #line-list li.status-unfinished {
  background: #e5dbff;
  border-left: 4px solid #8b5cf6;
}

#point-list li.status-finished, #polygon-list li.status-finished, #line-list li.status-finished {
  background: #d4edda;
  border-left: 4px solid #28a745;
}

#point-list li.status-my-assignment, #polygon-list li.status-my-assignment, #line-list li.status-my-assignment {
  background: #ffecb3;
  border-left: 4px solid #fd7e14;
}

/* Hover-Effekte für Status-Features */
#point-list li.status-unfinished:hover, #polygon-list li.status-unfinished:hover, #line-list li.status-unfinished:hover,
#point-list li.status-unfinished.active, #polygon-list li.status-unfinished.active, #line-list li.status-unfinished.active {
  background: #d4c5ff;
}

#point-list li.status-finished:hover, #polygon-list li.status-finished:hover, #line-list li.status-finished:hover,
#point-list li.status-finished.active, #polygon-list li.status-finished.active, #line-list li.status-finished.active {
  background: #c3e6cb;
}

#point-list li.status-my-assignment:hover, #polygon-list li.status-my-assignment:hover, #line-list li.status-my-assignment:hover,
#point-list li.status-my-assignment.active, #polygon-list li.status-my-assignment.active, #line-list li.status-my-assignment.active {
  background: #ffe099;
}

/* Overlay entfernt - Sidebar soll frei bedienbar sein */

/* Responsive Design - Tablet & Mobile */
@media (max-width: 1024px) {
  #main-container {
    flex-direction: column;
    height: auto;
  }
  
  #map {
    height: 45vh; /* Höhe für Tablet-Ansicht */
    min-width: 100%;
    margin-bottom: 20px;
  }
  
  #sidebar {
    margin-left: 0;
    max-width: 100%;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  #list-container {
    flex: 1;
    min-height: 0;
  }
  
  #point-list, #polygon-list, #line-list {
    min-height: 0;
  }
  
  #feature-details {
    margin-top: 20px;
    max-height: 250px;
  }
}

/* Schmale Desktop-Ansicht: Sidebar ausblenden, Karte vollflächig anzeigen */
@media (max-width: 1100px) and (min-width: 769px) {
  /* Hamburger-Menü einblenden, wenn Sidebar verschwindet */
  .mobile-menu-btn {
    display: flex !important;
  }
  
  #main-container {
    flex-direction: row;               /* wieder nebeneinander statt Spalte */
    height: calc(100vh - 80px);       /* volle verfügbare Höhe nutzen */
  }
  
  /* Sidebar als Overlay anzeigen (wie auf mobil) */
  #sidebar {
    position: fixed;
    top: 60px;
    left: -100%; /* Standardmäßig versteckt */
    width: 85%;
    max-width: 400px;
    bottom: 0;
    margin-left: 0;
    background: white;
    z-index: 10001;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    transition: left 0.3s ease;
    overflow: hidden; /* Kein Sidebar-Scroll, nur Liste scrollt */
    box-sizing: border-box;
    pointer-events: auto;
    display: flex; /* Wichtig: flex aktivieren */
    flex-direction: column;
  }
  
  #sidebar.mobile-open {
    left: 0; /* Sidebar einblenden */
  }
  
  /* Liste-Container Styles für Overlay-Modus */
  #list-container {
    flex-direction: column;
    max-height: none;
    gap: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    min-height: 0;
  }
  
  #list-container > .list-tab-content {
    display: none;
    flex-direction: column;
    min-height: 0;
  }
  #list-container > .list-tab-content.active {
    display: flex;
    flex: 1;
  }
  
  #point-list, #polygon-list, #line-list {
    flex: 1;
    min-height: 0;
  }
  
  #feature-details {
    display: none !important;
  }
  
  #map {
    flex: 1 1 auto;
    min-width: 0;                     /* Schrumpfen ohne Mindestbreite erlauben */
    width: 100%;
    height: 100%;
    margin-bottom: 0;
  }
}

@media (min-width: 0px) {
  /* Mobile Menu Button sichtbar machen */
  .mobile-menu-btn {
    display: flex !important;
  }
  
  #header {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 15px;
    height: 60px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
  }
  
  #user-info {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  #user-display {
    display: none; /* Benutzername auf mobil verstecken für mehr Platz */
  }
  
  /* Icon-Only Buttons für mobile Ansicht */
  #user-info button {
    padding: 0;
    font-size: 0; /* Text verstecken */
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    position: relative;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 5px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #user-info button:hover {
    background: #e9ecef;
    transform: translateY(-1px);
  }
  
  /* Ausnahme: Menü-Button mit Text (nicht icon-only) */
  #user-info .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    min-height: 44px;
    width: auto;
    min-width: 90px;
    padding: 0 16px;
    border-radius: 10px;       /* überschreibt 50%-Kreis */
    font-size: 14px;           /* Text wieder sichtbar */
    line-height: 1;
    white-space: nowrap;       /* kein Umbruch */
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #fff;
    border: none;
  }
  
  /* Icons für die Buttons */
  #logout-btn::before {
    content: "↗";
    font-size: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #495057;
  }
  
  #admin-panel-btn::before {
    content: "👤";
    font-size: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  #kml-panel-btn::before {
    content: "📁";
    font-size: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  #auswertung-panel-btn::before {
    content: "📊";
    font-size: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  #main-container {
    position: fixed;
    top: 60px; /* Direkt unter dem Header */
    left: 0;
    right: 0;
    bottom: 0; /* Bis zum Bildschirmende */
    margin: 0;
    flex-direction: row;
    overflow: hidden;
  }
  
  #map {
    height: 100%;
    width: 100%;
    margin-bottom: 0;
    flex: 1;
    position: relative;
  }
  
  /* Status-Bar über der Karte anpassen */
  #map-status-bar {
    position: absolute;
    top: 10px;
    left: 50px;
    z-index: 1000;
  }
  
  /* Sidebar als Overlay auf mobilen Geräten */
  #sidebar {
    position: fixed;
    top: 60px; /* Unter dem Header */
    left: -100%; /* Standardmäßig versteckt */
    width: 85%;
    max-width: 400px;
    bottom: 0; /* Bis zum Bildschirmende */
    margin-left: 0;
    background: white;
    z-index: 10001; /* Definitiv höher als alles andere */
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    transition: left 0.3s ease;
    overflow: hidden; /* Kein Sidebar-Scroll, nur Liste scrollt */
    box-sizing: border-box;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
  }
  
  #sidebar.mobile-open {
    left: 0; /* Sidebar einblenden */
  }
  
  #list-container {
    flex-direction: column;
    max-height: none;
    gap: 0;
    flex: 1; /* Nutzt den verfügbaren Platz in der Sidebar */
    overflow: hidden; /* Verhindert Überlauf der gesamten Container */
    display: flex; /* Explizit Flexbox aktivieren */
    min-height: 0;
  }
  
  /* Nur das aktive Tab-Panel anzeigen */
  #list-container > .list-tab-content {
    display: none;
    flex-direction: column;
    min-height: 0; /* Wichtig für Flexbox-Kinder */
  }
  #list-container > .list-tab-content.active {
    display: flex;
    flex: 1;
  }
  
  #point-list, #polygon-list, #line-list {
    flex: 1;
    min-height: 0;
  }
  
  #feature-details {
    display: none !important; /* In mobiler Version verstecken */
  }
  
  /* Routenplanungs-Panel mobile Anpassungen */
  #route-confirmation-panel {
    position: fixed !important;
    top: 70px !important; /* Unter dem mobilen Header */
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    z-index: 10002 !important; /* Über Sidebar */
    box-shadow: 0 6px 20px rgba(0,0,0,0.4) !important;
    margin: 0 !important;
    padding: 12px !important;
    font-size: 14px !important;
  }
  
  #route-confirmation-panel h4 {
    font-size: 16px !important;
    margin: 0 0 8px 0 !important;
  }
  
  #route-confirmation-panel p {
    font-size: 13px !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.3 !important;
  }
  
  #route-confirmation-panel select {
    font-size: 13px !important;
    padding: 6px 8px !important;
  }
  
  #route-confirmation-panel button {
    font-size: 13px !important;
    padding: 7px 12px !important;
    min-width: 100px !important;
  }
  

  
  /* KML-Verwaltung mobile Anpassungen */
  .status-stats {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
  
  .progress-container {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  
  .progress-text {
    text-align: left;
    min-width: auto;
  }
  
  #kml-files-list .file-item {
    padding: 12px;
  }
  
  .file-header { display: block !important; }
  
  #kml-files-list .file-name {
    font-size: 1em;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  #header {
    padding: 8px 10px;
    height: 50px;
    box-sizing: border-box;
  }
  
  #header h1 {
    font-size: 1.1em;
  }
  
  #main-container {
    top: 50px; /* Angepasst für kleineren Header */
  }

  #map {
    height: 100%;
    width: 100%;
  }
  
  #sidebar {
    width: 90%; /* Breitere Sidebar auf sehr kleinen Bildschirmen */
    top: 50px;
    bottom: 0; /* Bis zum Bildschirmende */
    padding: 15px;
    overflow: hidden;
  }
  
  #point-list, #polygon-list, #line-list {
    flex: 1;
    min-height: 0;
  }
  
  #feature-details {
    display: none !important; /* In mobiler Version verstecken */
  }
  
  /* Icon-Only Buttons für sehr kleine Bildschirme */
  #user-info button {
    padding: 0;
    font-size: 0; /* Text verstecken */
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    position: relative;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 5px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Icons für die Buttons hinzufügen */
  #logout-btn::before {
    content: "↗";
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
  }
  
  #admin-panel-btn::before {
    content: "👤";
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  #kml-panel-btn::before {
    content: "📁";
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  #auswertung-panel-btn::before {
    content: "📊";
    font-size: 16px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  
  #user-info button:hover {
    background: #e9ecef;
    transform: translateY(-1px);
  }
  
  .popup-btn {
    min-width: 36px;
    height: 36px;
  }
  
  .popup-btn svg {
    width: 16px;
    height: 16px;
  }
  
  /* Auswertung Modal für sehr kleine Bildschirme */
  #auswertung-modal {
    padding-top: 70px; /* Weniger Padding für kleineren Header */
    padding-bottom: 60px; /* Maximaler Platz am unteren Rand */
  }
  
  #auswertung-modal-content {
    max-height: calc(100vh - 170px); /* Maximaler Sicherheitsabstand für kleine Browser */
  }
  
  #auswertung-modal-close {
    width: 48px;
    height: 48px;
    font-size: 32px;
    margin-right: -14px;
  }
  
  #auswertung-modal-header {
    padding: 12px 15px;
  }
  
  #auswertung-modal-body {
    padding: 15px;
    overflow-y: auto;
    max-height: 100%;
  }

/* Info Modal */
#info-modal {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2147483647 !important;
}

#info-modal-content {
  background: #fff;
  width: 92%;
  max-width: 420px;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  position: relative;
  z-index: inherit;
}

#info-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

#info-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

#info-modal-close {
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

#info-modal-body {
  padding: 16px;
  text-align: center;
}

.info-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.info-logo {
  width: 200px !important;
  max-width: 200px !important;
  height: auto;
}

.info-text {
  margin: 6px 0;
  color: #333;
}
  
  /* Routenplanungs-Panel für sehr kleine Bildschirme */
  #route-confirmation-panel {
    top: 60px !important; /* Angepasst für kleineren Header */
    left: 5px !important;
    right: 5px !important;
    padding: 10px !important;
    font-size: 13px !important;
  }
  
  #route-confirmation-panel h4 {
    font-size: 15px !important;
  }
  
  #route-confirmation-panel p {
    font-size: 12px !important;
  }
  
  #route-confirmation-panel select {
    font-size: 12px !important;
    padding: 5px 6px !important;
  }
  
  #route-confirmation-panel button {
    font-size: 12px !important;
    padding: 5px 10px !important;
    min-width: 90px !important;
  }
  
  /* KML-Verwaltung Anpassungen für sehr kleine Bildschirme */
  #kml-files-list .file-item {
    padding: 10px;
    margin-bottom: 12px;
  }
  
  #kml-files-list .file-name {
    font-size: 0.95em;
  }
  
  .total-features {
    font-size: 0.8em;
  }
  
  .status-stats {
    font-size: 0.75em;
    gap: 4px;
  }
  
  .progress-text {
    font-size: 0.7em;
  }
  
  .file-header {
    gap: 6px;
  }
}

/* Auswertung Modal Styles */
#auswertung-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

#auswertung-modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#auswertung-modal-header {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

#auswertung-modal-header h2 {
  margin: 0;
  font-size: 1.4em;
}

#auswertung-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

#auswertung-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#auswertung-modal-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
}

.date-filter-container {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

/* Info Modal Styles (wie Auswertung) */
#info-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

#info-modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#info-modal-header {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

#info-modal-header h2 {
  margin: 0;
  font-size: 1.2em;
}

#info-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  min-width: 44px;
  min-height: 44px;
}

#info-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#info-modal-body {
  padding: 20px;
  overflow-y: auto;
}

.info-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.date-filter-row {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  gap: 15px;
}

.date-filter-row label {
  font-weight: 600;
  color: #495057;
  min-width: 60px;
}

.date-filter-row input[type="date"],
.date-filter-row input.date-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}

/* Flatpickr Confirm-Buttons umbenennen und Löschen ausblenden */
.flatpickr-confirm, .flatpickr-cancel {
  font-size: 14px;
}
.flatpickr-confirm span { display: none; }
.flatpickr-confirm::after { content: " Übernehmen"; }
.flatpickr-cancel::after { content: " Abbrechen"; }
.flatpickr-clear { display: none !important; }

.date-filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.quick-filter-btn {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.quick-filter-btn:hover {
  background: #545b62;
}

/* Patchnotes Modal */
#patchnotes-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

#patchnotes-modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#patchnotes-modal-header {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

#patchnotes-modal-header h2 {
  margin: 0;
  font-size: 1.2em;
}

#patchnotes-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

#patchnotes-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#patchnotes-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1; /* Inneres Scrolling statt außerhalb des Bildschirms */
}

#patchnotes-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px 16px;
  max-height: 60vh; /* Begrenzen, damit Liste nicht zu lang wird */
  overflow: auto;
}

#patchnotes-list {
  margin: 0;
  padding-left: 18px;
  max-height: 50vh; /* Sicherheitsnetz zusätzlich auf Listenelement */
  overflow-y: auto;
}

#patchnotes-list li {
  margin: 6px 0;
  line-height: 1.35;
  white-space: pre-wrap; /* Damit Klartext/Zeilenumbrüche korrekt sind */
}

/* Patchnotes Modal – mobile Optimierung */
@media (max-width: 600px) {
  #patchnotes-modal {
    padding-top: 44px; /* reduzierter Abstand nach oben */
    padding-bottom: 40px; /* etwas weniger Abstand unten */
  }
  #patchnotes-modal-content {
    max-height: calc(100vh - 100px);
  }
}

#auswertung-laden-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.2s;
}

#auswertung-laden-btn:hover {
  background: #218838;
}

#auswertung-results-section {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 2px solid #e9ecef;
}

#auswertung-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.summary-item {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.summary-label {
  display: block;
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 8px;
  font-weight: 500;
}

.summary-value {
  display: block;
  font-size: 28px;
  font-weight: bold;
  color: #495057;
}

#auswertung-details h4,
#auswertung-timeline h4 {
  color: #495057;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e9ecef;
}

.user-stat-item {
  background: white;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.user-stat-summary {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.user-stat-progress .progress-bar {
  background: #e9ecef;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.user-stat-progress .progress-fill {
  background: linear-gradient(90deg, #28a745, #20c997);
  height: 100%;
  transition: width 0.3s ease;
}

.user-stat-progress .line-progress {
  background: linear-gradient(90deg, #0d6efd, #66b2ff);
}

.timeline-item {
  background: white;
  padding: 12px 15px;
  margin-bottom: 8px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.timeline-date {
  font-weight: 500;
  color: #495057;
}

.timeline-count {
  color: #28a745;
  font-weight: 600;
}

.timeline-users {
  color: #6c757d;
  font-size: 0.9em;
  font-style: italic;
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 768px) {
  #auswertung-modal {
    align-items: flex-start;
    padding-top: 80px; /* Platz für Header schaffen */
    padding-bottom: 70px; /* Noch mehr Platz am unteren Rand */
  }
  
  #auswertung-modal-content {
    width: 95%;
    max-height: calc(100vh - 190px); /* Maximaler Sicherheitsabstand für mobile Browser */
  }
  
  #auswertung-modal-header {
    padding: 15px 20px;
  }
  
  #auswertung-modal-header h2 {
    font-size: 1.2em;
  }
  
  #auswertung-modal-close {
    width: 44px;
    height: 44px;
    font-size: 28px;
    margin-right: -10px; /* Kompensiert größere Größe */
  }
  
  #auswertung-modal-body {
    padding: 20px;
    overflow-y: auto; /* Sicherstellen dass Inhalt scrollbar ist */
  }

  /* Timeline mobile Optimierung */
  .timeline-item {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  .timeline-date {
    font-size: 14px;
  }
  
  .timeline-count {
    font-size: 13px;
    line-height: 1.3;
    margin-top: 2px;
    max-height: 100%; /* Nimmt verfügbaren Platz */
  }

  /* Benutzerstatistiken mobile Optimierung */
  .user-stat-summary {
    margin-top: 5px;
  }
  
  .user-stat-line {
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 2px;
  }
  
  .date-filter-actions {
    flex-direction: column;
  }
  
  .quick-filter-btn,
  #auswertung-laden-btn {
    width: 100%;
  }
  
  #auswertung-summary {
    grid-template-columns: 1fr;
  }
}

/* Popup-Button Styles */
.popup-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.popup-btn {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.popup-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  transform: translateY(-1px);
}

.popup-btn-assign-me {
  color: #fd7e14; /* wie eigene Zuordnung (orange) */
  background: #fff3cd; /* leicht gelblich */
  border-color: #ffe69c;
}

.popup-btn-assign-me:hover {
  background: #ffe8a1;
  border-color: #ffda6a;
}

.popup-btn-assign-other {
  color: #8b5cf6; /* lila wie andere Zuordnung */
  background: #ede9fe; /* leichtes Lila */
  border-color: #c4b5fd;
}

.popup-btn-assign-other:hover {
  background: #ddd6fe;
  border-color: #a78bfa;
}

.popup-btn-complete {
  color: #198754;
}

.popup-btn-complete:hover {
  background: #d1e7dd;
  border-color: #198754;
}

.popup-btn-edit-note {
  color: #6c757d;
}

.popup-btn-edit-note:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.popup-btn-route {
  color: #6c757d; /* Grau */
}

.popup-btn-route:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.popup-btn-edit {
  color: #6c757d; /* Grau */
}

.popup-btn-edit:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.popup-btn-release {
  color: #dc3545; /* leichter Rotton */
  background: #f8d7da; /* zartes Rot */
  border-color: #f5c2c7;
}

.popup-btn-release:hover {
  background: #f1b0b7;
  border-color: #ea868f;
}

.popup-btn-reopen {
  color: #dc3545;
}

.popup-btn-reopen:hover {
  background: #f8d7da;
  border-color: #dc3545;
}

.popup-btn-whatsapp {
  color: #25d366; /* WhatsApp-Grün für das Icon */
  /* Gleiche neutrale Optik wie andere Buttons */
}

.popup-btn-whatsapp:hover {
  background: #e9ecef; /* Gleicher Hover-Effekt wie andere */
  border-color: #adb5bd;
}

.popup-btn svg {
  width: 22px;
  height: 22px;
}

/* Panel-Header mit integrierten Sichtbarkeits-Toggles */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px;
  min-height: 36px; /* gleiche Höhe in beiden Spalten */
}
.panel-header h2 { margin: 0; font-size: 18px; }

.status-summary {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-left: auto;
  margin-right: 0;
  white-space: nowrap;
}
.status-count {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.status-count.finished { color: #28a745; }
.status-count.open { color: #fd7e14; }
.status-count.unassigned { color: #adb5bd; }

.toggle-eye {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border-radius: 8px; border: 1px solid #dee2e6;
  background: #f8f9fa; color: #6c757d;
}
.toggle-eye:hover { background: #e9ecef; }
.toggle-eye svg { width: 18px; height: 18px; fill: currentColor; }
.toggle-eye .icon-eye-off { display: none; }
.toggle-eye.is-off .icon-eye { display: none; }
.toggle-eye.is-off .icon-eye-off { display: inline; }

/* Messwerkzeug Control Styles */
.measure-control {
  margin-top: 10px; /* Abstand zum Layer-Control */
}

/* Container des Mess-Controls: undurchsichtig, mit Rundung und Clipping */
.leaflet-control.measure-control {
  background: #ffffff !important;
  border: 2px solid #A6B09E !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}


.measure-control .leaflet-bar,
.measure-control .leaflet-bar a {
  border-radius: 8px !important;
  border-top-left-radius: 8px !important;
  border-top-right-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
  -webkit-border-radius: 8px !important;
  -moz-border-radius: 8px !important;
}

.measure-control-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 35px !important;
  height: 35px !important;
  min-width: 35px !important;
  min-height: 35px !important;
  text-decoration: none;
  color: #4b5563;
  transition: all 0.2s ease;
  background: #ffffff;
  border-radius: 6px !important;
  border: 0px solid #A6B09E;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.measure-control-btn:hover {
  color: #4b5563;
  text-decoration: none;
  background: #ffffff;
}

.measure-control-btn.measure-active {
  background: #007bff !important;
  color: white !important; /* Icon weiß, wenn aktiv */
}

.measure-control-btn.measure-active:hover {
  background: #0056b3 !important;
}

/* Locate-Control: gleiche Optik/Größe wie Measure-Control, links positioniert */
.leaflet-control.locate-control {
  background: #ffffff !important;
  border: 2px solid #A6B09E !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.locate-control-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 35px !important;
  height: 35px !important;
  min-width: 35px !important;
  min-height: 35px !important;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
  background: #ffffff;
  border-radius: 6px !important;
  border: 0px solid #A6B09E;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.locate-control-btn:hover {
  color: #007bff;
  background: #ffffff;
  text-decoration: none;
}

/* Warning-Control: gleiche Optik wie Locate-Control */
.leaflet-control.warning-control {
  background: #ffffff !important;
  border: 2px solid #A6B09E !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.warning-control-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 35px !important;
  height: 35px !important;
  min-width: 35px !important;
  min-height: 35px !important;
  text-decoration: none;
  color: #333;
  transition: all 0.2s ease;
  background: #ffffff;
  border-radius: 6px !important;
  border: 0px solid #A6B09E;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.warning-control-btn:hover {
  color: #ff6b00;
  background: #ffffff;
  text-decoration: none;
}


/* Measure Overlay Styles */
#measure-overlay {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  z-index: 1000;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #d0d0d0;
  padding: 12px 16px;
  min-width: 200px;
}

.measure-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.measure-label {
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.measure-result {
  font-size: 20px;
  font-weight: bold;
  color: #007bff;
}

.measure-instruction {
  font-size: 11px;
  color: #6c757d;
  margin-top: 4px;
}

/* User Selection Modal Styles */
#user-selection-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#user-selection-modal-content {
  background: white;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#user-selection-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #eee;
}

#user-selection-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2em;
}

#user-selection-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
}

#user-selection-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

#user-selection-modal-body {
  padding: 20px;
  overflow-y: auto;
}

#user-selection-info {
  margin-bottom: 20px;
}

#user-selection-info p {
  margin: 0 0 10px 0;
  color: #555;
}

#user-selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-selection-item {
  padding: 12px 16px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-selection-item:hover {
  background: #f8f9fa;
  border-color: #0d6efd;
  transform: translateY(-1px);
}

.user-name {
  font-weight: 600;
  color: #333;
}

.user-role {
  font-size: 0.9em;
  color: #666;
  font-style: italic;
}

/* Note Edit Modal Styles */
#note-edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

/* Rename Modal Styles – ähnliches Design wie Note-Modal */
#rename-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 11000;
}

#rename-modal-content {
  background: white;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#rename-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #eee;
}

#rename-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2em;
}

#rename-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

#rename-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

#rename-modal-body {
  padding: 20px;
  overflow-y: auto;
}

#rename-info { margin-bottom: 16px; color: #555; }

#rename-form { display: flex; flex-direction: column; gap: 12px; }

#rename-form label { font-weight: 600; color: #333; }

#rename-input {
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  box-sizing: border-box;
}

#rename-input:focus {
  outline: none;
  border-color: #6f42c1;
  box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.2);
}

#rename-form .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

#rename-save-btn {
  background: #6f42c1;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
}

#rename-save-btn:hover { background: #5a2d91; }

#rename-cancel-btn {
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
}

#rename-cancel-btn:hover { background: #545b62; }

#note-edit-modal-content {
  background: white;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#note-edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #eee;
}

#note-edit-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2em;
}

#note-edit-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

#note-edit-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

#note-edit-modal-body {
  padding: 20px;
  overflow-y: auto;
}

#note-edit-info {
  margin-bottom: 20px;
}

#note-edit-info p {
  margin: 0 0 10px 0;
  color: #555;
}

#note-edit-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#note-edit-form label {
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
  display: block;
}

#note-edit-textarea {
  width: 100%;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
}

#note-edit-textarea:focus {
  outline: none;
  border-color: #6f42c1;
  box-shadow: 0 0 0 2px rgba(111, 66, 193, 0.2);
}

#note-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

#note-edit-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

#note-edit-actions button[type="submit"] {
  background: #6f42c1;
  color: white;
}

#note-edit-actions button[type="submit"]:hover {
  background: #5a2d91;
}

#note-edit-actions button[type="button"] {
  background: #6c757d;
  color: white;
}

#note-edit-actions button[type="button"]:hover {
  background: #545b62;
} 

/* Change Password Modal */
#change-password-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 11000;
}

/* Edit User Modal */
#edit-user-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 11000;
}

#edit-user-modal-content {
  background: white;
  border-radius: 10px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#edit-user-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

#edit-user-modal-body {
  padding: 16px 20px 20px 20px;
}

#edit-user-form div { margin-bottom: 12px; }
#edit-user-form label { display:block; margin-bottom:6px; font-weight:600; color:#333; }
#edit-user-form input, #edit-user-form select { width:100%; padding:10px; border:1px solid #ddd; border-radius:6px; font-size:14px; box-sizing:border-box; }
#edit-user-form button[type="submit"] { width:100%; padding:10px 14px; background:#3182ce; color:#fff; border:none; border-radius:6px; font-size:14px; cursor:pointer; }
#edit-user-form button[type="submit"]:hover { background:#2b77c4; }

#change-password-modal-content {
  background: white;
  border-radius: 10px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#change-password-modal-header {
  padding: 16px 20px 0 20px;
}

#change-password-modal-body {
  padding: 16px 20px 20px 20px;
}

#change-password-form div {
  margin-bottom: 12px;
}

#change-password-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
}

#change-password-form input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

#change-password-form button[type="submit"] {
  padding: 10px 14px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

#change-password-form button[type="submit"]:hover {
  background: #218838;
}

/* Abbrechen-Button im gleichen Design, aber rot */
#change-password-cancel {
  padding: 10px 14px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

#change-password-cancel:hover {
  background: #c82333;
}

/* Punkte-in-Polygon Modal Stile */
.points-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  padding: 10px;
  margin: 10px 0;
  background: #f8f9fa;
}

.points-list .point-item {
  padding: 5px 10px;
  margin: 2px 0;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 3px;
  font-size: 14px;
}

.points-list .point-item .point-name {
  font-weight: bold;
  color: #495057;
}

.points-list .point-item .point-status {
  color: #6c757d;
  font-size: 12px;
}

/* Modal-Buttons im Menü-Button-Style */
.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.modal-buttons button {
  padding: 12px 20px;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  background: #fafafa;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease, box-shadow 120ms ease;
  min-width: 140px;
}

.modal-buttons button:hover {
  background: #f0f6ff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.modal-buttons button:active {
  transform: translateY(1px);
}

/* Primär-Button (Ja) */
.modal-buttons button.btn-primary {
  background: #e6f3ff;
  border-color: #b3d9ff;
  color: #0066cc;
}

.modal-buttons button.btn-primary:hover {
  background: #cce6ff;
  box-shadow: 0 4px 12px rgba(0,102,204,0.15);
}

/* Sekundär-Button (Nein) */
.modal-buttons button.btn-secondary {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #495057;
}

/* Modal für Punkte in Polygon - verwendet existierende Modal-Stile */
#points-in-polygon-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}

#points-in-polygon-modal-content {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

#points-in-polygon-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

#points-in-polygon-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 18px;
}

#points-in-polygon-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#points-in-polygon-modal-close:hover {
  color: #333;
}

#points-in-polygon-modal-body {
  padding: 20px;
}

/* Feature Selection Modal */
#feature-selection-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

#feature-selection-modal-content {
  background-color: #fff;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#feature-selection-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
}

#feature-selection-modal-header h2 {
  margin: 0;
  font-size: 1.2em;
  color: #333;
}

#feature-selection-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
}

#feature-selection-modal-close:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.05);
}

#feature-selection-modal-body {
  padding: 20px;
}

#feature-selection-modal-body p {
  margin: 0 0 15px 0;
  color: #666;
}

#feature-selection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-selection-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
}

.feature-selection-item:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
}

.feature-selection-item-icon {
  margin-right: 12px;
  font-size: 20px;
  flex-shrink: 0;
}

.feature-selection-item-content {
  flex-grow: 1;
}

.feature-selection-item-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.feature-selection-item-description {
  font-size: 0.9em;
  color: #666;
  line-height: 1.3;
}

.feature-selection-item-type {
  font-size: 0.8em;
  color: #999;
  font-style: italic;
}

/* Leaflet Popup z-index anpassen - über eigenem Position-Marker (z-index 750) anzeigen */
.leaflet-popup-pane {
  z-index: 800 !important;
}

/* Auch für Tooltip-Pane sicherstellen */
.leaflet-tooltip-pane {
  z-index: 800 !important;
}

/* Navigation Info Box */
#navigation-info-box {
  position: fixed;
  top: 80px; /* Unterhalb des Headers */
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 1001; /* Über der Karte, aber unter Modals */
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideInFromTop 0.3s ease-out;
}

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

.nav-info-content {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nav-info-label {
  font-size: 13px;
  opacity: 0.9;
}

.nav-info-distance {
  font-size: 16px;
  font-weight: 700;
  color: #fef3cd;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Route Segment Labels - Marker-basiert */
.route-segment-label-marker {
  background: transparent !important;
  border: none !important;
  pointer-events: none !important;
  z-index: 1500 !important; /* Hoher Z-Index für Vordergrund */
}

.route-segment-label-text {
  background: rgba(34, 197, 94, 0.9) !important;
  border: 1px solid #fff !important;
  border-radius: 8px !important;
  padding: 2px 4px !important;
  font-size: 12px !important;
  font-weight: bold !important;
  color: white !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4) !important;
  white-space: nowrap !important;
  margin: 0 !important;
  pointer-events: none !important;
  user-select: none !important;
  font-family: Arial, sans-serif !important;
  z-index: 1500 !important; /* Hoher Z-Index für Vordergrund */
  position: relative !important;
}


/* Warning Modal Styles */
#warning-modal,
#warning-type-modal,
#warning-icon-modal,
#warning-details-modal,
#warning-list-modal,
#warning-radius-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

#warning-modal-content,
#warning-type-modal-content,
#warning-icon-modal-content,
#warning-details-modal-content,
#warning-list-modal-content,
#warning-radius-modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#warning-list-modal-content {
  max-width: 800px;
}

#warning-radius-modal-content {
  max-width: 400px;
}

#warning-modal-header,
#warning-type-modal-header,
#warning-icon-modal-header,
#warning-details-modal-header,
#warning-list-modal-header,
#warning-radius-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

#warning-modal-header h2,
#warning-type-modal-header h2,
#warning-icon-modal-header h2,
#warning-list-modal-header h2,
#warning-radius-modal-header h2 {
  margin: 0;
  color: #333;
}

#warning-details-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2em;
}

#warning-modal-close,
#warning-type-modal-close,
#warning-icon-modal-close,
#warning-details-modal-close,
#warning-list-modal-close,
#warning-radius-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
}

#warning-modal-close:hover,
#warning-type-modal-close:hover,
#warning-icon-modal-close:hover,
#warning-details-modal-close:hover,
#warning-list-modal-close:hover,
#warning-radius-modal-close:hover {
  color: #333;
}

#warning-modal-body,
#warning-type-modal-body,
#warning-icon-modal-body,
#warning-details-modal-body,
#warning-list-modal-body,
#warning-radius-modal-body {
  padding: 20px;
}

/* Warning Main Menu Buttons */
#warning-main-menu {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.warning-main-menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 18px;
  font-weight: 600;
}

.warning-main-menu-btn:hover {
  background: #e9ecef;
  border-color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Warning Type Selection Buttons */
#warning-type-menu {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.warning-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 25px 20px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.warning-type-btn span {
  font-size: 16px;
  font-weight: 600;
}

.warning-type-btn small {
  font-size: 13px;
  color: #6c757d;
}

.warning-type-btn:hover {
  background: #e9ecef;
  border-color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Warning Icon Selection Grid */
#warning-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
}

.warning-icon-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 8px;
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.warning-icon-option span:last-child {
  font-size: 12px;
  font-weight: 500;
  color: #495057;
}

.warning-icon-option:hover {
  background: #e9ecef;
  border-color: #28a745;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.warning-icon-option:active {
  transform: translateY(0);
}

/* Warning Drawing Confirmation Buttons on Map */
.warning-buttons-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
}

.warning-confirm-btn {
  background: #28a745 !important;
  color: white !important;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
  transition: all 0.2s ease;
}

.warning-confirm-btn:hover {
  background: #218838 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.5);
}

.warning-confirm-btn:active {
  transform: translateY(0);
}

.warning-cancel-btn {
  background: #dc3545 !important;
  color: white !important;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
  transition: all 0.2s ease;
}

.warning-cancel-btn:hover {
  background: #c82333 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(220, 53, 69, 0.5);
}

.warning-cancel-btn:active {
  transform: translateY(0);
}

/* Radius Handle for Circle Drawing */
.warning-radius-handle {
  background: #28a745;
  border: 4px solid white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: grab;
  box-shadow: 0 3px 12px rgba(40, 167, 69, 0.5);
  transition: all 0.2s ease;
}

.warning-radius-handle:hover {
  background: #218838;
  transform: scale(1.3);
  box-shadow: 0 4px 16px rgba(40, 167, 69, 0.7);
  cursor: grabbing;
}

/* Radius Label on Circle Line */
.warning-radius-label {
  background: #28a745;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
  border: 2px solid white;
  text-align: center;
  line-height: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.warning-radius-label:hover {
  background: #218838;
  transform: scale(1.05);
  box-shadow: 0 3px 12px rgba(40, 167, 69, 0.6);
}

#warning-add-section {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

#warning-add-form div {
  margin-bottom: 15px;
}

#warning-add-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

#warning-add-form input, #warning-add-form select, #warning-add-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

#warning-add-form textarea {
  white-space: pre-wrap;
  font-family: inherit;
}

#warning-add-form button {
  background: #ff6b00;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

/* Schraffur-Pattern für Warnflächen */
.warning-hatch-pattern {
  fill: url(#warningHatchPattern);
}

#warning-add-form button:hover {
  background: #e55e00;
}

.warning-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #f9f9f9;
}

.warning-details {
  flex: 1;
}

.warning-icon {
  font-size: 24px;
  margin-right: 10px;
}

.warning-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.warning-description {
  font-size: 0.9em;
  color: #666;
  white-space: pre-line;
  max-height: 3em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.warning-meta {
  font-size: 0.8em;
  color: #999;
  margin-top: 4px;
}

.warning-actions {
  display: flex;
  gap: 10px;
}

.warning-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.edit-warning-btn {
  background: #3182ce;
  color: white;
}

.edit-warning-btn:hover {
  background: #2b77c4;
}

.delete-warning-btn {
  background: #e53e3e;
  color: white;
}

.delete-warning-btn:hover {
  background: #c53030;
}

/* Warning Edit Modal */
#warning-edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
}

#warning-edit-modal-content {
  background: white;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#warning-edit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #eee;
}

#warning-edit-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2em;
}

#warning-edit-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
}

#warning-edit-modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

#warning-edit-modal-body {
  padding: 20px;
  overflow-y: auto;
}

#warning-edit-form div,
#warning-details-form div {
  margin-bottom: 15px;
}

#warning-edit-form label,
#warning-details-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

#warning-edit-form input, #warning-edit-form select, #warning-edit-form textarea,
#warning-details-form input, #warning-details-form select, #warning-details-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

#warning-edit-form textarea,
#warning-details-form textarea {
  white-space: pre-wrap;
  font-family: inherit;
}

#warning-edit-form .modal-actions,
#warning-details-form .modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

#warning-edit-form button[type="submit"],
#warning-details-form button[type="submit"] {
  background: #3182ce;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

#warning-edit-form button[type="submit"]:hover,
#warning-details-form button[type="submit"]:hover {
  background: #2b77c4;
}

#warning-edit-form button[type="button"],
#warning-details-form button[type="button"] {
  background: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

#warning-edit-form button[type="button"]:hover,
#warning-details-form button[type="button"]:hover {
  background: #545b62;
}

#warning-edit-form .delete-btn {
  background: #e53e3e !important;
  color: white !important;
  border: none !important;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

#warning-edit-form .delete-btn:hover {
  background: #c53030 !important;
}

/* Warning Marker Icon */
.warning-marker-icon {
  background: transparent !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.warning-popup {
  max-width: calc(100vw - 220px); /* 110px padding auf jeder Seite */
  min-width: 200px;
}

.warning-popup h3 {
  margin: 0 0 10px 0;
  font-size: 1.1em;
  color: #333;
}

.warning-popup p {
  white-space: pre-wrap;
  margin: 0 0 10px 0;
  color: #666;
}

.warning-popup-buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: nowrap;
}

.warning-popup button {
  background: white;
  color: #6c757d;
  border: 1px solid #dee2e6;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.warning-popup button:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

/* Mobile Anpassungen für Navigation Info Box */
@media (max-width: 768px) {
  #navigation-info-box {
    top: 70px; /* Angepasst für mobilen Header */
    left: 50%;
    transform: translateX(-50%);
    max-width: 280px;
    width: auto;
    text-align: center;
    font-size: 13px;
  }
  
  .nav-info-distance {
    font-size: 15px;
  }
  
  /* Mobile Anpassungen für Warning Items */
  .warning-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .warning-details {
    width: 100%;
    margin-bottom: 10px;
  }
  
  .warning-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  #navigation-info-box {
    top: 60px; /* Angepasst für sehr kleinen Header */
    left: 50%;
    transform: translateX(-50%);
    max-width: 250px;
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .nav-info-label {
    font-size: 12px;
  }
  
  .nav-info-distance {
    font-size: 14px;
  }
  
  /* Zusätzliche mobile Anpassungen für sehr kleine Bildschirme */
  .warning-actions {
    flex-direction: row;
    gap: 8px;
  }
  
  .warning-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
  }
}


/* Bundesländer-Karte Styling */
.bundesland-label {
  background: rgba(44, 62, 80, 0.9) !important;
  border: 2px solid #fff !important;
  border-radius: 4px !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 4px 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  pointer-events: none !important;
}

.bundesland-label::before {
  display: none !important;
}

/* Mobile Feature Panel (für Tablets und Mobile) */
#mobile-feature-panel {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10002;
  max-height: 40vh;
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 0 !important;
  border-top: 1px solid #dee2e6;
}

#mobile-feature-panel.visible {
  display: flex;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

#mobile-feature-panel-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 3px 8px !important;
  background: #f8f9fa !important;
  border-bottom: 1px solid #dee2e6 !important;
  flex-shrink: 0 !important;
  min-height: 26px !important;
  max-height: 26px !important;
}

#mobile-feature-panel-title {
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #2c3e50 !important;
  flex: 1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  line-height: 1.1 !important;
}

#mobile-feature-panel-close {
  background: none !important;
  border: none !important;
  font-size: 22px !important;
  line-height: 1 !important;
  color: #6c757d !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin-left: 4px !important;
  width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

#mobile-feature-panel-close:hover {
  color: #dc3545;
}

#mobile-feature-panel-content {
  padding: 8px 12px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

#mobile-feature-panel-info {
  font-size: 13px;
  line-height: 1.5;
  color: #495057;
}

#mobile-feature-panel-info b {
  font-weight: 600;
  color: #2c3e50;
}

#mobile-feature-panel-info small {
  font-size: 12px;
  color: #6c757d;
}

#mobile-feature-panel-info hr {
  margin: 6px 0;
  border: none;
  border-top: 1px solid #dee2e6;
}

#mobile-feature-panel-buttons {
  padding: 8px 12px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-evenly;
  flex-shrink: 0;
}

#mobile-feature-panel-buttons .popup-btn {
  flex: 0 0 auto;
  min-width: 44px;
  height: 44px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Status Badges im Mobile Panel */
#mobile-feature-panel .status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

#mobile-feature-panel .status-badge.status-finished {
  background-color: #d4edda;
  color: #155724;
}

#mobile-feature-panel .status-badge.status-unfinished {
  background-color: #fff3cd;
  color: #856404;
}

/* Nur auf Tablets und Mobile anzeigen (jetzt überall) */
@media (min-width: 0px) {
  /* Karte ohne Lücke zum Panel */
  #map {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom: none !important;
    margin-bottom: 0 !important;
  }
  
  /* Leaflet Popups auf Mobile/Tablet verstecken */
  .leaflet-popup {
    display: none !important;
  }
  
  .leaflet-popup-pane {
    display: none !important;
  }
}
