:root {
  --blau: #007AFF;
  --grau-hell: #F5F5F7;
  --grau-rand: #D2D2D7;
  --grau-text: #6E6E73;
  --gruen: #34C759;
  --schwarz: #1D1D1F;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--grau-hell);
  color: var(--schwarz);
  -webkit-font-smoothing: antialiased;
}
header.kopfzeile {
  background: rgba(255,255,255,0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--grau-rand);
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 16px 32px;
}
.kopfzeile-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
}
.aktion-bereich {
  display: flex;
  align-items: center;
  gap: 12px;
}
.zeitstempel {
  font-size: 13px;
  color: var(--grau-text);
}
.knopf {
  background: var(--blau);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.knopf:hover { opacity: 0.85; }
.knopf:active { transform: scale(0.97); }
.knopf.sekundaer {
  background: white;
  color: var(--schwarz);
  border: 1px solid var(--grau-rand);
}
.tableiste {
  max-width: 1100px;
  margin: 0 auto;
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grau-text);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
}
.tab.aktiv {
  background: var(--schwarz);
  color: white;
}
.tab:not(.aktiv):hover {
  background: rgba(0,0,0,0.06);
}
main {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 32px;
}
.karte {
  background: white;
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
  overflow: hidden;
}
.tabellen-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grau-text);
  background: var(--grau-hell);
  border-bottom: 1px solid var(--grau-rand);
}
tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid #F0F0F2;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #FAFAFC; }
tbody tr:hover { background: #F2F2F5; }

/* Letzte Spalte (Aktion/Knopf) am rechten Rand fixieren, damit sie beim
   horizontalen Scrollen immer sichtbar bleibt */
thead th:last-child, tbody td:last-child {
  position: sticky;
  right: 0;
  background: white;
  box-shadow: -6px 0 8px -6px rgba(0,0,0,0.08);
}
thead th:last-child { background: var(--grau-hell); }
tbody tr:nth-child(even) td:last-child { background: #FAFAFC; }
tbody tr:hover td:last-child { background: #F2F2F5; }
.status-punkt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 980px;
}
.status-gefunden { background: rgba(52,199,89,0.12); color: #248A3D; }
.status-fehlt { background: rgba(142,142,147,0.12); color: var(--grau-text); }
.leer-zustand {
  padding: 64px 32px;
  text-align: center;
}
.leer-zustand .haken {
  font-size: 48px;
  margin-bottom: 12px;
}
.leer-zustand h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
}
.leer-zustand p {
  color: var(--grau-text);
  margin: 0;
  font-size: 14px;
}
.noch-nie {
  padding: 64px 32px;
  text-align: center;
  color: var(--grau-text);
  font-size: 14px;
}

/* Formular-Elemente (Stammdaten) */
.formular {
  padding: 32px;
}
.formular-abschnitt {
  margin-bottom: 28px;
}
.formular-abschnitt h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grau-text);
  margin: 0 0 14px;
}
.formular-raster {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.feld {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feld.voll { grid-column: 1 / -1; }
.feld label {
  font-size: 13px;
  font-weight: 500;
  color: var(--grau-text);
}
.feld input, .feld textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--grau-rand);
  border-radius: 10px;
  background: var(--grau-hell);
  color: var(--schwarz);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.feld input:focus, .feld textarea:focus {
  border-color: var(--blau);
  background: white;
}
.formular-fuss {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #F0F0F2;
}
.erfolg-banner {
  background: rgba(52,199,89,0.12);
  color: #248A3D;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

/* Dropdown für mehrere Transportauftrag-Links */
.dropdown-wrapper { position: relative; display: inline-block; }
.dropdown-knopf { border: none; cursor: pointer; font-family: inherit; }
.dropdown-liste {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 6px;
  min-width: 140px;
  z-index: 20;
}
.dropdown-liste.offen { display: block; }
.dropdown-liste a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--schwarz);
  text-decoration: none;
  white-space: nowrap;
}
.dropdown-liste a:hover { background: var(--grau-hell); }

/* Lade-Overlay während "Aktualisieren" */
.lade-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245,245,247,0.9);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.lade-overlay.sichtbar { visibility: visible; opacity: 1; }
.lade-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--grau-rand);
  border-top-color: var(--blau);
  border-radius: 50%;
  animation: lade-drehung 0.8s linear infinite;
}
.lade-overlay span {
  font-size: 14px;
  color: var(--grau-text);
  font-weight: 500;
}
@keyframes lade-drehung {
  to { transform: rotate(360deg); }
}
