/* Admin-Bereich: ergänzt die Design-Basis (/gemeinsam/design.css) um Navigation, Listen, Check-in und Formulare.
   Mobile-first; Farben nur über die Variablen der Basis, damit hell und dunkel gleichermaßen gelten. */

:root {
  --gefahr-grund: #8a1c1c;
  --gefahr-hover: #6e1313;
  --ok-grund: #dff2e5;
  --ok-text: #17562f;
  --kopf-text: #ffffff;
  --kopf-feld-grund: #ffffff;
  --kopf-feld-text: #2a1a20;
}
@media (prefers-color-scheme: dark) {
  :root {
    --gefahr-grund: #b3382f;
    --gefahr-hover: #c9473e;
    --ok-grund: #173a26;
    --ok-text: #b8ecc9;
  }
}

main { max-width: 64rem; }

/* Das hidden-Attribut muss auch gegen display-Regeln der Komponenten gewinnen (Knöpfe, Listenzeilen). */
[hidden] { display: none !important; }

/* Kopfzeile mit Navigation und Schnellsuche */
.seitenkopf { gap: 0.6rem 1rem; }
.bereichsname { color: rgb(255 255 255 / 0.85); font-size: 0.95rem; }
.hauptnav { order: 3; width: 100%; }
.hauptnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.hauptnav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.25rem 0.75rem;
  border-radius: 0.5rem; color: var(--kopf-text); text-decoration: none; font-weight: 500;
}
.hauptnav a:hover { background: rgb(255 255 255 / 0.16); color: var(--kopf-text); }
.hauptnav a[aria-current="page"] { background: rgb(255 255 255 / 0.22); font-weight: 700; box-shadow: inset 0 -3px 0 #fff; }
.suchform { order: 4; display: flex; gap: 0.4rem; flex: 1 1 14rem; min-width: 0; }
.suchform input {
  flex: 1; min-width: 0; min-height: 2.75rem; padding: 0.4rem 0.75rem; font: inherit;
  color: var(--kopf-feld-text); background: var(--kopf-feld-grund); border: 2px solid transparent; border-radius: 0.5rem;
}
.abmelden { order: 5; margin-left: auto; }
.knopf--hell { background: #fff; color: var(--wein); border-color: #fff; }
.knopf--hell:hover { background: var(--wein-hell); color: var(--wein-dunkel); }
.seitenkopf .knopf--hell:focus-visible, .seitenkopf input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--wein-dunkel); }
@media (min-width: 60rem) {
  .hauptnav { order: 0; width: auto; }
  .suchform { order: 0; flex: 0 1 20rem; margin-left: auto; }
  .abmelden { order: 0; margin-left: 0; }
}

.knopf--gefahr { background: var(--gefahr-grund); color: #fff; }
.knopf--gefahr:hover { background: var(--gefahr-hover); color: #fff; }
.knopf--zweit.knopf--gefahr { background: transparent; color: var(--fehler-text); border-color: var(--fehler-text); }
.knopf--zweit.knopf--gefahr:hover { background: var(--fehler-grund); color: var(--fehler-text); }

/* Titel, Aktionen, Meldungen */
.titelzeile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.titelzeile h1 { margin: 0; }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 1rem 0; }
.aktionen form { margin: 0; }
.hinweis--ok { background: var(--ok-grund); color: var(--ok-text); border-color: var(--ok-text); }
.hilfe { color: var(--text-leise); font-size: 0.9rem; }
.leise { color: var(--text-leise); }
.leer { padding: 1rem; color: var(--text-leise); border: 1px dashed var(--rahmen); border-radius: var(--radius); }
.pflicht { color: var(--fehler-text); }
.karte + .karte, .karte + .aktionen, .daten + .karte { margin-top: 1rem; }

/* Filter */
.filter { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.filter-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.25rem 1rem;
  border: 2px solid var(--rahmen); border-radius: 999px; text-decoration: none; color: var(--text); background: var(--flaeche);
}
.filter-link[aria-current="true"] { background: var(--wein); border-color: var(--wein); color: #fff; font-weight: 600; }
@media (prefers-color-scheme: dark) { .filter-link[aria-current="true"] { background: var(--knopf-grund); border-color: var(--knopf-grund); } }

/* Listen aus Karten */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.eintrag {
  background: var(--flaeche); border: 1px solid var(--rahmen); border-radius: var(--radius); padding: 0.9rem 1rem; box-shadow: var(--schatten);
}
.eintrag--inaktiv { opacity: 0.85; border-style: dashed; }
.eintrag-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.75rem; }
.eintrag-kopf h3, .eintrag .person { margin: 0; font-size: 1.1rem; }
.eintrag-zeit { margin: 0.25rem 0 0; font-weight: 500; }
.eintrag-plaetze { margin: 0.15rem 0 0; color: var(--text-leise); }
.eintrag form.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem; }
.eintrag form.inline .feld { margin: 0; flex: 1 1 14rem; }

/* Datenliste */
.daten { display: grid; grid-template-columns: 1fr; gap: 0.1rem 1rem; margin: 0 0 1rem; }
.daten dt { font-weight: 600; color: var(--text-leise); margin-top: 0.6rem; }
.daten dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 40rem) {
  .daten { grid-template-columns: 12rem 1fr; }
  .daten dt, .daten dd { margin-top: 0.35rem; }
}

.raster--drei { display: grid; gap: 0 var(--abstand); }
@media (min-width: 48rem) { .raster--drei { grid-template-columns: repeat(3, 1fr); } }
textarea { font: inherit; }
.feld textarea { min-height: 6rem; resize: vertical; }
select { font: inherit; }

/* Tabellen werden auf kleinen Bildschirmen zu gestapelten Zeilen */
table.stapel thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
table.stapel tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--rahmen); }
table.stapel td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.2rem 0.25rem; }
table.stapel td::before { content: attr(data-label); font-weight: 600; color: var(--text-leise); }
table.stapel .zeile--storniert td:not(:first-child), table.stapel .zeile--storniert a { color: var(--text-leise); }
@media (min-width: 40rem) {
  table.stapel thead { position: static; width: auto; height: auto; clip-path: none; }
  table.stapel tr { display: table-row; padding: 0; }
  table.stapel td { display: table-cell; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--rahmen); }
  table.stapel td::before { content: none; }
}

/* Suchergebnisse und Verlauf */
.treffer-liste { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.treffer a { display: flex; flex-direction: column; padding: 0.55rem 0.75rem; min-height: 2.75rem; border-radius: 0.5rem; border: 1px solid var(--rahmen); text-decoration: none; color: var(--text); }
.treffer a:hover { background: var(--wein-hell); }
.treffer-titel { font-weight: 600; }
.treffer-info { color: var(--text-leise); font-size: 0.9rem; }
.blaettern { display: flex; gap: 0.6rem; margin-top: 1rem; }
.verlauf { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.verlauf li { padding: 0.4rem 0; border-bottom: 1px solid var(--rahmen); }
a.telefon { white-space: nowrap; }

/* Check-in: große Tippflächen für den Einsatz am Handy */
.summen { position: sticky; top: 0; z-index: 2; margin: 0 0 0.75rem; padding: 0.7rem 0.9rem; font-weight: 700; font-size: 1.05rem;
  background: var(--hinweis-grund); color: var(--hinweis-text); border-left: 6px solid var(--wein); border-radius: 0.6rem; }
.filterform { margin: 0 0 1rem; }
.segment { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.checkin-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.checkin-zeile { display: grid; grid-template-columns: 1fr; gap: 0.6rem; padding: 0.8rem 0.9rem; background: var(--flaeche);
  border: 1px solid var(--rahmen); border-left: 6px solid var(--rahmen); border-radius: var(--radius); }
.checkin-zeile--da { border-left-color: var(--ok-text); background: var(--ok-grund); }
.checkin-zeile[hidden] { display: none; }
.checkin-person { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.checkin-name { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.checkin-info { color: var(--text-leise); }
.checkin-zeile--da .checkin-info, .checkin-zeile--da .leise { color: inherit; }
.checkin-zeile a.telefon { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }
.checkin-zeile form { margin: 0; }
.checkin-knopf { width: 100%; min-height: 3.5rem; font-size: 1.1rem; }
@media (min-width: 40rem) {
  .checkin-zeile { grid-template-columns: 1fr 14rem; align-items: center; }
}
