/* Gemeinsames Layout und Erscheinungsbild des Haupt-Dashboards. Abhaengigkeiten: index.php und Hauptseiten. */
/* ========== Reset & Base ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
}

:root {
  --primary: #c62828;
  --primary-dark: #b71c1c;
  --primary-light: #ef5350;
  --accent: #1976d2;
  --accent-active: #8e24aa;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #c62828;
  --text: #1e293b;
  --muted: #64748b;
  --ok: #2e7d32;
  --ok-bg: #edf7ed;
  --warn: #ed6c02;
  --warn-bg: #fff4e5;
  --error: #d32f2f;
  --error-bg: #fdeded;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  /* Gesamthöhe des Headers + Nav, damit Dashboard genau den Rest füllt */
  --chrome-height: 160px;
}

/* =============================================
   VIEWPORT-LOCK: Seite scrollt nicht, alles
   passt exakt in 1920×1080 (oder den Browser)
   ============================================= */
html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body.dashboard-kiosk {
  height: 100%;
  overflow: hidden;
}

body.scroll-page {
  height: auto;
  overflow-y: auto;
}

/* ========== Header ========== */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  position: relative;
  z-index: 100;
}

.header-title h1 {
  font-size: 1.6rem;
  margin: 0;
}

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

.time-display {
  text-align: center;
  /*flex:1*/
  ;
}

#current-date {
  font-size: 1rem;
  opacity: .95;
}

#current-time {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ========== DWD Wetteranzeige im Header ========== */
.weather-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  user-select: none;
}

.weather-bar .weather-icon {
  font-size: 1.25rem;
  line-height: 1;
}

#weather-temp {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.weather-sep {
  opacity: 0.6;
  font-weight: 400;
}

.weather-forecast-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0, 0, 0, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.weather-forecast-label {
  opacity: 0.85;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.weather-forecast-icon {
  font-size: 1.05rem;
  line-height: 1;
}

#weather-forecast-temp {
  font-weight: 700;
}

/* Spezielle DWD-Wetterbox bei Ausbildung & Jugendfeuerwehr */
.event-weather-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 10px;
  margin-top: 6px;
  animation: pulse-border 3s infinite;
  user-select: none;
}

.event-weather-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-weather-badge {
  background: #ffffff;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.event-weather-title {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.92;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.event-weather-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

.event-weather-icon,
.event-weather-forecast-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.event-weather-temp {
  font-size: 1.1rem;
  font-weight: 800;
}

.event-weather-desc {
  font-weight: 600;
}

.event-weather-rain {
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
}

.event-weather-sep {
  opacity: 0.6;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* ========== Navigation (horizontal einklappbar) ========== */
.main-nav {
  background: #333;
  overflow: hidden;
  height: 5px;
  /* eingeklappt */
  transition: height 0.3s ease;
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.nav-toggle {
  display: none;
  width: 100%;
  border: 0;
  background: #333;
  color: #fff;
  min-height: 46px;
  font-size: 1.35rem;
  cursor: pointer;
}

.main-nav:hover {
  height: 50px;
  /* aufgeklappt */
}

.nav-item {
  color: #fff;
  text-decoration: none;
  padding: 14px 20px;
  transition: .2s background-color;
  display: none;
  /* versteckt im eingeklappten Zustand */
}

.main-nav:hover .nav-item {
  display: block;
  /* sichtbar im aufgeklappten Zustand */
}

.nav-item:hover,
.nav-item.active {
  background: var(--primary);
}

/* ✅ Touchgeräte: immer sichtbar */
@media (hover: none) and (pointer: coarse) and (min-width: 769px) {
  .main-nav {
    height: auto !important;
    display: flex !important;
    flex-direction: row;
    justify-content: space-around;
  }

  .nav-item {
    display: block !important;
    flex: 1;
    text-align: center;
    padding: 12px;
  }
}

/* ========== Layout ========== */

/* Dashboard füllt genau den Platz unter Header+Nav */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 20px;
  padding: 20px;
  /* Exakte Höhe = Viewport minus Header/Nav-Chrome */
  min-height: calc(100vh - var(--chrome-height));
  /* Panels dehnen sich gleichmäßig */
  align-items: stretch;
  /* Eine Grid-Row – Panels darf NICHT wachsen */
  grid-template-rows: auto;
  /* Wichtig: als Flex-Kind darf es nicht schrumpfen */
  min-height: 0;
}

body.dashboard-kiosk .dashboard {
  height: calc(100vh - var(--chrome-height));
  min-height: 0;
  grid-template-rows: 1fr;
}

/* Panel = vertikales Flex-Container, Höhe durch Grid vorgegeben */
.panel {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* min-height:0 ist der Schlüssel: erlaubt Flex-Kind zu schrumpfen */
  min-height: 0;
  height: auto;
}

body.dashboard-kiosk .panel {
  height: 100%;
}

/* Panel-Header: fixe Höhe, schrumpft nicht */
.panel-header {
  flex-shrink: 0;
  background: #f5f5f5;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h2 {
  color: var(--primary);
  font-size: 1.1rem;
  margin: 0;
}

/* Panel-Body: nimmt den restlichen Platz, schrumpft aber auch */
.panel-body {
  flex: 1;
  min-height: 0;
  /* KRITISCH – ohne das wächst das Panel ins Unendliche */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

/* ========== Buttons ========== */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: .9rem;
  cursor: pointer;
  transition: .2s background-color, .2s filter;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-secondary {
  background: #666;
  color: #fff;
}

.btn-secondary:hover {
  filter: brightness(.95);
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(.95);
}

.btn-success {
  background: var(--ok);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(.95);
}

.btn-small {
  padding: 4px 8px;
  font-size: .8rem;
}

/* ========== Meldungen ========== */
.alerts-panel {
  grid-column: 1;
}

.alert-list {
  flex: 1;
}

.alert-item {
  padding: 14px;
  border-bottom: 1px solid #eee;
  transition: .2s background-color;
  border-left: 4px solid transparent;
}

.alert-item:hover {
  background: #fafafa;
}

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

.alert-item.high-priority {
  border-left-color: #ff5722;
  background: #ffebee;
}

.alert-item.medium-priority {
  border-left-color: var(--warn);
}

.alert-item.low-priority {
  border-left-color: var(--ok);
}

.alert-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.alert-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.alert-time {
  font-size: .9rem;
  color: var(--muted);
  font-weight: 700;
}

.alert-description {
  font-size: .95rem;
}

/* ========== Kalender & Amtliche Warnungen (BBK / DWD) ========== */
.calendar-panel {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.calendar-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 100%;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  transition: flex 0.25s ease, height 0.25s ease;
}

.calendar-panel.has-warnings .calendar-section {
  flex: 1 1 50%;
  height: 50%;
  max-height: 50%;
}

.calendar-container {
  flex: 1;
  display: block;
  padding: 18px;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.warnings-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 50%;
  height: 50%;
  max-height: 50%;
  min-height: 0;
  overflow: hidden;
  border-top: 3px solid #d32f2f;
  background: #ffffff;
  transition: flex 0.25s ease, height 0.25s ease;
}

.calendar-panel:not(.has-warnings) .warnings-section,
.warnings-section[hidden] {
  display: none !important;
}

.warning-panel-header {
  background: #fff3e0;
  border-bottom: 1px solid #ffe0b2;
}

.warning-panel-header h2 {
  color: #c62828;
  display: flex;
  align-items: center;
  gap: 8px;
}

.warning-source-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.warning-source-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: #eceff1;
  color: #37474f;
  border: 1px solid #cfd8dc;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.warning-source-pill.source-dwd {
  background: #e3f2fd;
  color: #0d47a1;
  border-color: #90caf9;
}

.warning-source-pill.source-bbk {
  background: #fbe9e7;
  color: #bf360c;
  border-color: #ffab91;
}

.warnings-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}

.warnings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.warning-card {
  position: relative;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  border-left: 6px solid var(--warning-color, #e53935);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.warning-card.is-test-warning {
  border-style: dashed;
  border-left-style: solid;
}

.warning-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.warning-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.warning-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.warning-badge-source {
  background: #37474f;
  color: #ffffff;
}

.warning-badge-level {
  background: var(--warning-color, #e53935);
  color: var(--warning-text-color, #ffffff);
}

.warning-badge-cat {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.warning-badge-test {
  background: #f57c00;
  color: #ffffff;
}

.warning-card-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #666);
}

.warning-card-headline {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text, #111);
  line-height: 1.3;
  margin-top: 2px;
}

.warning-card-area {
  font-size: 0.82rem;
  font-weight: 600;
  color: #455a64;
}

.warning-card-description {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #333333;
  word-break: break-word;
}

.warning-card-instruction {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #4e342e;
  word-break: break-word;
}

.dienstplan-list {
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dienstplan-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

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

.dienstplan-item.today {
  margin: 0 -10px;
  padding: 12px 10px;
  border-left: 4px solid var(--accent-active);
  background: rgba(156, 39, 176, .08);
}

.dienstplan-item.recent {
  opacity: .72;
}

.dienstplan-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border-radius: 8px;
  background: #f5f5f5;
  color: var(--text);
}

.dienstplan-day {
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 800;
}

.dienstplan-month,
.dienstplan-weekday {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.dienstplan-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dienstplan-title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
}

.dienstplan-meta,
.dienstplan-location {
  color: var(--muted);
  font-size: .88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== Fahrzeuge Status & Details ========== */
.vehicle-panel {
  grid-column: 3;
}

.vehicle-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vehicle-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 3px;
}

.vehicle-details {
  font-size: .85rem;
  color: var(--muted);
}

.vehicle-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
}

.status-available {
  background: var(--ok);
}

.status-in-use {
  background: var(--warn);
}

.status-maintenance {
  background: var(--error);
}

/* ========== Planung (Dashboard) ========== */


.planung-item {
  padding: 14px;
  border-bottom: 1px solid #eee;
  transition: .2s background-color;
  border-right: 4px solid var(--accent);
  /* Standard: Balken rechts blau */
}

.planung-item.active {
  border-right-color: var(--accent-active);
}

/* Lila wenn aktiv */
.planung-item:hover {
  background: #fafafa;
}

.planung-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.planung-title {
  font-weight: 800;
  font-size: 1.2rem;
}

.planung-time {
  font-size: .9rem;
  color: var(--muted);
  font-weight: 700;
}

.planung-body p {
  margin: 4px 0;
  font-size: .9rem;
}

/* ========== Tabellen & Formulare ========== */
.form-container {
  background: #fff;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
  min-height: 90px;
}

.table-container {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

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

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f5f5f5;
  font-weight: 700;
  color: #333;
}

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

/* ========== Fahrzeugstatus-Karten unten ========== */
.vehicle-status-overview {
  margin-top: 16px;
  padding: 14px;
  background: #f9f9f9;
  border-radius: 10px;
}

.status-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.status-card {
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  color: #fff;
}

.status-card.available {
  background: var(--ok);
}

.status-card.in-use {
  background: var(--warn);
}

.status-card.maintenance {
  background: var(--error);
}

.status-count {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.status-label {
  font-size: .85rem;
}

/* ========== Misc ========== */
.no-data {
  text-align: center;
  padding: 28px 12px;
  color: #666;
  font-style: italic;
}

.loading {
  opacity: .7;
  pointer-events: none;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0)
  }

  100% {
    transform: rotate(360deg)
  }
}

/* ========== Responsive Extra ========== */
@media (max-width:1200px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .calendar-panel {
    grid-column: 1 / span 2;
  }
}

@media (max-width:768px) {
  body.dashboard-kiosk {
    height: auto;
    overflow-y: auto;
  }

  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 0;
    padding: 12px;
    gap: 12px;
  }

  body.dashboard-kiosk .dashboard {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto;
  }

  .calendar-panel {
    grid-column: 1;
  }

  .alerts-panel,
  .planung-panel {
    grid-column: 1;
  }

  .header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 10px 12px;
  }

  .time-display {
    order: -1;
  }

  #current-time {
    font-size: 2rem;
  }

  .calendar-footer {
    display: none;
  }

  .header-logo {
    max-width: 220px;
    height: auto !important;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    background: #24272d;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: none;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    transition: background-color 0.2s;
  }

  .nav-toggle:active {
    background: #181a1e;
  }

  .main-nav,
  .main-nav:hover {
    height: 0 !important;
    max-height: 0;
    display: flex !important;
    flex-direction: column;
    overflow-y: auto;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .main-nav.is-open {
    height: auto !important;
    max-height: 520px;
  }

  .nav-item,
  .main-nav:hover .nav-item {
    display: flex !important;
    align-items: center;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-item:active {
    background: var(--primary-dark);
  }

  .btn,
  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  .btn-small {
    padding: 9px 11px;
    font-size: .9rem;
  }

  .panel {
    min-height: auto;
  }

  body.dashboard-kiosk .panel {
    height: auto;
  }

  .calendar-container {
    min-height: 360px;
    padding: 8px;
  }

  .status-cards {
    grid-template-columns: 1fr;
  }

  .login-form-inline,
  .compact-login {
    width: 100%;
    justify-content: center;
  }

  .compact-login input,
  .compact-login button {
    flex: 1 1 100%;
    width: 100%;
  }

  /* ========== Mobile Dashboard Switcher Tabs ========== */
  .dashboard-mobile-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 10px 14px;
    background: #1e2126;
    position: sticky;
    top: 0;
    z-index: 90;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .dashboard-mobile-tabs::-webkit-scrollbar {
    display: none;
  }

  .d-tab-btn {
    flex: 1 0 auto;
    padding: 9px 15px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    white-space: nowrap;
    text-align: center;
    transition: all 0.2s ease;
  }

  .d-tab-btn:active,
  .d-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(198, 40, 40, 0.45);
  }

  /* Tab-Filterung auf dem Handy */
  .dashboard.show-alerts .calendar-panel,
  .dashboard.show-alerts .planung-panel {
    display: none !important;
  }

  .dashboard.show-calendar .alerts-panel,
  .dashboard.show-calendar .planung-panel {
    display: none !important;
  }

  .dashboard.show-planung .alerts-panel,
  .dashboard.show-planung .calendar-panel {
    display: none !important;
  }

  /* ========== Mobile Responsive Tables (Card View) ========== */
  .data-table.responsive-cards thead {
    display: none;
  }

  .data-table.responsive-cards,
  .data-table.responsive-cards tbody,
  .data-table.responsive-cards tr,
  .data-table.responsive-cards td {
    display: block;
    width: 100%;
  }

  .data-table.responsive-cards tr {
    margin-bottom: 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
  }

  .data-table.responsive-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.94rem;
  }

  .data-table.responsive-cards td:last-child {
    border-bottom: none;
  }

  .data-table.responsive-cards td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 12px;
    flex-shrink: 0;
  }

  .data-table.responsive-cards td.actions {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 12px;
    margin-top: 6px;
    border-top: 1px dashed var(--border);
  }

  .data-table.responsive-cards td.cell-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* ========== Komponenten: Chips, Presets, Prio, Upload & Filter ========== */
.chip-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chip-btn:hover {
  background: #e2e8f0;
}

.chip-btn.active,
.chip-btn.active:hover,
.chip-btn.active:focus {
  background: var(--primary, #c62828) !important;
  color: #fff !important;
  border-color: var(--primary-dark, #b71c1c) !important;
  box-shadow: 0 0 12px rgba(229, 57, 53, 0.75), 0 2px 6px rgba(198, 40, 40, 0.45) !important;
}

.prio-btn-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.prio-btn {
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  background: #f1f5f9;
  color: #333;
  transition: all 0.15s ease;
  text-align: center;
}

.prio-btn[data-prio="2"] { border-color: #81c784; background: #edf7ed; color: #1b5e20; }
.prio-btn[data-prio="5"] { border-color: #ffb74d; background: #fff8e1; color: #e65100; }
.prio-btn[data-prio="8"] { border-color: #ff8a65; background: #fbe9e7; color: #bf360c; }
.prio-btn[data-prio="10"] { border-color: #e57373; background: #ffebee; color: #b71c1c; }

.prio-btn.active {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  outline: 2px solid currentColor;
}

.time-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 10px;
}

.preset-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  margin-right: 4px;
}

.preset-btn {
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover,
.preset-btn:active {
  background: #cbd5e1;
  color: #0f172a;
}

.btn-quick-fill {
  margin-top: 6px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-quick-fill:hover {
  background: #bae6fd;
}

/* File Upload Drop Zone */
.file-upload-box {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  background: #f8fafc;
  transition: border-color 0.2s, background-color 0.2s;
  cursor: pointer;
  position: relative;
}

.file-upload-box:hover {
  border-color: var(--primary);
  background: #fff5f5;
}

.file-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.upload-icon {
  font-size: 2.2rem;
}

.upload-text {
  font-size: 1rem;
  color: var(--text);
}

.upload-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.file-preview-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}

.file-preview-card {
  position: relative;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  background: #fff;
}

.file-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-name {
  font-size: 0.68rem;
  padding: 3px 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* Live Filter & Search Bar */
.list-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.filter-search {
  flex: 1;
  min-width: 240px;
}

.filter-search input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.94rem;
  background: #f8fafc;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
}

/* Badges */
.badge-prio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-prio.prio-high {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

.badge-prio.prio-med {
  background: #fff8e1;
  color: #e65100;
  border: 1px solid #ffe082;
}

.badge-prio.prio-low {
  background: #edf7ed;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.8rem;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-claimed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.8rem;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.8rem;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.badge-active-pulse {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  animation: pulse-ring 2s infinite ease-in-out;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}

.badge-vehicle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #1e293b;
  font-weight: 700;
  font-size: 0.85rem;
}

.header-logo {
  height: 75px;
  /* anpassen nach Wunsch */
  object-fit: contain;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  /* Abstand zwischen den einzelnen Checkbox-Blöcken */
}

.checkbox-group label {
  display: inline-flex;
  align-items: center;
  font-size: .95rem;
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  margin-right: 4px;
  /* ✅ enger Abstand Text/Box */
}

.badge {
  color: var(--primary);
}






/* Scroll-Container für Meldungen: füllt Panel-Body, scrollt intern */
#meldungen-list {
  flex: 1;
  min-height: 0;
  /* KRITISCH */
  overflow: hidden;
  /* kein sichtbarer Scrollbalken */
  position: relative;
}

/* Scroll-Container für Planung: identisch */
#planung-next {
  flex: 1;
  min-height: 0;
  /* KRITISCH */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.inline-action-form {
  display: inline-block;
  margin: 0;
}

.inline-action-form button {
  font: inherit;
}

.login-form-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.compact-login input {
  min-width: 130px;
  padding: 7px 9px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.file-link-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== Header Login & User Info ========== */
.login-box,
.login-info,
.login-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.user-badge strong {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.header-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.header-btn-danger {
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-btn-warning {
  background: rgba(245, 158, 11, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-btn-info {
  background: rgba(14, 165, 233, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}


/* ========== Darkmode (17:00–08:00) ========== */

/* sanfter Übergang */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Basismode umschalten über Variablen */
html.dark-mode,
body.dark-mode {
  --bg: #282b30;
  /* Hintergrund */
  --text: #f5f5f5;
  /* Standard-Textfarbe */
  --muted: #aaaaaa;
  /* gedämpfte Texte */
}

/* Hintergrund wirklich dunkel setzen */
html.dark-mode,
body.dark-mode {
  background-color: #282b30;
  color: var(--text);
}

/* Panels dunkler */
body.dark-mode .panel {
  background: #32363d;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}

/* Panel-Header */
body.dark-mode .panel-header {
  background: #24272d;
  border-bottom: 1px solid #1c1e22;
}

/* Tabellen */
body.dark-mode .table-container {
  background: #32363d;
}

body.dark-mode .data-table th {
  background: #24272d;
  color: var(--text);
}

body.dark-mode .data-table td {
  border-bottom: 1px solid #1f2227;
}

body.dark-mode .data-table tr:hover {
  background: #2c3036;
}

/* Form-Container */
body.dark-mode .form-container {
  background: #32363d;
}

/* No-Data Meldungen */
body.dark-mode .no-data {
  color: #cccccc;
}

/* Navi etwas dunkler */
body.dark-mode .main-nav {
  background: #111;
}

/* Footer mit QR-Code etwas abtönen */
body.dark-mode .calendar-footer {
  background: transparent;
}

body.dark-mode .dienstplan-item {
  border-bottom-color: #1f2227;
}

body.dark-mode .dienstplan-date {
  background: #24272d;
  color: var(--text);
}

body.dark-mode .dienstplan-item.today {
  background: rgba(156, 39, 176, .16);
}

/* ========== Google Kalender Darkmode-Hack ========== */

/* GOOGLE CALENDAR DARKMODE – Anpassung Richtung #282b30 */

/* GOOGLE-KALENDER - Soft Dark Mode #282b30 */

/* Container bleibt normal */
.calendar-dark-wrap {
  position: relative;
  overflow: hidden;
}

/* Nur IFRAME stylen */
body.dark-mode .calendar-dark-wrap iframe {
  filter: invert(0.90)
    /* nur leicht invertieren */
    brightness(0.75)
    /* etwas abdunkeln */
    contrast(1.05);
  /* damit Schrift knackig bleibt */
}

/* =============================================
   Lagerverwaltung (Inventory Module) CSS
   ============================================= */

/* floor plan grid */
.room-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 6px;
  background: #e0e0e0;
  border: 2px solid #bbb;
  border-radius: 8px;
  padding: 8px;
  min-height: 480px;
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.grid-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 6px;
  padding: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
  min-height: 44px;
}

.grid-item:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .3);
}

.grid-item.typ-regal {
  background: var(--accent);
}

.grid-item.typ-schrank {
  background: #e67e22;
}

.grid-item.active-unit {
  background: var(--accent-active) !important;
  box-shadow: 0 0 10px var(--accent-active);
}

/* accordions for shelves */
.accordion-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}

.accordion-header {
  background: #f5f5f5;
  padding: 12px 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  user-select: none;
}

.accordion-header:hover {
  background: #eee;
}

.accordion-header::after {
  content: '▼';
  font-size: 0.8rem;
  transition: transform 0.2s;
}

.accordion-item.is-open .accordion-header::after {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 15px;
  border-top: 1px solid #eee;
}

.accordion-item.is-open .accordion-body {
  display: block;
}

/* status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.status-pill.status-offen {
  background: var(--muted);
}

.status-pill.status-vorhanden {
  background: var(--ok);
}

.status-pill.status-fehlend {
  background: var(--error);
}

/* touch buttons */
.touch-btn {
  min-height: 44px;
  min-width: 44px;
  font-size: 1.2rem;
  font-weight: bold;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #ccc;
  background: #eee;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  color: #333;
}

.touch-btn:active {
  background: #ddd;
}

/* live search list */
.search-results-list {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 5px;
  max-height: 250px;
  overflow-y: auto;
  position: absolute;
  width: 100%;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: var(--text);
}

.search-result-item:hover {
  background: #f5f5f5;
}

.breadcrumb-span {
  font-size: 0.75rem;
  color: var(--muted);
  display: block;
}

/* Dark mode overrides for lager */
body.dark-mode .room-grid {
  background: #24272d;
  border-color: #1c1e22;
}

body.dark-mode .accordion-item {
  border-color: #1f2227;
  background: #32363d;
}

body.dark-mode .accordion-header {
  background: #24272d;
  color: var(--text);
}

body.dark-mode .accordion-header:hover {
  background: #2c3036;
}

body.dark-mode .touch-btn {
  background: #24272d;
  border-color: #1f2227;
  color: #fff;
}

body.dark-mode .touch-btn:active {
  background: #1c1e22;
}

body.dark-mode .search-results-list {
  background: #32363d;
  border-color: #1f2227;
}

body.dark-mode .search-result-item {
  color: var(--text);
  border-bottom-color: #1f2227;
}

body.dark-mode .search-result-item:hover {
  background: #2c3036;
}

/* Print optimizations */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }
  .header, .main-nav, .nav-toggle, .no-print, .btn, .touch-btn, form, .login-info {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .panel {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .panel-body {
    overflow: visible !important;
  }
  .accordion-body {
    display: block !important;
    padding: 10px 0 !important;
  }
  .accordion-item {
    border: none !important;
    margin-bottom: 20px;
    page-break-inside: avoid;
  }
  .accordion-header {
    background: #eee !important;
    color: #000 !important;
    border-bottom: 2px solid #000 !important;
  }
  .accordion-header::after {
    display: none !important;
  }
  .status-pill {
    background: transparent !important;
    color: #000 !important;
    padding: 0 !important;
    font-size: 10pt !important;
  }
  .status-pill::before {
    content: '[';
  }
  .status-pill::after {
    content: ']';
  }
}

/* Lagerverwaltung: touch and keyboard ergonomics */
body.scroll-page .dashboard .btn,
body.scroll-page .dashboard .status-pill,
body.scroll-page .dashboard .tab-btn,
body.scroll-page .dashboard .search-result-item,
body.scroll-page .dashboard .admin-icon-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.scroll-page .dashboard .search-result-item {
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
}

body.scroll-page .dashboard input,
body.scroll-page .dashboard select,
body.scroll-page .dashboard textarea,
body.scroll-page .dashboard button,
body.scroll-page .dashboard a {
  scroll-margin: 80px;
}

body.scroll-page .dashboard input:focus-visible,
body.scroll-page .dashboard select:focus-visible,
body.scroll-page .dashboard textarea:focus-visible,
body.scroll-page .dashboard button:focus-visible,
body.scroll-page .dashboard a:focus-visible {
  outline: 3px solid var(--accent-active);
  outline-offset: 2px;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea,
body.dark-mode .quantity-input {
  background: #24272d;
  color: var(--text);
  border-color: #1f2227;
}

body.dark-mode .form-group select option,
body.dark-mode select option {
  background: #111;
  color: #fff;
}

body.dark-mode .choices,
body.dark-mode .choices__inner,
body.dark-mode .choices__input,
body.dark-mode .choices__list--dropdown,
body.dark-mode .choices__list[aria-expanded] {
  background: #111;
  color: #fff;
  border-color: #1f2227;
}

body.dark-mode .choices__item,
body.dark-mode .choices__placeholder {
  color: #fff;
}

body.dark-mode .choices__list--dropdown .choices__item--selectable,
body.dark-mode .choices__list[aria-expanded] .choices__item--selectable {
  background: #111;
  color: #fff;
}

body.dark-mode .choices__list--dropdown .choices__item--selectable.is-highlighted,
body.dark-mode .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: #24272d;
  color: #fff;
}

body.dark-mode .alert-item:hover,
body.dark-mode .planung-item:hover {
  background: #2c3036;
  color: var(--text);
}

body.dark-mode .alert-item.high-priority {
  background: #3a2629;
}

body.dark-mode .alert-item.medium-priority,
body.dark-mode .alert-item.low-priority {
  background: #32363d;
}

body.dark-mode .alert-item,
body.dark-mode .planung-item {
  border-bottom-color: #1f2227;
}

.maintenance-item {
  border-right-color: var(--error);
  margin-top: auto;
}

.maintenance-reason {
  color: var(--muted);
  font-size: .9rem;
  margin-top: 4px;
}


/* =========================================================
   DIENSTPLAN: Trenner zwischen Vergangenheit und Zukunft
   ========================================================= */
.dienstplan-divider {
  height: 2px;
  min-height: 2px;
  width: 100%;
  background: #d32f2f;
  /* negativer margin-top zieht die rote Linie exakt auf die
     1px-Trennlinie des vorherigen Termins, sodass diese
     komplett verdeckt wird und kein Doppelstrich entsteht */
  margin: -1px 0 5px 0;
  padding: 0;
  flex-shrink: 0;
  border-radius: 1px;
  position: relative;
  z-index: 1;
}

body.dark-mode .dienstplan-divider {
  background: #ef5350;
}

/* ========== Darkmode Ergänzungen für neue Komponenten ========== */
body.dark-mode .data-table.responsive-cards tr {
  background: #32363d;
  border-color: #3f444e;
}

body.dark-mode .data-table.responsive-cards td {
  border-bottom-color: #26292f;
}

body.dark-mode .data-table.responsive-cards td.actions {
  border-top-color: #3f444e;
}

body.dark-mode .chip-btn {
  background: #24272d;
  color: #cbd5e1;
  border-color: #3f444e;
}

body.dark-mode .chip-btn:hover {
  background: #2c3036;
}

body.dark-mode .chip-btn.active,
html.dark-mode .chip-btn.active,
body.dark-mode .chip-btn.active:hover,
html.dark-mode .chip-btn.active:hover,
body.dark-mode .chip-btn.active:focus,
html.dark-mode .chip-btn.active:focus {
  background: var(--primary, #c62828) !important;
  color: #fff !important;
  border-color: #ef5350 !important;
  box-shadow: 0 0 14px rgba(229, 57, 53, 0.85), 0 2px 8px rgba(198, 40, 40, 0.5) !important;
}

body.dark-mode .prio-btn[data-prio="2"] { background: #1b3d20; color: #a5d6a7; border-color: #2e7d32; }
body.dark-mode .prio-btn[data-prio="5"] { background: #3e2723; color: #ffe082; border-color: #f57f17; }
body.dark-mode .prio-btn[data-prio="8"] { background: #4a1919; color: #ffab91; border-color: #d84315; }
body.dark-mode .prio-btn[data-prio="10"] { background: #5c0d12; color: #ffcdd2; border-color: #c62828; }

body.dark-mode .preset-btn {
  background: #24272d;
  color: #cbd5e1;
  border-color: #3f444e;
}

body.dark-mode .preset-btn:hover {
  background: #2c3036;
}

body.dark-mode .btn-quick-fill {
  background: #1e3a5f;
  color: #7dd3fc;
  border-color: #0369a1;
}

body.dark-mode .file-upload-box {
  background: #24272d;
  border-color: #3f444e;
}

body.dark-mode .file-upload-box:hover {
  border-color: var(--primary-light);
  background: #2c3036;
}

body.dark-mode .list-filter-bar {
  background: #24272d;
  border-color: #3f444e;
}

body.dark-mode .filter-search input {
  background: #32363d;
  border-color: #3f444e;
  color: #fff;
}

body.dark-mode .filter-chip {
  background: #32363d;
  border-color: #3f444e;
  color: #cbd5e1;
}

body.dark-mode .filter-chip.active {
  background: var(--primary);
  color: #fff;
}

body.dark-mode .badge-category {
  background: #24272d;
  color: #cbd5e1;
  border-color: #3f444e;
}

body.dark-mode .badge-claimed {
  background: #1e3a5f;
  color: #7dd3fc;
  border-color: #0284c7;
}

body.dark-mode .badge-open {
  background: #24272d;
  color: #94a3b8;
  border-color: #3f444e;
}

body.dark-mode .badge-vehicle {
  background: #24272d;
  color: #f1f5f9;
}

/* ========== Teilaufgaben / Unterpositionen ========== */
.subitems-box {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: #1e293b;
}

.subitems-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.subitems-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.86rem;
}

.subitems-item {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subitems-badge {
  font-family: monospace;
  font-weight: 700;
  background: #e2e8f0;
  color: #1e293b;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.subitems-text {
  color: inherit;
}

.subitems-text.is-done {
  text-decoration: line-through;
  color: #94a3b8;
}

/* Dark Mode für Teilaufgaben / Unterpositionen */
body.dark-mode .subitems-box,
html.dark-mode .subitems-box {
  background: #24272d !important;
  border-color: #3e444e !important;
  color: #f1f5f9 !important;
}

body.dark-mode .subitems-title,
html.dark-mode .subitems-title {
  color: #94a3b8 !important;
}

body.dark-mode .subitems-badge,
html.dark-mode .subitems-badge {
  background: #383d46 !important;
  color: #f1f5f9 !important;
  border: 1px solid #4b525d;
}

body.dark-mode .subitems-text,
html.dark-mode .subitems-text {
  color: #f1f5f9 !important;
}

body.dark-mode .subitems-text.is-done,
html.dark-mode .subitems-text.is-done {
  color: #64748b !important;
}

/* Dark Mode für Amtliche Warnungen */
body.dark-mode .warnings-section,
html.dark-mode .warnings-section {
  background: #1e2124 !important;
  border-top-color: #c62828 !important;
}

body.dark-mode .warning-panel-header,
html.dark-mode .warning-panel-header {
  background: #2b1f1f !important;
  border-bottom-color: #3e2723 !important;
}

body.dark-mode .warning-panel-header h2,
html.dark-mode .warning-panel-header h2 {
  color: #ff8a80 !important;
}

body.dark-mode .warning-card,
html.dark-mode .warning-card {
  background: #262a30 !important;
  border-color: #383d46 !important;
  border-left-color: var(--warning-color, #e53935) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .warning-card-headline,
html.dark-mode .warning-card-headline {
  color: #f1f5f9 !important;
}

body.dark-mode .warning-card-area,
html.dark-mode .warning-card-area {
  color: #94a3b8 !important;
}

body.dark-mode .warning-card-description,
html.dark-mode .warning-card-description {
  color: #cbd5e1 !important;
}

body.dark-mode .warning-card-time,
html.dark-mode .warning-card-time {
  color: #94a3b8 !important;
}

body.dark-mode .warning-badge-cat,
html.dark-mode .warning-badge-cat {
  background: #333842 !important;
  border-color: #474f5d !important;
  color: #e2e8f0 !important;
}

body.dark-mode .warning-card-instruction,
html.dark-mode .warning-card-instruction {
  background: #2d261a !important;
  border-color: #5d4a22 !important;
  color: #ffe082 !important;
}




/* Emoji-Fallbacks fuer Chromium/Linux (z. B. Raspberry Pi OS). Fuer farbige Emojis muss
   zusaetzlich ein Emoji-Font auf dem Betriebssystem installiert sein. */
.emoji, .weather-icon, .weather-forecast-icon { font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; }

/* Fahrzeugplanung: kompakte, klar gegliederte Planungskacheln */
@media (max-width: 900px) {
  #planung-table.responsive-cards tr.planung-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 14px;
    padding: 14px 16px;
    margin: 0 0 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary, #3b82f6);
    border-radius: 12px;
    background: var(--card-bg, #30343a);
    box-shadow: var(--shadow-sm);
  }
  #planung-table.responsive-cards tr.planung-row > td {
    min-width: 0;
    width: auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 5px 0;
    border: 0;
    font-size: .92rem;
    overflow-wrap: anywhere;
  }
  #planung-table.responsive-cards tr.planung-row > td::before { display:none; }
  #planung-table.responsive-cards tr.planung-row > td[data-label="ID"] { display:none; }
  #planung-table.responsive-cards tr.planung-row > td[data-label="Zweck"] {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 0 0 7px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
  }
  #planung-table.responsive-cards tr.planung-row > td[data-label="Von"] {
    grid-column: 1 / -1;
    grid-row: 2;
    color: var(--muted, #aeb6c2);
    font-size: .86rem;
    padding: 2px 0 8px;
  }
  #planung-table.responsive-cards tr.planung-row > td[data-label="Bis"] {
    grid-column: 1 / -1;
    grid-row: 3;
    color: var(--muted, #aeb6c2);
    font-size: .86rem;
    padding: 0 0 8px;
  }
  #planung-table.responsive-cards tr.planung-row > td[data-label="Fahrer"] {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  #planung-table.responsive-cards tr.planung-row > td[data-label="Fahrzeuge"] {
    grid-column: 1 / -1;
    grid-row: 5;
    align-items: flex-start;
  }
  #planung-table.responsive-cards tr.planung-row > td.actions {
    grid-column: 1 / -1;
    grid-row: 6;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    margin-top: 5px;
    border-top: 1px solid var(--border);
  }
  #planung-table.responsive-cards .badge-vehicle {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    padding: 4px 8px;
    border-radius: 7px;
    line-height: 1.35;
  }
  #planung-table.responsive-cards td[data-label="Zweck"] .badge { margin: 3px 0 0 !important; }
}
