/* Oberfläche nach der Design-Vorlage Rugby Deutschland.
   Farben, Typografie und Bausteine folgen der Markenvorlage:
   Schwarz und Weiß tragen die Fläche, Rot und Gold sind sparsame Akzente. */

:root {
  --schwarz: #0B0B0C;
  --rot: #E2001A;
  --gold: #FFB81C;
  --weiss: #FFFFFF;
  --grund: #F1F0EC;
  --grund-zwei: #F7F6F4;

  --text: #0B0B0C;
  --text-flies: #2A2A2A;
  --text-mittel: #4A4A4A;
  --gedaempft: #6B6B6E;
  --hell-auf-schwarz: #C9C9C9;
  --rand: #00000010;
  --rand-linie: #eee;

  --gruen-flaeche: #E9F7EE;
  --gruen-text: #1B7F3D;
  --gelb-flaeche: #FFF3DC;
  --gelb-text: #92650B;
  --rot-flaeche: #FDE8E9;
  --rot-text: #B3121F;

  --radius: 12px;
  --radius-klein: 6px;
  --schatten: 0 8px 24px #00000015;
  --schatten-stark: 0 12px 32px #00000018;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--grund);
  color: var(--text);
  font: 400 15px/1.55 "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Der Marken-Farbverlauf, in der Vorlage als Abschlussstreifen eingesetzt. */
.swoosh {
  background: linear-gradient(90deg, #0B0B0C 0%, #E2001A 35%, #FFB81C 65%, #0B0B0C 100%);
  height: 6px;
}

/* ------------------------------------------------------------------ Kopf */
.kopf {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 40px;
  background: var(--weiss);
  border-bottom: 1px solid var(--rand-linie);
}
.kopf-halter { position: sticky; top: 0; z-index: 20; }
.marke { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.marke img { width: 42px; height: auto; display: block; }
.marke span { font-weight: 700; font-size: 16px; letter-spacing: -.2px; }
/* Zugeordnete Mannschaft unter dem Namen der Anwendung */
.marke-text { display: flex; flex-direction: column; line-height: 1.25; }
.marke span.marke-team {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  color: var(--rot);
}
.marke-team[hidden] { display: none; }

.kopf nav { display: flex; gap: 28px; flex: 1; }
.kopf nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-flies);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.kopf nav a:hover { color: var(--rot); }
.kopf nav a.aktiv { color: var(--schwarz); border-bottom-color: var(--rot); }

main { max-width: 1400px; width: 100%; margin: 0 auto; padding: 40px; flex: 1; }

/* --------------------------------------------------------------- Textstufen */
h1 { font-size: 34px; font-weight: 700; line-height: 1.15; margin: 0 0 6px; }
h2 { font-size: 20px; font-weight: 700; margin: 0 0 16px; }
h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gedaempft);
  margin: 0 0 10px;
}
a { color: var(--rot); }
a:hover { color: var(--schwarz); }

/* Roter Kicker über der Überschrift – Leitmotiv der Vorlage. */
.kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--rot);
  margin: 0 0 8px;
}

.karte {
  background: var(--weiss);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--schatten);
  margin-bottom: 24px;
}

.zeile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.zwischen { justify-content: space-between; }
.raster { display: grid; gap: 24px; }
.raster.zwei { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.raster.vier { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 24px; }
.gedaempft { color: var(--gedaempft); }
.klein { font-size: 13px; }
.oben-abstand { margin-top: 24px; }

/* ---------------------------------------------------------------- Buttons
   Alle Schaltflächen haben dieselbe Höhe. Bei „schmal“ trägt der 1-px-Rand
   1 px mehr Innenabstand, sonst ist die Rechnung identisch:
   6 + 6 + 2 + 2 = 7 + 7 + 1 + 1. Unterschiedlich ist nur die Breite. */
.knopf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  border: 2px solid var(--schwarz);
  border-radius: var(--radius-klein);
  background: transparent;
  color: var(--schwarz);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.knopf:hover { background: var(--schwarz); color: var(--weiss); }
.knopf.haupt { background: var(--schwarz); border-color: var(--schwarz); color: var(--weiss); }
.knopf.haupt:hover { background: #26262a; border-color: #26262a; }
.knopf.aktion { background: var(--rot); border-color: var(--rot); color: var(--weiss); }
.knopf.aktion:hover { background: #b80015; border-color: #b80015; }
.knopf.gefahr { border-color: var(--rot); color: var(--rot); background: transparent; }
.knopf.gefahr:hover { background: var(--rot); color: var(--weiss); }
.knopf.schmal { padding: 7px 14px; font-size: 13px; border-width: 1px; }
.knopf[disabled] { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------- Formulare */
input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #00000020;
  border-radius: var(--radius-klein);
  background: var(--weiss);
  color: var(--text);
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--schwarz);
  box-shadow: 0 0 0 3px #0B0B0C15;
}
textarea { min-height: 80px; resize: vertical; }
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--gedaempft);
  margin-bottom: 6px;
}
.feld { margin-bottom: 18px; }
.feld-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 20px; }
.schalter { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.schalter input { width: auto; margin-top: 4px; accent-color: var(--rot); }
.schalter label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--text-flies); }

/* Hervorgehobener Einzelwert, etwa der aktuelle Kaderstatus. */
.wert-gross { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--grund);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ Tabelle */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--gedaempft);
  padding: 10px 12px;
  border-bottom: 1px solid var(--rand-linie);
  white-space: nowrap;
}
td { padding: 14px 12px; border-bottom: 1px solid var(--rand-linie); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--grund-zwei); }
tbody tr.klickbar { cursor: pointer; }
.tabelle-huelle { overflow-x: auto; }

/* Sortierbare Spaltenköpfe */
th.sortierbar { cursor: pointer; user-select: none; }
th.sortierbar:hover { color: var(--text); }
th.sortierbar.aktiv { color: var(--schwarz); }
th.sortierbar .pfeil { margin-left: 5px; font-size: 9px; color: var(--rot); }
/* Platzhalter, damit die Spalte beim Umschalten nicht springt */
th.sortierbar:not(.aktiv) .pfeil::after { content: "▲"; visibility: hidden; }
/* Datenlisten bleiben in einer Zeile und scrollen lieber waagerecht,
   statt Namen und Vereine umzubrechen. */
.kompakt td, .kompakt th { white-space: nowrap; }
/* Mehrfachzugehörigkeiten sollen die Zeile nicht auseinanderziehen. */
.kader-zelle { max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
/* Knöpfe am Zeilenende dürfen umbrechen, statt aus der Karte zu laufen. */
.aktionen { text-align: right; }
.kompakt td.aktionen { white-space: normal; }
.aktionen .knopf { margin-left: 8px; margin-top: 2px; margin-bottom: 2px; }

/* --------------------------------------------------------------- Status-Tags */
.marker {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.marker.neutral { background: var(--grund); color: var(--gedaempft); }
.marker.gruen { background: var(--gruen-flaeche); color: var(--gruen-text); }
.marker.gelb { background: var(--gelb-flaeche); color: var(--gelb-text); }
.marker.rot { background: var(--rot-flaeche); color: var(--rot-text); }

/* ------------------------------------------------------------ Kennzahlkarte */
.kennzahl {
  background: var(--schwarz);
  border: 0;
  border-radius: 10px;
  padding: 22px 26px;
  box-shadow: var(--schatten);
  margin-bottom: 0;
}
.kennzahl .wert { font-size: 34px; font-weight: 700; color: var(--weiss); line-height: 1.1; }
.kennzahl .titel { font-size: 13px; font-weight: 600; color: var(--gold); margin-top: 5px; }

.liste-schlicht { list-style: none; margin: 0; padding: 0; }
.liste-schlicht li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rand-linie);
}
.liste-schlicht li:last-child { border-bottom: 0; }
.liste-schlicht li:first-child { padding-top: 0; }

/* ------------------------------------------------------------------ Reiter */
.reiter { display: flex; gap: 28px; border-bottom: 1px solid #00000015; margin-bottom: 28px; overflow-x: auto; }
.reiter button {
  padding: 12px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--gedaempft);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  width: auto;
}
.reiter button:hover { color: var(--text); }
.reiter button.aktiv { color: var(--schwarz); border-bottom-color: var(--rot); }

/* ------------------------------------------------------------------ Dialog */
.dialog-huelle {
  position: fixed;
  inset: 0;
  background: #0B0B0C70;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  z-index: 40;
}
.dialog-huelle[hidden] { display: none; }
/* Die Sicherheitsabfrage liegt über einem eventuell offenen Formulardialog. */
.frage-huelle { z-index: 50; align-items: center; }
.dialog.schmal { max-width: 460px; }
.dialog.schmal .dialog-inhalt p { margin: 0; color: var(--text-flies); }
.dialog.schmal .dialog-fuss { margin-top: 22px; }
.dialog {
  background: var(--weiss);
  border-radius: var(--radius);
  width: 100%;
  max-width: 680px;
  overflow: hidden;
  box-shadow: 0 20px 48px #00000035;
}
.dialog-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  background: var(--schwarz);
  color: var(--weiss);
}
.dialog-kopf h2 { margin: 0; font-size: 19px; color: var(--weiss); }
.dialog-inhalt { padding: 28px; }
.schliessen {
  border: 0; background: none; font-size: 26px; line-height: 1;
  color: var(--hell-auf-schwarz); cursor: pointer; width: auto; padding: 0 4px;
}
.schliessen:hover { color: var(--weiss); }
.dialog-fuss {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rand-linie);
}

/* ------------------------------------------------------------------ Hinweis */
.hinweis {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--schwarz);
  color: var(--weiss);
  padding: 13px 24px;
  border-radius: var(--radius-klein);
  font-size: 14px;
  font-weight: 600;
  z-index: 60;
  box-shadow: 0 8px 24px #00000030;
}
.hinweis.fehler { background: var(--rot); }

/* Hinweiskasten, etwa für nicht auflösbare Kader beim Import */
.warnung {
  background: var(--gelb-flaeche);
  border-radius: var(--radius-klein);
  padding: 16px 18px;
}
.warnung p { margin: 10px 0 0; }
.warnung .marker { margin-right: 4px; }

.laden { padding: 56px; text-align: center; color: var(--gedaempft); }
.leer { padding: 40px; text-align: center; color: var(--gedaempft); }

/* ------------------------------------------------------------------- Fuss */
.fuss {
  background: var(--schwarz);
  color: var(--hell-auf-schwarz);
  padding: 26px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 13px;
  flex-wrap: wrap;
}
.fuss img { width: 22px; background: var(--weiss); border-radius: 3px; padding: 2px; }
.fuss .absender { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- Porträt */
.akte-kopf { display: flex; align-items: center; gap: 22px; }
/* Aktionen zur Akte stehen unter der Reiterleiste, nur bei den Stammdaten. */
.akte-aktionen { margin: -4px 0 24px; }
.portrait {
  display: block;
  object-fit: cover;
  border-radius: 10px;
  background: var(--grund-zwei);
  flex-shrink: 0;
}
.portrait.gross { width: 108px; height: 132px; }
.portrait.klein { width: 40px; height: 48px; border-radius: 6px; }
.portrait.platzhalter {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #00000025;
  color: var(--gedaempft);
  font-weight: 700;
  letter-spacing: 1px;
}
.portrait.gross.platzhalter { font-size: 28px; }
.portrait.klein.platzhalter { font-size: 13px; letter-spacing: 0; }
.bildwahl { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bildwahl input[type="file"] { width: auto; border: 0; padding: 0; }

@media (max-width: 720px) {
  .akte-kopf { gap: 14px; }
  .portrait.gross { width: 76px; height: 94px; }
}

/* -------------------------------------------------------------- Fitness */
/* Festes Spaltenraster: Ohne table-layout richten sich die Breiten nach dem
   längsten Wort im Kopf – „Kick“ bekäme eine schmale, „Standweitsprung“ eine
   breite Spalte. Fest verteilt bekommen alle Wertespalten denselben Anteil
   der Restbreite. Die Mindestbreite setzt das Blatt selbst, abhängig von der
   Spaltenzahl; erst darunter wird gescrollt. */
.fitnessblatt { table-layout: fixed; width: 100%; }
.fitnessblatt th.fw-name, .fitnessblatt td.fw-name { width: 220px; }

/* Oben ausgerichtet: Die Köpfe sind unterschiedlich hoch, weil Einheit,
   Hinweis oder Durchschnitt darunterstehen – bündig oben liest sich die
   Zeile besser als unten hängend. Gilt für Fitness- und Feedbackbogen. */
.fitnessblatt th.fw-kopf {
  text-align: center;
  vertical-align: top;
  padding-top: 12px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}
.fitnessblatt .fw-einheit {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gedaempft);
}
.fitnessblatt th.fw-name, .fitnessblatt td.fw-name {
  position: sticky;
  left: 0;
  background: var(--weiss);
  z-index: 2;
}
.fitnessblatt tbody tr:hover td.fw-name { background: var(--grund-zwei); }
.fitnessblatt td.fw-zelle { padding: 5px 6px; text-align: center; }
/* Eingabefeld füllt seine Spalte – so bleiben auch die Felder gleich breit. */
.fw-eingabe {
  width: 100%;
  max-width: 88px;
  padding: 6px 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-radius: 5px;
}
.fw-eingabe.bester { background: var(--gruen-flaeche); border-color: #1B7F3D40; font-weight: 700; }
.fw-eingabe.letzter { background: var(--rot-flaeche); border-color: #B3121F30; }

/* -------------------------------------------------------- Feedbackbogen */
/* Bewertungen 1–5: tief rot, Mitte neutral, hoch grün. Dieselbe Sprache wie
   die Status-Tags, damit man die Farben nicht neu lernen muss. */
.stufe-tief { background: var(--rot-flaeche); color: var(--rot-text); }
.stufe-mitte { background: var(--grund); color: var(--gedaempft); }
.stufe-hoch { background: var(--gruen-flaeche); color: var(--gruen-text); }

.feedbackblatt td.fw-zelle { position: relative; }
/* Durchschnitt und Notizen-Knopf bekommen eigene Breiten, damit sie den
   gleichmäßigen Anteil der Kriterienspalten nicht verzerren. */
.feedbackblatt th.fw-schnitt, .feedbackblatt td.fw-schnitt { width: 64px; }
.feedbackblatt th.fw-aktion, .feedbackblatt td.fw-aktion { width: 118px; }

/* Legende und Hinweise stehen unter dem Bogen, nicht davor */
.bogen-fuss {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rand-linie);
}
.bogen-fuss .feedback-legende { margin-top: 0; }
select.fb-eingabe {
  width: 100%;
  max-width: 76px;
  padding: 6px 2px;
  text-align: center;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
}
.notizmarke {
  position: absolute;
  top: 2px; right: 4px;
  color: var(--rot);
  font-weight: 700;
  line-height: 1;
}
.kommentarmarke { color: var(--rot); margin-left: 4px; }
.feedback-legende .stufenpunkt {
  display: inline-block;
  width: 20px;
  border-radius: 4px;
  text-align: center;
  font-weight: 700;
  margin-right: 3px;
}

/* Bogen einer einzelnen Person im Dialog */
.bogen-zeile { padding: 14px 0; border-bottom: 1px solid var(--rand-linie); }
.bogen-zeile:last-of-type { border-bottom: 0; }
.bogen-kopf { margin-bottom: 8px; }
.bogen-stufen { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.stufenwahl {
  position: relative;
  flex: 1;
  max-width: 64px;
  text-align: center;
  border: 1px solid var(--rand-linie);
  border-radius: var(--radius-klein);
  padding: 8px 0;
  font-weight: 700;
  cursor: pointer;
}
.stufenwahl input { position: absolute; opacity: 0; pointer-events: none; }
.stufenwahl:hover { border-color: var(--schwarz); }
.stufenwahl:has(input:checked) { outline: 2px solid var(--schwarz); outline-offset: 1px; }
.bogen-notiz { font-size: 14px; }


/* ------------------------------------------------------------- Work-ons */
.workonmarke {
  color: var(--rot);
  margin-left: 5px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.workons { margin: 6px 0 0; padding-left: 18px; }
.workons li { margin-bottom: 4px; line-height: 1.45; }
.workons li:last-child { margin-bottom: 0; }

/* Gesamtkommentare und Work-ons in der Spielerakte teilen sich diesen Aufbau:
   Der jüngste Stand ist der gültige – deshalb abgesetzt und ungedämpft, alles
   Ältere daneben zurückgenommen. */
.notiz-aktuell {
  border-left: 3px solid var(--rot);
  padding: 4px 0 4px 12px;
}
.notiz-frueher {
  padding: 10px 0 10px 12px;
  border-left: 3px solid var(--rand-linie);
  border-bottom: 1px solid var(--rand-linie);
}
.notiz-frueher:last-child { border-bottom: 0; }
.notiz-frueher .workons, .notiz-frueher .notiztext { color: var(--gedaempft); }
.notiztext { margin: 6px 0 0; line-height: 1.5; }
/* Kommentar und Work-ons einer einzelnen Runde nebeneinander */
.notizpaar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  border-top: 1px solid var(--rand-linie);
  padding-top: 14px;
}
@media (max-width: 720px) { .notizpaar { grid-template-columns: 1fr; } }
.besser { color: var(--gruen-text); font-weight: 700; }
.schlechter { color: var(--rot-text); font-weight: 700; }

/* ------------------------------------------------ Mannschaftsvergleich */
.vergleichstabelle th.vgl-zahl, .vergleichstabelle td.vgl-zahl {
  text-align: right;
  min-width: 150px;
}
.vergleichstabelle td.vgl-zahl strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.vergleichstabelle td.vgl-zahl .klein { display: block; }
/* Bessere Mannschaft je Zeile – zurückhaltend, es bleibt ein Durchschnitt */
.vergleichstabelle td.vgl-zahl.beste { background: var(--gruen-flaeche); }
.vergleichstabelle th.vgl-pfeil, .vergleichstabelle td.vgl-pfeil {
  width: 28px;
  text-align: right;
  color: var(--gedaempft);
  font-size: 18px;
}
.vergleichstabelle tr.klickbar:hover td.vgl-pfeil { color: var(--rot); }
.vergleichstabelle th .fw-einheit {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gedaempft);
}
.raster.drei { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.vgl-spalte {
  padding: 16px;
  border: 1px solid var(--rand-linie);
  border-radius: var(--radius-klein);
  background: var(--grund-zwei);
}
.vgl-spalte h3 { margin: 0; font-size: 15px; }
.vgl-spalte .rangliste li { padding: 8px 10px; background: var(--weiss); }
.vgl-spalte .rangliste li:first-child { border-radius: 6px 6px 0 0; }
.vgl-spalte .rangliste li:last-child { border-radius: 0 0 6px 6px; }

/* Rangliste im Mannschaftsvergleich */
.rangliste { list-style: none; margin: 0; padding: 0; counter-reset: rang; }
.rangliste li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rand-linie);
  font-size: 14px;
}
.rangliste li:last-child { border-bottom: 0; }
.rangliste li.beste { font-weight: 600; }
.rangliste .platz {
  display: inline-block;
  width: 22px;
  color: var(--gedaempft);
  font-size: 12px;
  font-weight: 700;
}
.rangliste li.beste .platz { color: var(--rot); }
.rangliste strong { font-variant-numeric: tabular-nums; }

.kurve { display: block; overflow: visible; }

/* --------------------------------------------------- Einstellungen */
/* Feste Höhe statt mitwachsend: Ohne das wird die Seite so lang wie die
   längste Liste. Zehn Zeilen zeigen genug, der Rest ist scrollbar. */
.listenfeld {
  height: 216px;
  min-height: 216px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
}
.listenkarte h2 { margin: 0; }
.listenkarte .marker { flex-shrink: 0; }
.pfad {
  font-size: 12px;
  word-break: break-all;
  background: var(--grund);
  padding: 3px 6px;
  border-radius: 4px;
}
/* Farbfeld in Tabellen – wie in der Kalender-Seitenspalte */
input[type="color"].farbtupfer {
  padding: 0;
  border: 1px solid var(--rand-linie);
  border-radius: 5px;
  background: none;
  cursor: pointer;
}
input[type="color"].farbtupfer::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"].farbtupfer::-webkit-color-swatch { border: 0; border-radius: 3px; }

/* ------------------------------------------------------- Klappmenü */
.klappe { position: relative; display: inline-flex; }
.klappe .pfeil { font-size: 11px; opacity: .7; }
.klappe-menue {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 292px;
  padding: 6px;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--rand-linie);
  border-radius: var(--radius-klein);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
}
.klappe-menue[hidden] { display: none; }
.klappe-menue > button,
.klappe-menue > a {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-flies);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.klappe-menue > button:hover,
.klappe-menue > a:hover { background: var(--grund); color: var(--schwarz); }

/* Vorschau des Termin-Imports */
tr.vergangen td { opacity: .5; }
.hinweis-fehler {
  padding: 12px 14px;
  border-radius: var(--radius-klein);
  background: var(--rot-flaeche);
  color: var(--rot-text);
  font-size: 14px;
}

/* ------------------------------------------------------------- Kalender */
.kalender-huelle {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.kalender-steuerung { position: sticky; top: 90px; }
.kalender-steuerung h3 { margin-bottom: 14px; }

.k-wahl { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.k-wahl input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--schwarz); }
.k-wahl input[type="color"] {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--rand-linie);
  border-radius: 5px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}
.k-wahl input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.k-wahl input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.k-wahl label {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-flies);
  cursor: pointer;
}
.k-wahl label .klein { display: block; font-weight: 400; }
.farbtupfer { width: 24px; height: 24px; border-radius: 5px; flex-shrink: 0; }
/* Farbfeld im Formular */
.farbfeld { width: 100%; height: 42px; padding: 4px; cursor: pointer; }
.farbpunkt {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
}

.kalender { padding: 0; overflow: hidden; }
.k-kopf {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--rand-linie);
}
.k-kopf div {
  padding: 12px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--gedaempft);
}
.k-woche { position: relative; border-bottom: 1px solid var(--rand-linie); }
.k-woche:last-child { border-bottom: 0; }
.k-tage { display: grid; grid-template-columns: repeat(7, 1fr); }
.k-tag {
  min-height: var(--wochenhoehe, 104px);
  border-left: 1px solid var(--rand-linie);
  padding: 8px 10px;
  cursor: pointer;
}
.k-tag:hover { background: var(--grund-zwei); }
.k-tag.fremd:hover { background: #EDECE7; }
.k-tag:first-child { border-left: 0; }
.k-tag.fremd { background: var(--grund-zwei); }
.k-tag .k-zahl { font-size: 13px; font-weight: 600; color: var(--text-flies); }
.k-tag.fremd .k-zahl { color: var(--gedaempft); font-weight: 400; }
.k-tag.heute .k-zahl {
  background: var(--rot);
  color: #fff;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Balken liegen über dem Tagesraster, damit sie über Tage hinweg laufen. */
.k-balken-raster {
  position: absolute;
  top: 32px;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px 0;
  padding: 0 4px;
  pointer-events: none;
}
.k-balken {
  pointer-events: auto;
  margin: 0 3px;
  padding: 3px 8px;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.k-balken:hover { color: #fff; filter: brightness(1.12); }
/* Eigene Termine sind Schaltflächen und öffnen die Detailansicht. */
button.k-balken {
  display: block;
  width: auto;
  border: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.k-balken .k-zeit { font-weight: 700; opacity: .85; margin-right: 3px; }
.k-balken.geburtstag {
  background: transparent !important;
  color: var(--text-flies);
  font-weight: 500;
  padding-left: 0;
}
.k-balken.geburtstag::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--punktfarbe, var(--gedaempft));
  margin-right: 6px;
  vertical-align: 1px;
}
/* Fitness-Testtermine nur im Umriss: eigene Art von Ereignis, aber in der
   Farbe der Mannschaft, zu der sie gehören. */
.k-balken.fitness {
  background: transparent !important;
  border: 1.5px solid var(--punktfarbe, var(--gedaempft));
  color: var(--punktfarbe, var(--gedaempft));
  padding: 1.5px 6px;
}
.k-balken.fitness:hover {
  background: var(--punktfarbe, var(--gedaempft)) !important;
  color: #fff;
  filter: none;
}

/* Schulferien sind Rahmenbedingung, kein Termin: heller Grund, farbige Kante.
   Sie nehmen keine Klicks an, damit darunter weiter ein Termin angelegt
   werden kann. */
.k-balken.ferien {
  pointer-events: none;
  font-weight: 600;
  font-size: 11px;
}
.k-balken.ferien.offen-links { box-shadow: none !important; }

/* Ferienauswahl in der Seitenspalte */
.ferien-block { margin-top: 20px; border-top: 1px solid var(--rand-linie); padding-top: 16px; }
.ferien-block > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--schwarz);
  list-style: none;
}
.ferien-block > summary::-webkit-details-marker { display: none; }
.ferien-block > summary::before {
  content: "›";
  display: inline-block;
  margin-right: 8px;
  transition: transform .15s;
}
.ferien-block[open] > summary::before { transform: rotate(90deg); }
.ferien-block > summary .klein {
  display: block;
  margin-left: 18px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.ferien-liste {
  margin-top: 14px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.ferien-liste .k-wahl { margin-bottom: 7px; }
.ferien-liste label { font-size: 13px; }
.knopf.voll { display: flex; width: 100%; justify-content: center; }

/* Läuft ein Termin über die Woche hinaus, wird die Kante gerade abgeschnitten. */
.k-balken.offen-links { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.k-balken.offen-rechts { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }

@media (max-width: 900px) {
  .kalender-huelle { grid-template-columns: 1fr; }
  .kalender-steuerung { position: static; }
  .k-tag { min-height: var(--wochenhoehe, 78px); padding: 6px; }
  .k-balken { font-size: 11px; padding: 2px 5px; }
}

/* ---------------------------------------------------- Förder-Zeitachse */
.zeitleiste { margin-top: 4px; }
.zl-gruppe { margin-top: 22px; }
.zl-gruppe h3 { margin-bottom: 10px; }
.zl-zeile { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.zl-name {
  width: 210px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zl-bahn {
  position: relative;
  flex: 1;
  height: 30px;
  background: var(--grund);
  border-radius: 6px;
}
.zl-achse .zl-bahn { background: transparent; height: 26px; }
.zl-jahr {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid #00000018;
}
.zl-jahr span {
  position: absolute;
  top: 2px;
  left: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--gedaempft);
}
.zl-raster { position: absolute; top: 0; bottom: 0; border-left: 1px solid #00000012; }
.zl-heute { position: absolute; top: 0; bottom: -4px; border-left: 2px solid var(--rot); }
.zl-balken {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 5px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zl-balken.aktuell { background: var(--gruen-flaeche); color: var(--gruen-text); box-shadow: inset 0 0 0 1px #1B7F3D40; }
.zl-balken.kuenftig { background: var(--gelb-flaeche); color: var(--gelb-text); box-shadow: inset 0 0 0 1px #92650B30; }
.zl-balken.beendet { background: #E4E3DE; color: var(--gedaempft); }
/* Offenes Ende: der Balken laeuft nach rechts aus. */
.zl-balken.offen {
  -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 82%, transparent 100%);
}
.zl-punkt { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }
.zl-punkt.aktuell { background: var(--gruen-flaeche); box-shadow: inset 0 0 0 1px #1B7F3D40; }
.zl-punkt.kuenftig { background: var(--gelb-flaeche); box-shadow: inset 0 0 0 1px #92650B30; }
.zl-punkt.beendet { background: #E4E3DE; }
.zl-punkt.heute { width: 3px; border-radius: 0; background: var(--rot); }

@media (max-width: 720px) {
  .zl-name { width: 110px; font-size: 12px; }
}

/* ------------------------------------------------- Dokumentenmatrix */
.matrix th.dreh {
  height: 190px;
  white-space: nowrap;
  vertical-align: bottom;
  padding: 0 0 12px;
  width: 38px;
}
.matrix th.dreh > div {
  transform: rotate(-60deg);
  transform-origin: left bottom;
  width: 38px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-flies);
}
.matrix th:first-child, .matrix td:first-child { white-space: nowrap; }
.matrix th:last-child, .matrix td:last-child { width: 99%; padding-left: 24px; }
.matrix td.zelle { text-align: center; padding: 8px; width: 38px; }
.punkt {
  display: inline-block;
  width: 22px; height: 22px;
  border-radius: 6px;
  line-height: 22px;
  font-size: 12px;
  font-weight: 700;
}
.punkt.vorhanden, .punkt.geprueft { background: var(--gruen-flaeche); color: var(--gruen-text); }
.punkt.fehlt { background: var(--grund); color: #B0B0B2; }
.punkt.abgelaufen { background: var(--gelb-flaeche); color: var(--gelb-text); }
.punkt.abgelehnt { background: var(--rot-flaeche); color: var(--rot-text); }
.legende { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.legende span { display: inline-flex; align-items: center; gap: 7px; }

@media (max-width: 720px) {
  .kopf { padding: 12px 16px; gap: 16px; flex-wrap: wrap; }
  .kopf nav { gap: 16px; order: 3; flex-basis: 100%; }
  main { padding: 20px 16px; }
  h1 { font-size: 26px; }
  .karte { padding: 20px; }
  .fuss { padding: 20px 16px; }
}

/* -------------------------------------------------- Anmeldung und Rollen */
body.abgemeldet > header,
body.abgemeldet > main,
body.abgemeldet > footer { display: none; }

#anmeldung {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grund);
  padding: 24px;
  z-index: 50;
}
.anmeldekarte {
  width: 100%;
  max-width: 380px;
  background: var(--weiss);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 32px;
}
.anmeldekarte h1 { margin: 4px 0 12px; font-size: 26px; }
.anmeldekarte .feld { margin-bottom: 14px; }
.knopf.breit { width: 100%; justify-content: center; }
.anmeldefehler {
  background: var(--rot-flaeche);
  color: var(--rot-text);
  border-radius: var(--radius-klein);
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 14px;
}

#benutzerleiste {
  position: absolute;
  top: 14px; right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
#benutzerleiste a { color: var(--hell-auf-schwarz); text-decoration: none; }
#benutzerleiste a:hover { color: var(--weiss); text-decoration: underline; }

/* Was die Rolle nicht darf, verschwindet. Das ist Bedienkomfort – der Schutz
   sitzt im Server, der jeden Aufruf einzeln prüft. */
body.nur-lesen .nur-schreibend { display: none !important; }
body.ohne-leistung .nur-leistung { display: none !important; }
body:not(.ist-admin) .nur-admin { display: none !important; }
