/* style.css – EINE QUELLE DER WAHRHEIT */

/* Grundlayout */
body, html {
  margin:0; height:100%; overflow:hidden;
  font-family:'Segoe UI',sans-serif;
  background:#000;
}
#map { width:100vw; height:100vh; }

/* DARK MODE – einheitlich */
body.dark, [data-theme="dark"] {
  background:#121212 !important;
  color:#e0e0e0 !important;
}
body.dark #map, body.dark .leaflet-container,
[data-theme="dark"] #map {
  filter:invert(1) hue-rotate(180deg) brightness(0.95);
}
body.dark .modal-content,
[data-theme="dark"] .modal-content {
  background:grey !important;
  border:4px solid #131313 !important;
  color:#eee;
  border-radius:20px
}
body.dark input, body.dark select, body.dark textarea,
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background:#232323 !important;
  color:#fff !important;
  border:1px solid #555 !important;
}
body.dark button,
[data-theme="dark"] button {
  background:#3a3a3a !important;
  color:#fff !important;
  border:1px solid #555 !important;
}
body.dark button:hover { background:#555 !important; }

/* HEADER & FOOTER */
body.dark .header { background:#232323; color:white; padding:20px; font-size:22px; font-weight:bold; position:relative; text-align:left; border-bottom: 2px solid #000; }
body.dark .footer { background:#232323; display:inline-flex; gap:20px; align-items:center; justify-content:center; width:100%; margin:0 auto; border-top: 2px solid #000;}
body.dark .modalbody{ background:grey; display:inline-flex; gap:30%; align-items:center; justify-content:center; width:100%; margin: 20px auto; }

/* dropdownMenu Animation*/
body.dark .user-dropdown {
  position:fixed;
  bottom:120px;
  right:18px;
  background:rgba(0,0,0,0.6);
  padding:10px;
  border-radius:20px;
  border:4px solid #000;
  box-shadow:0 20px 50px rgba(0,0,0,0.8);
  z-index:29000;
  opacity:0;
  transform:translateY(20px);
  visibility:hidden;
  transition:opacity 0.3s ease, transform 0.35s ease;
}
body.dark .user-dropdown.open {
  opacity:1;
  transform:translateY(0);
  visibility:visible;
}
/* Horizontaler Button-Style */
#userDropdown .menu-btn:hover { transform:translateY(-3px);box-shadow:0 8px 25px rgba(0,0,0,0.6); }




/* MODALE – einheitlich */
.modal {
  pointer-events: auto;
  position:fixed; inset:0;
  background:rgba(0,0,0,0.5); z-index:20000;
  justify-content:center; align-items:center; padding:20px;
  box-sizing:border-box;
  width:100vw; height:100vh;
}


.modal-content {
  pointer-events: auto;
  background:grey; border-radius:12px;
  box-shadow:0 20px 60px rgba(0,0,0,0.6);
  width:90%; max-width:900px; max-height:95vh;
  border:4px solid #ffa600; 
  border-radius:20px;
  overflow:hidden;
  display:flex; flex-direction:column;
}

/* ACCORDION */
.accordion-item { background:grey; margin:15px 0; border-radius:12px; overflow:hidden; box-shadow:0 6px 25px rgba(0,0,0,0.1); border:2px solid #ffa600; vertical-align: baseline;}
.accordion-header { padding:20px; background:#232323; color: white; cursor:pointer; user-select:none; transition:background 0.3s;  vertical-align: baseline;}
.accordion-header:hover { background:#373737; }
.accordion-header span { float:right; font-size:24px; color:#ffa600; transition:transform 0.3s; }
.accordion-header.active { border-bottom: 2px solid #ffa600; }
.accordion-header.active span { transform:rotate(180deg); }
.accordion-content { max-height:0; overflow:hidden; transition: max-height 0.3s ease-out;}
.accordion-content.open { max-height: none; padding:20px; }
.accordion-item.open .accordion-content {max-height: none; padding: 15px;}
/* BUTTONS */
.btn-primary { background:#0066cc; color:white; padding:14px 28px; border:none; border-radius:12px; font-weight:bold; cursor:pointer; }
.btn-danger { background:#d32f2f; }
.btn-close { position:absolute; top:15px; right:15px; background:#d32f2f; color:white; width:50px; height:50px; border-radius:50%; font-size:28px; cursor:pointer; }

/* MENU BUTTONS */
.menu-btn {
  width:48px; height:48px; background:#232323; color:white;
  border-radius:50%; box-shadow:0 8px 30px rgba(255,111,0,0.6);margin:10px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  border:3px solid #ffa600; transition:all 0.3s;
}
.menu-btn img {
  display: block;
  margin: 0 auto;
  width: 42px;
  height: 42px;
}
.menu-btn:hover { 
  background: #ffa600;
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 20px 40px rgba(255,166,0,0.4);
  transform:translateY(-4px) scale(1.1); box-shadow:0 12px 30px rgba(0,0,0,0.6); }
.menu-btn:hover img {
  filter: brightness(0) invert(0);  /* orange für Hover */
}


/* TOOLTIP */
.tooltip-top {
  position:absolute; bottom:100%; left:50%; transform:translateX(-50%);
  background:#232323; color:white; padding:8px 14px; border-radius:8px; border: 2px solid #ffa600;
  font-size:14px; white-space:nowrap; opacity:0; visibility:hidden;
  transition:all 0.3s; pointer-events:none; margin-bottom:10px; z-index:30000;
  pointer-events: none;
}
.tooltip-top::after {
  z-index: 30000 !important;
  content:''; position:absolute; top:100%; left:50%; margin-left:-6px;
  border:5px solid #ffa600; border-top-color:#232323;
}

/* Arrow grau + sichtbar */
.tooltip .tooltip-arrow {
  z-index: 30000 !important;
  background-color: #232323;
}

/* Arrow-Inhalt grau */
.tooltip .tooltip-arrow::before {
  z-index: 30000 !important;
  border-color: #ffa600;
  background-color: #232323 !important;  /* grau (Bootstrap secondary) */
}

/* Tooltip-Inhalt dunkel */
.tooltip .tooltip-inner {
  background-color: #232323;  /* dark */
  color: #fff;
}

/* ==================== LEAFLET PANE ORDNUNG (wichtig!) ==================== */
.leaflet-pane {
  z-index: 400 !important;           /* Default zurücksetzen */
}

.leaflet-overlay-pane {              /* Polygone & Wege */
  z-index: 450 !important;
}

.leaflet-marker-pane {
  z-index: 600 !important;
}

.leaflet-tooltip-pane {
  z-index: 650 !important;
}

/* ==================== POPUP – DAS WICHTIGSTE ==================== */
.leaflet-popup-pane {
  z-index: 10000 !important;         /* Sehr hoch! */
}

.leaflet-popup-content-wrapper {
  background-color: #232323 !important;
  color: #ffffff !important;
  border: 3px solid #ffa600 !important;
  border-radius: 8px !important;
  box-shadow: 0 6px 20px rgba(255, 166, 0, 0.4) !important;
}

.leaflet-popup-tip {
  background-color: #232323 !important;
  border: 3px solid #ffa600 !important;
  box-shadow: 0 6px 20px rgba(255, 166, 0, 0.4) !important;
}

.leaflet-popup-content {
  margin: 10px 14px !important;
  font-size: 14.5px !important;
}

/* Close Button schöner */
.leaflet-popup-close-button {
  color: #ffa600 !important;
  font-size: 20px !important;
  top: 2px !important;
  right: 4px !important;
}

.schlag-popup .menu-btn {
  width:48px; height:48px; background:#232323; color:white;
  border-radius:50%; box-shadow:0 8px 30px rgba(255,111,0,0.6);margin:10px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  border:3px solid #ffa600; transition:all 0.3s;
}
.schlag-popup .menu-btn img {
  display: block;
  margin: 0 auto;
  width: 42px;
  height: 42px;
}
.schlag-popup .menu-btn:hover { 
  background: #ffa600;
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 20px 40px rgba(255,166,0,0.4);
  transform:translateY(-4px) scale(1.1); box-shadow:0 12px 30px rgba(0,0,0,0.6); }
.schlag-popup .menu-btn:hover img {
  filter: brightness(0) invert(0);  /* orange für Hover */
}


.menu-btn:hover .tooltip-top { opacity:1; visibility:visible; }

/* HEADER & FOOTER */
.header { background:#232323; color:white; padding:20px; font-size:22px; font-weight:bold; position:relative; text-align:left; border-bottom: 2px solid #ffa600; }
.footer { background:#232323; display:inline-flex; gap:20px; align-items:center; justify-content:center; width:100%; margin:0 auto; border-top: 2px solid #ffa600;}
.modalbody{ background:grey; display:inline-flex; gap:30%; align-items:center; justify-content:center; width:100%; margin: 20px auto; }

.modalbody input {
  width: 80%;                       /* schön breit */
  max-width: 400px;                 /* nicht zu breit auf großen Bildschirmen */
  padding: 16px 20px;
  font-size: 18px;
  border: 2px solid #ffa600;
  border-radius: 12px;
  background: grey;
  color: black;
  text-align: center;              /* Text im Input zentriert */
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  transition: all 0.3s;
}

.modalbody input:focus {
  outline: none;
  border-color: rgba(0, 136, 0, 1);
  transform: translateY(-2px);
}



/* CONTEXT MENU */
#schlagContextMenu::-webkit-scrollbar { display:none; }
@keyframes slideUp { from { transform:translateX(-50%) translateY(100px); opacity:0; } to { transform:translateX(-50%) translateY(0); opacity:1; } }







.user-dropdown {
  position:fixed;
  bottom:120px;
  right:18px;
  background:rgba(0,0,0,0.6);
  padding:10px;
  border-radius:20px;
  border:4px solid #ffa600;
  box-shadow:0 20px 50px rgba(0,0,0,0.8);
  z-index:29000;
  opacity:0;
  transform:translateY(20px);
  visibility:hidden;
  transition:opacity 0.3s ease, transform 0.35s ease;
}

.user-dropdown.open {
  opacity:1;
  transform:translateY(0);
  visibility:visible;
}
/* Horizontaler Button-Style */
#userDropdown .menu-btn:hover { transform:translateY(-3px);box-shadow:0 8px 25px rgba(0,0,0,0.6); }

.personal-settings {
  background:grey;
  border:3px solid #ffa600;
  max-width:500px;
  width:90%;
  height:auto;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding-bottom:20px;
}

.settings-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 20px 20px;
  background: grey;
  flex-wrap: wrap;
}

.admin-menu {
  background:grey;
  border:2px solid #ffa600;
  max-width:500px;
  width:90%;
  height:auto;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding-bottom:20px;
}


.admin-menu.show {
  opacity:1;
  transform:translateY(0);
}

.admin-buttons {
  display:flex;
  gap:10px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top:20px;
}


body.dark .list-item {
  background: grey;                      /* dein grauer Hintergrund */
  border: 2px solid #000;              /* dein goldener Rahmen */
  border-radius: 12px;                    /* abgerundet – passt zum Design */
  padding: 20px;                          /* mehr Luft drin */
  margin: 15px 0;                         /* Abstand zwischen Einträgen */
  box-shadow: 0 8px 25px rgba(0,0,0,0.3); /* leichter Schatten */
  cursor: pointer;                        /* zeigt „klickbar“ */
  transition: all 0.3s ease;              /* Animation beim Hover */
}

.list-item {
  background: grey;                      /* dein grauer Hintergrund */
  border: 2px solid #ffa600;              /* dein goldener Rahmen */
  border-radius: 12px;                    /* abgerundet – passt zum Design */
  padding: 20px;                          /* mehr Luft drin */
  margin: 15px 0;                         /* Abstand zwischen Einträgen */
  box-shadow: 0 8px 25px rgba(0,0,0,0.3); /* leichter Schatten */
  cursor: pointer;                        /* zeigt „klickbar“ */
  transition: all 0.3s ease;              /* Animation beim Hover */
}

.list-item:hover {
  background: #444;                       /* etwas heller beim Hover */
  transform: translateY(-5px);            /* hebt sich leicht */
  box-shadow: 0 15px 40px rgba(255,166,0,0.4); /* goldener Glow */
}

.list-item strong {
  font-size: 20px;
  color: #ffa600;
}

.list-item small {
  color: #ccc;
}

.list-item-btn{
  background:#232323;
  color:white;
  width:100%;
  text-align:left;
  padding:10px;
  margin:5px; 
  border: 2px solid #ffa600; 
  border-radius:10px;
}



#gpsButton:hover {
  background: #ffa600;  /* #ffa600 */
  transform: scale(1.05);
}

#gpsButton.active {
  background: #ffa600;
  box-shadow: 0 4px 16px rgba(255,166,0,0.4);
}

#gpsButton img {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);  /* weiß für dunkle Buttons */
}

#gpsButton:hover img {
  filter: brightness(0) invert(0);  /* orange für Hover */
}


/* In deiner CSS-Datei oder im Modal-Style */
#globalHistorieModal .modal-content {
  height: 95vh !important;        /* fast volle Bildschirmhöhe */
  display: flex;
  flex-direction: column;
}

#globalHistorieModal canvas#historieChart {
  height: 100% !important;        /* Canvas füllt komplett den verfügbaren Platz */
  width: 100% !important;
}

#historieAuswahlFooter.collapsed #schlagAuswahlListe {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#historieAuswahlFooter:not(.collapsed) #schlagAuswahlListe {
  max-height: 300px;
  transition: max-height 0.4s ease;
}

#historieAuswahlFooter.collapsed > div:first-child span:last-child {
  transform: rotate(-90deg);
}


#auswahlTrigger:hover { background:#222; }
#pfeil { transition: transform 0.3s; }
#historieAuswahlFooter.open #pfeil { transform: rotate(180deg); }


/* 1. Footer begrenzt die Höhe – darf nie über den Modal-Footer wachsen */
#historieAuswahlFooter {
  max-height: 70vh;                    /* oder 600px */
  overflow: hidden;                    /* verhindert Überlappen */
  transition: max-height 0.5s ease;
  background: #111;
  border-top: 2px solid #333;
}

/* 2. Inhaltsbereich – immer scrollbar, auch wenn zugeklappt */
#schlagAuswahlListe {
  max-height: 0;
  overflow-y: auto !important;         /* ← IMMER aktiv! */
  transition: max-height 0.5s ease, padding 0.3s ease;
  padding: 0 15px;
  background: #1a1a1a;
  /* Schöne Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #444 #1a1a1a;
}

#schlagAuswahlListe::-webkit-scrollbar {
  width: 8px;
}
#schlagAuswahlListe::-webkit-scrollbar-track {
  background: transparent;
}
#schlagAuswahlListe::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

/* 3. Beim Öffnen: volle Höhe minus Trigger-Höhe */
#historieAuswahlFooter.open #schlagAuswahlListe {
  max-height: calc(70vh - 64px) !important;   /* 64px = Trigger-Höhe (anpassen, falls nötig) */
  padding: 20px 15px !important;
}


#pfeil {
  display: inline-block;
  transition: transform 0.35s ease;
}
#historieAuswahlFooter.open #pfeil {
  transform: rotate(180deg);
}


/* Einheitlich für alle Eingabefelder in Add-Modals */
.add-input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid #ffa600;
  background: #232323;
  color: white;
  box-sizing: border-box;   /* ← wichtig: padding wird in width mitgerechnet */
}

.add-select {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid #ffa600;
  background: #232323;
  color: white;
  box-sizing: border-box;
}


.file-list {
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid #ffa600;
  background: #232323;
  color: white;
  margin-top: 20px;
}

.file-item img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.file-item a {
  color: white;
  text-decoration: none;
}

.file-item a:hover {
  text-decoration: underline;
}

.file-item .file-info {
  display: flex;
  align-items: center;
}

.file-item .delete-btn {
  margin-left: auto; /* schiebt Button nach rechts */
}

.file-item .file-left {
  display: flex;
  align-items: center;
}

.file-item .file-right {
  display: flex;
  align-items: center;
  gap: 10px;  /* Abstand zwischen Datum, User und Mülleimer */
}


.chip {
  display: flex;
  flex-direction: row;  /* ← horizontal */
  align-items: center;  /* vertikal zentriert */
  gap: 8px;             /* Abstand zwischen Name und Button */
  background-color: #232323;
  border: 2px solid #ffa600;
  border-radius: 18px;
  padding: 5px;
  color: white;
  cursor: pointer;
}

.chip .remove-betrieb-btn {
  padding: 0;
  margin: 0;
  flex-shrink: 0;  /* Button behält Größe */
}

.custom-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #232323;
  color: white;
  border: 3px solid #ffa600;
  border-radius: 12px;
  padding: 20px 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 3000;  /* über alles */
  text-align: center;
  font-size: 18px;
  max-width: 400px;
}

.custom-alert button {
  background-color: #ffa600;
  color: #232323;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  margin-top: 15px;
  cursor: pointer;
  font-weight: bold;
}

.custom-alert button:hover {
  background-color: #ffb733;
}

#tourItemsList .list-group-item {
  margin-bottom: 10px;  /* Gap zwischen Items */
  border-radius: 8px;
}

.tour-item {
  background-color: #232323;
  border: 2px solid #ffa600;
  border-radius: 8px;
  padding: 12px 16px;
  color: white;
}

.tour-item-row {
  display: flex;
  align-items: center;          /* vertikal zentriert */
  gap: 12px;                    /* Abstand zwischen Selects und Button */
  margin-bottom: 12px;          /* Abstand zwischen den Zeilen */
  padding: 8px 12px;
  background: #232323;
  border: 1px solid #ffa600;
  border-radius: 8px;
 
}

.tour-item-row .flex-grow-1 {
  flex: 1;                      /* Selects nehmen den Rest der Breite */
}

.tour-item .task-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
}

.tour-item-row .schlag-select {
  flex: 2;                      /* Schlag nimmt mehr Platz */
  min-width: 0;
}

.tour-item-row .task-select {
  flex: 1;
  min-width: 0;
}

.tour-item-row .delete-btn {
  flex-shrink: 0;               /* Button bleibt immer klein */
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-item-row .delete-btn img {
  width: 24px;
  height: 24px;
}


/* 1. Das Select-Feld selbst */
.form-select.bg-dark {
  background-color: #232323 !important;
  color: white !important;
  border: 2px solid #ffa600 !important;
  border-radius: 12px !important;
  padding: 14px !important;
  font-size: 16px !important;
}

/* Pfeil (Caret) anpassen */
.form-select.bg-dark::after {
  border-top-color: #ffa600 !important;  /* Pfeil orange */
}

/* 2. Dropdown-Liste (geöffnet) */
.form-select.bg-dark ~ .dropdown-menu {
  background-color: #232323 !important;
  border: 2px solid #ffa600 !important;
  border-radius: 12px !important;
  color: white !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

/* 3. Einzelne Optionen (dropdown-item) */
.form-select.bg-dark ~ .dropdown-menu .dropdown-item {
  color: white !important;
  background-color: #232323 !important;
}

.form-select.bg-dark ~ .dropdown-menu .dropdown-item:hover,
.form-select.bg-dark ~ .dropdown-menu .dropdown-item:focus {
  background-color: #ffa600 !important;
  color: #232323 !important;
}

/* 4. Focus-Ring entfernen oder anpassen (Bootstrap macht oft blauen Ring) */
.form-select.bg-dark:focus {
  border-color: #ffa600 !important;
  box-shadow: 0 0 0 0.25rem #ffa600 !important;
}


#tourAdminModal .btn-group .btn {
  flex: 1;
}

#tourAdminModal .modal-body {
  max-height: 75vh;
  overflow-y: auto;
  padding: 30px;
}

#tourAdminModal .table th, #tourAdminModal .table td {
  vertical-align: middle;
  text-align: center;
}

#tourAdminModal .table .btn {
  padding: 4px 8px;
  font-size: 14px;
}

.tour-card {
  border: 2px solid #ffa600;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  transition: all 0.2s;
}

.tour-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.tour-title {
  color: white;
  font-size: 1.25rem;
  font-weight: bold;
}

.tour-date {
  color: white;
  font-size: 0.95rem;
  text-align: right;
  white-space: nowrap;
}

.tour-info {
  color: white;
  font-size: 0.95rem;
  line-height: 1.5;
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
}

.tour-card:hover {
  background-color: #373737;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255,166,0,0.2);
}

.tour-info img {
  flex-shrink: 0;
}

/* ============================================
   MOBILE: Phone Optimierungen
   - Accordions und Listen-Objekte (list-item, tour-card) 
     ohne seitliche Margins + ohne runde Ecken
   ============================================ */
@media (max-width: 768px) {
  .accordion-item,
  .list-item,
  .tour-card {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
    width: 100%;
    box-sizing: border-box;
  }

  /* Modals auf Phone kantig und full-width, weniger Ränder */
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  .modal {
    padding: 0 !important;
  }

  /* Accordion-Inhalt auf Phone viel mehr Platz geben + volle Breite */
  .accordion-content.open,
  .accordion-item.open .accordion-content {
    max-height: 65vh !important;
    overflow-y: auto !important;
    padding: 6px 4px !important;
    margin: 0 !important;
  }

  /* Die inneren Container der Tour-Accordions (personal*Touren, vergangeneTouren etc.) */
  .accordion-content > div[id$="Touren"],
  #vergangeneTouren,
  #heutigeTouren,
  #zukuenftigeTouren,
  #personalVergangeneTouren,
  #personalHeutigeTouren,
  #personalZukuenftigeTouren {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
  }

  .tour-card,
  .list-item {
    margin: 4px 0 !important;
    padding: 10px 8px !important;
  }

  /* Weniger Padding in Accordion-Headern */
  .accordion-header {
    padding: 10px 8px;
  }

  /* Allgemein weniger Luft in Modal-Bodys */
  .modal-content > div[style*="padding:20px"],
  .modal-content > div[style*="flex:1"] {
    padding: 6px 4px !important;
  }

  /* Footer-Buttons auf Phone kompakter */
  .modal-content .footer {
    padding: 6px 4px !important;
    gap: 4px !important;
  }

  /* === Tour Admin Accordions: die Accordion-Container selbst bis zum Rand === */
  #tourAdminModal .accordion-container,
  #tourAdminModal .accordion-item,
  #adminTourAccordions,
  #adminTourAccordions .accordion-item {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #tourAdminModal .modal-body,
  #tourAdminModal .accordion-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* tour-cards in tourAdmin-Accordions: Name nicht mehr abschneiden auf Mobile */
  #tourAdminModal .tour-card .tour-header > div:first-child,
  .tour-card .tour-header > div[style*="flex: 1"] {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    font-size: 1.05rem !important;
    line-height: 1.2 !important;
    min-width: 0 !important;
  }

  /* Progress-Bar in Header auf Mobile etwas kleiner machen, damit Name Platz hat */
  #tourAdminModal .tour-card .tour-header > div[style*="flex-shrink: 0"],
  .tour-card .tour-header > div:last-child {
    flex-shrink: 0;
    max-width: 110px;
  }

  /* Tour Detail Modals: Items-Listen bis zum Rand */
  #tourDetailModal .modal-body,
  #adminTourDetailModal .modal-body {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  #tourDetailItemsList,
  #adminTourDetailItemsList {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    overflow-x: hidden !important; /* keine horizontale Scroll-Leiste im List-Element */
  }

  #tourDetailItemsList > *,
  #adminTourDetailItemsList > * {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
    width: 100%;
    box-sizing: border-box;
  }

  /* Speziell für die Schlagliste im adminTourDetailModal:
     Verhindere horizontales Überlaufen der Buttons (up/down + bin) */
  #adminTourDetailItemsList .tour-item-row {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 6px 4px !important;
    align-items: flex-start !important;
  }

  #adminTourDetailItemsList .tour-item-row .flex-grow-1 {
    flex: 1 1 100% !important;
    min-width: 0;
    margin-bottom: 4px;
  }

  #adminTourDetailItemsList .tour-item-row select {
    min-width: 90px;
    flex: 1 1 auto;
  }

  /* Action buttons group - compact and can sit below on narrow screens */
  #adminTourDetailItemsList .tour-item-row .tour-item-actions {
    flex-wrap: wrap;
    gap: 4px !important;
    justify-content: flex-end;
    width: 100%;
    margin-top: 2px;
  }

  #adminTourDetailItemsList .tour-item-row .tour-item-actions .menu-btn {
    width: 26px !important;
    height: 26px !important;
    padding: 2px !important;
    flex-shrink: 0;
  }

  #adminTourDetailItemsList .tour-item-row .tour-item-actions .menu-btn img {
    width: 18px !important;
    height: 18px !important;
  }

  /* === AdminTourDetailModal: Bearbeitungsfelder auf kleinem Telefon === */
  #adminTourDetailModal .modal-body > div[style*="background:#232323"] {
    padding: 10px !important;
    margin-bottom: 12px !important;
  }

  /* Name + Datum: auf Phone untereinander, damit nichts überläuft */
  #adminTourDetailModal div[style*="display: flex; width: 100%;"] {
    flex-direction: column !important;
    gap: 10px !important;
  }

  #adminTourDetailModal div[style*="flex: 1; padding-right: 28px;"] {
    padding-right: 0 !important;
    width: 100% !important;
  }

  #adminTourDetailModal div[style*="width: 235px; flex-shrink: 0;"] {
    width: 100% !important;
    max-width: 160px !important; /* Datum vernünftig klein */
  }

  #adminTourDetailModal #adminTourName,
  #adminTourDetailModal #adminTourDate {
    font-size: 15px !important;
    padding: 10px 12px !important;
  }

  /* Mitbearbeiter: Select + Hinzufügen-Button */
  #adminTourDetailModal div[style*="display:flex; gap:10px;"] {
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center;
  }

  #adminTourDetailModal #adminTourUser {
    flex: 1 1 65% !important;
    min-width: 130px;
    font-size: 14px !important;
    padding: 8px 10px !important;
  }

  #adminTourDetailModal #btnAddUserToTour {
    width: 36px !important;
    height: 36px !important;
    flex-shrink: 0;
    padding: 4px !important;
  }

  #adminTourDetailModal #btnAddUserToTour img {
    width: 20px !important;
    height: 20px !important;
  }

  /* Chips etwas kompakter */
  #adminTourDetailModal #assignedUsersChips {
    gap: 4px !important;
    margin-bottom: 8px !important;
  }
}

.tour-info .d-flex {
  font-size: 0.95rem;
  color: white;
}

#tourItemsList {
  display: block !important;
  min-height: 100px;
}

#tourItemsList .list-group-item {
  margin-bottom: 12px;
  padding: 15px;
  background: #2a2a2a;
  border: 2px solid #ffa600;
  border-radius: 8px;
  color: white;
}