/* Linienverkehr-Stammdaten — gruppierte Liste (Alt-System-Optik) */

/* Aufklappbare Tour-Gruppe */
.line-group {
  border: 1px solid var(--color-border, #e0e3ea);
  border-radius: 6px;
  margin-bottom: 4px;
  background: var(--color-surface, #fff);
  overflow: hidden;
}
.line-group.is-pausiert { opacity: 0.7; }
.line-group.is-beendet  { opacity: 0.5; }

/* Gruppen-Kopfzeile in der Kundenfarbe, klickbar zum Auf-/Zuklappen */
.line-group-header {
  display: grid;
  /* Spalten: Aufklapp-Pfeil (::before) · TourNr · Linie · Wochentage · Zeit ·
     Bus · Strecke · Status — der Pfeil ist selbst ein Grid-Element. */
  grid-template-columns: auto 110px 1fr minmax(180px, auto) minmax(140px, auto) minmax(160px, auto) auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 14px;
  background: var(--color-brand-primary-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--color-brand-primary) 25%, white);
  cursor: pointer;
  list-style: none;
  font-size: 0.92em;
  user-select: none;
}
.line-group-header::-webkit-details-marker { display: none; }
.line-group-header::before {
  content: "▶";
  display: inline-block;
  margin-right: 6px;
  font-size: 0.7em;
  color: #6b7280;
  transition: transform 0.15s ease;
}
.line-group[open] > .line-group-header::before {
  transform: rotate(90deg);
}
.line-group-header:hover { background: color-mix(in srgb, var(--color-brand-primary) 16%, white); }

.line-group-tour {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.line-group-linie { font-weight: 500; }
.line-group-time {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.line-group-bus { font-size: 0.9em; color: var(--color-text-muted, #6b7280); }
.line-group-weekdays { display: flex; gap: 3px; }

/* Daten-Zeile pro Wochentag (innen) — Spreadsheet-Optik wie im Alt-System */
.line-group-body { background: var(--color-surface, #fff); }
.line-row {
  display: grid;
  grid-template-columns: 60px minmax(220px, 1.4fr) 80px 40px 60px 70px 70px minmax(140px, auto) 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid #f1f3f7;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.08s ease;
}
.line-row:last-child { border-bottom: none; }
.line-row:hover { background: var(--color-brand-primary-soft); }
.line-row:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: -2px;
}
.line-row-tour { font-variant-numeric: tabular-nums; color: var(--color-text-muted, #6b7280); }
.line-row-status { font-size: 0.85em; color: var(--color-text-muted, #6b7280); }
.line-row-wd-num { font-variant-numeric: tabular-nums; color: var(--color-text-muted, #6b7280); text-align: right; }
.line-row-wd-label { font-weight: 500; }
.line-row-time { font-variant-numeric: tabular-nums; text-align: right; }
.line-row-bus { color: var(--color-text-muted, #6b7280); }
.line-row-extra { font-size: 0.82em; }
.line-row-empty { padding: 10px 14px; }
.line-weekdays {
  display: flex;
  gap: 3px;
}
.line-weekday-chip {
  display: inline-block;
  width: 22px;
  text-align: center;
  font-size: 0.78em;
  padding: 2px 0;
  border-radius: 3px;
  background: var(--color-surface-alt, #eef1f6);
  color: var(--color-text-muted, #6b7280);
}
.line-weekday-chip.is-on {
  background: var(--color-brand-primary);
  color: var(--color-brand-primary-on);
  font-weight: 600;
}
.line-time {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 0.95em;
}
.line-bus {
  font-size: 0.9em;
  color: var(--color-text-muted, #6b7280);
}
.line-status-chip {
  font-size: 0.78em;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--color-surface-alt, #eef1f6);
  text-transform: lowercase;
}
.line-status-chip.is-aktiv    { background: #dcfce7; color: #166534; }
.line-status-chip.is-pausiert { background: #fef3c7; color: #92400e; }
.line-status-chip.is-beendet  { background: #f3f4f6; color: #6b7280; }

/* Wochentag-Toggle im Dialog */
.weekday-field {
  border: 1px solid var(--color-border, #e0e3ea);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0;
}
.weekday-field legend {
  padding: 0 4px;
  font-size: 0.9em;
  color: var(--color-text-muted, #6b7280);
}
.weekday-toggle {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.weekday-toggle label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95em;
  cursor: pointer;
}

.checkbox-field {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
}
.checkbox-field input {
  width: auto;
}

/* Confirm-Dialog */
.confirm-dialog { max-width: 420px; }
.confirm-body { padding: 8px 4px 4px; }

.btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn.btn-ghost.btn-danger {
  background: transparent;
  color: #dc2626;
  border-color: transparent;
}
.btn.btn-ghost.btn-danger:hover {
  background: #fef2f2;
}

/* Strecken-Chip: zeigt auf einen Blick, ob die Linie nach Art. 3 lit. a
   VO 561/2006 von den EU-Lenkzeiten ausgenommen ist (bis 50 km einfache
   genehmigte Strecke). Ohne Angabe gilt sie als nicht bestätigt ausgenommen. */
.line-chip-km {
  font-size: var(--font-size-xs, 12px);
  font-weight: var(--font-weight-bold);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.line-chip-km.is-frei  { background: #ecfdf3; color: #166534; border: 1px solid #86efac; }
.line-chip-km.is-eu    { background: #eef2ff; color: #3730a3; border: 1px solid #a5b4fc; }
.line-chip-km.is-fehlt { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
