@import url("../css/admin-notes.css?v=20261123d");
/* ==========================================================================
   Admin-Bereich – Fanclub Trinkpause Fanshop
   Baut auf den Variablen/Fonts aus css/style.css auf.
   ========================================================================== */

/* min-height 1px über 100vh statt genau 100vh: siehe Kommentar in
   css/style.css bei body { min-height } - erzwingt echten (minimalen)
   Scroll-Bedarf auf jeder Seite, damit der Scrollbalken nicht je nach
   Tab-Inhalt erscheint/verschwindet und den Inhalt seitlich verschiebt. */
.admin-body { background: var(--off-white); min-height: calc(100vh + 1px); }

/* ---------- Login ---------- */
.admin-login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, #4a4a4d 0%, var(--anthracite) 45%, #1b1b1c 100%);
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: min(380px, 100%);
  text-align: center;
  box-shadow: var(--shadow-strong);
}
.login-logo { width: 72px; height: 72px; margin: 0 auto 16px; }
.login-card h1 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 4px; }
.login-sub { font-size: 0.85rem; margin-bottom: 22px; }
.login-card label {
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; font-size: 0.82rem; font-weight: 600;
  margin-bottom: 16px;
}
.login-card input {
  padding: 11px 12px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-size: 0.95rem;
}
.login-card input:focus { outline: none; border-color: var(--red); }
.login-error {
  background: #fdeaea; color: #b30000; border: 1px solid #f5c2c2;
  border-radius: 8px; padding: 8px 10px; font-size: 0.8rem; margin-bottom: 14px; text-align: left;
}
.back-link { display: inline-block; margin-top: 16px; font-size: 0.8rem; color: var(--text-muted); text-decoration: underline; }
.back-link:hover { color: var(--red); }

/* ---------- Header ---------- */
.admin-header {
  background: var(--anthracite);
  color: var(--white);
  position: sticky; top: 0; z-index: 100;
}
.admin-header-inner {
  max-width: 1360px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.admin-header .brand-logo { width: 38px; height: 38px; }
.admin-header .brand-name { color: var(--white); font-size: 1.1rem; }
.admin-header .brand-sub { color: rgba(255,255,255,0.55); }
.admin-tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tab-btn {
  background: transparent; border: none; color: rgba(255,255,255,0.7);
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 0.86rem;
  transition: background 200ms, color 200ms;
}
.tab-btn:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.tab-btn.active { background: var(--red); color: var(--white); }
.admin-header-actions { display: flex; gap: 8px; }
.btn-ghost-dark {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.25);
  padding: 9px 18px;
  font-size: 0.82rem;
}
.btn-ghost-dark:hover { background: rgba(255,255,255,0.2); }

/* ---------- Main / Panels ---------- */
.admin-main { max-width: 1360px; margin: 0 auto; padding: 34px 24px 80px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; animation: panel-in 280ms ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--font-heavy); font-size: 1.3rem; margin: 0; }
.panel-hint { margin: 0; font-size: 0.85rem; }
.btn-blue { background: #1a73e8; color: #ffffff; border: none; }
.btn-blue:hover { background: #1558b0; }

/* ---------- Mitglieder: Excel-Import-Prüfung ---------- */
.import-review-box {
  background: var(--off-white);
  border: 1.5px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
}
.import-review-box h4 { margin: 0 0 4px; font-family: var(--font-heavy); font-size: 1rem; }
.import-review-box .field-hint { margin: 0 0 14px; }
/* ---------- Notizen-Übersicht (Betrieb -> Notizen, Wunsch vom 28.10.2026) ----------
   Zeigt ALLE Notizen aller Bereiche/Kacheln, gruppiert in 3 Abschnitte
   (In Arbeit / Offen / Abgeschlossen, in dieser Reihenfolge). */
.notes-overview-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: start;
}
/* Notizfeld für allgemeine Notizen in dieser Kachel (Wunsch vom
   23.11.2026): Es steht hier AUSNAHMSWEISE oberhalb der Notizen-Liste,
   "damit nicht jedes mal ganz nach unten gescrollt werden muss" - in
   allen anderen Kacheln bleibt das Notizfeld unten. Der Abstand von
   .admin-notes (margin-top, auf die Platzierung unten ausgelegt) wird
   darum nach unten gedreht. */
.admin-notes.admin-notes-top { margin-top: 0; margin-bottom: 20px; }

/* ---------- Zähler, Filter und Sortierung der Notizen-Übersicht
   (Wünsche vom 23.11.2026, kompakte Fassung nach "zu unübersichtlich") ----------
   Alles in EINEM hellen Kasten: zwei Zeilen Zahlen-Pillen (Erfasser,
   Kategorie), darunter eine Zeile mit Priorität, Zeitspanne, Kachel
   (nur bei gewählter Kategorie) und Sortierung. Die Erklärung liegt
   hinter dem blauen Info-Knopf (.sd-info-btn aus stammdaten.css). */
.notes-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.notes-toolbar-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.notes-toolbar-label { font-family: var(--font-heavy); font-size: 0.76rem; color: var(--anthracite); }
.notes-toolbar-row > .notes-toolbar-label { min-width: 72px; }
.notes-info-btn { margin-left: auto; }
.notes-info-box p:last-child { margin-bottom: 0 !important; }

/* Zahlen-Pillen: Name + rote Zahl (offen) + orange Zahl (in Arbeit /
   zu prüfen, nur wenn vorhanden). Klein gehalten wie alle Knöpfe im
   Verwaltungsbereich (Wunsch vom 16.11.2026). */
.notes-stats-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.notes-stats-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--white);
  border: 1.5px solid var(--grey-line);
  border-radius: 999px;
  padding: 3px 4px 3px 10px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--anthracite);
  cursor: pointer;
  transition: all var(--transition);
}
.notes-stats-chip:hover { border-color: var(--anthracite); }
.notes-stats-chip.active { background: var(--anthracite); border-color: var(--anthracite); color: var(--white); }
.notes-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  box-sizing: border-box;
}
.notes-badge-offen { background: var(--red); }
/* Orange wie der Status "Zu prüfen" auf den Notizen selbst */
.notes-badge-arbeit { background: #e8762b; }
.notes-stats-empty { font-size: 0.76rem; color: var(--text-muted); }

/* Filterzeile: durch eine feine Linie von den Zahlen getrennt */
.notes-toolbar-filters { gap: 8px 14px; padding-top: 8px; border-top: 1px solid var(--grey-line); }
.notes-toolbar-group { display: inline-flex; align-items: center; gap: 6px; }
/* <label> mit display:inline-flex würde das hidden-Attribut überstimmen */
.notes-toolbar-group[hidden] { display: none; }
/* Ausgeblendete Zeitspannen-Pillen (keine passende Notiz) */
.notes-toolbar .filter-btn[hidden] { display: none; }
/* Kachel-Auswahl am Ende der Kategorie-Zeile (verfeinert die Kategorie);
   etwas breiter, weil ohne gewählte Kategorie der Bereich davorsteht. */
.notes-kachel-group { margin-left: 4px; }
.notes-toolbar .notes-kachel-group select { max-width: 280px; }
.notes-pill-group { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.notes-toolbar .filter-btn { padding: 4px 10px; font-size: 0.74rem; }
/* Prioritäts-Pillen: nur die farbigen Kreise, klein */
.notes-toolbar .notes-prio-filter-btn { display: inline-flex; align-items: center; padding: 5px 8px; }
.notes-prio-filter-btn .prio-label { display: none; }
.notes-prio-filter-btn .prio-dots { gap: 2px; }
.notes-prio-filter-btn .prio-dot { width: 9px; height: 9px; }
/* Statische Kreise reagieren nicht auf Klicks - der Klick soll die
   Pille treffen, nicht einen einzelnen Kreis. */
.prio-control.is-static { pointer-events: none; }
.notes-toolbar select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--grey-line);
  font-family: inherit;
  font-size: 0.76rem;
  background: var(--white);
  max-width: 190px; /* schmal genug, damit Kachel + Sortierung noch in die Filterzeile passen */
}
.notes-filter-result { margin: 0; font-size: 0.76rem; color: var(--text-muted); }
.notes-link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--red);
  text-decoration: underline;
  cursor: pointer;
}
/* Fusszeile der Karten trägt Status (links) und die beiden
   Symbol-Knöpfe (rechts) - auf schmalen Bildschirmen umbrechen. */
.notes-overview-card-footer { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 900px) {
  .notes-toolbar select { max-width: 100%; }
  /* Kachel-Auswahl auf dem Handy über die ganze Breite statt über den
     Rand hinaus */
  .notes-kachel-group { margin-left: 0; flex: 1 1 100%; min-width: 0; }
  .notes-toolbar .notes-kachel-group select { max-width: none; flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 900px) {
  .notes-overview-columns { grid-template-columns: 1fr; }
}
.notes-overview-column {
  background: var(--off-white);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 80px;
}
.notes-overview-column h4 {
  margin: 0 0 12px;
  font-family: var(--font-heavy);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notes-overview-column-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.notes-overview-column.col-in-arbeit .notes-overview-column-dot { background: #e0a100; }
.notes-overview-column.col-offen .notes-overview-column-dot { background: var(--red); }
.notes-overview-column.col-abgeschlossen .notes-overview-column-dot { background: #2f9e52; }
/* Anzahl Notizen pro Spalte (Wunsch vom 13.11.2026), rot mit weisser
   Schrift wie der Zähler am Ursprungsort (.admin-notes-count, Wunsch
   vom 14.11.2026) */
.notes-overview-column-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
}
.notes-overview-empty { color: var(--grey-text, #777); font-size: 0.85rem; }
.notes-overview-card {
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
  margin-bottom: 12px;
  border-left: 4px solid var(--grey-line);
}
/* Farbliche Hervorhebung nach Status (Wunsch vom 13.11.2026), dieselben
   Farben wie bei den Notiz-Karten am Ursprungsort (.admin-notes-item)
   und bei den Punkten der 3 Spalten oben. */
.notes-overview-card[data-status="offen"] { border-left-color: var(--red); background: #fdebe9; }
.notes-overview-card[data-status="in_arbeit"] { border-left-color: #e0a100; background: #fdf3df; }
.notes-overview-card[data-status="zu_pruefen"] { border-left-color: #e8762b; background: #fde6d3; }
.notes-overview-card[data-status="erledigt"] { border-left-color: #2f9e52; background: #e7f5ec; }
.notes-overview-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.notes-overview-card-area { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--grey-text, #888); }
/* Priorität steht seit 23.11.2026 (zweite Rückmeldung) in der Titelzeile
   statt in der Fusszeile - rechts neben dem Kachel-Namen, damit die
   Fusszeile für Status (links) und die Symbol-Knöpfe (rechts) frei
   bleibt. */
.notes-overview-card-title {
  font-family: var(--font-heavy);
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.notes-overview-card-title a { color: inherit; text-decoration: none; }
.notes-overview-card-title a:hover { text-decoration: underline; }
/* In der Titelzeile ist nur wenig Platz - das Wort zur Stufe (z.B.
   "Hoch") entfällt dort und steht stattdessen im Tooltip jedes Kreises
   (siehe prioControlHTML). An den übrigen Orten (Notizfeld, Fusszeile
   der alten Darstellung, Filterleiste) bleibt das Wort sichtbar. */
.notes-card-title-prio { flex: 0 0 auto; }
.notes-card-title-prio .prio-label { display: none; }
.notes-overview-card-content { font-size: 0.86rem; white-space: pre-wrap; margin: 6px 0; }
.notes-overview-card-meta { font-size: 0.76rem; color: var(--grey-text, #888); margin-bottom: 8px; }
.notes-overview-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.notes-overview-card-footer select {
  padding: 4px 6px;
  border-radius: 6px;
  border: 1.5px solid var(--grey-line);
  font-family: inherit;
  font-size: 0.78rem;
  background: var(--white);
}

/* ---------- Ticket-Dropdown (Wettbewerb/Spielort/Sektor Priorität) ---------- */
.dropdown-priority-grid {
  display: grid;
  /* War vorher auf max-width:900px begrenzt, unabhängig von der
     tatsächlich verfügbaren Breite - dadurch wirkten die Kacheln zu
     schmal, obwohl (wie z.B. bei der Mengenrabatt-Tabelle darunter)
     mehr Platz vorhanden war. Jetzt nutzt das Gitter die volle
     verfügbare Breite, die einzelnen Kacheln bleiben durch minmax()
     weiterhin mindestens 240px breit und brechen bei schmalen
     Bildschirmen automatisch um. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
@media (max-width: 720px) {
  .dropdown-priority-grid { grid-template-columns: 1fr; }
}
/* Rückmeldung vom 25.10.2026: "Zahlungsart wird jetzt aber nur auf der
   Hälfte der Kachel angezeigt." - die Kachel "Einnahmen/Ausgaben-
   Dropdown" hat seit Migration 93 genau 3 Boxen (Kategorie/Firma/
   Zahlungsart). Mit repeat(auto-fit, minmax(240px, 1fr)) oben passen bei
   mittlerer Fensterbreite nur 2 Boxen in eine Zeile - die dritte (hier:
   Zahlungsart) rutscht dann allein in eine neue Zeile, nimmt darin aber
   nur die Breite EINER Spalte ein (nicht die volle Zeilenbreite), was wie
   "halbe Kachel" aussieht. Diese Kachel hat IMMER genau 3 Boxen, darum
   hier bewusst fest auf 3 gleich breite Spalten statt auto-fit - matcht
   dann exakt die Breite von Kategorie/Firma, wie gewünscht ("wie bei
   Firma angezeigt"). Bewusst NUR für diese eine Kachel (ID-Selektor),
   damit Ticket-Dropdown/Artikel-Dropdown (mit abweichender Boxenzahl)
   unverändert bleiben. */
#panel-einnahmenAusgabenDropdown .dropdown-priority-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}
@media (max-width: 720px) {
  #panel-einnahmenAusgabenDropdown .dropdown-priority-grid { grid-template-columns: 1fr; }
}
.dropdown-priority-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
}
.dropdown-priority-box .panel-head { margin-bottom: 10px; }
.dropdown-priority-box .panel-head h3 { margin: 0; font-size: 1rem; }
.dp-add-btn {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.dp-add-btn:hover { opacity: 0.85; }
/* "Filterkriterium hinzufügen" (Kategorie-Formular, Nachbesserung vom
   28./29.10.2026) trägt - anders als alle übrigen .dp-add-btn-Buttons,
   die nur ein blosses "+" zeigen - einen vollen Textlabel. Die generische
   Regel oben (feste 30x30px, Fehler gemeldet von Stefan am 29.10.2026:
   Button wurde dadurch auf ein kaum lesbares "+"-Quadrat zusammengestaucht)
   wird hier gezielt NUR für diesen einen Button überschrieben - alle
   anderen .dp-add-btn-Buttons (Dropdown-Prioritäten usw.) bleiben
   unverändert kompakte "+"-Buttons. */
#cfAddFilterBtn {
  width: auto;
  height: auto;
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
}
.dropdown-priority-table.admin-table { table-layout: fixed; min-width: 0; width: 100%; }
.dropdown-priority-table.admin-table td { padding: 8px 10px; overflow-wrap: break-word; }
.dropdown-priority-table.admin-table th:first-child, .dropdown-priority-table.admin-table td:first-child { width: 44px; }
.dropdown-priority-table.admin-table th:last-child, .dropdown-priority-table.admin-table td:last-child { width: 38px; }
/* Kategorie/Firma-Tabellen (Einnahmen/Ausgaben-Dropdown): gleiches
   Grid-Layout wie die anderen Dropdown-Kacheln, aber nur 2 Spalten
   (Name + Aktionen), daher ohne die Nr.-Spalten-Breiten oben. Ohne
   "min-width: 0" würde die generische .admin-table-Mindestbreite
   (640px) die Tabelle über die Box hinaus in die Nachbar-Kachel
   ragen lassen - dort landete dann der "Löschen"-Button optisch
   unter der Nachbar-Box und war nicht mehr klickbar. */
.finance-ref-table.admin-table { table-layout: fixed; min-width: 0; width: 100%; }
.finance-ref-table.admin-table td { overflow-wrap: break-word; }
.dp-value-cell {
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 8px;
  display: inline-block;
  min-width: 60px;
}
.dp-value-cell:hover { background: var(--off-white); }
/* Zwei unabhängige Filter-"Achsen" je Kategorie (Nachbesserung vom
   28.10.2026 - zuerst als echte Verschachtelung "Bekleidung -> gpard ->
   Herren" umgesetzt, auf Stefans Rückfrage hin aber durch zwei
   unabhängige, flache Filterzeilen ersetzt, da "Herren" sonst pro
   Typ-Wert einzeln hätte angelegt werden müssen). Trennzeile zwischen
   den beiden Gruppen in der Filterkriterien-Tabelle im
   Kategorie-Formular (cfFiltersTable). */
.cf-axis-header td {
  background: var(--off-white);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--grey-text, #777);
  padding: 6px 8px;
}
.cf-axis-empty td { color: var(--grey-text, #777); font-size: 0.82rem; font-style: italic; padding: 6px 8px; }
.dp-value-input, .dp-position-input {
  box-sizing: border-box;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--red);
  font-family: inherit;
  font-size: 0.86rem;
}
.dp-value-input { width: 100%; }
.dp-position-input { width: 44px; }
.dp-delete-btn {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.dp-delete-btn:hover { opacity: 0.7; }
.dp-new-row-actions { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.dp-new-row-save {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.dp-new-row-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Ticketkategorien: Spiele-Preismatrix (eine Matrix pro Kombination) ---------- */
.tv-matrix-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 14px 22px 20px;
  margin-bottom: 24px;
}
.tv-matrix-section.tv-matrix-dragging { opacity: 0.4; }
.tv-matrix-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: grab;
  padding: 6px 0;
}
.tv-matrix-drag-handle { color: var(--text-muted); font-size: 1.1rem; line-height: 1; }
.tv-matrix-section-title { margin: 0; font-family: var(--font-heavy); font-size: 1.05rem; flex: 1; }
.tv-matrix-collapse-btn {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 8px;
}
.tv-matrix-collapse-btn:hover { color: var(--anthracite); }
.tv-matrix-reload-btn {
  background: none;
  border: 1.5px solid var(--grey-line);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 4px 10px;
}
.tv-matrix-reload-btn:hover { color: var(--red); border-color: var(--red); }
.tv-matrix-section.tv-matrix-collapsed .tv-matrix-body-wrap { display: none; }
.tv-matrix-body-wrap { margin-top: 10px; }
.tv-matrix-toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.tv-matrix-toolbar-item { display: inline-block; }
.tv-matrix-add-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--grey-line);
  font-family: inherit;
  font-size: 0.82rem;
}
.tv-matrix-sektor-name { margin-right: 4px; }
.tv-matrix-sektor-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.6;
  padding: 0 2px;
}
.tv-matrix-sektor-remove:hover { opacity: 1; }
.tv-matrix-col-remove {
  background: none;
  border: none;
  color: inherit;
  font-size: 0.68rem;
  cursor: pointer;
  opacity: 0.55;
  padding: 0 0 0 3px;
  vertical-align: middle;
}
.tv-matrix-col-remove:hover { opacity: 1; color: var(--red); }
.tv-matrix-table th, .tv-matrix-table td { text-align: center; }
.tv-matrix-table th:first-child, .tv-matrix-table td:first-child {
  text-align: left;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}
.tv-matrix-table th:first-child { background: var(--off-white); }
.tv-matrix-table td:first-child { background: var(--white); }
.tv-matrix-table th.tv-matrix-source-group { border-left: 2px solid var(--grey-line); font-size: 0.72rem; }
.tv-matrix-table td.tv-matrix-group-start { border-left: 2px solid var(--grey-line); }
.tv-matrix-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.tv-matrix-value {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.tv-matrix-value:hover { background: var(--off-white); }
.tv-matrix-value .tv-matrix-label { color: var(--text-muted); font-size: 0.68rem; margin-right: 2px; }
.tv-matrix-input {
  width: 60px;
  box-sizing: border-box;
  padding: 3px 4px;
  border-radius: 6px;
  border: 1.5px solid var(--red);
  font-family: inherit;
  font-size: 0.78rem;
  text-align: center;
}

/* ---------- Tabellen ---------- */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
  /* Lange Listen und Protokolle (Wunsch Stefan, 27.11.2026): eine Tabelle
     wächst nicht mehr unbegrenzt nach unten. Ab 70 % der Fensterhöhe
     bekommt sie einen eigenen Scrollbalken; kürzere Tabellen bleiben
     unverändert. Die Höhe lässt sich hier an EINER Stelle ändern. */
  max-height: var(--table-max-height, 70vh);
  overflow-y: auto;
}
/* Kopfzeile bleibt beim Scrollen in der Tabelle stehen. Nur bei
   einzeiligen Köpfen - mehrzeilige (Ticketmatrix, Lagerbestand) würden
   sich sonst überlagern. Die Trennlinie kommt als Schatten, weil ein
   normaler Rahmen bei "border-collapse" nicht mitwandert. */
.table-wrap > .admin-table > thead > tr:only-child > th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: inset 0 -1px 0 var(--grey-line);
}
/* Total-Zeile direkt unter der Kopfzeile (Spielübersicht, Dashboard
   "letzte Spiele") bleibt ebenfalls stehen (Wunsch Stefan, 27.11.2026).
   Sie klebt unter der Kopfzeile; deren Höhe misst js/spiel-shared.js
   (spielUebersichtTotalFixieren) und legt sie in --table-kopf-hoehe ab. */
.table-wrap > .admin-table > tbody > tr.total-row > td {
  position: sticky;
  top: var(--table-kopf-hoehe, 0px);
  z-index: 1;
  box-shadow: inset 0 -2px 0 var(--grey-line);
}
/* In Fenstern scrollt bereits das Fenster selbst - dort keine zweite
   Begrenzung. Beim Drucken immer die ganze Tabelle. */
.modal .table-wrap { max-height: none; overflow-y: visible; }
@media print {
  .table-wrap { max-height: none; overflow: visible; }
  .table-wrap > .admin-table > thead > tr:only-child > th,
  .table-wrap > .admin-table > tbody > tr.total-row > td { position: static; }
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 640px; }
.admin-table th {
  text-align: left;
  background: var(--off-white);
  padding: 12px 16px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--grey-line);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--grey-line); vertical-align: middle; }
/* Saldo-Spalte (Mitgliederliste in Stammdaten): etwas breiter und ohne
   Zeilenumbruch, damit auch grössere Beträge (z.B. "-CHF 1'234.55")
   immer auf einer Zeile Platz haben. */
.admin-table th.saldo-col, .admin-table td.saldo-col { min-width: 110px; white-space: nowrap; }
.admin-table tbody tr:hover { background: var(--off-white); }
.admin-table tbody tr[data-row-id] { cursor: pointer; }
.admin-table tbody tr[data-row-id] .actions-cell { cursor: default; }
.admin-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Tabellen-Gruppierung (z.B. Aktuell/Zukünftig/Vergangen) ---------- */
.events-group-header td {
  background: var(--anthracite);
  color: var(--white);
  font-family: var(--font-heavy);
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 16px;
  border-left: 4px solid var(--red);
  border-bottom: none !important;
}
/* Abstand zwischen den Bereichen - über einen transparenten oberen
   Rand statt margin, da <tr>/<td> kein margin unterstützen. Der erste
   Bereich bekommt keinen Abstand nach oben. */
.events-group-header:not(:first-child) td {
  border-top: 18px solid var(--white);
}
.events-group-count {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.78rem;
  margin-left: 8px;
  color: var(--white);
}
.events-group-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 12px 16px;
}
.events-group-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.events-group-filter {
  padding: 5px 10px;
  border-radius: 6px;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: normal;
  background: rgba(255,255,255,0.9);
  color: var(--anthracite);
  cursor: pointer;
}
.admin-table th[data-sort-key] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.admin-table th[data-sort-key]:hover { color: var(--anthracite); }
.admin-table th[data-sort-key]::after {
  content: "⇅";
  display: inline-block;
  margin-left: 4px;
  opacity: 0.35;
  font-size: 0.9em;
}
.admin-table th[data-sort-key].sort-asc::after { content: "↑"; opacity: 1; color: var(--red); }
.admin-table th[data-sort-key].sort-desc::after { content: "↓"; opacity: 1; color: var(--red); }
/* Vorschaubild in Tabellen (Stammdaten -> Artikel, -> Mannschaften).
   15.11.2026, Wunsch von Stefan: so gross wie möglich, ohne dass die
   Zeilen höher werden. Früher 42px Bild + 2 × 12px Zellenabstand = 66px
   Zeilenhöhe; jetzt 60px Bild + 2 × 3px = dieselben 66px. Die Breite ist
   fest (vorher wurde das Bild in der schmalen Spalte auf ~20px
   zusammengedrückt). Beim Darüberfahren zeigt stammdaten.js das Bild
   gross an (.row-thumb-preview). */
.row-thumb { width: 60px; height: 60px; min-width: 60px; max-width: none; border-radius: 8px; object-fit: contain; padding: 2px; box-sizing: border-box; background: var(--off-white); display: block; cursor: zoom-in; }
.admin-table td:has(> .row-thumb) { padding: 3px 4px; width: 68px; }
.row-thumb-preview {
  position: fixed;
  z-index: 3000;
  width: 300px;
  height: 300px;
  padding: 8px;
  box-sizing: border-box;
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  pointer-events: none;   /* die Vorschau darf die Maus nicht "fangen" */
}
.row-thumb-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qty-in { color: #1e8e3e; font-weight: 700; }
.qty-out { color: var(--red); font-weight: 700; }
.stock-chip {
  display: inline-block;
  background: var(--off-white);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  margin: 1px 2px 1px 0;
  font-weight: 600;
}
.stock-chip.zero { color: var(--red); }
.table-action-btn {
  background: transparent; border: 1.5px solid var(--grey-line);
  border-radius: 8px; padding: 6px 12px; font-size: 0.78rem; font-weight: 600;
  margin-right: 6px; transition: all 160ms;
}
.table-action-btn:hover { border-color: var(--anthracite); }
/* Aktions-"Buttons", die ein Link sind (Absprung in eine andere App:
   Tickets -> "Bearbeiten", Stammdaten -> Spiele -> "Kontingente",
   15.11.2026), sollen wie die übrigen Aktions-Buttons aussehen. */
a.table-action-btn { color: inherit; text-decoration: none; }
.table-action-btn.danger { border-color: var(--red); color: var(--red); }
.table-action-btn.danger:hover { background: var(--red); color: var(--white); }
.table-action-btn.primary { border-color: #1e8e3e; color: #1e8e3e; }
.table-action-btn.primary:hover { background: #1e8e3e; color: var(--white); }
.admin-table tr.row-hidden { opacity: 0.55; }
.sizes-stacked { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.admin-table td.actions-cell { white-space: nowrap; }
.admin-table td.actions-cell .table-action-btn { display: inline-block; }

/* Mitgliederliste: Aktions-Buttons in FESTEN Spalten (CSS-Grid mit
   fixen Spaltenbreiten, siehe userActionsHTML() in stammdaten.js) - jede
   Buttonart hat immer dieselbe Spalte (1 = Initialpasswort erstellen,
   2 = Sperren/Freischalten/Aktivieren, 3 = Archivieren, 4 = Löschen/
   Endgültig löschen). Fehlt eine Buttonart in einer Zeile (z.B.
   "Initialpasswort erstellen" bei einem Gast-Konto ohne E-Mail, oder
   "Archivieren" bei einem bereits archivierten Konto), bleibt die
   entsprechende Spalte in dieser Zeile einfach leer, statt dass die
   übrigen Buttons nachrücken (10.09.2026, von Stefan so gewünscht -
   vorherige Lösung stapelte stattdessen alle Buttons untereinander in
   EINER Spalte, was nicht dem Wunsch entsprach). Spaltenbreiten fix in
   Pixeln (nicht "auto"/"max-content") - jede Zeile hat sonst ihr eigenes,
   unabhängiges Grid, dessen leere Spalte sonst auf 0 Breite kollabieren
   und die folgenden Spalten trotzdem verschieben würde. Breiten mit
   Playwright GEGEN DIE ECHTE SEITE (nicht per setContent()-Attrappe)
   gemessen, jeweils Spalte = breitester vorkommender Button-Text darin
   + Sicherheitspuffer, damit "justify-items: start" (Buttons in
   natürlicher Breite, nicht gestreckt) nie in die nächste Spalte
   hineinragt: Initialpasswort erstellen 168px, Freischalten 99px,
   Archivieren 95px, Endgültig löschen 134px. */
.user-actions-grid {
  display: grid;
  grid-template-columns: 176px 108px 102px 142px;
  column-gap: 10px;
  align-items: center;
  justify-items: start;
}
.user-actions-grid .table-action-btn { margin-right: 0; }

/* ---------- Formulare ---------- */
.movement-form, .settings-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
}
.movement-form label, .settings-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--anthracite);
}
.movement-form label[hidden], .settings-form label[hidden] { display: none; }
.settings-form { flex-direction: column; align-items: stretch; max-width: 360px; }
.movement-form label.grow { flex: 1; min-width: 200px; }
.form-row-break { flex-basis: 100%; height: 0; }
#intakeForm label.grow { flex: 0 1 auto; width: calc(25% - 12px); }
@media (max-width: 900px) {
  #intakeForm label.grow { width: 100%; }
}
.movement-form select, .movement-form input, .settings-form input {
  padding: 10px 11px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-size: 0.88rem; font-family: inherit;
}
.movement-form select:focus, .movement-form input:focus, .settings-form input:focus { outline: none; border-color: var(--red); }

.form-message {
  margin-top: 14px; padding: 10px 14px; border-radius: 8px; font-size: 0.85rem;
}
.form-message.success { background: #e6f6ea; color: #1e8e3e; border: 1px solid #b9e6c4; }
.form-message.error { background: #fdeaea; color: #b30000; border: 1px solid #f5c2c2; }
/* Für die Zeitstempel-Korrektur (Wunsch vom 24.08.2026): Warnhinweis bei
   einem Monatswechsel, der sich auf die Buchhaltung auswirkt - bewusst
   gelb/orange statt rot, da es (anders als .error) kein Fehler ist,
   sondern eine Rückfrage vor dem eigentlichen Speichern. */
.form-message.warning { background: #fff6e0; color: #8a6100; border: 1px solid #f2dfa1; }

/* Kleines ✏️-Icon direkt neben einem Zeitstempel-Wert, öffnet die
   Korrektur (siehe data-edit-timestamp in tickets.js/betrieb.js). Ein
   zusätzliches ✎-Abzeichen mit Tooltip erscheint, wenn der Wert bereits
   manuell korrigiert wurde (Original-Wert + wer/wann in title). */
.ts-edit-btn {
  border: none; background: transparent; cursor: pointer; padding: 0 2px;
  font-size: 0.85rem; opacity: 0.55; vertical-align: middle;
}
.ts-edit-btn:hover { opacity: 1; }
.ts-changed-badge {
  font-size: 0.72rem; color: #8a6100; margin-left: 4px; cursor: help;
  border-bottom: 1px dotted #8a6100;
}

.field-label { font-size: 0.82rem; font-weight: 700; margin: 4px 0 8px; }
.field-hint { font-size: 0.76rem; color: var(--text-muted); margin: 6px 0 0; }
.size-stock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin-bottom: 6px; }
.size-stock-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.76rem; font-weight: 700; }
.size-stock-grid input { padding: 8px; border-radius: 8px; border: 1.5px solid var(--grey-line); width: 100%; }

@media (max-width: 700px) {
  .admin-header-inner { flex-direction: column; align-items: flex-start; }
  .admin-tabs { width: 100%; }
  .size-stock-grid { grid-template-columns: repeat(2, 1fr); }
  .movement-form { flex-direction: column; align-items: stretch; }
}

/* ---------- Stammdaten-Unternavigation ---------- */
.stammdaten-subnav {
  background: var(--off-white);
  border-bottom: 1px solid var(--grey-line);
  padding: 10px 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.subnav-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--white);
  border: 1.5px solid var(--grey-line);
  text-decoration: none;
  transition: all 160ms;
}
.subnav-pill:hover { border-color: var(--red); color: var(--red); }
.subnav-pill.active { background: var(--red); border-color: var(--red); color: var(--white); }

/* ---------- Ausklappbares Kopfzeilen-Menü ---------- */
.admin-header-actions { position: relative; margin-left: auto; }
.nav-menu-toggle {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.25);
  padding: 9px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-menu-toggle:hover { background: rgba(255,255,255,0.2); }
.nav-menu-dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-strong);
  min-width: 190px;
  padding: 8px;
  z-index: 200;
}
.nav-menu-dropdown.open { display: flex; }
.nav-menu-dropdown a, .nav-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--anthracite);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-menu-dropdown a:hover, .nav-menu-dropdown button:hover { background: var(--off-white); }
/* Aktuelle Seite im Dropdown: hervorgehoben statt ausgeblendet. */
.nav-menu-dropdown a.active { background: rgba(237,28,36,0.1); color: var(--red); cursor: default; }
.nav-menu-divider { border: none; border-top: 1px solid var(--grey-line); margin: 6px 2px; }

/* ---------- Rollen-Auswahl (Mitglied-Formular) ---------- */
.roles-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.role-checkbox-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--off-white);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px 14px 12px 34px;
  cursor: pointer;
  transition: all 160ms;
}
.role-checkbox-card:hover { border-color: var(--grey-line); }
.role-checkbox-card input {
  position: absolute;
  left: 12px;
  top: 14px;
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}
.role-checkbox-card:has(input:checked) { border-color: var(--red); background: rgba(237,28,36,0.06); }
.role-checkbox-card.checked { border-color: var(--red); background: rgba(237,28,36,0.06); }

/* ---------- Filterkriterien-Auswahl (Artikel-Formular) ---------- */
/* Nutzt bewusst dieselbe .role-checkbox-card-Optik wie die Rollen-Auswahl
   oben, nur in einem flexiblen statt starren 2-Spalten-Raster, da die
   Anzahl Filterkriterien je Kategorie stark variieren kann. */
.pf-filters-wrap { display: flex; flex-direction: column; gap: 10px; }
/* Zwei unabhängige Filter-Achsen (Nachbesserung 28.10.2026, siehe Doku
   bei .cf-axis-header): je eine eigene Zeile mit Chips, damit klar
   bleibt, dass die zweite Gruppe (z.B. Geschlecht) UNABHÄNGIG von der
   ersten (z.B. Typ) ist. Innerhalb einer Gruppe sind es seit der
   Nachbesserung Radiobuttons (ein Artikel hat pro Achse höchstens einen
   Wert), inkl. einer dezenten "– keine Auswahl –"-Karte je Gruppe. */
.pf-filter-axis-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pf-filter-axis-group-2 { padding-top: 10px; border-top: 1px dashed var(--grey-line); }
.pf-filters-wrap .role-checkbox-card { flex: 0 0 auto; padding: 10px 14px 10px 34px; }
.pf-filter-none .rcc-title { font-style: italic; color: var(--grey-mid, #888); font-weight: 400; }
.pf-filters-wrap .rcc-title { font-size: 0.85rem; }
.pf-filters-empty-hint { font-size: 0.82rem; color: var(--grey-mid, #888); margin: 0; }
.rcc-title { font-weight: 700; font-size: 0.9rem; color: var(--anthracite); }
.rcc-desc { font-size: 0.74rem; color: var(--text-muted); }
@media (max-width: 480px) {
  .roles-checkbox-grid { grid-template-columns: 1fr; }
}

/* ---------- Einheitliche Basis-Formatierung für ALLE Formulare in
   Modals (Artikel, Mitglieder, Events, Ticketvarianten, ...) - ohne
   diese Regeln fehlte bisher jede Abstands-/Ausrichtungslogik für
   Label/Eingabefeld-Paare ausserhalb des Checkout-Formulars, was zu
   uneinheitlichen, "versetzt" wirkenden Formularen führte. ---------- */
.modal-panel form { display: flex; flex-direction: column; gap: 14px; }
.modal-panel form .form-row { margin: 0; }
.modal-panel form .form-section { display: flex; flex-direction: column; gap: 14px; }
/* Bug vom 22.08.2026: Bierdeckel/Rucksack (ohne Grössen) zeigten nach
   dem Öffnen eines Grössen-Artikels (z.B. T-Shirt) dessen Grössen
   weiter an. Root Cause: die Regel oben setzt IMMER "display:flex" auf
   jedes ".form-section" - auch wenn JS currently per ".hidden = true"
   versucht, es auszublenden. Das Standard-Browserverhalten für das
   "hidden"-Attribut (display:none) hat KEIN "!important", eine
   Autoren-Regel wie die obige gewinnt daher normalerweise dagegen -
   das Element blieb trotz hidden=true sichtbar UND zeigte seinen
   zuletzt für einen ANDEREN Artikel aufgebauten Inhalt weiter an
   (".form-section"-Bereiche werden beim Wechsel auf einen Artikel ohne
   Grössen nicht neu aufgebaut, nur ausgeblendet). Per Playwright
   empirisch bestätigt (computedDisplay blieb "flex" trotz
   hiddenProp=true). Diese Regel stellt für konkret betroffene Bereiche
   im Artikel-Formular das erwartete Verhalten wieder her. */
#pf-editSizesBlock[hidden],
#pf-editSingleStockBlock[hidden] {
  display: none;
}
/* Derselbe Bug (28.08.2026 gefunden, siehe Projektstand): das "Von"-
   Feld im Ticketeingang-Bearbeiten-Modal (#ie-memberWrap) blieb aus
   demselben Grund IMMER sichtbar, unabhängig von der gewählten
   Quelle - die Regel oben setzt "display:flex" auf JEDES Label in
   einem Modal-Formular, das schlägt das "hidden"-Attribut. */
#ie-memberWrap[hidden] {
  display: none;
}
.modal-panel form label:not(.checkbox-row):not(.role-checkbox-card) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--anthracite);
}
.modal-panel form input[type="text"],
.modal-panel form input[type="email"],
.modal-panel form input[type="number"],
.modal-panel form input[type="date"],
.modal-panel form input[type="password"],
.modal-panel form input[type="tel"],
.modal-panel form select,
.modal-panel form textarea {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--grey-line);
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 160ms;
}
.modal-panel form input:focus,
.modal-panel form select:focus,
.modal-panel form textarea:focus {
  outline: none;
  border-color: var(--red);
}
.modal-panel form textarea { resize: vertical; min-height: 64px; }
.modal-panel form .field-hint { margin: 0; }
.modal-panel form .btn-block { margin-top: 4px; }

/* ---------- Formular-Abschnitte (nicht überladenes Layout) ---------- */
.modal-wide { max-width: 640px; width: 100%; }
.form-section {
  border-top: 1px solid var(--grey-line);
  padding-top: 18px;
  margin-top: 4px;
}
.form-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.form-section-title {
  font-family: var(--font-heavy);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* ---------- Reiter im Artikel-Formular ---------- */
.form-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--grey-line);
  margin-bottom: 18px;
  overflow-x: auto;
}
.form-tab {
  padding: 10px 14px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms, border-color 160ms;
}
.form-tab:hover { color: var(--anthracite); }
.form-tab.active { color: var(--red); border-bottom-color: var(--red); }
.form-tab-panel[hidden] { display: none; }

/* ---------- Einheitliche Fenstergrösse über alle Register hinweg ----------
   Ohne dies ist das Fenster nur so hoch wie der Inhalt des GERADE
   sichtbaren Registers, d.h. es springt beim Wechseln des Registers auf
   eine andere Höhe. Trick: alle Register-Inhalte liegen in einem
   gemeinsamen CSS-Grid übereinander in derselben Zelle - die Zeile wird
   dadurch automatisch so hoch wie das GRÖSSTE Register, unabhängig
   davon, welches gerade angezeigt wird. Das inaktive Register bleibt
   dazu mit visibility:hidden (statt display:none) im Layout, damit es
   weiter zur Höhenberechnung beiträgt, ist aber unsichtbar und nicht
   anklickbar (Wunsch vom 22.08.2026: "damit die Fenstergrösse nicht
   ändert, wenn man die Register wechselt"). Die Regel unten überschreibt
   dafür gezielt (höhere Spezifität) das allgemeine
   ".form-tab-panel[hidden] { display: none; }" von oben, aber NUR
   innerhalb eines .form-tab-panels-Containers. */
.form-tab-panels {
  display: grid;
}
.form-tab-panels > .form-tab-panel {
  grid-row: 1;
  grid-column: 1;
  min-width: 0;
}
.form-tab-panels > .form-tab-panel[hidden] {
  display: block;
  visibility: hidden;
  pointer-events: none;
}

/* ---------- Bildauswahl-Feld im Formular ---------- */
.image-picker-field { display: flex; flex-direction: column; gap: 8px; }
.article-extra-images { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.article-extra-image-item {
  width: 90px; border: 1.5px solid var(--grey-line); border-radius: 8px;
  overflow: hidden; background: var(--off-white);
}
.article-extra-image-item img { width: 100%; height: 70px; object-fit: contain; display: block; background: var(--white); }
.article-extra-image-actions { display: flex; justify-content: space-between; padding: 4px; gap: 2px; }
.article-extra-image-actions .icon-btn { font-size: 0.75rem; width: 22px; height: 22px; }
.image-picker-label { font-size: 0.8rem; font-weight: 600; color: var(--anthracite); }
.image-picker-preview {
  width: 100%;
  height: 88px;
  border-radius: 10px;
  border: 1.5px dashed var(--grey-line);
  background: var(--off-white);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-picker-preview img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.image-picker-preview span { font-size: 0.76rem; color: var(--text-muted); }

/* ---------- Bildauswahl-Galerie (Modal) ---------- */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.image-gallery-item {
  border: 1.5px solid var(--grey-line);
  border-radius: 10px;
  padding: 10px;
  background: var(--off-white);
  cursor: pointer;
  transition: border-color 160ms, transform 160ms;
  text-align: center;
}
.image-gallery-item:hover { border-color: var(--red); transform: translateY(-2px); }
.image-gallery-item img { width: 100%; height: 64px; object-fit: contain; margin-bottom: 6px; }
.image-gallery-item span { display: block; font-size: 0.68rem; color: var(--text-muted); word-break: break-word; }
.image-picker-manual { margin-top: 10px; font-size: 0.85rem; }
.image-picker-manual summary { cursor: pointer; color: var(--text-muted); font-size: 0.8rem; }
.image-picker-manual label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 0.8rem; font-weight: 600; }
.image-picker-manual input { padding: 9px 10px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-family: inherit; }

/* ---------- Mengenrabatt-Stufen (Kärtchen-Darstellung) ---------- */
.bulk-tier-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--off-white);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.bulk-tier-badge {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bulk-tier-fields {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.bulk-tier-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bulk-tier-fields input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--grey-line);
  font-family: inherit;
  font-size: 0.88rem;
  width: 100px;
}
.bulk-tier-connector {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-bottom: 9px;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .bulk-tier-row { flex-wrap: wrap; }
  .bulk-tier-fields { width: 100%; }
  .bulk-tier-fields input { width: 100%; }
}

.image-upload-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px;
  border: 1.5px dashed var(--grey-line);
  border-radius: 10px;
  background: var(--off-white);
  margin-bottom: 8px;
}
.image-upload-box .btn { cursor: pointer; }
.image-gallery-divider {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 18px 0 12px;
  position: relative;
}

/* ---------- Pop-up aus einem anderen Bereich (15.11.2026) ----------
   "Bearbeiten" in Tickets -> Spiele & Kontingente zeigt das Spiel-
   Formular der Stammdaten, "Kontingente" in Stammdaten -> Spiele zeigt
   die Ticket-Kategorien aus Tickets - jeweils OHNE Seitenwechsel: die
   andere Seite liegt im "eingebetteten Modus" (html.embed-mode) in
   einem durchsichtigen iframe über der ganzen Seite und zeigt nur ihr
   Fenster. Die Abdunklung kommt von hier. Siehe openSpielEditor()
   (tickets.js) und openKontingentePopup() (stammdaten.js). */
.embed-popup-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.embed-popup-overlay iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; background: transparent;
}
.embed-popup-overlay.loading iframe { visibility: hidden; }
.embed-popup-loading { color: #fff; font-weight: 600; font-size: 1rem; }
.embed-popup-overlay:not(.loading) .embed-popup-loading { display: none; }
/* Die eingebettete Seite selbst: nur ihre Fenster (.modal-overlay) sind
   sichtbar, Hintergrund durchsichtig, kein eigener Rollbalken
   (style.css erzwingt sonst overflow-y: scroll auf html). */
html.embed-mode, html.embed-mode body { background: transparent !important; min-height: 0; }
html.embed-mode { overflow: hidden !important; scrollbar-gutter: auto; }
html.embed-mode body > *:not(.modal-overlay) { display: none !important; }
html.embed-mode #eventOverlay, html.embed-mode #eventDetailOverlay { background: transparent; }

/* ---------- "Kacheln anordnen": dezentes Symbol neben der Überschrift ----------
   (15.11.2026, Wunsch von Stefan: in allen Bereichen vorhanden, aber
   viel dezenter als der frühere grosse rote Knopf in den Stammdaten;
   nur für Admins sichtbar.) Im Ruhezustand ein kleines, graues
   Griff-Symbol direkt hinter "…-Bereiche"; im Anordnen-Modus wird
   daraus ein kleiner Knopf "Speichern", daneben "Abbrechen". */
.panel-head h2 .tile-order-btn { vertical-align: middle; margin-left: 16px; }
.panel-head h2 .tile-order-cancel-btn { vertical-align: middle; margin-left: 8px; }
.tile-order-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 5px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--text-muted);
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; line-height: 1;
  opacity: 0.55; cursor: pointer;
  transition: opacity 140ms, border-color 140ms, background 140ms, color 140ms;
}
.tile-order-btn:hover, .tile-order-btn:focus-visible { opacity: 1; border-color: var(--grey-line); background: var(--white); color: var(--anthracite); }
.tile-order-btn[hidden], .tile-order-cancel-btn[hidden] { display: none; }
.tile-order-btn.is-editing {
  opacity: 1; padding: 0 12px; font-size: 0.78rem;
  background: var(--red); border-color: var(--red); color: var(--white);
}
.tile-order-btn.is-editing:hover { background: var(--red); color: var(--white); filter: brightness(0.93); }
.tile-order-cancel-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; padding: 0 12px;
  border: 1px solid var(--grey-line); border-radius: 7px;
  background: var(--white); color: var(--anthracite);
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; line-height: 1; cursor: pointer;
}
.tile-order-cancel-btn:hover { border-color: var(--anthracite); }


/* ---------- Spiel-Detailfenster (js/spiel-shared.js; Betrieb ->
   Spielübersicht und Finanzen -> Dashboard), kompakte Fassung vom
   15.11.2026 (Wunsch von Stefan: mehr Informationen auf einen Blick):
   Kennzahlen in 4 statt 2 Spalten, Erfassen-Block auf einer Zeile,
   Tabelle "Ticketkategorien" mit schmalen Zahlenspalten - der Platz
   geht an Sektor und Preiskategorie (weniger Zeilenumbrüche). ---------- */
#gameDetailModal .game-detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 18px; }
#gameDetailModal .game-detail-item { padding: 5px 0; gap: 0; }
#gameDetailModal .game-detail-label { font-size: 0.64rem; letter-spacing: 0; white-space: nowrap; }
#gameDetailModal .game-detail-grid { grid-template-columns: 0.9fr 1fr 1.05fr 1.1fr; }
#gameDetailModal .game-detail-value { font-size: 0.92rem; }
#gameDetailModal .game-detail-total .game-detail-value { font-size: 1.1rem; }
.game-detail-h3 { margin: 12px 0 6px; font-size: 0.95rem; }

.game-detail-erfassen { margin-top: 10px; padding: 9px 12px; border: 1px solid var(--grey-line); border-radius: 10px; background: var(--off-white); }
.game-detail-erfassen h3 { margin: 0 0 6px; font-size: 0.9rem; }
.game-detail-erfassen-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px 12px; align-items: start; }
.game-detail-erfassen-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 0.76rem; font-weight: 600; }
.game-detail-erfassen-grid input { width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--grey-line); border-radius: 7px; background: var(--white); font: inherit; font-size: 0.86rem; font-weight: 400; }
.game-detail-erfassen-grid .field-hint { font-weight: 400; font-size: 0.72rem; margin: 0; }
.game-detail-erfassen-grid button { align-self: start; margin-top: 17px; }
.game-detail-erfassen-hint { margin: 4px 0 0; font-size: 0.72rem; }
.game-detail-erfassen .form-message { margin: 6px 0 0; padding: 5px 10px; font-size: 0.8rem; }

.admin-table.game-detail-table { min-width: 0; font-size: 0.82rem; }
.admin-table.game-detail-table th { padding: 6px 10px; font-size: 0.66rem; }
.admin-table.game-detail-table td { padding: 5px 10px; }
.admin-table.game-detail-table th.col-narrow,
.admin-table.game-detail-table td.col-narrow { width: 1%; max-width: none; padding-left: 8px; padding-right: 8px; white-space: nowrap; text-align: right; }

@media (max-width: 720px) {
  #gameDetailModal .game-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-detail-erfassen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-detail-erfassen-grid button { margin-top: 0; }
}

/* ---------- Formular-Abschnitte (15.11.2026): "Spielangaben" (vor dem
   Spiel) / "Spielabschluss" (nach dem Spiel) im Fenster "Spiel
   bearbeiten" (Stammdaten), beide als eigener Kasten mit Rahmen ---------- */
.form-section-box {
  /* seitlich nach aussen gezogen, damit die Felder im Kasten gleich breit
     bleiben wie die Felder darüber (sonst umbricht "Becherspende (Anzahl)") */
  margin: 0 -13px 0 -16px;
  padding: 10px 12px 12px;
  border: 1px solid var(--grey-line);
  border-left: 4px solid var(--red);
  border-radius: 10px;
  background: var(--off-white);
}
.form-section-box + .form-section-box { margin-top: 12px; }   /* kleiner Abstand zwischen den Abschnitten */
/* Bewusst nur INNERHALB der Kästen: ".form-section-title" gibt es schon
   weiter oben für das Artikel-Formular - dessen Aussehen bleibt unberührt. */
.form-section-box .form-section-title {
  font-family: var(--font-heavy);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--anthracite);
  margin: 2px 0 6px;
  padding: 0;
  border: none;
}

/* ---------- Notizen-Übersicht: Bearbeiten / Löschen (23.11.2026) ----------
   Zwei Knöpfe unten rechts in der Fusszeile jeder Karte, seit der
   zweiten Rückmeldung nur noch als Symbole (Stift/Papierkorb) statt mit
   Beschriftung - der Tooltip (title) und aria-label tragen weiterhin
   den vollen Text für Maus-Hover bzw. Screenreader. Im Bearbeiten-Modus
   ersetzt ein kleines Formular (Text + Kachel) den Text der Karte;
   Priorität (jetzt in der Titelzeile) und Status bleiben direkt
   bedienbar. */
.notes-card-actions { display: inline-flex; gap: 4px; }
.notes-card-icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
}
.notes-card-btn {
  border-radius: 6px;
  border: 1.5px solid var(--grey-line);
  background: var(--white);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text, #222);
  cursor: pointer;
}
.notes-card-btn:not(.notes-card-icon-btn) { padding: 3px 9px; }
.notes-card-btn:hover:not(:disabled) { border-color: #999; }
.notes-card-btn:disabled { opacity: 0.5; cursor: default; }
.notes-card-delete-btn:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.notes-card-btn-primary { background: var(--red); border-color: var(--red); color: var(--white); }
.notes-card-btn-primary:hover:not(:disabled) { border-color: var(--red); filter: brightness(0.92); }
.notes-overview-card.is-editing .notes-overview-card-content { display: none; }
.notes-overview-card.is-editing .notes-card-actions { display: none; }
.notes-card-edit { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 10px; }
.notes-card-edit-label { display: flex; flex-direction: column; gap: 3px; font-size: 0.74rem; font-weight: 600; color: var(--text-muted, #666); }
.notes-card-edit-text,
.notes-card-edit-kachel {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--grey-line);
  background: var(--white);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text, #222);
}
.notes-card-edit-text { resize: vertical; min-height: 60px; }
.notes-card-edit-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notes-card-edit-hint { font-size: 0.76rem; color: var(--red); }

/* Hinweis «Offene Vorbestellungen» nach einer Bestandsänderung (29.11.2026, js/api.js) */
#vorbestellungHinweisOverlay .vh-kasten { margin-top: 10px; font-size: 0.88rem; }
#vorbestellungHinweisOverlay .vh-kasten-da { border-left-color: #1f9d4c; }
#vorbestellungHinweisOverlay .vh-stand { margin-top: 4px; color: var(--text-muted); }
#vorbestellungHinweisOverlay .vh-knoepfe { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
