/* AD AutoClass – Komponenten-Design-System
 * Zentral gepflegt: ändert sich hier ein Button-Stil, wirkt sich das
 * automatisch auf alle Seiten aus, ohne einzelne Templates anzufassen.
 */

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--brand-primary);
  color: var(--text-on-brand);
}

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

.btn-secondary {
  background: var(--surface-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
}

.btn-sm {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: 13.5px;
}

/* WhatsApp-Vorlagen mit frei vom Betrieb gewählter Farbe (siehe
 * models/whatsapp_vorlage.py, templates/auftraege/detail.html) - Farbe
 * kommt zur Laufzeit aus der DB, daher als CSS-Custom-Property statt
 * fester Klasse, nach demselben color-mix()-Muster wie .status-badge--*
 * weiter unten. */
.btn-vorlage-farbe {
  color: var(--vorlage-farbe);
  background: color-mix(in srgb, var(--vorlage-farbe) 16%, transparent);
  border-color: color-mix(in srgb, var(--vorlage-farbe) 35%, transparent);
}

.btn-vorlage-farbe:hover {
  background: color-mix(in srgb, var(--vorlage-farbe) 26%, transparent);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card-elevated {
  background: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text-primary);
}

.card-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ---------- Runde 5: klickbare Karten/Zeilen + ausgegraute Aktions-Buttons ---------- */
.card--clickable {
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.card--clickable:hover {
  background: var(--surface-hover);
}

.table-row-clickable {
  cursor: pointer;
}

.table-row-clickable:hover {
  background: var(--surface-hover);
}

.btn--geklickt {
  opacity: 0.55;
}

/* ---------- Runde 5 Teil 2: Unterschrift-Canvas (Abtretung) ---------- */
.signatur-canvas {
  display: block;
  width: 100%;
  max-width: 600px;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

/* ---------- Status Badge (Auftragsstatus - eigene Farbwelt) ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge--angelegt {
  color: var(--status-angelegt);
  background: color-mix(in srgb, var(--status-angelegt) 16%, transparent);
}

.status-badge--bestellt {
  color: var(--status-bestellt);
  background: color-mix(in srgb, var(--status-bestellt) 16%, transparent);
}

.status-badge--eingetroffen {
  color: var(--status-eingetroffen);
  background: color-mix(in srgb, var(--status-eingetroffen) 16%, transparent);
}

.status-badge--urlaub {
  color: var(--status-urlaub);
  background: color-mix(in srgb, var(--status-urlaub) 16%, transparent);
}

.status-badge--abgelehnt {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Neutrales Badge für Rollen/Aktiv-Status u.ä. (KEIN Auftragsstatus) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-3);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.badge--success {
  color: var(--success);
  border-color: transparent;
  background: var(--success-soft);
}

.badge--muted {
  color: var(--text-muted);
}

.badge--brand {
  color: var(--brand-primary);
  border-color: transparent;
  background: var(--brand-primary-soft);
}

/* Klickbare Platzhalter-Chips (z.B. {VORNAME}) in Textvorlagen-Formularen -
   fügen den Platzhalter per Klick an der Cursor-Position im zugehörigen
   Textfeld ein, siehe app.js "Platzhalter-Chips" und
   templates/pages/_whatsapp_vorlage_felder.html. */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip-button {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease;
}

.chip-button:hover {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  background: var(--brand-primary-soft);
}

.chip-button:active {
  transform: scale(0.95);
}

.chip-button.is-copied {
  color: var(--success);
  border-color: var(--success);
  background: var(--success-soft);
}

/* ---------- Formulare ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 46px;
  padding: 0 var(--space-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.textarea {
  height: auto;
  min-height: 110px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: var(--focus-ring);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group .input {
  padding-right: 48px;
}

.input-group__action {
  position: absolute;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.input-group__action:hover {
  color: var(--text-primary);
}

.field-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

.field-error {
  font-size: 12.5px;
  color: var(--danger);
}

/* ---------- Alert / Flash-Meldungen ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
}

.alert-danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}

.alert-success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
  color: var(--success);
}

.alert-info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--brand-secondary) 35%, transparent);
  color: var(--brand-secondary);
}

.alert-warning {
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 35%, transparent);
  color: var(--warning);
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
  color: var(--text-secondary);
}

.empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-elevated);
  color: var(--brand-primary);
}

.empty-state__title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
}

.empty-state__text {
  max-width: 40ch;
  font-size: 13.5px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 60;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

/* Größere Modal-Variante für die Dokument-Vorschau (Bild/PDF direkt im
   Fenster statt Download + separatem Browser-Tab) - siehe
   templates/auftraege/detail.html + static/js/app.js. */
.modal--preview {
  max-width: 800px;
}

.dokument-vorschau-bild {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: var(--radius-md);
}

.dokument-vorschau-pdf {
  display: block;
  width: 100%;
  height: 78vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ---------- PageHeader ---------- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page-header__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-header__subtitle {
  margin-top: var(--space-1);
  color: var(--text-secondary);
  font-size: 13.5px;
}

/* ---------- Table (Benutzerverwaltung etc.) ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

table.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

table.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

table.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

table.table tbody tr:last-child td {
  border-bottom: none;
}

table.table tbody tr:hover {
  background: var(--surface-hover);
}

/* ---------- Benutzer-Karten (mobile Alternative zur Tabelle) ---------- */
.user-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
}

.user-card__info {
  flex: 1;
  min-width: 0;
}

.user-card__name {
  font-weight: 650;
  font-size: 14.5px;
}

.user-card__meta {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.user-card__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---------- UserAvatar / UserMenu ---------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 18px;
}

.user-menu {
  position: relative;
}

.user-menu__dropdown {
  display: none;
  margin-top: var(--space-2);
}

.user-menu.is-open .user-menu__dropdown {
  display: block;
}

.user-menu__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.user-menu__trigger:hover {
  background: var(--surface-hover);
}

.user-menu__info {
  flex: 1;
  min-width: 0;
}

.user-menu__name {
  font-size: 13.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__role {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Tabs (z.B. Auftrags-Detailseite: Kunde/Fahrzeug/Versicherung/Termin/Ware) ---------- */
.tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
  overflow-x: auto;
}

.tabs__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tabs__item:hover {
  color: var(--text-primary);
}

.tabs__item.is-active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* ---------- Such-/Filterleiste (Listenansichten) ---------- */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.list-toolbar__search {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.list-toolbar__search svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.list-toolbar__search .input {
  padding-left: 44px;
}

.list-toolbar .select {
  width: auto;
  min-width: 160px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.pagination__item {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

.pagination__item:hover {
  background: var(--surface-hover);
}

.pagination__item.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagination__status {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- Kalender (Monatsansicht) ---------- */
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.calendar-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.calendar-legend__dot--angelegt {
  background: var(--status-angelegt);
}

.calendar-legend__dot--bestellt {
  background: var(--status-bestellt);
}

.calendar-legend__dot--eingetroffen {
  background: var(--status-eingetroffen);
}

.calendar-legend__dot--urlaub {
  background: var(--status-urlaub);
}

.calendar-legend__dot--leihwagen {
  background: var(--status-leihwagen);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-grid__weekday {
  background: var(--surface);
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

.calendar-day {
  background: var(--surface);
  min-height: 96px;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.calendar-day--empty {
  background: var(--background);
}

.calendar-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-day__number {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-secondary);
}

.calendar-day--today .calendar-day__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--text-on-brand);
}

.calendar-day__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.calendar-day:hover .calendar-day__add,
.calendar-day__add:focus-visible {
  opacity: 1;
}

.calendar-day__add:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

@media (hover: none) {
  .calendar-day__add {
    opacity: 1;
  }
}

.calendar-day__entry {
  display: block;
  font-size: 11px;
  font-weight: 650;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day__entry--angelegt {
  color: var(--status-angelegt);
  background: color-mix(in srgb, var(--status-angelegt) 18%, transparent);
}

.calendar-day__entry--bestellt {
  color: var(--status-bestellt);
  background: color-mix(in srgb, var(--status-bestellt) 18%, transparent);
}

.calendar-day__entry--eingetroffen {
  color: var(--status-eingetroffen);
  background: color-mix(in srgb, var(--status-eingetroffen) 18%, transparent);
}

.calendar-day__entry--urlaub {
  color: var(--status-urlaub);
  background: color-mix(in srgb, var(--status-urlaub) 18%, transparent);
}

.calendar-day__entry--leihwagen {
  color: var(--status-leihwagen);
  background: color-mix(in srgb, var(--status-leihwagen) 18%, transparent);
}

@media (max-width: 640px) {
  .calendar-day {
    min-height: 64px;
    padding: var(--space-1);
  }

  .calendar-grid__weekday {
    padding: var(--space-1);
    font-size: 10px;
  }

  .calendar-day__entry {
    font-size: 10px;
  }
}

/* ---------- NavigationItem ---------- */
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-item svg {
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.nav-item.is-active {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
}

.nav-item__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-section-label {
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Arbeitsplan-Zeitleiste ("Heutiger Arbeitsplan") ---------- */
.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.timeline-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timeline-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.timeline-axis {
  display: flex;
}

.timeline-axis__label-col {
  width: 150px;
  flex-shrink: 0;
}

.timeline-axis__hours {
  position: relative;
  flex: 1;
  height: 18px;
}

.timeline-axis__hour {
  position: absolute;
  font-size: 11px;
  color: var(--text-muted);
  transform: translateX(-50%);
}

.timeline-row {
  display: flex;
  align-items: center;
  min-height: 52px;
}

.timeline-row__label {
  width: 150px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding-right: var(--space-2);
}

.timeline-row__label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Route vorschlagen"-Kurzlink pro Mitarbeiter-Zeile (Phase 2
   Routenoptimierung, siehe blueprints/arbeitsplan.py route_vorschlag()) -
   bewusst kleiner als .icon-btn (44px), da er in die schmale 150px-
   Label-Spalte neben den Namen passen muss. */
.timeline-row__route-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.timeline-row__route-btn:hover {
  background: var(--surface-hover);
  color: var(--brand-primary);
}

/* ---------- Routenvorschlag (Phase 2 Routenoptimierung, siehe
   templates/arbeitsplan/route_vorschlag.html) ---------- */
.route-segment-row--konflikt {
  background: var(--arbeitsplan-konflikt-soft);
}

.route-segment-row--konflikt td {
  color: var(--arbeitsplan-konflikt);
}

.route-konflikt-hinweis {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--arbeitsplan-konflikt);
}

.route-segment-hinweis {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}

.timeline-row__track {
  position: relative;
  flex: 1;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to right,
    var(--border) 0,
    var(--border) 1px,
    transparent 1px,
    transparent calc(100% / 9)
  );
}

.timeline-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: var(--radius-sm);
  border: none;
  padding: 0 var(--space-2);
  display: flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand-on-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: box-shadow var(--transition-fast);
}

.timeline-block:hover,
.timeline-block:focus-visible {
  box-shadow: 0 0 0 2px var(--text-primary);
  outline: none;
}

.timeline-block--fahrt {
  background: var(--arbeitsplan-fahrt);
}

.timeline-block--mobil {
  background: var(--arbeitsplan-mobil);
}

.timeline-block--station {
  background: var(--arbeitsplan-station);
}

.timeline-block--buero {
  background: var(--arbeitsplan-buero);
}

.timeline-block--pause {
  background: var(--arbeitsplan-pause);
  color: var(--text-primary);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.08) 0,
    rgba(255, 255, 255, 0.08) 2px,
    transparent 2px,
    transparent 7px
  );
}

.timeline-detail {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- Runde 6: Klick-Anleitung (gefuehrte Tour) ---------- */
.tour-dim {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(15, 15, 20, 0.55);
  cursor: pointer;
}

.tour-highlight {
  position: relative;
  z-index: 1000;
  outline: 3px solid var(--brand, #4f46e5);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

.tour-tooltip {
  position: fixed;
  z-index: 1001;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--surface-elevated, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  padding: var(--space-4);
}

.tour-tooltip__text {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.tour-tooltip__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.tour-tooltip__zaehler {
  font-size: 12px;
  color: var(--text-secondary);
}

.tour-tooltip__buttons {
  display: flex;
  gap: var(--space-2);
}

/* ---------- Auftrags-Arbeitsplatz: vertikale Abschnitte statt Tabs ---------- */
.arbeitsplatz {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.arbeitsplatz-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

.arbeitsplatz-section > summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 650;
}

.arbeitsplatz-section > summary::-webkit-details-marker {
  display: none;
}

.arbeitsplatz-section[open] > summary {
  border-bottom: 1px solid var(--border);
}

.arbeitsplatz-section__hinweis {
  flex: 1;
  min-width: 0;
  font-weight: 400;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arbeitsplatz-section__chevron {
  flex: 0 0 auto;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}

.arbeitsplatz-section[open] > summary .arbeitsplatz-section__chevron {
  transform: rotate(180deg);
}

.arbeitsplatz-section__body {
  padding: var(--space-4);
  padding-top: var(--space-1);
}

.arbeitsplatz-jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.arbeitsplatz-jump__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--space-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.arbeitsplatz-jump__chip:hover {
  border-color: var(--brand, #4f46e5);
  color: var(--text-primary);
}
