/*
  Lokani – Bereich Termine: Kalender (Tag = Werkstatttag, Woche als Liste, Monat mit FullCalendar; seit 0.59), Terminliste-Zubehör,
  Mechaniker-Chip, Arbeitsvorlagen im Terminformular. Bis 0.53 in erp.css; Farben nur über Tokens (kein Roh-Hex).
  Die Termin-Plakette ist Baustein plakette (status.css: .plakette.marke-pill / .status-chip).
*/
/* ---------- Kalender (neu seit 0.59, Sprache der Übersicht): Kopf, Kennzahlen, Tag = Werkstatttag ---------- */
.kal-kopf { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.kal-titel { display: flex; flex-direction: column; min-width: 0; }
.kal-titel h1 { font-size: 1.5rem; }
.kal-steuerung { display: flex; align-items: center; gap: .5rem .75rem; flex-wrap: wrap; }
.kal-navi { display: flex; align-items: center; gap: .375rem; }
.kal-datum { display: flex; align-items: center; gap: .375rem; margin: 0; }
.kal-datum .eingabe { width: auto; }
.kal-datum__los.nur-vorlesen:focus-visible { position: static; width: auto; height: auto; margin: 0; clip: auto; clip-path: none;
  overflow: visible; white-space: nowrap; }
/* Ansichten: Lagune-Hauch für die gewählte (nur „+ Termin“ ist gefüllt – One Laguna Rule) */
.kal-ansichten { display: inline-flex; padding: 3px; gap: 2px; background: var(--flaeche-2); border-radius: var(--radius); }
.kal-ansichten__eintrag { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; min-width: 4.5rem;
  padding: 0 .875rem; font-weight: 600; color: var(--text-leise); text-decoration: none; border-radius: 8px; }
.kal-ansichten__eintrag:hover { color: var(--text); text-decoration: none; background: var(--flaeche); }
.kal-ansichten__eintrag.ist-aktiv { color: var(--primaer-text); background: var(--flaeche);
  box-shadow: inset 0 0 0 1px var(--primaer-linie); }
.kal-hinweise { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: 1rem; }
.kal-hinweise__eintrag { display: inline-flex; align-items: center; gap: .375rem; font-size: .875rem; }
.kal-tag__hinweis { padding-inline-end: .5rem; }
.tag-plan__neu { flex: none; margin-inline-start: auto; width: 44px; min-height: 44px; }
/* mit Zeitachse: „+“ erscheint beim Überfahren der Spalte (oder per Tastatur), damit die Namen ganz lesbar bleiben */
@media (min-width: 1200px) {
  .tag-plan__neu { position: absolute; inset-inline-end: .25rem; top: 50%; translate: 0 -50%; width: 2.25rem; min-height: 2.25rem;
    background: var(--flaeche); box-shadow: var(--schatten-feld); opacity: 0; transition: opacity .15s ease-out; }
  .tag-plan__spur:hover .tag-plan__neu, .tag-plan__neu:focus-visible { opacity: 1; }
}
/* Ziehen in der Zeitleiste (static/js/tagesplan.js) */
.tag-plan--kalender .tag-plan__knopf[data-id] { cursor: grab; }
@media (min-width: 1200px) { .tag-plan--kalender .tag-plan__knopf[data-id] { touch-action: none; } }
.zieht-termin, .zieht-termin * { cursor: grabbing !important; user-select: none; }
.tag-plan__termin.zieht { opacity: .4; }
.tag-plan__geist { z-index: 5; pointer-events: none; left: 0; width: 100%; }
.tag-plan__geist .tag-plan__knopf { box-shadow: var(--schatten-hoch); border-color: var(--primaer); }
@media (max-width: 1199.98px) {
  .kal-steuerung { width: 100%; gap: .5rem; }
  .kal-datum .eingabe { width: 9.25rem; }
  .kal-ansichten__eintrag { min-width: 4rem; padding: 0 .75rem; }
}
@media (max-width: 767.98px) {
  .kal-ansichten { flex: 1 1 100%; }
  .kal-steuerung > .knopf--primaer { flex: 1; justify-content: center; }
  .kal-ansichten__eintrag { flex: 1; min-width: 0; }
}
.m-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--text); }
.m-chip::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: none;  /* Ring = Person, Punkt = Status (0.58) */
  border: 3px solid var(--m-farbe, var(--leise)); box-sizing: border-box; flex: none; }
.vorlagen { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 6px; }
.vorlagen label { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border: 1px solid var(--linie); border-radius: var(--r-klein); cursor: pointer; background: var(--flaeche-2); margin: 0; font-weight: 500; font-size: .92rem; }
.vorlagen label:has(input:checked) { border-color: var(--primaer); background: var(--primaer-hell); }  /* bis 0.58 Signalorange */
.vorlagen label small { margin-left: auto; color: var(--leise); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dauer-anzeige { font-weight: 700; font-variant-numeric: tabular-nums; }
.erinnerung-chip { display: inline-flex; align-items: center; gap: .375rem; min-height: 36px; padding: .25rem .75rem; border-radius: 99px;
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--text); text-decoration: none; font-size: .875rem; }
.erinnerung-chip:hover { border-color: var(--primaer); text-decoration: none; }
.erinnerung-chip .icon { width: 1rem; height: 1rem; color: var(--primaer-text); }
.erinnerung-chip.faellig { font-weight: 600; border-color: color-mix(in oklab, var(--rot) 40%, var(--flaeche)); }
.hu-wahl label { gap: 8px; }
.hu-wahl .feld__hilfe { margin-left: 28px; }
.kal-voll-rahmen .karte__inhalt { padding: .75rem; }
.kal-meldung:empty { display: none; }
.kal-meldung { margin-bottom: .75rem; display: grid; gap: .5rem; }
.kal-meldung .hinweis { margin: 0; }
/* ---------- Monat (FullCalendar) im Lokani-Gewand: ruhige Zellen, Fläche = Status, Person = Ring ---------- */
.fc {
  --fc-border-color: color-mix(in oklab, var(--linie) 70%, transparent);
  --fc-page-bg-color: var(--flaeche);
  --fc-neutral-bg-color: var(--flaeche);
  --fc-today-bg-color: var(--aktiv-grund);
  --fc-now-indicator-color: var(--text);
  --fc-highlight-color: color-mix(in oklab, var(--primaer) 15%, transparent);
  --fc-event-bg-color: var(--flaeche);
  --fc-event-border-color: var(--linie-stark);
  --fc-event-text-color: var(--text);
  --fc-small-font-size: .8125rem;
  font-size: .875rem;
}
.fc .fc-col-header-cell { background: none; }
.fc .fc-col-header-cell-cushion { padding: .5rem; color: var(--text-leise); font-weight: 600; font-size: .8125rem; text-decoration: none; }
.fc .fc-daygrid-day-top { flex-direction: row; }
.fc .fc-scrollgrid { border-radius: var(--radius); overflow: hidden; }
.fc .fc-daygrid-day-number { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; min-height: 2rem;
  margin: .25rem; padding: 0 .375rem; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none;
  border-radius: 99px; }
.fc .fc-daygrid-day-number:hover { background: var(--flaeche-2); text-decoration: none; }
.fc .fc-day-today .fc-daygrid-day-number { color: var(--auf-primaer); background: var(--erp-primaer-flaeche); }
.fc .fc-day-other .fc-daygrid-day-top { opacity: 1; }
.fc .fc-day-other .fc-daygrid-day-number { color: var(--text-leise); font-weight: 500; }
.fc .fc-more-link { display: inline-flex; align-items: center; min-height: 28px; padding: 0 .375rem; color: var(--primaer-text);
  font-weight: 600; font-size: .8125rem; }
.fc .fc-popover { background: var(--flaeche); border-radius: var(--radius); box-shadow: var(--schatten-menue); }
.fc .fc-popover-header { background: var(--flaeche-2); }
.fc .erp-termin, .fc .erp-termin:hover { color: var(--text); text-decoration: none; }
.fc .erp-termin { background: var(--t-grund, var(--flaeche)); border: 1px solid var(--t-linie, var(--linie-stark)); border-radius: 6px; }
.fc .erp-termin:hover { border-color: var(--t-farbe, var(--text-leise)); }
.fc .erp-termin.offen { border-style: dashed; }
.fc .erp-termin.status-abgesagt .kunde { text-decoration: line-through; color: var(--text-leise); }
.fc .erp-termin .fc-event-main { flex: 1; min-width: 0; color: inherit; padding: 4px 7px 5px; overflow: hidden; }
.fc-daygrid-event.erp-termin { white-space: normal; margin: 1px 4px 3px; }
.erp-termin-inhalt { width: 100%; display: grid; gap: 1px; line-height: 1.25; font-size: .8125rem; }
.erp-termin-inhalt .erste { display: flex; gap: 4px; align-items: center; min-width: 0; }
.erp-termin-inhalt .zeit { font-variant-numeric: tabular-nums; font-weight: 600; }
.erp-termin-inhalt .kuerzel { margin-inline-start: auto; }
.erp-termin-inhalt .kunde { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-termin-inhalt .zeile { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-daygrid-event .erp-termin-inhalt .zeile { display: none; }
.fc .erp-erinnerung, .fc .erp-pruefdienst, .fc .erp-geschlossen { background: var(--flaeche-2); border: 0; border-radius: var(--r-klein); color: var(--text); }
.fc .erp-erinnerung.faellig { background: var(--rot-hell); }
.fc .erp-erinnerung .fc-event-main, .fc .erp-pruefdienst .fc-event-main, .fc .erp-geschlossen .fc-event-main { color: inherit; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; padding: 2px 6px; }
.fc .erp-pruefdienst, .fc .erp-geschlossen { cursor: default; }
.fc .fc-bg-event.erp-pruefzeit { background: var(--azur); opacity: .14; }
.fc .hu-marke, .fc .wartet-marke { font-size: .6875rem; padding: 0 4px; }
.fc .erp-termin.wartekunde { border-color: var(--text); border-width: 1.5px; border-style: solid; }
.fc .kunde-gesperrt .kunde { color: var(--rot); }
/* ---------- Woche als Liste je Tag (0.52; seit 0.60 dieselben Kacheln und Avatare wie der Werkstatttag, keine Spaltenlinien) ---------- */
.woche-rahmen { position: relative; overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .5rem; }
.woche { display: grid; grid-template-columns: repeat(var(--tage), minmax(176px, 1fr)); gap: .375rem; min-width: calc(var(--tage) * 176px + (var(--tage) - 1) * .375rem); }
.woche-tag { display: flex; flex-direction: column; justify-content: flex-start; min-height: 520px; min-width: 0; border-radius: var(--radius); }
.woche-tag.heute { background: var(--aktiv-grund); }
.woche-tag.feiertag { background: var(--flaeche-2); }
.woche-tag.ziel { background: color-mix(in srgb, var(--erp-primaer-flaeche) 10%, transparent); outline: 2px dashed var(--erp-primaer-flaeche); outline-offset: -2px; }
.woche-kopf { display: flex; align-items: center; gap: .25rem; padding: .5rem .375rem .5rem .625rem; }
.woche-kopf > a:first-child { flex: 1; min-width: 0; display: flex; align-items: center; gap: .625rem; min-height: 44px;
  color: inherit; text-decoration: none; border-radius: var(--r-klein); }
.woche-datum { display: flex; flex-direction: column; align-items: center; flex: none; width: 2.5rem; line-height: 1.1; }
.woche-wtag { color: var(--text-leise); font-size: .75rem; font-weight: 600; }
.woche-zahl { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; font-family: var(--erp-schrift-titel);
  font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .15s ease-out; }
.woche-kopf > a:first-child:hover .woche-zahl { background: var(--flaeche-2); }
.woche-tag.heute .woche-wtag { color: var(--primaer-text); }
.woche-tag.heute .woche-zahl { color: var(--auf-primaer); background: var(--erp-primaer-flaeche); }  /* White-on-Deep */
.woche-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.woche-anzahl { color: var(--text-leise); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.woche-tag.feiertag .woche-anzahl { color: var(--text); font-weight: 600; }  /* bis 0.58 rot – ein Feiertag ist kein Fehler */
.woche-wetter { color: var(--text-leise); font-size: .75rem; }
.woche-neu { flex: none; }
.woche-hinweise { display: flex; flex-direction: column; gap: .25rem; padding: 0 .75rem .5rem; font-size: .8125rem; }
.woche-hinweise .erinnerung-chip { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.woche-liste { list-style: none; margin: 0; padding: 0 .375rem .5rem; display: flex; flex-direction: column; gap: .375rem; flex: 1; }
.woche-termin > a { display: flex; flex-direction: column; gap: .0625rem; min-height: 44px; padding: .4375rem .625rem .5rem; color: var(--text);
  text-decoration: none; border-radius: var(--r-mittel, 8px); border: 1px solid var(--t-linie, var(--linie-stark));
  background: var(--t-grund, var(--flaeche)); font-size: .8125rem; line-height: 1.3;
  transition: box-shadow .18s cubic-bezier(.2, .8, .2, 1), translate .18s cubic-bezier(.2, .8, .2, 1), border-color .18s ease-out; }
.woche-termin > a:hover { border-color: var(--t-farbe, var(--text-leise)); text-decoration: none; translate: 0 -1px;
  box-shadow: 0 4px 6px -2px color-mix(in oklab, var(--schatten-farbe) 10%, transparent), 0 10px 15px -3px color-mix(in oklab, var(--schatten-farbe) 10%, transparent); }
.woche-termin.offen > a { border-style: dashed; border-width: 1.5px; }
.woche-termin.ist-wartekunde > a { border-color: var(--text); border-width: 1.5px; border-style: solid; }
.woche-termin .wartet-marke, .woche-termin .hu-marke { font-size: .6875rem; padding-block: 0; }
.woche-termin[draggable] { cursor: grab; }
.woche-termin.wird-gezogen { opacity: .45; }
.woche-termin .zeile-1 { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .375rem; }
.woche-termin .zeit { font-variant-numeric: tabular-nums; opacity: .85; white-space: nowrap; }
.woche-termin .kuerzel { margin-inline-start: auto; }
.woche-termin .kunde { font-weight: 650; font-size: .875rem; overflow-wrap: anywhere; }
.woche-termin .fahrzeug, .woche-termin .arbeit { overflow-wrap: anywhere; }
.woche-termin .arbeit { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.woche-termin .code { font-size: .75rem; white-space: nowrap; background: none; color: inherit; padding: 0; }
.woche-termin .woche-status { display: inline-flex; align-items: center; gap: .375rem; margin-top: .1875rem; font-weight: 600; font-size: .75rem; }
.woche-termin.status-abgeholt .kunde { font-weight: 500; }
.woche-termin.status-abgesagt .kunde { text-decoration: line-through; }
.woche-leer { color: var(--text-leise); font-size: .8125rem; padding: .25rem .375rem; }
.woche-fuss { display: flex; flex-direction: column; gap: .375rem; padding: .5rem .75rem .625rem; font-size: .8125rem; font-weight: 600;
  margin-top: auto; color: var(--text-leise); }
.woche-fuss .ziffern { color: var(--text); }
.woche-balken { display: block; height: 4px; border-radius: 99px; background: color-mix(in oklab, var(--linie) 80%, transparent); overflow: hidden; }
.woche-balken span { display: block; height: 100%; border-radius: inherit; background: var(--primaer); }
.woche-balken span.ueber { background: var(--rot); }
@media (prefers-reduced-motion: reduce) { .woche-termin > a, .woche-zahl { transition: none; } .woche-termin > a:hover { translate: none; } }

/* Terminseite: Karte „Status“ mit 18 px Abstand darunter (früher style="margin-bottom:18px") */
.termin-status { margin-bottom: 18px; }
/* Marken rechts in einer Terminzeile (HU/AU, Mechaniker, Status) */
.termin-marken { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Terminformular (0.74): Häkchen untereinander mit Erklärung, dann mit Abstand „Weitere Arbeiten“ */
.termin-optionen { display: grid; gap: .875rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--linie); }
.termin-option .feld__hilfe { margin: .25rem 0 0 2rem; }
.termin-weitere { margin-top: 1.25rem; }
