/* Veranstaltungen an der Kasse (Desktop + Mobile) - Etappe 4, 16.11.2026 */

/* ---------- Menü: vier Bereiche + Umschalter Verkauf | Verlauf ---------- */
.km-tab-btn[hidden], .payment-btn[hidden] { display: none !important; }
.km-tabs .km-tab-btn { padding-left: 4px; padding-right: 4px; white-space: nowrap; min-width: 0; }
@media (max-width: 420px) { .km-tabs .km-tab-btn { font-size: 0.72rem; padding-left: 2px; padding-right: 2px; letter-spacing: -0.2px; } }
.kasse-ansicht { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: var(--off-white); padding: 8px 12px; box-sizing: border-box; max-width: 100%; }
.kasse-ansicht-gruppe { display: flex; grid-column: 2; min-width: 0; }
.kasse-ansicht-btn { background: var(--white); border: 1.5px solid var(--grey-line); color: var(--anthracite); padding: 6px 18px; line-height: 1.2; font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.kasse-ansicht-btn { border-radius: 0; }
.kasse-ansicht-btn:not(:last-child) { border-right: 0; }
.kasse-ansicht-btn:first-child { border-radius: 999px 0 0 999px; }
.kasse-ansicht-btn:last-child { border-radius: 0 999px 999px 0; }
.kasse-ansicht-btn.active { background: var(--anthracite); border-color: var(--anthracite); color: var(--white); }
.kasse-seller-inline { font-weight: 400; opacity: 0.85; }

/* Verkäufer:in steht jetzt klein im Titel - die grosse Anzeige entfällt */
.kasse-buyer-bar > .kasse-field:first-child, #sellerLabel, #sellerDisplay { display: none; }
#sellerDisplay + .km-field-label { margin-top: 0 !important; }

/* Der Bereich bestimmt, was ausgewählt werden kann */
#kvRoot { display: none; }
body[data-kasse-area="veranstaltungen"] #kvRoot { display: block; }
body[data-kasse-area="veranstaltungen"] #kasseProductsSection > :not(#kvRoot),
body[data-kasse-area="veranstaltungen"] #kmProductsSection > :not(#kvRoot) { display: none !important; }
body[data-kasse-area="tickets"] #filterBar { display: none; }
/* Verfügbarkeitsfilter (24.11.2026): Alle / Verfügbar / Bestellbar - nur im Bereich Shop */
.kasse-verfuegbar { display: flex; justify-content: center; margin: 0 0 12px; }
.kasse-verfuegbar-btn { background: var(--white); border: 1.5px solid var(--grey-line); color: var(--anthracite); padding: 7px 16px; line-height: 1.2; font-family: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; border-radius: 0; }
.kasse-verfuegbar-btn:not(:last-child) { border-right: 0; }
.kasse-verfuegbar-btn:first-child { border-radius: 999px 0 0 999px; }
.kasse-verfuegbar-btn:last-child { border-radius: 0 999px 999px 0; }
.kasse-verfuegbar-btn.active { background: var(--anthracite); border-color: var(--anthracite); color: var(--white); }
.kasse-verfuegbar-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
body[data-kasse-area="tickets"] #kasseVerfuegbarFilter { display: none; }
body[data-kasse-area="shop"] #filterBar .filter-btn[data-filter="tickets"] { display: none; }

/* Veranstaltungen zur Auswahl */
.kv-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kv-event { background: var(--white); border: 1px solid var(--grey-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.kv-event-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kv-event-opt { display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; border-top: 1px dashed var(--grey-line); padding-top: 6px; flex: 1; }
.kv-anmelden { align-self: stretch; }
#kvMeldung { margin: 0 0 10px; }

/* Zahlungsfenster: weitere offene Positionen */
.kasse-extras { border: 1px dashed var(--grey-line); border-radius: 10px; padding: 10px 12px; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.kasse-extras[hidden] { display: none; }
.kasse-extras-titel { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.kasse-extra { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.kasse-extra-name { font-size: 0.88rem; font-weight: 600; }
.kasse-extra-btn { background: var(--white); border: 1.5px solid var(--anthracite); border-radius: 999px; color: var(--anthracite); padding: 6px 14px; font-family: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.kasse-extra-btn:hover { background: var(--anthracite); color: var(--white); }
#donationPaymentToggle .payment-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.kv-abschnitt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.kv-abschnitt-head h3 { margin: 0; font-size: 0.95rem; }
.kv-zaehler { color: var(--text-muted); font-weight: 500; }
.kv-suche { flex: 1 1 220px; max-width: 340px; padding: 9px 12px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-family: inherit; font-size: 0.9rem; box-sizing: border-box; }
.kv-liste { display: flex; flex-direction: column; gap: 10px; }
.kv-leer { color: var(--text-muted); font-size: 0.88rem; margin: 6px 0; }
.kv-karte { background: var(--white); border: 1px solid var(--grey-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.kv-karte-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kv-wer { font-weight: 700; font-size: 0.98rem; }
.kv-betrag { font-family: var(--font-heavy); color: var(--red); font-size: 1.1rem; white-space: nowrap; }
.kv-klein { font-size: 0.78rem; color: var(--text-muted); font-weight: 400; }
.kv-chip { font-size: 0.68rem; font-weight: 500; color: var(--text-muted); background: var(--off-white); border: 1px solid var(--grey-line); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.kv-personen-liste { border-top: 1px dashed var(--grey-line); padding-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.kv-person { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.kv-person > span:last-child { white-space: nowrap; }
.kv-kassieren { align-self: flex-end; }

/* Fenster */
#kvAnmModal .modal-body, #kvZahlModal .modal-body { display: flex; flex-direction: column; gap: 10px; }
#kvAnmModal .kasse-field, #kvZahlModal .kasse-field { margin-bottom: 0; }
.kv-label { margin-top: 4px; font-size: 0.82rem; font-weight: 600; }
.kv-relativ { position: relative; }
.kv-gewaehlt { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--off-white); border: 1px solid var(--grey-line); border-radius: 8px; padding: 8px 12px; font-size: 0.9rem; }
.kv-personen { display: flex; flex-direction: column; gap: 8px; }
.kv-p { background: var(--white); border: 1px solid var(--grey-line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.kv-p-kopf { display: flex; justify-content: space-between; align-items: center; font-size: 0.92rem; }
.kv-name { padding: 9px 12px; border-radius: 8px; border: 1.5px solid var(--grey-line); font-family: inherit; font-size: 0.9rem; width: 100%; box-sizing: border-box; }
.kv-optionen { display: flex; flex-direction: column; gap: 4px; }
.kv-option { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--grey-line); border-radius: 8px; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.kv-option:has(input:checked) { border-color: var(--red); background: rgba(237, 28, 36, 0.06); }
.kv-option input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.kv-option-preis { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv-add { align-self: flex-start; background: var(--white); color: var(--anthracite); border: 1.5px dashed var(--grey-line); border-radius: 8px; padding: 8px 14px; font-family: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.kv-add:hover { border-color: var(--anthracite); }
.kv-total { margin: 2px 0; }
.kv-zweit { background: transparent; border: 1.5px solid var(--grey-line); border-radius: 999px; color: var(--anthracite); padding: 10px 14px; font-family: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; width: 100%; }
.kv-zweit:hover { border-color: var(--anthracite); }
.kv-zweit:disabled { opacity: 0.5; cursor: default; }
.kv-x { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 0.8rem; cursor: pointer; flex: none; }
.kv-x:hover { background: #fde8e8; color: #b30000; }
.kv-zahl-info { font-size: 0.95rem; line-height: 1.4; }
#kvZahlToggle .payment-btn:disabled { opacity: 0.45; cursor: not-allowed; }
#kvGuthabenInfo { margin: 0; }

/* ---------- Ansichten: Verkauf | Ausgabe | Verlauf ---------- */
/* Verkauf: nur neue Positionen hinzufügen - die offenen Positionen gehören zur Ausgabe */
body[data-kasse-ansicht="verkauf"] :is(#kasseAssignedTicketsSection, #kasseOpenOrdersSection, #kvOffenSection, #kmAssignedTicketsSection, #kmOpenOrdersSection) { display: none !important; }
/* Ausgabe: keine Artikelauswahl, nur die offenen Positionen des gewählten Bereichs */
body[data-kasse-ansicht="ausgabe"] :is(#kasseProductsSection, #kmProductsSection) { display: none !important; }
body[data-kasse-ansicht="ausgabe"][data-kasse-area="shop"] :is(#kasseAssignedTicketsSection, #kmAssignedTicketsSection, #kvOffenSection) { display: none !important; }
body[data-kasse-ansicht="ausgabe"][data-kasse-area="tickets"] :is(#kasseOpenOrdersSection, #kmOpenOrdersSection, #kvOffenSection) { display: none !important; }
body[data-kasse-ansicht="ausgabe"][data-kasse-area="veranstaltungen"] :is(#kasseAssignedTicketsSection, #kmAssignedTicketsSection, #kasseOpenOrdersSection, #kmOpenOrdersSection) { display: none !important; }
/* Verlauf: kein Hinweis "zuerst Käufer:in wählen" (ohne Person wird alles gezeigt) */
body[data-kasse-ansicht="verlauf"] :is(#kasseNoBuyerHint, #kmNoBuyerHint) { display: none !important; }
/* Spende: Käufer:in-Leiste wie in den anderen Bereichen (Mitglied/Gast), aber ohne Hinweis "zuerst wählen" */
body[data-kasse-area="spende"] :is(#kasseNoBuyerHint, #kmNoBuyerHint) { display: none !important; }
.kasse-ansicht-btn:disabled { opacity: 0.4; cursor: not-allowed; background: var(--off-white); }
.kasse-buyer-wrap { padding-bottom: 0; }
#kvAusgabeLeer { margin: 14px 0; }

/* ---------- Info-Knopf + Info-Box ---------- */
.kasse-info-btn { grid-column: 3; justify-self: end; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #1b6fc9; color: #fff; font: italic 700 0.95rem/26px Georgia, serif; padding: 0; cursor: pointer; }
.kasse-info-btn.active { background: #12508f; box-shadow: 0 0 0 3px rgba(27, 111, 201, 0.25); }
.kasse-info-box { margin: 8px 12px 0; padding: 10px 14px; background: #eaf3fc; border: 1.5px solid #1b6fc9; border-radius: 10px; font-size: 0.86rem; color: var(--anthracite); }
.kasse-info-box p { margin: 4px 0 0; line-height: 1.45; }

/* ---------- Kasse Mobile: kompakte Käufer:in-Suche ---------- */
.km-buyer-row { display: flex; gap: 8px; align-items: stretch; }
.km-buyer-row .km-search-input { flex: 1; min-width: 0; margin: 0; }
.km-list-btn { flex: none; padding: 0 16px; font-size: 0.85rem; }
.km-list-btn.active { background: var(--anthracite); color: var(--white); border-color: var(--anthracite); }
.km-buyer-list { margin-top: 8px; max-height: 45vh; overflow-y: auto; border: 1.5px solid var(--grey-line); border-radius: 10px; background: var(--white); -webkit-overflow-scrolling: touch; }
.km-buyer-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--grey-line); background: transparent; font: inherit; font-size: 0.9rem; cursor: pointer; }
.km-buyer-list button:last-child { border-bottom: 0; }
.km-buyer-list button.active { background: var(--off-white); font-weight: 700; }
.km-buyer-list .kbl-none { color: #5b5b5b; font-style: italic; }
.km-buyer-chosen { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1.5px solid #2f8f4e; border-radius: 10px; background: #f0faf3; font-weight: 700; font-size: 0.9rem; }
.km-buyer-chosen button { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; cursor: pointer; color: #555; padding: 0 4px; }
.km-buyer-chosen[hidden], .km-buyer-list[hidden], .kasse-info-box[hidden] { display: none !important; }
[hidden] { display: none !important; }

/* Storno im Verlauf (26.11.2026) */
#ksModal .ks-body { display: flex; flex-direction: column; gap: 10px; }
#ksModal .ks-info p { margin: 0 0 6px; }
#ksModal .ks-info ul { margin: 0; padding-left: 18px; }
#ksModal .ks-ware { display: flex; flex-direction: column; gap: 6px; background: var(--off-white); border: 1px solid var(--grey-line); border-radius: 8px; padding: 8px 12px; }
#ksModal .ks-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
#ksModal textarea { width: 100%; box-sizing: border-box; }
#ksModal .ks-knoepfe { display: flex; justify-content: flex-end; gap: 8px; }
.ks-hinweis { display: block; font-size: 0.78rem; color: var(--text-muted); text-decoration: none; }
.ks-chip { display: inline-block; }

/* Chip «Shop» im Kassen-Verlauf: gelb, damit Shop-Bestellungen auffallen (26.11.2026) */
.kv-chip.kv-chip-shop { background: #ffd43b; border-color: #e0b400; color: #3d3000; font-weight: 700; }

/* Herkunfts-Chips im Spende-Verlauf: je Quelle eine Farbe (26.11.2026) */
.kv-chip.kv-chip-kasse { background: #d3f0dc; border-color: #5cb85c; color: #14532d; font-weight: 700; }
.kv-chip.kv-chip-stammdaten { background: #d6e6fb; border-color: #4a90d9; color: #12396b; font-weight: 700; }
.kv-chip.kv-chip-retourgeld { background: #ffe0c2; border-color: #f0903c; color: #6b3200; font-weight: 700; }
