* {
  box-sizing: border-box;
}

/* Standard etwas kleiner auf Desktop; auf Apple-Mobilgeräten kein Zoom für natives Gefühl */
html {
  -webkit-text-size-adjust: 100%;
  zoom: min(0.9, 100vw / 1200);
}

/* iPhone / iPad: kein Zoom – Layout ist responsiv, sonst wird alles zu klein */
@media (max-width: 1024px) {
  html {
    zoom: 1;
  }
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #1a1a1a;
  color: #e8e8e8;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header + Logo + Tabs – fixiert */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin-left: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  padding: 0.5rem 0.85rem;
  padding-left: max(0.85rem, env(safe-area-inset-left) + 0.5rem);
  padding-right: max(0.85rem, env(safe-area-inset-right) + 0.5rem);
  margin: 6px 20px 0;
  margin-left: max(20px, env(safe-area-inset-left));
  margin-right: max(20px, env(safe-area-inset-right));
  margin-top: max(6px, env(safe-area-inset-top));
  background: #242424;
  border: 1px solid #3a3a3a;
  border-radius: 48px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.logo-wrap {
  flex-shrink: 0;
}

.logo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.logo-btn:hover {
  opacity: 0.9;
}

.logo-btn:active {
  transform: scale(0.98);
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Logo-Dashboard Overlay – 7 Container nebeneinander */
.logo-dashboard {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.logo-dashboard[aria-hidden="false"] {
  pointer-events: auto;
  opacity: 1;
}

.logo-dashboard-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}

.logo-dashboard-inner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  background: #242424;
  border: 1px solid #3a3a3a;
  border-radius: 32px;
  padding: 1.5rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.logo-dashboard-title {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #e8e8e8;
  text-align: center;
}

.logo-dashboard-cards {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
  flex-wrap: nowrap;
}

.logo-dashboard-card {
  flex: 1;
  min-width: 0;
  min-height: 80px;
  padding: 1rem 0.5rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 20px;
  color: #e8e8e8;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.logo-dashboard-card:hover {
  background: #333;
  border-color: #2d7d46;
  transform: translateY(-2px);
}

.logo-dashboard-card:active {
  transform: translateY(0);
}

.logo-dashboard-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #404040;
  border-radius: 50%;
  color: #b8b8b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.logo-dashboard-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #e8e8e8;
}

@media (max-width: 900px) {
  .logo-dashboard-cards {
    flex-wrap: wrap;
  }
  .logo-dashboard-card {
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: 80px;
  }
}

@media (max-width: 520px) {
  .logo-dashboard-card {
    flex: 1 1 100%;
  }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

/* iPhone: Tabs horizontal scrollbar statt umbrechen – bessere UX */
@media (max-width: 667px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
    margin: 0 -4px;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab {
    flex-shrink: 0;
  }
}

.tab {
  padding: 0.6rem 0.9rem;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #b8b8b8;
  border-radius: 20px;
  font-weight: 500;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit;
}

.tab-icon svg {
  display: block;
  vertical-align: middle;
}

.tab-label {
  white-space: nowrap;
}

/* Reiter-Namen einklappbar */
.tab-labels-collapsed .tab-label {
  display: none;
}

.tab-labels-collapsed .tab {
  padding: 0.5rem 0.6rem;
}

.btn-toggle-tab-labels {
  padding: 0.4rem;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #4a4a4a;
  border-radius: 10px;
  color: #b8b8b8;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.btn-toggle-tab-labels:hover {
  background: #333;
  color: #e8e8e8;
}

.tab-labels-collapsed .btn-toggle-tab-labels-icon {
  transform: rotate(180deg);
}

.btn-toggle-tab-labels-icon {
  display: inline-flex;
  transition: transform 0.2s ease;
}

.tab:hover {
  background: #333;
  color: #e8e8e8;
}

.tab.active {
  background: #2d7d46;
  color: #fff;
  font-weight: 600;
}

.dashboard-day-toggles {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.dashboard-day-btn {
  padding: 0.35rem 0.45rem;
  min-height: 44px;
  min-width: 44px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #b8b8b8;
  background: transparent;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-day-btn:hover {
  background: #333;
  color: #e8e8e8;
}

.dashboard-day-btn.active {
  background: #2d7d46;
  color: #fff;
  border-color: #2d7d46;
}

.dashboard-day-btn {
  position: relative;
}

.dashboard-day-btn.has-termine::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: #e74c3c;
  border-radius: 50%;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-toggle-names {
  padding: 0.4rem;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #4a4a4a;
  border-radius: 10px;
  color: #b8b8b8;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-toggle-names:hover {
  background: #333;
  color: #e8e8e8;
}

.btn-toggle-names.names-hidden .btn-toggle-names-icon {
  transform: rotate(180deg);
}

.btn-toggle-names-icon {
  display: inline-flex;
  transition: transform 0.2s ease;
}

.btn-toggle-names-icon svg {
  display: block;
}

.user-email {
  font-size: 1rem;
  color: #b8b8b8;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  padding: 0.5rem 1rem;
  min-height: 44px;
  background: transparent;
  border: 1px solid #4a4a4a;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  color: #b8b8b8;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-logout:hover {
  background: #333;
  color: #e8e8e8;
}
.btn-admin-users {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  min-height: 36px;
  background: transparent;
  border: 1px solid #7c3aed44;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  color: #a78bfa;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-admin-users:hover {
  background: #7c3aed22;
  color: #c4b5fd;
}

/* Main – immer unter dem Header, nur Inhalt scrollt */
.main {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(3.5rem + 40px + env(safe-area-inset-top));
  padding-right: max(12px, env(safe-area-inset-right) + 8px);
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left) + 8px);
  margin: 0 12px;
  margin-left: max(12px, env(safe-area-inset-left));
  margin-right: max(12px, env(safe-area-inset-right));
  max-width: none;
  min-height: 0;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.container-haupt {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Kalender-Grid: immer 7 Tage, passt sich der Breite an */
.dashboard-calendar-section {
  width: 100%;
  max-width: 100%;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.dashboard-calendar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

/* KW-Auswahl im Dashboard-Header: kein Abstand nach unten */
.header-dashboard .dashboard-calendar-header {
  margin-bottom: 0;
}

.dashboard-calendar-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #e8e8e8;
  min-width: 140px;
  text-align: center;
}

.dashboard-calendar-nav {
  padding: 0.5rem 0.85rem;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.2rem;
  color: #b8b8b8;
  background: #2a2a2a;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-calendar-nav:hover {
  background: #333;
  color: #e8e8e8;
}

.dashboard-calendar-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  width: 100%;
  min-width: min(100%, 560px);
  box-sizing: border-box;
}

.dashboard-calendar-day {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 200px;
  min-width: 0;
  padding: 0.75rem 0.5rem;
  background: #242424;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
}

.dashboard-calendar-dayname {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d7d46;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.dashboard-calendar-date {
  display: block;
  font-size: 0.9rem;
  color: #b8b8b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.dashboard-calendar-day.dashboard-calendar-day-today {
  border-color: #2d7d46;
  background: rgba(45, 125, 70, 0.12);
  box-shadow: 0 0 0 2px rgba(45, 125, 70, 0.3);
}

.dashboard-calendar-day.dashboard-calendar-day-today .dashboard-calendar-dayname,
.dashboard-calendar-day.dashboard-calendar-day-today .dashboard-calendar-date {
  color: #e8e8e8;
}

.dashboard-calendar-day.dashboard-calendar-day-drag-over {
  background: rgba(13, 148, 136, 0.15);
  border-radius: 12px;
  outline: 2px dashed rgba(13, 148, 136, 0.5);
}

.dashboard-calendar-day.dashboard-calendar-day-hidden {
  display: none;
}

.dashboard-calendar-day-cards {
  width: 100%;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 600px;
  min-height: 2rem;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dashboard-calendar-day-cards::-webkit-scrollbar {
  display: none;
}

.dashboard-calendar-card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  border: 1px solid #3a3a3a;
  background: #1e1e1e;
  flex-shrink: 0;
  cursor: grab;
}
.dashboard-calendar-card:active {
  cursor: grabbing;
}
.dashboard-calendar-card.dashboard-card-dragging {
  opacity: 0.6;
  cursor: grabbing;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.dashboard-calendar-card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dashboard-calendar-card-beginn .dashboard-calendar-card-badge {
  color: #2d7d46;
}

.dashboard-calendar-card-fertig .dashboard-calendar-card-badge {
  color: #0d9488;
}

.dashboard-card-dates {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.dashboard-card-date-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.dashboard-card-date-erstbegehung {
  color: #1c1917;
  background: #eab308;
  border-color: #ca8a04;
}

.dashboard-card-date-fertigstellung {
  color: #fff;
  background: #2563eb;
  border-color: #1d4ed8;
}

.dashboard-card-date-geplant {
  color: #fff;
  background: #dc2626;
  border-color: #b91c1c;
  font-size: 0.6rem;
  padding: 0.12rem 0.3rem;
}

.dashboard-card-date-label {
  font-weight: 500;
  opacity: 0.95;
}

.dashboard-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.dashboard-card-date-btn .dashboard-card-icon {
  flex-shrink: 0;
}

/* Erstbegehung-Dialog */
.erstbegehung-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.erstbegehung-modal[hidden] {
  display: none;
}
.erstbegehung-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.erstbegehung-modal-box {
  position: relative;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 16px;
  padding: 1.5rem;
  min-width: 260px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.erstbegehung-modal-title {
  margin: 0 0 1.25rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e8e8e8;
}
.erstbegehung-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}
.erstbegehung-modal-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.erstbegehung-modal-ja {
  background: #0d9488;
  color: #fff;
  border-color: #14b8a6;
}
.erstbegehung-modal-ja:hover {
  background: #0f766e;
}
/* Date-Edit Modal Input */
.date-edit-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #555;
  background: #1e1e1e;
  color: #e8e8e8;
  margin-bottom: 1rem;
  box-sizing: border-box;
}
.date-edit-input:focus {
  outline: none;
  border-color: #0d9488;
}
.date-edit-save {
  background: #2d7d46;
  color: #fff;
  border-color: #3a9956;
}
.date-edit-save:hover {
  background: #246838;
}
.date-edit-cancel {
  background: #404040;
  color: #e8e8e8;
  border-color: #555;
}
.date-edit-cancel:hover {
  background: #505050;
}

.erstbegehung-modal-nein {
  background: #404040;
  color: #e8e8e8;
  border-color: #555;
}
.erstbegehung-modal-nein:hover {
  background: #505050;
}

.dashboard-card-addr-lage {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.dashboard-card-addr-btn {
  display: inline-block;
  padding: 0.2rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #e8e8e8;
  background: #404040;
  border: 1px solid #555;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.dashboard-card-addr-line {
  display: inline;
}

.dashboard-card-addr-btn:hover {
  background: #505050;
}

.dashboard-calendar-card-addr {
  font-weight: 600;
  color: #e8e8e8;
}

.dashboard-calendar-card-ort {
  color: #999;
  font-size: 0.7rem;
}

.dashboard-card-lage-btn {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  font-size: 0.7rem;
  color: #e8e8e8;
  background: #404040;
  border: 1px solid #555;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.dashboard-card-lage-btn:hover {
  background: #505050;
}

.dashboard-calendar-card-lage {
  display: block;
  color: #888;
  font-size: 0.7rem;
  margin-top: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.dashboard-calendar-card-nummer-btn {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: #0d9488;
  border: 1px solid #14b8a6;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.dashboard-calendar-card-nummer-btn:hover {
  background: #0f766e;
  transform: scale(1.05);
}

.dashboard-calendar-card-nummer-btn:active {
  transform: scale(0.98);
}

.dashboard-card-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.25rem;
  align-items: center;
}

.dashboard-card-actions .dashboard-calendar-card-nummer-btn {
  margin-top: 0;
}

.dashboard-card-notiz-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #93c5fd;
  background: #2a2a2a;
  border: 1px solid #555;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.dashboard-card-notiz-btn:hover {
  background: #353535;
  border-color: #93c5fd;
  color: #bfdbfe;
}

.dashboard-card-notiz-btn:active {
  opacity: 0.9;
}

.dashboard-card-begehung-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  color: #5eead4;
  background: #2a2a2a;
  border: 1px solid #555;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.dashboard-card-begehung-btn:hover {
  background: #353535;
  border-color: #0d9488;
  color: #99f6e4;
}
.dashboard-card-begehung-btn.dashboard-card-begehung-done {
  background: #0d9488;
  border-color: #14b8a6;
  color: #fff;
}

/* Erledigt-Button */
.dashboard-card-done-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #4a4a4a;
  background: transparent;
  color: #666;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.dashboard-card-done-btn:hover {
  border-color: #2d7d46;
  color: #2d7d46;
  background: rgba(45, 125, 70, 0.1);
}
.dashboard-card-done-btn.dashboard-card-done-active {
  border-color: #2d7d46;
  background: #2d7d46;
  color: #fff;
}
/* Erledigte Karte: grüner Hintergrund */
.dashboard-calendar-card.dashboard-card-done {
  background: rgba(45, 125, 70, 0.15);
  border-color: rgba(45, 125, 70, 0.4);
}
/* Projekt-abgeschlossen Button (Zielflagge) */
.dashboard-card-finish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #4a4a4a;
  background: transparent;
  color: #666;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.dashboard-card-finish-btn:hover {
  border-color: #0d9488;
  color: #0d9488;
  background: rgba(13, 148, 136, 0.1);
}
.dashboard-card-finish-btn.dashboard-card-finish-active {
  border-color: #0d9488;
  background: #0d9488;
  color: #fff;
}
/* Abgeschlossene Karte: kräftiger grüner Hintergrund */
.dashboard-calendar-card.dashboard-card-finished {
  background: rgba(13, 148, 136, 0.2);
  border-color: rgba(13, 148, 136, 0.5);
}

/* Trennlinie "Erledigte Aufgaben" */
.dashboard-done-separator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.7rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dashboard-done-separator::before,
.dashboard-done-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #3a3a3a;
}

.dashboard-card-notiz-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.dashboard-card-notiz-container.open {
  max-height: 360px;
  margin-top: 0.3rem;
  overflow-y: auto;
}

.dashboard-notiz-previous-wrap {
  margin-bottom: 0.5rem;
}

.dashboard-notiz-previous-toggle {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: #93c5fd;
  background: #252525;
  border: 1px solid #444;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}

.dashboard-notiz-previous-toggle:hover {
  background: #2a2a2a;
  border-color: #555;
}

.dashboard-notiz-previous-list {
  margin-top: 0.35rem;
  padding-left: 0.25rem;
  border-left: 2px solid #444;
  max-height: 140px;
  overflow-y: auto;
}

.dashboard-notiz-previous-item {
  padding: 0.3rem 0;
  font-size: 0.7rem;
  border-bottom: 1px solid #333;
}

.dashboard-notiz-previous-item:last-child {
  border-bottom: none;
}

.dashboard-notiz-previous-date {
  display: block;
  color: #888;
  margin-bottom: 0.1rem;
}

.dashboard-notiz-previous-text {
  color: #e8e8e8;
  white-space: pre-wrap;
  word-break: break-word;
}

.dashboard-card-notiz-input {
  width: 100%;
  min-height: 50px;
  max-height: 100px;
  padding: 0.3rem;
  font-size: 0.7rem;
  font-family: inherit;
  color: #e8e8e8;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 6px;
  resize: vertical;
  box-sizing: border-box;
}

.dashboard-card-notiz-input:focus {
  outline: none;
  border-color: #818cf8;
}

.dashboard-card-notiz-save {
  display: block;
  margin-top: 0.35rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: #16a34a;
  border: 1px solid #15803d;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dashboard-card-notiz-save:hover {
  background: #15803d;
}

.dashboard-calendar-card-addr,
.dashboard-calendar-card-ort {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

@media (max-width: 700px) {
  .dashboard-calendar-grid {
    gap: 0.4rem;
  }
  .dashboard-calendar-day {
    min-height: 140px;
    padding: 0.5rem 0.25rem;
  }
  .dashboard-calendar-day-cards {
    max-height: 400px;
  }
  .dashboard-calendar-dayname {
    font-size: 0.7rem;
  }
  .dashboard-calendar-date {
    font-size: 0.75rem;
  }
}

.dashboard-term-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

.dashboard-term-section .container-titel {
  margin-bottom: 0.5rem;
}

.dashboard-term-info {
  font-size: 0.9rem;
  color: #999;
  margin: 0 0 0.5rem 0;
}

.dashboard-main .dashboard-containers {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  width: 100%;
}

.dashboard-main .dashboard-box {
  flex: 1 1 0;
  min-width: 0;
  min-height: 200px;
}

.dashboard-main .dashboard-box.dashboard-box-hidden {
  display: none;
}

.dashboard-box-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #e8e8e8;
}

@media (max-width: 900px) {
  .dashboard-main .dashboard-containers {
    flex-wrap: wrap;
  }
  .dashboard-main .dashboard-box {
    flex: 1 1 calc(33.333% - 0.5rem);
    min-width: 120px;
  }
}

@media (max-width: 520px) {
  .dashboard-main .dashboard-box {
    flex: 1 1 100%;
  }
}

.container-inner {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #242424;
  border-radius: 40px;
  border: 1px solid #3a3a3a;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Tab-Content: nur aktiven anzeigen */
.container-inner.tab-content {
  display: none;
  flex: 1 1 100%;
}

.container-inner.tab-content.active {
  display: block;
  margin-bottom: 20px;
}

#content-teamleiterplus.active,
#content-plusfertigmeldung.active {
  height: 800px;
  overflow: auto;
}
#content-pluskalender.active {
  height: calc(100vh - 80px);
  max-height: calc(100vh - 80px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.container-titel {
  margin: 0 0 0.4rem 0;
  font-size: 1.1rem;
  color: #e8e8e8;
}
#content-pluskalender .container-titel {
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.leo-checklist-reiter {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #2d7d46;
  border-radius: 20px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leo-list-current-title {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  color: #e8e8e8;
}

.leo-list-current-title #leoListCurrentName {
  font-weight: 600;
  color: #b8b8b8;
}

.leo-checklist-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.leo-checklist-content {
  padding: 0;
}

/* Innerer Container mit Überschrift im großen Container */
.plusleoliste-inner {
  width: 100%;
  margin-bottom: 0.75rem;
}

.plusleoliste-inner-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.plusleoliste-box {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 24px;
  box-sizing: border-box;
}

.plusleoliste-box-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #e8e8e8;
}

.plusleoliste-content {
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Ausklappbarer Header-Button */
.leo-checklist-header {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #333;
}

.leo-checklist-container .db-desc {
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: #e8e8e8;
  max-width: 100%;
}

.leo-checklist-container .db-table-wrap {
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 380px);
  min-height: 400px;
}

.leo-checklist-container .db-table-scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.leo-checklist-container .db-table-scroll::-webkit-scrollbar {
  display: none;
}

/* Login-Seite – Safe Areas für iPhone Notch und Home-Indikator */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  background: #242424;
  border-radius: 32px;
  border: 1px solid #3a3a3a;
  padding: 2rem;
  padding-left: max(2rem, 1rem + env(safe-area-inset-left));
  padding-right: max(2rem, 1rem + env(safe-area-inset-right));
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo img {
  max-width: 240px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.login-form h1 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  color: #333;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
  color: #e8e8e8;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  min-height: 44px;
  border: 1px solid #4a4a4a;
  border-radius: 20px;
  font-size: 16px; /* verhindert Zoom auf iOS */
  background: #2a2a2a;
  color: #e8e8e8;
}

.form-group input:focus {
  outline: none;
  border-color: #2d7d46;
}

.form-error {
  color: #c00;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.btn-primary {
  width: 100%;
  padding: 0.75rem 1rem;
  min-height: 44px;
  background: #2d7d46;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  background: #358a51;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary,
.tab,
.btn-logout {
  touch-action: manipulation;
}

/* plusdatenbank+ */
#content-plusdatenbank {
  max-width: 100%;
  padding: 1.5rem;
}

.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.sub-tab {
  padding: 0.5rem 1rem;
  min-height: 44px;
  min-width: 44px;
  font-size: 1rem;
  background: #333;
  border: 1px solid #4a4a4a;
  border-radius: 20px;
  cursor: pointer;
  color: #b8b8b8;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sub-tab:hover {
  background: #3d3d3d;
  color: #e8e8e8;
}

.sub-tab.active {
  background: #2d7d46;
  color: #fff;
  border-color: #2d7d46;
}

.sub-tab-content {
  display: none;
}

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

.db-desc {
  color: #b8b8b8;
  margin-bottom: 1rem;
  font-size: 1rem;
  max-width: 60ch;
}

.db-desc code {
  font-size: 0.95em;
  background: #333;
  color: #e8e8e8;
  padding: 0.1em 0.4em;
  border-radius: 28px;
}

.db-upload {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #2a2a2a;
  border-radius: 20px;
  border: 1px solid #404040;
}

.db-upload .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.db-upload label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  flex: 1;
  min-width: 200px;
}

.db-upload input[type="file"] {
  font-size: 0.9rem;
  max-width: 100%;
}

.db-upload .btn-primary {
  width: auto;
  min-width: 140px;
  padding: 0.6rem 1.5rem;
  min-height: 44px;
}

.merge-status {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.merge-status.success {
  color: #0a0;
}

.merge-status.error {
  color: #c00;
}

.db-actions {
  margin-bottom: 1rem;
}

.db-actions .btn-clear-db {
  margin-right: 0.5rem;
}

.leo-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
}

.leo-list-actions .btn-primary,
.leo-list-actions .btn-secondary {
  width: auto;
  min-width: 140px;
}

.leo-list-save-status {
  font-size: 0.95rem;
  margin-left: 0.25rem;
}

.leo-list-save-status.success {
  color: #0a0;
}

.leo-list-save-status.error {
  color: #c00;
}

.leo-list-saved-load {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.75rem;
}

.leo-list-saved-load label {
  font-size: 1rem;
  color: #e8e8e8;
}

.leo-list-saved-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #4a4a4a;
  border-radius: 32px;
  font-size: 1rem;
  min-width: 160px;
  background: #2a2a2a;
  color: #e8e8e8;
}

.leo-list-col-toggle {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 32px;
}

.leo-list-col-toggle-label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: #e8e8e8;
  margin-bottom: 0.5rem;
}

.leo-list-col-toggle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.leo-list-col-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
}

.leo-list-col-check input {
  margin: 0;
}

.leo-list-col-check-all {
  font-weight: 600;
  color: #fff;
  padding-right: 0.5rem;
  border-right: 1px solid rgba(255,255,255,0.3);
  margin-right: 0.25rem;
}

.leo-list-order-wrap {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 32px;
}

.leo-list-order-label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: #e8e8e8;
  margin-bottom: 0.5rem;
}

.leo-list-order-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.leo-list-order-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.35rem;
  background: #404040;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #fff;
}

.leo-list-order-name {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leo-list-order-btns {
  display: inline-flex;
  gap: 0.1rem;
}

.btn-order {
  padding: 0.1rem 0.3rem;
  font-size: 0.75rem;
  line-height: 1.2;
  border: none;
  border-radius: 6px;
  background: #555;
  color: #fff;
  cursor: pointer;
}

.btn-order:hover:not(:disabled) {
  background: #666;
}

.btn-order:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.leo-list-badges-cell {
  vertical-align: top;
  width: 1%;
  white-space: nowrap;
}

.leo-list-badges {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.25rem;
  width: max-content;
  min-width: 5rem;
}

.leo-badge {
  display: inline-block;
  min-width: 5rem;
  width: max-content;
  max-width: 8rem;
  box-sizing: border-box;
  padding: 0.12rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #fff;
  background: #404040;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

.leo-badge:nth-child(1) { background: #2563eb; border-color: #3b82f6; }   /* Erstbegehung – Blau */
.leo-badge:nth-child(2) { background: #ea580c; border-color: #f97316; }   /* Meldung – Orange */
.leo-badge:nth-child(3) { background: #16a34a; border-color: #22c55e; }   /* Fertigstellung – Grün */
.leo-badge:nth-child(4) { background: #0d9488; border-color: #14b8a6; }   /* Endabnahme – Teal */
.leo-badge:nth-child(5) { background: #b91c1c; border-color: #dc2626; }   /* Asbest – Rot */
.leo-badge:nth-child(6) { background: #7c3aed; border-color: #8b5cf6; }   /* Bewohnerzustand – Violett */
.leo-badge:nth-child(7) { background: #c2410c; border-color: #ea580c; }   /* Mangel – Dunkelorange */

.leo-list-badges-th {
  background: #f5f5f5;
  font-weight: 600;
  cursor: default;
}

/* Lösch-Spalte in plusleoliste+ */
.leo-list-delete-th {
  width: 30px;
  min-width: 30px;
  max-width: 30px;
}
.leo-list-delete-cell {
  text-align: center;
  padding: 0;
  vertical-align: middle;
}
.leo-list-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.leo-list-delete-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #ef4444;
}

/* Zugewiesene Listen Übersicht */
.assigned-lists-wrap {
  margin: 0.5rem 0;
}
.assigned-lists-table {
  margin-top: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.assigned-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 6px;
  font-size: 0.78rem;
}
.assigned-list-info {
  flex: 1;
  color: #ccc;
}
.assigned-list-user {
  font-weight: 600;
  color: #e8e8e8;
}
.assigned-list-title {
  color: #9ca3af;
  margin-left: 0.3rem;
}
.assigned-list-meta {
  color: #666;
  font-size: 0.7rem;
}
.assigned-list-remove {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  border: 1px solid #555;
  border-radius: 4px;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
}
.assigned-list-remove:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: #ef4444;
}

.leo-list-notiz-cell {
  vertical-align: top;
  min-width: 120px;
  max-width: 200px;
}

.leo-list-notiz-input {
  width: 100%;
  min-height: 32px;
  max-height: 80px;
  padding: 0.25rem 0.35rem;
  font-size: 0.75rem;
  font-family: inherit;
  color: #e8e8e8;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
}

.leo-list-notiz-input:focus {
  outline: none;
  border-color: #818cf8;
}

td[contenteditable="true"]:focus {
  outline: 2px solid #818cf8;
  outline-offset: -2px;
  background: #1e1e1e;
}

.db-table-wrap {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid #404040;
  background: #2a2a2a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

#plusbaustellenTableWrap {
  border-radius: 0;
  overflow: visible;
  border-color: #000;
}

#plusbaustellenHeaderTable th,
#plusbaustellenListTable td {
  border-color: #000;
}

.pb-fixed-header {
  overflow: hidden;
  border-bottom: 1px solid #000;
}

/* Header-Table ist außerhalb des Scroll-Containers — kein sticky mehr nötig */
#plusbaustellenHeaderTable th {
  position: static;
  box-shadow: none;
}

.pb-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.pb-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 4px;
  color: #a0a0a0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pb-toolbar-btn:hover {
  background: #383838;
  color: #e0e0e0;
}

.pb-toolbar-btn-save {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}

.pb-toolbar-btn-save:hover {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.pb-toolbar-btn-export {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.35);
}

.pb-toolbar-btn-export:hover {
  background: rgba(147, 197, 253, 0.12);
  color: #bfdbfe;
}

.pb-toolbar-btn-yellow {
  color: #fde047;
  border-color: rgba(253, 224, 71, 0.35);
}

.pb-toolbar-btn-yellow:hover {
  background: rgba(253, 224, 71, 0.12);
  color: #fef08a;
}

.pb-toolbar-btn-active {
  background: rgba(253, 224, 71, 0.18) !important;
  color: #fde047 !important;
  border-color: rgba(253, 224, 71, 0.6) !important;
}

.pb-toolbar-btn-ics {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
}

.pb-toolbar-btn-ics:hover {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
}

.pb-toolbar-btn-ics.pb-toolbar-btn-active {
  background: rgba(96, 165, 250, 0.18) !important;
  color: #60a5fa !important;
  border-color: rgba(96, 165, 250, 0.6) !important;
}

/* Alle Termine ICS – Teams-Lila */
.pb-toolbar-btn-ics-all {
  color: #7c6fcd;
  border-color: rgba(124, 111, 205, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.pb-toolbar-btn-ics-all:hover {
  background: rgba(124, 111, 205, 0.14);
  color: #9d8fe0;
}
.pb-toolbar-btn-delete-all {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.pb-toolbar-btn-delete-all:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
}

/* plusbaustellen+ – Sortierleiste */
.plusbaustellen-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0.5rem 0;
  flex-wrap: wrap;
}

.plusbaustellen-sort-label {
  font-size: 0.9rem;
  color: #b0b0b0;
  margin-right: 0.25rem;
}

.pb-th-drag {
  cursor: grab;
  user-select: none;
}
.pb-th-drag:active { cursor: grabbing; }
.pb-th-drag-over {
  background: rgba(13, 148, 136, 0.25);
  outline: 2px dashed #0d9488;
}
.pb-th-dragging {
  opacity: 0.4;
}

.pb-th-sortable {
  cursor: pointer;
}

.pb-th-sort-active {
  color: #2dd4bf;
}

.pb-col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 1;
  user-select: none;
}

#plusbaustellenListTable {
  width: max-content;
  min-width: 100%;
}

.plusbaustellen-cal-cell {
  text-align: center;
  vertical-align: middle;
  width: 56px;
  min-width: 56px;
  padding: 0.25rem;
  white-space: nowrap;
}
.pb-lws-nummer {
  display: block;
  font-size: 0.72em;
  color: #9ca3af;
  line-height: 1.3;
  margin-top: 2px;
}
.pb-baustop-cell {
  text-align: center;
  vertical-align: middle;
  width: 32px;
  min-width: 32px;
  padding: 0.25rem;
}

.pb-cal-check {
  cursor: pointer;
  accent-color: #60a5fa;
  width: 13px;
  height: 13px;
  vertical-align: middle;
  margin-left: 4px;
}

.plusbaustellen-cal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  opacity: 0.7;
  cursor: pointer;
}

.plusbaustellen-cal-icon:hover {
  opacity: 1;
}

#plusbaustellenTableWrap th {
  text-align: center;
  vertical-align: middle;
  background: #333;
}


#plusbaustellenListTable td {
  text-align: center;
  vertical-align: middle;
}

/* Gelb markierte Zelle (KW) */
#plusbaustellenListTable td.pb-cell-yellow {
  background: rgba(234, 179, 8, 0.2) !important;
  color: #fde047;
}

#plusbaustellenListTable td.pb-cell-yellow:hover {
  background: rgba(234, 179, 8, 0.32) !important;
}

.plusbaustellen-kw-cell {
  position: relative;
}

.pb-kw-mark-btn {
  display: none;
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: #fde047;
  cursor: pointer;
  line-height: 1;
  opacity: 0.6;
  z-index: 1;
  padding: 2px;
}

.pb-kw-mark-btn:hover {
  opacity: 1;
}

.plusbaustellen-kw-cell:hover .pb-kw-mark-btn,
td.pb-cell-yellow .pb-kw-mark-btn {
  display: inline-block;
}

/* Grün markierte Zelle (LEO_Beginn) */
#plusbaustellenListTable td.pb-cell-green {
  background: rgba(34, 197, 94, 0.18) !important;
  color: #86efac;
}

#plusbaustellenListTable td.pb-cell-green:hover {
  background: rgba(34, 197, 94, 0.28) !important;
}

/* Hover-Markierungs-Button (grüner Punkt) in Beginn-Zelle */
.pb-mark-btn {
  display: none;
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: #4ade80;
  cursor: pointer;
  line-height: 1;
  opacity: 0.6;
  z-index: 1;
  padding: 2px;
}

.pb-mark-btn:hover {
  opacity: 1;
}

.pb-editable-cell {
  position: relative;
}

.pb-editable-inner {
  display: block;
  outline: none;
  min-height: 1em;
  white-space: pre-wrap;
  word-break: break-word;
}

.pb-editable-cell:hover .pb-mark-btn,
td.pb-cell-green .pb-mark-btn {
  display: inline-block;
}

.plusbaustellen-sort-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: #e8e8e8;
  background: #2a2a2a;
  border: 1px solid #555;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.plusbaustellen-sort-btn:hover {
  background: #353535;
  border-color: #666;
}

.plusbaustellen-sort-btn.active {
  background: #0d9488;
  border-color: #14b8a6;
  color: #fff;
}

.plusbaustellen-strasse-cell {
  cursor: pointer;
  color: #93c5fd;
  text-decoration: underline;
}
.plusbaustellen-strasse-cell:hover {
  color: #bfdbfe;
}

/* LEO_Ausführungsbeginn: Rosa, wenn Erstbegehung eingetragen */
.plusbaustellen-ausfuehrungsbeginn-erstbegehung-done {
  background-color: #e879a0 !important;
  color: #1a1a1a;
}

.plusbaustellen-detail-row td {
  padding: 0;
  vertical-align: top;
  border-top: none;
  background: #252525;
}

.plusbaustellen-detail-box {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plusbaustellen-detail-section label {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.25rem;
}

.plusbaustellen-begehungen-section label {
  display: inline;
  margin-bottom: 0;
}
.plusbaustellen-begehung-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: 0.35rem;
  padding: 0.25rem 0.4rem;
  background: #0d9488;
  color: #fff;
  border: 1px solid #14b8a6;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plusbaustellen-begehung-btn:hover {
  background: #0f766e;
  border-color: #0d9488;
}
.pb-baustop-btn {
  cursor: pointer;
  font-size: 16px;
  opacity: 0.35;
  vertical-align: middle;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.pb-baustop-btn:hover,
.pb-baustop-btn.pb-baustop-active {
  opacity: 1;
}
.pb-row-red td {
  background-color: rgba(220, 38, 38, 0.18) !important;
  color: #fca5a5 !important;
}
/* Abgeschlossene Projekte: grüner Hintergrund */
.pb-row-finished td {
  background-color: rgba(13, 148, 136, 0.18) !important;
}
.pb-row-finished-hidden {
  display: none;
}
/* Eye-Toggle Button für abgeschlossene Projekte */
.pb-toolbar-btn-finished.pb-toolbar-btn-active {
  background: #0d9488;
  color: #fff;
  border-color: #14b8a6;
}
.plusbaustellen-delete-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #374151;
}
.plusbaustellen-delete-btn {
  padding: 0.3rem 0.8rem;
  background: #7f1d1d;
  color: #fca5a5;
  border: 1px solid #991b1b;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.plusbaustellen-delete-btn:hover {
  background: #991b1b;
  color: #fff;
}
.plusbaustellen-begehung-icon {
  display: inline-flex;
  line-height: 1;
}
.plusbaustellen-begehungen-section .plusbaustellen-detail-input {
  margin-top: 0.35rem;
}

.plusbaustellen-detail-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: #e8e8e8;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 8px;
  box-sizing: border-box;
}

.plusbaustellen-detail-input:focus {
  outline: none;
  border-color: #0d9488;
}

.plusbaustellen-notizen-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.plusbaustellen-notiz-item {
  padding: 0.4rem 0.6rem;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  border-left: 3px solid #0d9488;
}

.plusbaustellen-notiz-date {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.2rem;
}

.plusbaustellen-notiz-text {
  font-size: 0.9rem;
  color: #e8e8e8;
  white-space: pre-wrap;
}

.plusbaustellen-notiz-empty {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* plusbaustellen+ – Button-Liste und Detail */
.plusbaustellen-button-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.75rem 0 1rem 0;
}

.plusbaustellen-btn-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  text-align: left;
  color: #e8e8e8;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.plusbaustellen-btn-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
}

.plusbaustellen-btn-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.plusbaustellen-btn-lbl {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: #888;
  min-width: 6.5em;
}

.plusbaustellen-btn-item:hover {
  background: #353535;
  border-color: #555;
}

.plusbaustellen-btn-item.active {
  background: #0d9488;
  border-color: #14b8a6;
  color: #fff;
}

.plusbaustellen-detail {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 16px;
}

.plusbaustellen-detail-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem 1.5rem;
}

.plusbaustellen-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.plusbaustellen-label,
.plusbaustellen-field label {
  font-size: 0.8rem;
  color: #888;
  font-weight: 500;
}

.plusbaustellen-value {
  color: #e8e8e8;
  font-size: 0.95rem;
}

.plusbaustellen-input {
  padding: 0.4rem 0.5rem;
  font-size: 0.95rem;
  color: #e8e8e8;
  background: #1e1e1e;
  border: 1px solid #555;
  border-radius: 8px;
}

.plusbaustellen-input:focus {
  outline: none;
  border-color: #0d9488;
}

/* plusfertigmeldung+ – Wohnungen nach KW (Fertigstellung) */
.fertigmeldung-info-box {
  background: rgba(45, 125, 70, 0.1);
  border: 1px solid rgba(45, 125, 70, 0.3);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.fertigmeldung-desc {
  color: #e8e8e8;
  margin: 0 0 0.75rem 0;
  line-height: 1.5;
}

.fertigmeldung-desc:last-child {
  margin-bottom: 0;
}

.fertigmeldung-status-list {
  list-style: none;
  margin: 0.5rem 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.fertigmeldung-status-list li {
  color: #b8b8b8;
  font-size: 0.95rem;
  padding: 0.35rem 0.75rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 12px;
  display: flex;
  align-items: center;
}

.fertigmeldung-status-list li:before {
  content: "✓";
  display: inline-block;
  width: 1.2rem;
  height: 1.2rem;
  margin-right: 0.5rem;
  color: #2d7d46;
  font-weight: 600;
  flex-shrink: 0;
}

.fertigmeldung-list-wrap {
  width: 100%;
  margin-top: 0.5rem;
}

.fertigmeldung-nav-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.fertigmeldung-nav-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: #e8e8e8;
  min-width: 180px;
  text-align: center;
}

.fertigmeldung-nav-btn {
  padding: 0.5rem 0.85rem;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.2rem;
  color: #b8b8b8;
  background: #2a2a2a;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fertigmeldung-nav-btn:hover:not(:disabled) {
  background: #333;
  color: #e8e8e8;
}

.fertigmeldung-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fertigmeldung-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 700px) {
  .fertigmeldung-pair {
    grid-template-columns: 1fr;
  }
}

.fertigmeldung-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

@media (max-width: 700px) {
  .fertigmeldung-list {
    grid-template-columns: 1fr;
  }
}

.fertigmeldung-kw {
  background: #242424;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.fertigmeldung-kw-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d7d46;
}

.fertigmeldung-kw-count {
  font-weight: 500;
  color: #888;
  font-size: 0.95rem;
}

.fertigmeldung-wohnungen {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.fertigmeldung-item {
  margin-bottom: 0.5rem;
  color: #e8e8e8;
  font-size: 0.95rem;
}

.fertigmeldung-btn-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.fertigmeldung-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #2a2a2a;
  color: #e8e8e8;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.fertigmeldung-btn:hover {
  background: #333;
  border-color: #4a4a4a;
}

.fertigmeldung-btn.expanded {
  background: rgba(45, 125, 70, 0.15);
  border-color: #2d7d46;
}

.fertigmeldung-btn-content {
  flex: 1;
  min-width: 0;
}

.fertigmeldung-status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  background: #2d7d46;
  color: #fff;
  border-radius: 12px;
  font-weight: 500;
}

.fertigmeldung-status-badge.status-red {
  background: #c53030;
}

.fertigmeldung-status-badge.status-orange {
  background: #dd6b20;
}

.fertigmeldung-email-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  color: #e8e8e8;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.fertigmeldung-email-btn:hover {
  background: #2d7d46;
  border-color: #2d7d46;
  transform: scale(1.05);
}

.fertigmeldung-email-btn:active {
  transform: scale(0.98);
}

.fertigmeldung-email-btn.submitted {
  background: #2d7d46;
  border-color: #2d7d46;
  color: #fff;
  cursor: default;
  pointer-events: none;
}

.fertigmeldung-email-btn.submitted:hover {
  transform: none;
}

.fertigmeldung-form {
  display: none;
  padding: 0.75rem;
  margin-top: 0.35rem;
  background: #1e1e1e;
  border: 1px solid #404040;
  border-radius: 8px;
}

.fertigmeldung-form.expanded {
  display: block;
}

.fertigmeldung-form-group {
  margin-bottom: 0.75rem;
}

.fertigmeldung-form-group:last-child {
  margin-bottom: 0;
}

.fertigmeldung-form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: #b8b8b8;
  font-weight: 500;
}

.fertigmeldung-form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #2a2a2a;
  color: #e8e8e8;
  cursor: pointer;
}

.fertigmeldung-form-select:focus {
  outline: none;
  border-color: #2d7d46;
}

.fertigmeldung-form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  min-height: 80px;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #2a2a2a;
  color: #e8e8e8;
  font-family: inherit;
  resize: vertical;
}

.fertigmeldung-form-textarea:focus {
  outline: none;
  border-color: #2d7d46;
}

.fertigmeldung-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.fertigmeldung-form-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.fertigmeldung-form-btn.btn-save {
  background: #2d7d46;
  color: #fff;
}

.fertigmeldung-form-btn.btn-save:hover {
  background: #358a51;
}

.fertigmeldung-form-btn.btn-cancel {
  background: #333;
  color: #e8e8e8;
  border: 1px solid #4a4a4a;
}

.fertigmeldung-form-btn.btn-cancel:hover {
  background: #3d3d3d;
}

.fertigmeldung-form-btn:active {
  transform: scale(0.98);
}

.fertigmeldung-datum {
  color: #2d7d46;
  font-size: 0.9rem;
  white-space: nowrap;
}

.fertigmeldung-meta {
  font-size: 0.82rem;
  color: #a0a0a0;
  white-space: nowrap;
}

.fertigmeldung-nummer {
  color: #7dd3fc;
}

.fertigmeldung-uebergabe-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  font-size: 0.82rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 10px;
  white-space: nowrap;
  vertical-align: middle;
}

.fertigmeldung-empty {
  color: #999;
  margin: 0;
  padding: 1rem;
  background: #242424;
  border-radius: 12px;
  border: 1px solid #3a3a3a;
}

/* teamleiterplus+ – Fertigstellungen */
.teamleiter-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 20px;
}

.teamleiter-filter-bar label {
  font-size: 0.9rem;
  color: #b8b8b8;
  font-weight: 500;
}

.teamleiter-filter-select {
  padding: 0.4rem 0.6rem;
  min-height: 44px;
  border: 1px solid #4a4a4a;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #333;
  color: #e8e8e8;
  cursor: pointer;
  min-width: 160px;
}

.teamleiter-filter-select:focus {
  outline: none;
  border-color: #2d7d46;
}

.teamleiter-status-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
  background: #2d7d46;
  color: #fff;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.teamleiter-status-badge.status-red {
  background: #c53030;
}

.teamleiter-status-badge.status-orange {
  background: #dd6b20;
}

/* plusboard+ Terminliste – verschiebbare Karten */
.plusboard-term-wrap {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid #404040;
  background: #2a2a2a;
  padding: 0.75rem;
}

.plusboard-term-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

.plusboard-term-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 100%;
  padding: 0.6rem 0.75rem;
  background: #404040;
  border: 1px solid #555;
  border-radius: 16px;
  color: #fff;
  font-size: 0.9rem;
  cursor: grab;
  user-select: none;
  box-sizing: border-box;
}

.plusboard-term-card:active {
  cursor: grabbing;
}

.plusboard-term-card.plusboard-term-dragging {
  opacity: 0.6;
  border-style: dashed;
}

.plusboard-term-card.plusboard-term-drag-over {
  border-color: #0d9488;
  box-shadow: 0 0 0 2px #0d9488;
}

.plusboard-term-addr {
  font-weight: 600;
  color: #e8e8e8;
}

.plusboard-term-row {
  font-size: 0.8rem;
  color: #b0b0b0;
}

.plusboard-term-label {
  color: #888;
  margin-right: 0.25rem;
}

/* pluskalender+ – Monatskalender mit Adress-Karten */
.calendar-wrap {
  width: 100%;
  max-width: 100%;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 20px;
  padding: 0.4rem;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  gap: 0.5rem;
}

.calendar-month-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #e8e8e8;
}

.btn-calendar-nav {
  padding: 0.3rem 0.6rem;
  font-size: 0.95rem;
  border: 1px solid #555;
  border-radius: 12px;
  background: #404040;
  color: #fff;
  cursor: pointer;
}

.btn-calendar-nav:hover {
  background: #505050;
}

/* Gantt Monats-Toggle */
.gantt-month-toggles {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.75rem;
}
.gantt-month-btn {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #555;
  border-radius: 6px;
  background: #404040;
  color: #aaa;
  cursor: pointer;
}
.gantt-month-btn:hover {
  background: #505050;
  color: #e8e8e8;
}
.gantt-month-btn.active {
  background: #2d7d46;
  border-color: #3a9956;
  color: #fff;
}

/* Gantt-Bauzeitenplan */
.calendar-grid {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.gantt-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.72rem;
}

.gantt-table th,
.gantt-table td {
  padding: 0;
  border: 1px solid #333;
  text-align: center;
  vertical-align: middle;
}

/* Header: Tage */
.gantt-th-day {
  font-size: 0.6rem;
  font-weight: 600;
  color: #aaa;
  padding: 0.2rem 0;
  min-width: 22px;
  background: #2a2a2a;
  position: sticky;
  top: 0;
  z-index: 2;
}
.gantt-th-day-weekend {
  background: #332a2a;
  color: #888;
}
.gantt-th-day-holiday {
  background: #3a2222;
  color: #ef6b6b;
}
.gantt-th-day-today {
  background: #2d7d46;
  color: #fff;
}
.gantt-th-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #aaa;
  padding: 0.2rem 0.4rem;
  text-align: left;
  background: #2a2a2a;
  min-width: 160px;
  max-width: 220px;
  position: sticky;
  left: 0;
  top: 0;
  z-index: 3;
}

/* Zeilen */
.gantt-row-label {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #1e1e1e;
  color: #e0e0e0;
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 160px;
  max-width: 220px;
  cursor: default;
}
.gantt-row-label-addr {
  font-weight: 600;
}
.gantt-row-label-nr {
  color: #888;
  font-size: 0.58rem;
  margin-left: 0.3rem;
}

/* Zellen im Grid */
.gantt-cell {
  height: 22px;
  min-width: 22px;
  background: #1e1e1e;
  position: relative;
}
.gantt-cell-weekend {
  background: #252020;
}
.gantt-cell-holiday {
  background: #2a1a1a;
}
.gantt-cell-today {
  background: rgba(45, 125, 70, 0.1);
}

/* Balken */
.gantt-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 1px;
  right: 1px;
  border-radius: 3px;
  z-index: 1;
  cursor: pointer;
  transition: opacity 0.15s;
}
.gantt-bar:hover {
  opacity: 0.85;
}
.gantt-bar-label {
  font-size: 0.5rem;
  font-weight: 600;
  color: #fff;
  padding: 0 3px;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Abgeschlossenes Projekt */
.gantt-bar-finished {
  opacity: 0.5;
}
.gantt-row-finished .gantt-row-label,
.gantt-row-finished .gantt-cell {
  background: rgba(13, 148, 136, 0.15);
}
/* Info-Zeile */
.calendar-info {
  margin: 0.3rem 0 0 0;
  font-size: 0.75rem;
  color: #888;
  flex-shrink: 0;
}

.db-table-scroll {
  overflow: auto;
  max-height: min(55vh, 50dvh, 460px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.db-table-scroll::-webkit-scrollbar {
  display: none;
}

.db-table {
  border-collapse: collapse;
  font-size: 0.95rem;
  width: 100%;
  table-layout: auto;
}

.db-table th,
.db-table td {
  border: 1px solid #404040;
  padding: 0.5rem 0.75rem;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 200px;
  overflow: hidden;
  color: #d8d8d8;
}

.db-table th {
  background: #333;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  color: #e8e8e8;
  box-shadow: 0 2px 0 #404040;
  padding: 1rem 0.75rem;
  min-height: 3rem;
}

.db-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  padding-right: 1.25rem;
}

.db-table th.sortable:hover {
  background: #ebebeb;
}

.db-table .sort-icon {
  opacity: 0.4;
  font-size: 0.75em;
  margin-left: 0.2em;
}

.db-table .sort-icon.active {
  opacity: 1;
}

.db-table td {
  background: #2a2a2a;
}

.db-table tbody tr:hover {
  background: #353535;
}

.db-table tr:nth-child(even) td {
  background: #272727;
}

.db-table tr:nth-child(even):hover td {
  background: #353535;
}

#mergedInfo,
#leoListInfo {
  display: none;
}

/* plusfilter+: Listen-Vorlagen */
.filter-desc {
  margin: 0 0 1.25rem 0;
  font-size: 1rem;
  color: #b8b8b8;
  line-height: 1.45;
}

.filter-section {
  margin-bottom: 1.5rem;
}

.filter-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.filter-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #333;
}

.template-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 20px;
}

.template-item-name {
  font-weight: 500;
  color: #e8e8e8;
  font-size: 1rem;
}

.template-item-badge {
  display: inline-block;
  min-width: 3.5rem;
  box-sizing: border-box;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: #2d7d46;
  color: #fff;
  border-radius: 32px;
  font-weight: 500;
  text-align: center;
}

.template-item-cols {
  font-size: 0.95rem;
  color: #b8b8b8;
}

.template-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: auto;
}

.template-list-empty {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: #b8b8b8;
  background: #2a2a2a;
  border-radius: 20px;
  border: 1px dashed #4a4a4a;
}

.template-editor-wrap {
  margin-top: 1rem;
  padding: 1.25rem;
  background: #2a2a2a;
  border: 1px solid #404040;
  border-radius: 24px;
}

.template-editor-wrap h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #e8e8e8;
}

.template-form .form-group {
  margin-bottom: 1rem;
}

.template-cols-hint {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: #555;
}

.template-cols-wrap {
  margin-bottom: 1rem;
  max-height: 280px;
  overflow-y: auto;
  background: #1f1f1f;
  border: 1px solid #404040;
  border-radius: 20px;
  padding: 0.5rem;
}

.template-cols-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.template-col-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 32px;
}

.template-col-item:hover {
  background: #f5f5f5;
}

.template-col-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.template-col-check {
  flex-shrink: 0;
}

.template-col-name {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-col-move {
  display: flex;
  gap: 0.2rem;
}

.btn-move {
  padding: 0.25rem 0.5rem;
  min-width: 32px;
  font-size: 0.85rem;
  background: #e8e8e8;
  border: 1px solid #ccc;
  border-radius: 32px;
  cursor: pointer;
}

.btn-move:hover {
  background: #ddd;
}

.template-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 32px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}

.btn-sm:hover {
  background: #f0f0f0;
}

.btn-sm.btn-apply {
  background: #2d7d46;
  color: #fff;
  border-color: #2d7d46;
}

.btn-sm.btn-apply:hover {
  background: #256b3a;
}

.btn-sm.btn-edit {
  background: #f0f0f0;
}

.btn-sm.btn-delete {
  color: #c00;
  border-color: #e0a0a0;
}

.btn-sm.btn-delete:hover {
  background: #ffe0e0;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: #333;
  border: 1px solid #4a4a4a;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  color: #e8e8e8;
}

.btn-secondary:hover {
  background: #3d3d3d;
}

.btn-danger-sm {
  padding: 0.4rem 0.8rem;
  background: #991b1b;
  color: #fff;
  border: 1px solid #dc2626;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger-sm:hover {
  background: #b91c1c;
}

/* iPad & Tablet (768px+) */
@media (min-width: 768px) {
  .header {
    padding: 0.6rem 1rem;
    margin: 8px 20px 0;
    border-radius: 28px;
  }

  .logo-img {
    height: 44px;
  }

  .tab {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
  }

  .main {
    padding-top: calc(3.5rem + 40px + env(safe-area-inset-top));
    padding-right: 0.75rem;
    padding-bottom: 0.5rem;
    padding-left: 0.75rem;
  }

  .container-inner {
    padding: 1.15rem;
    border-radius: 28px;
  }

  #content-plusdatenbank {
    padding: 1.5rem 1.5rem;
  }

  .db-table {
    font-size: 0.85rem;
  }

  .db-table-scroll {
    max-height: min(58vh, 500px);
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .header {
    padding: 0.65rem 1.25rem;
    margin: 8px 20px 0;
    border-radius: 32px;
  }

  .logo-img {
    height: 44px;
  }

  .main {
    padding-top: calc(3.5rem + 40px + env(safe-area-inset-top));
    padding-right: 1rem;
    padding-bottom: 0.75rem;
    padding-left: 1rem;
  }

  #content-plusdatenbank {
    padding: 1.5rem 2rem;
  }

  .db-table {
    font-size: 0.85rem;
  }

  .db-table-scroll {
    max-height: min(58vh, 540px);
  }

  .db-upload .form-row {
    gap: 1.5rem;
  }
}

/* ========== Apple-Geräte: iPhone, iPad, iPad Pro 11" ========== */

/* iPhone (schmale Viewports) – kompakter Header, mehr Platz für Inhalt */
@media (max-width: 430px) {
  .header {
    margin-left: 12px;
    margin-right: 12px;
    padding-left: max(0.6rem, env(safe-area-inset-left) + 0.4rem);
    padding-right: max(0.6rem, env(safe-area-inset-right) + 0.4rem);
    border-radius: 24px;
  }
  .main {
    margin-left: 12px;
    margin-right: 12px;
    padding-left: max(12px, env(safe-area-inset-left) + 8px);
    padding-right: max(12px, env(safe-area-inset-right) + 8px);
  }
  .user-email {
    max-width: 100px;
    font-size: 0.9rem;
  }
  .logo-img {
    height: 36px;
  }
  .container-inner {
    padding: 0.85rem;
    border-radius: 24px;
  }
  .login-wrapper {
    padding: 1.5rem;
    margin-left: env(safe-area-inset-left);
    margin-right: env(safe-area-inset-right);
  }
}

/* iPad Pro 11" (834×1194 pt) – optimale Nutzung der Breite, 7-Spalten-Kalender perfekt */
@media (min-width: 834px) and (max-width: 1194px) {
  .header {
    margin-left: 24px;
    margin-right: 24px;
    padding: 0.6rem 1rem;
    padding-left: max(1rem, env(safe-area-inset-left) + 0.5rem);
    padding-right: max(1rem, env(safe-area-inset-right) + 0.5rem);
    border-radius: 32px;
  }
  .main {
    padding-top: calc(3.5rem + 40px + env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left) + 10px);
    padding-right: max(16px, env(safe-area-inset-right) + 10px);
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    margin-left: 16px;
    margin-right: 16px;
  }
  .dashboard-calendar-section {
    padding: 0 2px;
  }
  .dashboard-calendar-grid {
    gap: 0.6rem;
    min-width: 0;
  }
  .dashboard-calendar-day {
    min-height: 180px;
    padding: 0.65rem 0.5rem;
  }
  .dashboard-calendar-day-cards {
    max-height: 550px;
  }
  .dashboard-calendar-dayname {
    font-size: 0.8rem;
  }
  .dashboard-calendar-date {
    font-size: 0.85rem;
  }
  .container-inner {
    padding: 1.25rem;
    border-radius: 32px;
  }
  .db-table-scroll {
    max-height: min(50vh, 50dvh, 420px);
  }
  .leo-checklist-container .db-table-wrap {
    height: calc(100vh - 360px);
    height: calc(100dvh - 360px);
    min-height: 380px;
  }
}

/* iPad / Tablet allgemein (768px–833px) – Übergang zu iPad Pro */
@media (min-width: 768px) and (max-width: 833px) {
  .main {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  }
  .dashboard-calendar-day-cards {
    max-height: 500px;
  }
}

/* Bauleiter Listen-Auswahl */
.pb-list-select-wrap { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; padding: 0.4rem 0.75rem; background: #2a2a2a; border: 1px solid #404040; border-radius: 8px; }
.pb-saved-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.pb-filter-tag { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.25rem 0.5rem; background: #333; border: 1px solid #555; border-radius: 14px; font-size: 0.78rem; color: #e0e0e0; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.pb-filter-tag:hover { background: #444; border-color: #888; }
.pb-filter-tag.active { background: #2d7d46; border-color: #3a9e5a; color: #fff; }
.pb-filter-tag-x { font-size: 0.7rem; color: #999; cursor: pointer; margin-left: 2px; line-height: 1; }
.pb-filter-tag-x:hover { color: #ff6b6b; }

/* DB erweitern */
.dbext-section { background: #1a1a1a; border: 1px solid #404040; border-radius: 8px; padding: 1rem; }
.dbext-heading { color: #f97316; font-size: 0.9rem; font-weight: 600; margin: 0 0 0.75rem; }
.dbext-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.dbext-label { font-size: 0.85rem; color: #9ca3af; min-width: 80px; }
.dbext-select { background: #2a2a2a; border: 1px solid #404040; color: #f3f4f6; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.85rem; }
.dbext-select:focus { outline: none; border-color: #f97316; }
.dbext-input { background: #2a2a2a; border: 1px solid #404040; color: #f3f4f6; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.85rem; min-width: 160px; }
.dbext-input:focus { outline: none; border-color: #f97316; }
.dbext-textarea { background: #2a2a2a; border: 1px solid #404040; color: #f3f4f6; padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.85rem; width: 100%; font-family: monospace; resize: vertical; }
.dbext-textarea:focus { outline: none; border-color: #f97316; }
.dbext-tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.5rem; }
.dbext-table-card { background: #2a2a2a; border: 1px solid #404040; border-radius: 6px; padding: 0.6rem 0.8rem; cursor: pointer; }
.dbext-table-card:hover { border-color: #f97316; }
.dbext-table-card .name { color: #f3f4f6; font-size: 0.88rem; font-weight: 500; }
.dbext-table-card .count { color: #6b7280; font-size: 0.75rem; }
.dbext-cols-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.dbext-cols-table th { text-align: left; padding: 0.4rem 0.6rem; color: #9ca3af; font-weight: 500; border-bottom: 1px solid #374151; }
.dbext-cols-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid #1f2937; color: #d1d5db; }

/* === Routenplaner+ === */
.routenplaner-wrap { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.routenplaner-toolbar { display: flex; flex-direction: column; gap: 10px; }
.route-start-label { display: flex; align-items: center; gap: 6px; color: #aaa; font-size: .85rem; white-space: nowrap; }
.route-start-input { flex: 0 1 200px; min-width: 140px; padding: 6px 10px; background: #2a2a2a; border: 1px solid #404040; border-radius: 8px; color: #e2e8f0; font-size: .82rem; outline: none; transition: border-color .15s; }
.route-start-input:focus { border-color: #22c55e; }
.route-start-input::placeholder { color: #666; }
.btn-small { padding: 7px 14px !important; font-size: .82rem !important; }
.route-toggle { background: #333 !important; color: #aaa !important; border: 1px solid #555 !important; }
.route-toggle.active { background: #555 !important; color: #fff !important; border-color: #555 !important; }
.route-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow-x: auto; }
.route-actions-row .btn { flex: none; width: auto; padding: 6px 14px; font-size: .82rem; white-space: nowrap; min-height: auto; border-radius: 8px; }
.route-actions-row .route-info { color: #aaa; font-size: .85rem; margin-left: auto; }
.route-sort-group { display: flex; gap: 2px; background: #2a2a2a; border-radius: 8px; padding: 2px; }
.route-sort-btn { background: transparent !important; color: #888 !important; border: none !important; padding: 6px 12px !important; font-size: .78rem !important; border-radius: 6px !important; transition: all .15s; }
.route-sort-btn:hover { color: #ccc !important; }
.route-sort-btn.active { background: #444 !important; color: #e8e8e8 !important; }
.route-list-item { user-select: none; }
.route-list-item.dragging { opacity: .4; }
.route-list-item.drag-over { border-top: 2px solid #22c55e; }
.routenplaner-content { display: flex; gap: 16px; min-height: 500px; }
.route-list { flex: 0 0 320px; background: #2a2a2a; border: 1px solid #404040; border-radius: 12px; overflow-y: auto; max-height: 600px; }
.route-list-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #333; cursor: grab; transition: background .15s; }
.route-list-item:hover { background: #333; }
.route-list-item .route-num { background: #22c55e; color: #fff; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.route-list-item .route-addr { font-size: .85rem; color: #e2e8f0; }
.route-list-item .route-addr small { display: block; color: #888; font-size: .75rem; }
.route-list-item.finished { opacity: .5; }
.route-list-item.finished .route-num { background: #16a34a; }
.route-map { flex: 1; background: #2a2a2a; border: 1px solid #404040; border-radius: 12px; min-height: 400px; display: flex; align-items: center; justify-content: center; color: #888; font-size: .9rem; }
