/* =====================================================================
   Ansicht: Auftragsvergabe (Admin-Liste, Admin-Detail, Partner-Anfragen)
   Nur Ergänzungen zum Designsystem (app.css, admin.css); Farben nur über Variablen.
   ===================================================================== */

/* Restzeit bis zur Antwortfrist (Text in Listen und Seitenleiste) */
.restzeit { font-weight: 650; }
.restzeit--normal { color: var(--muted); }
.restzeit--knapp { color: var(--warn); }
.restzeit--dringend { color: var(--err); }
.restzeit--vorbei { color: var(--subtle); text-decoration: line-through; }

/* Leistungen als Kacheln im Dialog */
.auftrag-leistungen { display: flex; flex-wrap: wrap; gap: 8px; }
.auftrag-leistungen .admin-schalter { flex: 0 1 auto; }

/* ---------------------------------------------------------------------
   Admin-Detail: Vorschlagsliste
   --------------------------------------------------------------------- */
.vorschlaege { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: vorschlag; }
.vorschlag {
  counter-increment: vorschlag; position: relative;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-2);
  padding: 14px 16px 14px 48px; display: flex; flex-direction: column; gap: 8px;
}
.vorschlag::before {
  content: counter(vorschlag); position: absolute; left: 14px; top: 14px;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 750; background: var(--orange-tint); color: var(--text);
}
.vorschlag--gesperrt { opacity: .72; }
.vorschlag--gesperrt::before { background: var(--bg-2); }
.vorschlag__kopf { display: flex; align-items: flex-start; gap: 10px 18px; flex-wrap: wrap; }
.vorschlag__name { font-weight: 700; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.vorschlag__name:hover { color: var(--link); text-decoration: underline; }
.vorschlag__km, .vorschlag__punkte { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.vorschlag__fakten { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); }
.vorschlag__hinweise { margin: 0; padding-left: 18px; font-size: 13px; color: var(--warn); }
.vorschlag__aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .vorschlag { padding-left: 16px; padding-top: 44px; }
  .vorschlag__km, .vorschlag__punkte { align-items: flex-start; text-align: left; }
  .vorschlag__aktionen .btn { flex: 1 1 auto; }
}

/* Seitenleiste: Begriffe über den Werten, sonst wird die Spalte zu schmal */
.auftrag-seite .definitionen { grid-template-columns: minmax(0, 1fr); gap: 0; }
.auftrag-seite .definitionen dt { font-size: 12.5px; }
.auftrag-seite .definitionen dd { margin-bottom: 10px; overflow-wrap: anywhere; }
.auftrag-seite .definitionen dd:last-child { margin-bottom: 0; }

/* Protokoll (eingeklappt) */
.auftrag-verlauf summary { cursor: pointer; }
.auftrag-verlauf__liste { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.auftrag-verlauf__liste li { display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.auftrag-verlauf__liste li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---------------------------------------------------------------------
   Partner: Anfragen
   --------------------------------------------------------------------- */
.auftraege-seite { max-width: 820px; margin-inline: auto; }
.anfrage { display: flex; flex-direction: column; gap: 14px; }
.anfrage--offen { border-top: 3px solid var(--orange); }
.anfrage h2 { overflow-wrap: anywhere; }
.anfrage h2:focus { outline: none; }
.anfrage__vorzeile { margin: 0; font-size: 12.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.anfrage--offen .anfrage__vorzeile { color: var(--orange-dark); }
.restzeit-block {
  border-radius: var(--radius); padding: 12px 16px; background: var(--bg-2); border: 1px solid var(--line);
}
.restzeit-block p { margin: 0; }
.restzeit-block__wert { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.restzeit-block.restzeit--knapp { background: var(--warn-bg); border-color: transparent; }
.restzeit-block.restzeit--dringend { background: var(--err-bg); border-color: transparent; }
.restzeit-block.restzeit--knapp .restzeit-block__wert { color: var(--warn); }
.restzeit-block.restzeit--dringend .restzeit-block__wert { color: var(--err); }
.restzeit-block.restzeit--vorbei .restzeit-block__wert { color: var(--subtle); }
.anfrage__aktionen { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.anfrage__aktionen[hidden], .anfrage__vorbei[hidden] { display: none; }
.anfrage__kunde { border-top: 1px solid var(--line); padding-top: 14px; }
.anfrage__kunde h3 { font-size: 16px; }
.anfrage__abstimmung { border-top: 1px solid var(--line); padding-top: 14px; }
.anfrage__abstimmung h3 { font-size: 16px; }
.anfrage__schritte { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.anfrage__frueher { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.anfrage__frueher li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .anfrage__aktionen .btn { flex: 1 1 0; }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .anfrage--offen .anfrage__vorzeile { color: var(--orange-2); }
}
:root[data-theme='dark'] .anfrage--offen .anfrage__vorzeile { color: var(--orange-2); }

/* Partnersuche (Admin-Auftrag) */
.psk-zitat { margin: 0; font-style: italic; overflow-wrap: anywhere; }
.psk-antwort { border-left: 3px solid var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.psk-antwort p { margin: 0; }

/* Unterlagen je Auftrag (Admin-Karte und Partner-Abschnitt) */
.unterlagen h2, .unterlagen h3 { margin: 0; }
.unterlagen--partner { border-top: 1px solid var(--line); padding-top: 14px; }
.unterlagen__formular { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--card-2); }
.unterlage-upload { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.unterlage-upload:empty { display: none; }
.unterlage-upload li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.unterlage-upload__name { overflow-wrap: anywhere; min-width: 0; flex: 1 1 200px; }
.unterlage-upload__status { color: var(--muted); }
.unterlage-upload li[data-klasse='ok'] .unterlage-upload__status { color: var(--ok); font-weight: 700; }
.unterlage-upload li[data-klasse='fehler'] .unterlage-upload__status { color: var(--err); font-weight: 600; }
.unterlagen__liste:empty { display: none; }
.unterlage-kacheln { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.unterlage-kachel { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.unterlage-kachel__knopf { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); cursor: pointer; overflow: hidden; }
.unterlage-kachel__knopf:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.unterlage-kachel__rahmen { display: block; aspect-ratio: 4 / 3; width: 100%; }
.unterlage-kachel__bild { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--bg-2); }
.unterlage-kachel__fuss { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.unterlage-kachel__name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.unterlage-videos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.unterlage-video { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.unterlage-video__platz { aspect-ratio: 16 / 9; width: 100%; background: var(--ink-deep); border-radius: 12px; overflow: hidden; display: flex; }
.unterlage-video__start { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent; color: #fff; font: inherit; font-weight: 700; cursor: pointer; min-height: 120px; }
.unterlage-video__start:focus-visible { outline: 3px solid var(--orange-2); outline-offset: -3px; }
.unterlage-video__spieler { width: 100%; height: 100%; background: #000; }
/* Hinweis, wenn der Dateiserver des Teams nicht antwortet (Bild-Kachel hell, Video dunkel) */
.unterlage-hinweis { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; height: 100%; min-height: 96px; padding: 12px; text-align: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.unterlage-video__platz .unterlage-hinweis { color: #fff; }
.unterlage-zeilen { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.unterlage-zeile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); flex-wrap: wrap; }
.unterlage-zeile__symbol { color: var(--muted); display: flex; }
.unterlage-zeile__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; align-items: flex-start; }
.unterlage-zeile__name { font-weight: 600; overflow-wrap: anywhere; }
.unterlage-zeile__aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  /* Handy: zwei Kacheln nebeneinander, große Tippflächen, Videos volle Breite */
  .unterlage-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .unterlage-videos { grid-template-columns: 1fr; }
  .unterlage-zeile { padding: 12px; }
  .unterlage-zeile__aktionen { width: 100%; }
  .unterlage-zeile__aktionen .btn { flex: 1 1 0; min-height: 48px; }
}

/* Auftragsliste: fünf Kennzahl-Kacheln (Storniert, neutral grau) auf dem Desktop in einer Reihe; schmal gilt das Raster der Admin-Kacheln (zwei Spalten) */
.kennzahl--grau { border-top: 3px solid var(--subtle); }
@media (min-width: 900px) {
  .admin-kennzahlen--fuenf { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Partnersuche, zehn Betriebe in zwei Gruppen (06.10.2026): Abzeichen in einer Reihe, die auf dem Handy umbricht; Satz am Telefon aufklappbar */
.psk-abzeichen { flex-wrap: wrap; gap: 6px; }
.psk-gruppen { margin: 0; font-weight: 600; }
.psk-anruf { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--card-2); }
.psk-anruf summary { cursor: pointer; }
.psk-satz { margin-top: 10px; }
.psk-satz p { margin: 0; overflow-wrap: anywhere; }
.psk-satz__text { line-height: 1.5; }
.psk-satz__regie { font-style: italic; color: var(--muted); }
.psk-platzhalter { background: var(--warn-bg); color: var(--warn); padding: 0 4px; border-radius: 4px; font-weight: 600; }
@media (max-width: 600px) {
  .psk-kopieren { flex: 1 1 auto; min-height: 44px; }
  .psk-anruf { padding: 10px; }
}
