:root {
  /* Vereinsfarben METZLER Werkzeuge SK Brederis: Rot-Gelb
     (Rot exakt von skbrederis.at uebernommen, Gold als zweite Vereinsfarbe). */
  --color-bg: #f7f4ee;
  --color-surface: #ffffff;
  --color-text: #241b17;
  --color-muted: #7a6a63;
  --color-border: #e7ddd0;
  --color-primary: #9b0000;
  --color-primary-dark: #700000;
  --color-accent: #d4a72c;
  --color-accent-dark: #a9821e;
  --color-danger: #c0392b;
  --color-danger-dark: #9c2d20;
  --radius: 10px;
  --shadow-card: 0 1px 3px rgba(36, 27, 23, 0.08);
  --shadow-dialog: 0 12px 32px rgba(36, 27, 23, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.topbar {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 14px 20px 12px;
  border-bottom: 3px solid var(--color-accent);
  position: relative;
  overflow: hidden;
}

/* Angedeuteter Anspielkreis, wie eine Eckfahnen-Perspektive auf ein Spielfeld -
   rein dekorativ, blendet auf kleinen Bildschirmen nicht. */
.topbar::after {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 180px;
  height: 180px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  pointer-events: none;
}

.topbar h1 {
  margin: 0;
  font-size: 1.3rem;
}

.topbar-titel {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.topbar-logo {
  height: 42px;
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

.topbar-verein {
  margin: 2px 0 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.topbar-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.topbar-benutzer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.topbar-benutzer .btn {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: white;
}

.topbar-benutzer .btn:hover {
  background: rgba(255,255,255,0.3);
}

.saison-auswahl-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
}

.saison-auswahl-label select {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: var(--radius);
  padding: 4px 6px;
  font-size: 0.85rem;
}

.saison-auswahl-label select option {
  color: black;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
}

.tab-btn:hover:not(.active):not(:disabled) {
  background: rgba(255,255,255,0.28);
}

.tab-btn.active {
  background: white;
  color: var(--color-primary-dark);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--color-accent);
}

.tab-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 8px 0;
}

.btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}

.btn:active { transform: translateY(1px); }

/* Links, die wie Buttons aussehen sollen (z.B. der Excel-Export-Link) */
a.btn {
  display: inline-block;
  text-decoration: none;
  color: var(--color-text);
  box-sizing: border-box;
}

.btn:hover { background: #f0f0f0; }

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}
.btn-danger:hover { background: var(--color-danger-dark); }

.btn-small {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.table-wrap {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
  white-space: nowrap;
}

th {
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

tbody tr:hover { background: #fafafa; }

tbody tr.inaktiv { opacity: 0.55; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-aktiv { background: #f8ecc4; color: #7a5b1f; }
.badge-inaktiv { background: #f0f0f0; color: var(--color-muted); }

.pos-chip {
  display: inline-block;
  background: #eef2f6;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.75rem;
  margin-right: 4px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Kleine, platzsparende Icon-Buttons (Bearbeiten/Löschen direkt neben dem
   Namen statt in einer eigenen Spalte ganz rechts). */
/* Erziehungsberechtigte-Spalte: dort duerfen Name/Telefon/E-Mail umbrechen
   statt die Tabelle unkontrolliert in die Breite zu ziehen. */
.zelle-kontakt {
  white-space: normal;
  max-width: 260px;
  min-width: 200px;
}

.kontakt-eintrag {
  margin-bottom: 4px;
}

.kontakt-eintrag:last-child {
  margin-bottom: 0;
}

.kontakt-name {
  font-weight: 600;
  display: block;
}

.kontakt-detail {
  display: block;
  color: var(--color-muted);
  font-size: 0.82rem;
}

/* Kompakte Ansicht der Übungsbibliothek: weniger wichtige Spalten
   ausblenden, damit mehr Übungen ohne Scrollen auf einen Blick passen. */
table.uebungen-kompakt .uebung-detail-spalte {
  display: none;
}

.icon-btn {
  padding: 4px 9px;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Name/Bezeichnung + Aktionen in einer Zelle: Name links, Icons rechts direkt
   daneben - so muss man nicht erst zum Zeilenende scrollen. */
.zelle-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.zelle-name .zelle-name-text {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Erzwingt einen Zeilenumbruch innerhalb der (flex-wrap) Namenszeile, damit
   der Geschwister-Hinweis unter dem Namen steht statt daneben gequetscht
   zu werden. */
.geschwister-hinweis {
  flex-basis: 100%;
  font-size: 0.75rem;
  color: var(--color-muted);
}

/* --- Responsive Karten-Ansicht: Tabellen mit vielen Spalten werden auf
   schmalen Bildschirmen (Handy) zu gestapelten Karten statt seitlich
   scrollen zu muessen. Jede <td> braucht dafuer ein data-label-Attribut. --- */
@media (max-width: 720px) {
  table.responsive-karten { min-width: 0; }

  table.responsive-karten thead { display: none; }

  table.responsive-karten, table.responsive-karten tbody,
  table.responsive-karten tr, table.responsive-karten td {
    display: block;
    width: 100%;
  }

  table.responsive-karten tr {
    padding: 10px 12px;
    border-bottom: 6px solid var(--color-bg);
  }

  table.responsive-karten td {
    border-bottom: none;
    white-space: normal;
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }

  table.responsive-karten td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    flex-shrink: 0;
  }

  table.responsive-karten td.zelle-name {
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--color-border);
  }

  table.responsive-karten td.zelle-name::before {
    content: none;
  }

  table.responsive-karten td.zelle-name .zelle-name-text {
    font-size: 1rem;
  }
}

.leer-hinweis {
  padding: 20px;
  text-align: center;
  color: var(--color-muted);
}

.leer-hinweis::before {
  content: "⚽";
  display: block;
  font-size: 1.8rem;
  margin-bottom: 6px;
  opacity: 0.35;
}

.fehlerliste {
  background: #fdecea;
  border: 1px solid #f5c6cb;
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: 8px 0;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.82rem;
  color: var(--color-danger-dark);
}

.fehlerliste[hidden] { display: none; }

.fehlerliste ul {
  margin: 4px 0 0 0;
  padding-left: 18px;
}

.erfolg-box {
  background: #f8ecc4;
  color: #7a5b1f;
  border: 1px solid #ecd68f;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin: 8px 0;
}

tr.abgesagt td {
  text-decoration: line-through;
  color: var(--color-muted);
}

/* Trainingsplan: die naechsten 2 anstehenden Termine und der zuletzt
   stattgefundene Termin werden farblich hervorgehoben, damit man auf
   einen Blick sieht, was als naechstes ansteht bzw. zuletzt war. */
tr.training-naechste td {
  background: #eef7f0;
  border-left: 3px solid #2f6f4e;
}
tr.training-naechste:hover td {
  background: #e3f1e6;
}

tr.training-letztes td {
  background: #f4f0fb;
  border-left: 3px solid #6a4bb5;
}
tr.training-letztes:hover td {
  background: #ece4f8;
}

.training-filter-zeile {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 8px 0;
}

.filter-gruppe-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.filter-gruppe-label select {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.gruppe-info-box {
  background: #eef2f6;
  border: 1px solid #d7e0e8;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.85rem;
  margin: 4px 0 10px 0;
}

.gruppe-info-box[hidden] { display: none; }

.ferien-details {
  margin-top: 20px;
}

.ferien-details summary {
  cursor: pointer;
  color: var(--color-primary-dark);
  font-weight: 600;
  margin-bottom: 8px;
}

.warnung-icon {
  margin-left: 4px;
  cursor: help;
}

.schulferien-table {
  width: 100%;
  border-collapse: collapse;
}

.schulferien-table th {
  text-align: left;
  font-size: 0.8rem;
  color: var(--color-muted);
  padding: 4px 6px;
}

.schulferien-table td {
  padding: 4px 6px;
}

.schulferien-table input[type="text"],
.schulferien-table input[type="date"] {
  min-width: 110px;
}

.fehler-box, .fehler-text {
  background: #fdecea;
  color: var(--color-danger-dark);
  border: 1px solid #f5c6cb;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin: 8px 0;
}

/* --- Overlay / Dialog (Formular) --- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  overflow-y: auto;
}

.overlay[hidden] {
  display: none;
}

.dialog {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-dialog);
  border-top: 4px solid var(--color-primary);
}

.dialog-small { max-width: 380px; }

.dialog h2 {
  margin-top: 0;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.form-row[hidden] {
  display: none;
}

.form-row label, .label-like {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
}

input[type="text"], input[type="date"], input[type="number"], input[type="tel"], input[type="email"] {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  width: 100%;
}

.form-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 12px 2px 12px;
  margin-bottom: 12px;
}

.form-fieldset legend {
  font-size: 0.8rem;
  color: var(--color-muted);
  padding: 0 6px;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: normal;
  font-size: 0.9rem;
  color: var(--color-text);
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.tab-panel[hidden] {
  display: none;
}

.section-head-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pos-chip.spielklasse {
  background: #e3ecf7;
  color: #274a72;
  font-weight: 600;
}

.pos-chip.spielklasse.bambini {
  background: #f5eee3;
  color: #7a5b28;
}

.dialog-hinweis {
  font-size: 0.85rem;
  color: var(--color-muted);
  background: #f4f6f8;
  border-radius: var(--radius);
  padding: 10px 12px;
  line-height: 1.5;
}

.dialog-hinweis a { color: var(--color-primary-dark); }

.spalten-hilfe {
  font-size: 0.82rem;
  color: var(--color-text);
  background: #faf7f0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.spalten-hilfe summary {
  cursor: pointer;
  color: var(--color-primary-dark);
  font-weight: 600;
}

.spalten-hilfe table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  margin-top: 8px;
}

.spalten-hilfe td {
  padding: 5px 4px;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
  white-space: normal;
  font-size: 0.8rem;
}

.spalten-hilfe td:first-child {
  white-space: nowrap;
  color: var(--color-primary-dark);
  width: 1%;
  padding-right: 10px;
}

.altersklassen-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  margin: 12px 0;
}

.altersklassen-table th {
  text-align: left;
  font-size: 0.8rem;
  color: var(--color-muted);
  padding: 4px 6px;
}

.altersklassen-table td {
  padding: 4px 6px;
}

.altersklassen-table input[type="number"] {
  width: 70px;
}

.guardian-block {
  position: relative;
  margin-bottom: 16px;
}

.suggestion-box {
  position: absolute;
  z-index: 5;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  max-height: 180px;
  overflow-y: auto;
}

.suggestion-box[hidden] {
  display: none;
}

.suggestion-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: #faf3dc; }

/* Reiner Info-Hinweis (z.B. "Geschwister automatisch erkannt") statt einer
   klickbaren Auswahl - kein Zeigefinger-Cursor, kein Hover-Effekt. */
.suggestion-item.suggestion-info {
  cursor: default;
  background: #eef7f0;
}
.suggestion-item.suggestion-info:hover { background: #eef7f0; }
.suggestion-item.suggestion-info .sugg-name { color: #2f6f4e; }

.suggestion-item .sugg-name { font-weight: 600; }
.suggestion-item .sugg-detail { color: var(--color-muted); display: block; font-size: 0.78rem; }

.guardian-hinweis {
  background: #f8ecc4;
  border: 1px solid #ecd68f;
  color: #7a5b1f;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  margin: 4px 0 0 0;
}

.guardian-hinweis[hidden] { display: none; }

.feld-hinweis {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin: 4px 0 0 0;
}

select#spielklasse-override {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  width: 100%;
  background: white;
}

.pos-chip.spielklasse .manuell-icon {
  margin-left: 3px;
}

/* --- Mannschaften: Kachel-Ansicht --- */

.kachel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.kachel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.kachel-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.kachel-kopf h3 {
  margin: 0;
  font-size: 1.1rem;
}

.kachel-anzahl {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.kachel-spielerliste {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kachel-spielerliste li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.kachel-spielerliste .manuell-icon {
  color: var(--color-muted);
  font-size: 0.75rem;
}

.kachel-trainer {
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
  font-size: 0.85rem;
}

.kachel-trainer-titel {
  color: var(--color-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.kachel-trainer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.trainer-chip {
  background: #eef2f6;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
}

.trainer-chip.leer {
  color: var(--color-muted);
  background: transparent;
  padding-left: 0;
}

.form-row-zwei {
  display: flex;
  gap: 12px;
}

.form-row-zwei .form-row {
  flex: 1;
}

.pdf-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 24px 12px;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.pdf-dropzone:hover,
.pdf-dropzone.dropzone-aktiv {
  background: #f8ecc4;
  border-color: var(--color-accent-dark);
  color: #7a5b1f;
}

textarea {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  width: 100%;
  font-family: inherit;
  resize: vertical;
}

.inhalt-trenner {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 16px 0;
}

.bloecke-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.block-karte {
  background: #f8f9fa;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.85rem;
}

.block-karte-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  list-style: none; /* eigenes Aufklapp-Symbol statt des Browser-Standards */
}

.block-karte-kopf::-webkit-details-marker {
  display: none;
}

.block-karte-titel {
  font-weight: 600;
}

.block-karte-titel::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  color: var(--color-muted);
  transition: transform 0.15s;
}

details[open] > .block-karte-kopf .block-karte-titel::before {
  transform: rotate(90deg);
}

/* Der Block selbst bleibt sichtbar von den eingeklappten Nachbarn abgesetzt. */
.block-karte + .block-karte {
  margin-top: 2px;
}

.block-karte-dauer {
  color: var(--color-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.block-karte-details {
  color: var(--color-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.block-karte-details div {
  margin-top: 2px;
}

.block-karte-griff {
  cursor: grab;
  color: var(--color-muted);
  font-size: 1.1rem;
  padding: 0 2px;
  touch-action: none; /* verhindert Scrollen am Handy waehrend des Ziehens */
}

.block-karte-griff:active {
  cursor: grabbing;
}

.block-karte.dragging {
  opacity: 0.4;
}

input[type="time"] {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  width: 100%;
}

input[readonly] {
  background: #f4f6f8;
}

.kachel-trainingsliste {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kachel-trainingsliste .kachel-keine-termine {
  color: var(--color-muted);
  font-style: italic;
}

/* --- Spielplan / Torschuetzen --- */

.torschuetzen-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.torschuetzen-liste[hidden] { display: none; }

.torschuetze-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2f6;
  border-radius: 999px;
  padding: 3px 6px 3px 12px;
  font-size: 0.82rem;
}

.torschuetze-chip.eigentor-chip {
  background: #f5eee3;
}

.torschuetze-chip button {
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 2px 4px;
}

.torschuetze-chip button:hover { color: var(--color-danger); }

.torschuetze-hinzufuegen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.torschuetze-hinzufuegen[hidden] { display: none; }

.torschuetze-hinzufuegen select {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  flex: 1;
  min-width: 140px;
}

/* --- Anwesenheit --- */

.anwesenheit-spieler-liste {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  max-height: 50vh;
  overflow-y: auto;
}

.anwesenheit-spieler-zeile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: #f8f9fa;
}

.anwesenheit-spieler-name {
  font-size: 0.9rem;
}

.status-buttons {
  display: flex;
  gap: 4px;
}

.status-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.status-btn:hover { background: #f0f0f0; }

.status-btn[data-status="anwesend"].aktiv { background: #2f6f4e; border-color: #2f6f4e; color: white; }
.status-btn[data-status="entschuldigt"].aktiv { background: #d99a2b; border-color: #d99a2b; color: white; }
.status-btn[data-status="unentschuldigt"].aktiv { background: #c0392b; border-color: #c0392b; color: white; }

.anwesenheit-trainer-titel {
  margin: 4px 0 0;
  font-size: 1rem;
  color: var(--color-muted);
}

.saison-sieger-zeile {
  background: #fff8e1;
  font-weight: 600;
}

/* Spielplan: Spiele in den naechsten 7 Tagen dezent hervorheben, damit das
   naechste anstehende Spiel auf einen Blick auffaellt. */
.spiel-bald {
  background: #eef7f0;
}
.spiel-bald:hover {
  background: #e3f1e6;
}

.kassa-saldo-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f4f6f8;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 12px 0 20px;
  font-size: 1rem;
}

.kassa-saldo-box strong {
  font-size: 1.5rem;
  color: var(--color-primary-dark);
}

.betrag-einnahme { color: #2f6f4e; font-weight: 600; }
.betrag-ausgabe { color: #c0392b; font-weight: 600; }

.balken-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}

.balken-hintergrund {
  flex: 1;
  background: #e9ecef;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.balken {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
}

.balken-text {
  font-size: 0.8rem;
  color: var(--color-muted);
  min-width: 34px;
  text-align: right;
}

.checkbox-group-vertikal {
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

/* --- Mobile Anpassungen --- */
@media (max-width: 600px) {
  .container { padding: 10px; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

/* --- Drucken / als PDF speichern (Spielplan, Bestellungen, Trainingseinheit) ---
   Ein ".druckbereich"-Element ist normalerweise leer/unsichtbar und wird von
   app.js nur kurz vor dem Drucken befuellt. Beim Drucken selbst wird ALLES
   andere ausgeblendet und nur dieser Bereich gezeigt - eine bewaehrte,
   einfache Technik fuer "nur einen Ausschnitt der Seite drucken". Wichtig:
   die Sichtbarkeits-Regel gilt fuer ALLE ".druckbereich"-Elemente gemeinsam -
   sonst bleibt ein neu hinzugefuegter Bereich (wie frueher bei den
   Bekleidungs-Bestellungen) leer/weiss, weil er von der Regel unten mit
   ausgeblendet wird, ohne dass eine eigene Regel ihn wieder sichtbar macht.

   "display: none" statt "visibility: hidden" auf den Nicht-Druckbereichen:
   header, <main> (die ganze App - alle Tabs stecken gleichzeitig im DOM) und
   die Overlay-Dialoge sind alles direkte Kinder von <body>. Mit nur
   "visibility: hidden" bleiben sie zwar unsichtbar, belegen aber weiterhin
   ihre volle Höhe im Layout (z. B. die lange Spielerliste oder der gerade
   offene Tab) - dadurch hat das Dokument insgesamt viel mehr Höhe, als der
   eigentlich gedruckte Inhalt braucht, und der Browser druckt am Schluss
   lauter leere Seiten. "display: none" entfernt sie komplett aus dem Layout,
   dann bestimmt nur noch der Druckbereich selbst die Seitenzahl. */
.druckbereich {
  display: none;
}

@media print {
  @page {
    size: A3;
    margin: 12mm;
  }

  body > *:not(.druckbereich) {
    display: none !important;
  }

  .druckbereich {
    display: block;
    width: 100%;
  }

  .druck-kopf {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 3px solid #9b0000;
    padding-bottom: 8px;
    margin-bottom: 14px;
  }

  .druck-kopf h1 {
    margin: 0;
    font-size: 20pt;
  }

  .druck-kopf p {
    margin: 0;
    font-size: 10pt;
    color: #444;
  }

  .druck-gruppe {
    margin-bottom: 16px;
  }

  /* Die Spaltenüberschriften (DATUM, MANNSCHAFT, ...) auf jeder Druckseite
     wiederholen, und eine einzelne Zeile nie mitten auf der Seite
     zerschneiden - beides sorgt dafür, dass eine lange, mehrseitige Liste
     gut lesbar bleibt. ("break-inside: avoid" auf dem GESAMTEN
     .druck-gruppe-Block hat vorher dazu geführt, dass der Browser die
     ganze, mehrseitige Tabelle als unteilbar behandelt und komplett auf
     die zweite Seite geschoben hat - dadurch blieb die erste Seite fast leer.) */
  .druck-gruppe thead {
    display: table-header-group;
  }

  .druck-gruppe tr {
    break-inside: avoid;
  }

  .druck-gruppe h2 {
    font-size: 14pt;
    margin: 0 0 4px 0;
    padding: 3px 8px;
    background: #9b0000;
    color: white;
    border-radius: 4px;
  }

  .druck-gruppe table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5pt;
  }

  .druck-gruppe th, .druck-gruppe td {
    border: 1px solid #999;
    padding: 4px 8px;
    text-align: left;
  }

  .druck-gruppe th {
    background: #f0e6c8;
  }

  .druck-gruppe tr.druck-heim td {
    background: #faf5e6;
  }

  .druck-leer {
    color: #666;
    font-style: italic;
    font-size: 10pt;
  }

  /* Trainingseinheit: ein Block pro Kaestchen, immer voll ausgeklappt
     (anders als am Bildschirm gibt es beim Ausdruck kein Auf-/Zuklappen -
     es soll ja alles auf dem Papier/PDF stehen). */
  .druck-block {
    border: 1px solid #999;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 10px;
    break-inside: avoid;
  }

  .druck-block h3 {
    margin: 0 0 4px 0;
    font-size: 12.5pt;
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .druck-block p {
    margin: 3px 0;
    font-size: 10.5pt;
  }
}

/* --- Anwesenheit: heutiges/naechstes Training farblich getrennt --- */
tr.anwesenheit-aktuell td {
  background: #fff4e0;
  border-left: 3px solid #d98a00;
}
tr.anwesenheit-aktuell td:not(:first-child) {
  border-left: none;
}
tr.anwesenheit-bevorstehend td {
  background: #eef7f0;
  border-left: 3px solid #2f6f4e;
}
tr.anwesenheit-bevorstehend td:not(:first-child) {
  border-left: none;
}
.anwesenheit-marke {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
}
.anwesenheit-marke-aktuell {
  background: #ffe2ad;
  color: #7a4a00;
}
.anwesenheit-marke-bevorstehend {
  background: #cfe8d5;
  color: #1f5a3c;
}
.anwesenheit-legende {
  margin: 4px 0 12px;
  font-size: 0.85rem;
  color: var(--color-text-muted, #5b6470);
}
.anwesenheit-legende .anwesenheit-marke {
  margin-left: 0;
}

/* --- Uebung: Teile ankreuzen (E/T/S/A/K) --- */
.uebung-teil-kuerzel {
  display: inline-block;
  min-width: 2.6em;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e8edf5;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
}
.uebung-teil-angelegt {
  opacity: 0.75;
}
.erfolg-text {
  color: #1f5a3c;
  background: #eef7f0;
  border: 1px solid #b8dcc4;
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 0.9rem;
  margin: 8px 0;
}
