/* ==========================================================================
   Betrieb – Fanclub Trinkpause
   Baut auf css/style.css und admin/admin.css auf.
   ========================================================================== */

/* ---------- Dashboard: Kennzahlen-Karten ---------- */
/* Die Kachel-Navigation erbt von stammdaten.css eine max-width:700px
   und width:fit-content, die dort für die nebeneinander liegenden,
   einzeln verschiebbaren Bereichs-Boxen gedacht sind - hier gibt es nur
   eine einzige Navigation, die soll wie bei Stammdaten mehrere Kacheln
   pro Zeile zeigen. width:100% statt fit-content ist nötig, sonst kann
   der Browser bei "auto-fill" nicht berechnen, wie viele Spalten passen,
   und zeigt nur eine einzige Spalte. */
#betriebNavGrid { width: 100%; max-width: none; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}
.dashboard-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px 16px;
}
.dashboard-card-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dashboard-card-value {
  font-family: var(--font-heavy);
  font-size: 1.4rem;
  color: var(--anthracite);
  margin: 0;
}
.dashboard-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 6px 0 0;
}
/* Kachel als Link in den passenden Bereich (24.11.2026) */
a.dashboard-card-link { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: transform 160ms, box-shadow 160ms, border-color 160ms; }
a.dashboard-card-link:hover, a.dashboard-card-link:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-strong); }
a.dashboard-card-link .dashboard-card-label::after { content: " →"; opacity: 0.45; }
.dashboard-card.warn .dashboard-card-value { color: #b30000; }
.dashboard-card.ok .dashboard-card-value { color: #1e8e3e; }

/* ---------- Dashboard: Karten-Gruppentitel (z.B. "Tickets", "Shop") ---------- */
.dashboard-group { margin-bottom: 22px; }
.dashboard-group-title {
  font-family: var(--font-heavy);
  font-size: 0.9rem;
  color: var(--anthracite);
  margin: 0 0 10px;
}

/* ---------- Dashboard: To-Do-Liste ---------- */
.dashboard-todo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dashboard-todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--white);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 12px 16px;
  border-left: 4px solid var(--grey-line);
}
.dashboard-todo-item.priority-high { border-left-color: var(--red); }
.dashboard-todo-item.priority-medium { border-left-color: #d97706; }
.dashboard-todo-item.priority-low { border-left-color: #1e8e3e; }
.dashboard-todo-text { font-size: 0.88rem; }
.dashboard-todo-count {
  display: inline-block;
  background: var(--off-white);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-right: 8px;
}
.dashboard-todo-empty {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 20px;
}

/* ---------- Ticketübersicht: schmale/zentrierte Spalten ---------- */
.admin-table th.col-narrow, .admin-table td.col-narrow { width: 90px; max-width: 90px; text-align: center; white-space: nowrap; }
.admin-table th.col-center, .admin-table td.col-center { text-align: center; }
.ticketuebersicht-negativ { color: #b30000; font-weight: 600; }
.ticketuebersicht-positiv { color: #1e8e3e; font-weight: 600; }
.events-group-empty { text-align: center; color: var(--text-muted); font-style: italic; padding: 20px; }

/* Spieldetail-Popup: Standardmässig sind Modals auf 560px begrenzt
   (gedacht für normale Formulare) - seit die Ticketkategorien-Tabelle
   (6 Spalten) dort mit reinkam, war das zu schmal für eine gute
   Übersicht. "width: 100%" ist hier nötig, nicht nur max-width, da die
   Basisregel sonst schon vorher eine kleinere feste Breite vorgibt. */
#gameDetailModal { width: 100%; max-width: 900px; }

/* ---------- Spielübersicht/Dashboard: Total-Zeile & klickbare Spiele-Zeilen ---------- */
.admin-table .total-row td {
  background: var(--off-white);
  font-weight: 700;
  border-bottom: 2px solid var(--grey-line);
}
.admin-table tr.clickable-row { cursor: pointer; }
.admin-table tr.clickable-row:hover td { background: rgba(0,0,0,0.03); }
.admin-table td.cell-bold { font-weight: 700; }

/* ---------- Spiel-Detailansicht ---------- */
.game-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.game-detail-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--grey-line); }
.game-detail-label { font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.game-detail-value { font-family: var(--font-heavy); font-size: 1.05rem; color: var(--anthracite); }
.game-detail-value.total { color: #1e8e3e; }
.game-detail-value.total.negativ { color: #b30000; }
.game-detail-full { grid-column: 1 / -1; }

/* ---------- Bestellung löschen: Rückerstattungs-Optionen ---------- */
.btn-secondary {
  background: var(--off-white);
  color: var(--anthracite);
  border: 1.5px solid var(--grey-line);
}
.btn-secondary:hover { background: var(--grey-line); }

/* Vorbestellungs-Kennzeichnung in der Bestellungen-Tabelle (Positionen,
   für die bei Bestelleingang nicht genug Bestand da war). */
.order-item-backorder-badge {
  display: inline-block;
  background: #fff3cd;
  color: #856404;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  margin: 0 4px;
}

/* ---------- Lagerbestand (18.11.2026): beide Lager in einer Tabelle ---------- */
.lb-head { margin-bottom: 12px; }
.lb-title { display: flex; align-items: center; gap: 10px; }
.lb-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-info { margin: 0 0 12px; }
.lb-info .lb-badge { white-space: nowrap; }
.lb-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.lb-search { flex: 1 1 260px; max-width: 380px; padding: 6px 10px; border: 1px solid var(--grey-line); border-radius: 8px; font-size: 0.85rem; }
.lb-select { padding: 6px 8px; border: 1px solid var(--grey-line); border-radius: 8px; font-size: 0.85rem; background: var(--white); }
.lb-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; white-space: nowrap; cursor: pointer; }
.lb-check input { margin: 0; }
.lb-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--red); color: var(--white); font-size: 0.72rem; line-height: 18px; text-align: center; }

.lb-table { font-size: 0.84rem; }
.lb-table th, .lb-table td { padding-top: 6px; padding-bottom: 6px; }
.lb-table thead th { vertical-align: bottom; }
.lb-table th.lb-group { text-align: center; border-bottom: 1px solid var(--grey-line); }
.lb-table .lb-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lb-table .lb-group-haupt { background: rgba(27, 111, 201, 0.05); }
.lb-table .lb-group-mosi { background: rgba(120, 120, 120, 0.06); }
.lb-table .lb-strong { font-weight: 700; }
.lb-table .lb-zero { color: var(--text-muted); }
.lb-table .lb-negative { color: #b30000; font-weight: 700; }
.lb-table .lb-empty { text-align: center; color: var(--text-muted); padding: 18px; }
.lb-table .lb-hinweis { min-width: 250px; }
.lb-table .lb-col-artikel { min-width: 170px; }
.lb-hinweis-text { font-size: 0.78rem; }
.lb-badge { white-space: nowrap; }
.lb-farbe { color: var(--text-muted); font-size: 0.8rem; }
.lb-status { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: #eee; color: #555; font-size: 0.72rem; }
.lb-sum-row td { font-weight: 700; border-top: 2px solid var(--anthracite); background: var(--white); }

/* Warnstufen Mindestbestand: Orange = nur Hauptlager (aus Mosi umbuchen),
   Rot = beide Lager (nachbestellen). Farben wie bei den Notizen. */
.lb-row-orange td { background: #fde6d3; }
.lb-row-red td { background: #fbd5d5; }
.lb-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.76rem; line-height: 1.35; color: #fff; }
.lb-badge-orange { background: #e8762b; }
.lb-badge-red { background: #c62828; }

/* Mindestbestand direkt in der Tabelle ändern (18.11.2026) */
.lb-min-btn { border: 1px dashed transparent; background: transparent; border-radius: 6px; padding: 1px 8px; min-width: 34px; font: inherit; color: inherit; cursor: pointer; text-align: right; }
.lb-min-btn:hover, .lb-min-btn:focus-visible { border-color: #1b6fc9; background: #eaf3fc; outline: none; }
.lb-min-input { width: 70px; padding: 2px 6px; border: 1.5px solid #1b6fc9; border-radius: 6px; font: inherit; text-align: right; }

/* "Schloss" in der Kachel Lagerbestand (18.11.2026); Knopf/Hinweis-Stile aus stammdaten.css */
.lb-title .stock-lock-btn { margin-left: 6px; }
#lbLockWarning { margin: 0 0 12px; }
.lb-table .lb-stock-input { width: 56px; padding: 2px 6px; border: 1.5px solid #e8762b; border-radius: 6px; font: inherit; text-align: right; background: var(--white); }

/* Warenbewegung stornieren (23.11.2026) */
#movementsTable tr.sm-storniert td:not(:first-child):not(.actions-cell) { text-decoration: line-through; color: var(--text-muted); }
#movementsTable tr.sm-storno td { background: #fff8e1; }
.sm-storno-dl { display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px; margin: 0; font-size: 0.86rem; }
.sm-storno-dl dt { color: var(--text-muted); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 2px; }
.sm-storno-dl dd { margin: 0; }
.sm-storno-hinweis { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.sm-storno-warnung { padding: 10px 12px; border: 1.5px solid #e8762b; background: #fff4e8; border-radius: 10px; font-size: 0.86rem; line-height: 1.45; }
.sm-storno-warnung[hidden] { display: none; }
.sm-storno-warnung-knoepfe { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }

/* ==========================================================================
   Mailprotokoll (Wunsch vom 23.11.2026)
   Zähler Shop/Mailomat als Balken (Markierungen bei Vorwarnung 75% und
   "fast erreicht" 95%), Hinweisliste, Tabelle mit Status-Etiketten.
   Farben wie bei den Notizen: grün ok, orange Vorsicht, rot Problem.
   ========================================================================== */
.mp-zaehler {
  background: var(--white);
  border: 1.5px solid var(--grey-line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.mp-zaehler-kopf { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.mp-zaehler-kopf strong { font-family: var(--font-heavy); font-size: 1rem; }
.mp-abgleich { display: inline-flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--text-muted); }
.mp-balken-zeile { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 8px; }
.mp-balken-label { font-size: 0.82rem; font-weight: 600; }
.mp-balken { position: relative; height: 12px; border-radius: 999px; background: var(--off-white); overflow: hidden; }
.mp-balken-fuell { height: 100%; border-radius: 999px; transition: width var(--transition); }
.mp-stufe-ok { background: #2f9e52; }
.mp-stufe-warn { background: #e8762b; }
.mp-stufe-kritisch { background: var(--red); }
.mp-marke { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, 0.18); }
.mp-zahl { font-family: var(--font-heavy); font-size: 1rem; min-width: 84px; text-align: right; white-space: nowrap; }
.mp-zahl-limit { font-family: var(--font-body); font-weight: 400; font-size: 0.8rem; color: var(--text-muted); }
.mp-stufe-text-ok { color: #1e8e3e; }
.mp-stufe-text-warn { color: #d97706; }
.mp-stufe-text-kritisch { color: #b30000; }
.mp-nicht-eingerichtet { grid-column: 2 / 4; font-size: 0.8rem; color: var(--text-muted); font-style: italic; }
.mp-zaehler .form-message { margin: 8px 0 0; }
.mp-hinweise { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mp-hinweise li { font-size: 0.8rem; padding-left: 20px; position: relative; }
.mp-hinweise li::before { position: absolute; left: 0; }
.mp-hinweis-ok::before { content: "✓"; color: #1e8e3e; font-weight: 700; }
.mp-hinweis-warn::before { content: "⚠"; color: #d97706; }
.mp-hinweis-bad::before { content: "⚠"; color: var(--red); }
.mp-hinweis-bad { color: #b30000; }
.mp-hinweis-neutral::before { content: "ℹ"; color: var(--text-muted); }
.mp-hinweis-neutral { color: var(--text-muted); }

.mp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; }
.mp-toolbar .filter-bar { margin-bottom: 0; justify-content: flex-start; }
.mp-monat { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; }
.mp-monat input { padding: 5px 8px; border-radius: 6px; border: 1.5px solid var(--grey-line); font-family: inherit; font-size: 0.82rem; }

.mp-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.mp-chip-ok { background: #e7f5ec; color: #1e7a3c; }
.mp-chip-warn { background: #fde6d3; color: #b45309; }
.mp-chip-bad { background: #fdebe9; color: #b30000; }
.mp-chip-neutral { background: var(--off-white); color: var(--text-muted); }
.mp-chip-extern { background: #e8eefb; color: #1b4f9c; }
.mp-teil { font-size: 0.74rem; color: var(--text-muted); }
.mp-detail { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; word-break: break-word; }
.mp-nowrap { white-space: nowrap; }
.mp-empf { font-size: 0.82rem; }
.mp-zeile-extern td { background: #f7f9fe; }

.mp-startwert { margin-top: 16px; font-size: 0.84rem; }
.mp-startwert summary { cursor: pointer; font-weight: 600; color: var(--text-muted); }
.mp-startwert-felder { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.mp-startwert-felder label { display: flex; flex-direction: column; gap: 4px; font-size: 0.78rem; font-weight: 600; }
.mp-startwert-felder input { width: 110px; padding: 6px 8px; border-radius: 6px; border: 1.5px solid var(--grey-line); font-family: inherit; }
.mp-startwert .form-message { margin-top: 8px; }

@media (max-width: 700px) {
  .mp-balken-zeile { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; }
  .mp-zahl { min-width: 0; }
}

/* Dashboard (Finanzen): dritte Farbstufe "Vorsicht" (orange) für die
   Mail-Kachel ab 75% des Kontingents (23.11.2026) */
.dashboard-card.caution .dashboard-card-value { color: #d97706; }

/* Mailprotokoll: Titel mit Hinweis auf das Zurücksetzen der Abo-Periode (23.11.2026) */
.mp-titel { display: flex; flex-direction: column; gap: 2px; }
.mp-reset { font-size: 0.76rem; color: var(--text-muted); }
.mp-monat select { padding: 5px 8px; border-radius: 6px; border: 1.5px solid var(--grey-line); font-family: inherit; font-size: 0.82rem; background: var(--white); }
.mp-startwert[hidden] { display: none; }
.mp-startwert-felder select { padding: 6px 8px; border-radius: 6px; border: 1.5px solid var(--grey-line); font-family: inherit; }
.mp-startwert-felder input[type="date"] { width: auto; }

/* ==========================================================================
   Loginprotokoll (Wunsch vom 23.11.2026) - nutzt die Etiketten des
   Mailprotokolls (mp-chip-ok/-warn/-bad)
   ========================================================================== */
.lp-zusammenfassung {
  background: var(--white);
  border: 1.5px solid var(--grey-line);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.lp-kennzahlen { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.lp-kennzahl-titel { font-size: 0.8rem; font-weight: 600; margin-right: 4px; }
.lp-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.lp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.lp-toolbar .filter-bar { margin-bottom: 0; justify-content: flex-start; }
/* Filter aus «auffällige Versuche» (IP oder fremde E-Mail) - seit der
   Mitglied-Suche (24.11.2026) als entfernbarer Hinweis statt Freitextfeld */
.lp-suchchip { display: inline-flex; align-items: center; gap: 8px; margin: -4px 0 12px; padding: 5px 6px 5px 12px; border-radius: 999px; border: 1.5px solid var(--red); background: #fdeaea; font-size: 0.82rem; font-weight: 600; }
.lp-suchchip[hidden] { display: none; }
.lp-suchchip button { border: 0; background: none; font-size: 1rem; line-height: 1; cursor: pointer; color: var(--anthracite); padding: 0 6px; }
.lp-email { font-size: 0.82rem; word-break: break-all; }
.lp-ip { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.lp-mail { margin-top: 4px; font-size: 0.74rem; color: var(--text-muted); }
.lp-fuss { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }

/* Mailprotokoll: Hochrechnung bis Periodenende (24.11.2026, Variante A) */
.mp-hr { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eeecea; display: flex; flex-direction: column; gap: 8px; }
.mp-hr-kopf { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.mp-hr-kopf strong { font-family: var(--font-heavy); font-size: 0.9rem; }
.mp-hr-basis { margin: 0; justify-content: flex-start; gap: 6px; }
.mp-hr-ergebnis { margin-left: auto; font-size: 0.84rem; font-weight: 700; }
.mp-hr-knopf { flex: none; }
.mp-hr-kopf strong + .mp-hr-knopf { margin-left: auto; } /* ausgeblendet bzw. ohne Ergebnis: Knopf rechts */
.mp-hr-zu { gap: 0; }
.mp-hr-svg { display: block; width: 100%; height: auto; max-height: 280px; }
.mp-hr-gitter { stroke: #eeecea; stroke-width: 1; }
.mp-hr-achse { font-size: 11px; fill: var(--text-muted); }
.mp-hr-limit { stroke: var(--red); stroke-width: 2; }
.mp-hr-limit-text { font-size: 11px; font-weight: 700; fill: #b30000; }
.mp-hr-warn { stroke: #e8762b; stroke-width: 1.5; stroke-dasharray: 2 4; }
.mp-hr-warn-text { font-size: 11px; fill: #b45309; }
.mp-hr-flaeche { fill: #2f9e52; fill-opacity: 0.1; }
.mp-hr-ist { fill: none; stroke: #2f9e52; stroke-width: 3; stroke-linejoin: round; }
.mp-hr-ist-punkt { fill: #2f9e52; }
.mp-hr-prognose { fill: none; stroke: var(--anthracite); stroke-width: 2.5; stroke-dasharray: 7 6; }
.mp-hr-prognose-punkt { fill: var(--anthracite); }
.mp-hr-wert { font-size: 12px; font-weight: 700; fill: var(--anthracite); }
.mp-hr-heute { stroke: var(--anthracite); stroke-width: 1; stroke-dasharray: 3 3; }
.mp-hr-limit-punkt { fill: #fff; stroke: var(--red); stroke-width: 2.5; }
.mp-hr-legende { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.76rem; color: var(--text-muted); }
.mp-hr-legende span { display: inline-flex; align-items: center; gap: 6px; }
.mp-hr-legende i { display: inline-block; width: 18px; }
.mp-hr-leg-ist { height: 3px; background: #2f9e52; border-radius: 2px; }
.mp-hr-leg-prognose { height: 0; border-top: 2.5px dashed var(--anthracite); }
.mp-hr-leg-limit { height: 2px; background: var(--red); }
@media (max-width: 700px) { .mp-hr-ergebnis { margin-left: 0; width: 100%; order: 3; } }

/* Bestellungen: Hinweis auf automatisch aufgeteilte Bestellung (25.11.2026) */
.order-teil-hinweis { display: block; margin-top: 3px; font-size: 0.72rem; font-weight: 600; color: #1b4f9c; white-space: nowrap; }

/* Teillieferung (29.11.2026): Schild und Knopf in der Bestellliste, Fenster «Eingetroffenes abtrennen» */
.order-teilweise-chip { display: block; width: fit-content; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: #fff0d0; color: #7a5200; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.order-abtrennen-btn { display: block; margin-top: 4px; white-space: nowrap; }
.abtrennen-kasten { margin-top: 10px; }
.abtrennen-kasten ul { margin: 6px 0 0; padding-left: 18px; font-size: 0.88rem; }
.abtrennen-knoepfe { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
/* «Eingetroffen» links grün (Wunsch Stefan, 29.11.2026), «Fehlt noch» bleibt rot */
#orderAbtrennenModal .abtrennen-kasten-da { border-left-color: #1f9d4c; }
/* Vorbestellte Position, für die wieder genug Bestand da ist (29.11.2026) */
.order-item-anlager-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #dff3e4; color: #17662e; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }

/* Knöpfe der Bestellliste farblich hervorgehoben und auf einer Linie
   (Wunsch Stefan, 29.11.2026): «Eingetroffen» grün, «Eingetroffenes
   abtrennen» gelb (wie das Schild «teilweise eingetroffen»). In Zeilen mit
   beiden Knöpfen stehen die zwei Zellen unten bündig; beide Knöpfe sind dort
   das letzte Element ihrer Zelle und gleich hoch. */
#ordersTable .order-eingetroffen-btn { background: #1f9d4c; border-color: #1f9d4c; color: #fff; }
#ordersTable .order-eingetroffen-btn:hover { background: #17803d; border-color: #17803d; }
#ordersTable .order-eingetroffen-btn:disabled { opacity: 0.6; }
#ordersTable .order-abtrennen-btn { background: #f5c400; border-color: #d9a400; color: #3d2f00; }
#ordersTable .order-abtrennen-btn:hover { background: #e0b300; border-color: #b88a00; }
#ordersTable .order-items-cell .order-eingetroffen-btn { display: block; margin: 4px 0 0; }
#ordersTable .order-abtrennen-btn { margin: 4px 0 0; }
/* Schild und Knopf stehen seit 29.11.2026 in der Spalte «Mitglied» */
#ordersTable tr.order-row-teilweise td.order-mitglied-cell,
#ordersTable tr.order-row-teilweise td.order-items-cell { vertical-align: bottom; }

/* Bemerkung zur Bestellung als blauer Info-Knopf (29.11.2026) statt eigener Spalte */
.order-bemerkung-btn { width: 20px; height: 20px; border-radius: 50%; border: 0; background: #1b6fc9; color: #fff; font: italic 700 0.8rem/20px Georgia, serif; padding: 0; cursor: pointer; vertical-align: middle; margin-left: 4px; }
.order-bemerkung-btn.active { background: #12508f; box-shadow: 0 0 0 3px rgba(27, 111, 201, 0.25); }
.order-bemerkung-text { display: block; margin-top: 4px; padding: 5px 9px; background: #eaf3fc; border: 1.5px solid #1b6fc9; border-radius: 8px; font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 260px; }
.order-bemerkung-text[hidden] { display: none; }

/* Spalte «Artikel»: je Artikel eine eigene Zeile (29.11.2026) */
#ordersTable .order-item-zeile { display: block; }
#ordersTable .order-item-zeile + .order-item-zeile { margin-top: 3px; }

/* Status als Schild mit gezielten Knöpfen (29.11.2026) statt Auswahl-Liste */
.order-status-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; background: #ececec; color: #444; }
.order-status-chip.order-status-offen { background: #fff0d0; color: #7a5200; }
.order-status-chip.order-status-bezahlt { background: #dbe9fb; color: #17498f; }
.order-status-chip.order-status-abgeholt { background: #dff3e4; color: #17662e; }
.order-status-chip.order-status-storniert { background: #f6dede; color: #8f1d1d; }
.order-status-knoepfe { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 5px; }
.order-status-knoepfe .table-action-btn { margin: 0; white-space: nowrap; padding: 4px 9px; font-size: 0.74rem; }
#orderStatusModal .abtrennen-knoepfe[hidden] { display: none; }

/* Schmale Zeit-Spalten (29.11.2026): Datum und Uhrzeit untereinander */
#ordersTable .order-zeit-cell { width: 1%; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
#ordersTable th.order-zeit-cell { white-space: normal; }
#ordersTable .order-zeit-datum { display: block; line-height: 1.25; }
#ordersTable .order-zeit-uhr { display: inline-block; line-height: 1.25; } /* der Korrektur-Stift steht daneben */
#ordersTable .order-zeit-uhr { color: var(--text-muted); font-size: 0.8rem; }
/* Testbestellungen löschen (nur Admin): «×» je Zeile nur im Löschmodus */
.orders-loeschen-btn { margin: 0 0 0 auto; align-self: center; }
.orders-loeschen-btn.is-aktiv { background: var(--red); color: var(--white); }
#ordersTable .order-loeschen-cell { display: none; width: 1%; padding-left: 4px; padding-right: 8px; }
#ordersTable.loeschmodus .order-loeschen-cell { display: table-cell; }
.order-loeschen-x { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--red); background: var(--white); color: var(--red); font-size: 1.05rem; font-weight: 700; line-height: 1; padding: 0; cursor: pointer; }
.order-loeschen-x:hover { background: var(--red); color: var(--white); }
#orderLoeschenModal [hidden] { display: none; }
.orders-loeschen-btn[hidden], #ordersLoeschenHinweis[hidden] { display: none; }
/* Spalte «Nr.» zentriert (29.11.2026, Wunsch Stefan) */
#ordersTable th.order-nr-cell, #ordersTable td.order-nr-cell { text-align: center; }

/* ==========================================================================
   Mailprotokoll: Zeitraum Periode / Jahr / Total und Zähler «Mails nach Art»
   (29.11.2026, Wunsch Stefan). Der Zeitraum nutzt die Knöpfe der Finanzen
   (.zeitraum-wahl in stammdaten.css).
   ========================================================================== */
.mp-zeitraum { margin-bottom: 14px; }
.mp-zeitraum .mp-monat select { padding: 6px 10px; font-size: 0.85rem; }
.mp-summe { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0 2px; }
.mp-summe-wert { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--text-muted); }
.mp-summe-wert strong { font-family: var(--font-heavy); font-size: 1.3rem; color: var(--black, #111); }
.mp-arten[hidden] { display: none; }
.mp-arten-tabelle { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.mp-arten-tabelle th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 4px 10px 6px 0; border-bottom: 1.5px solid var(--grey-line); white-space: nowrap; }
.mp-arten-tabelle td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--grey-line); vertical-align: middle; }
.mp-arten-tabelle th:last-child, .mp-arten-tabelle td:last-child { padding-right: 0; }
.mp-arten-tabelle .mp-arten-zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mp-arten-tabelle td.mp-arten-zahl strong { font-family: var(--font-heavy); }
.mp-arten-balken-zelle { width: 34%; min-width: 90px; }
.mp-arten-balken { height: 10px; border-radius: 999px; background: var(--off-white); overflow: hidden; }
.mp-arten-balken span { display: block; height: 100%; border-radius: 999px; background: #1b4f9c; }
.mp-arten-null td { color: var(--text-muted); }
.mp-arten-start td { color: var(--text-muted); font-style: italic; }
.mp-arten-total td { border-bottom: none; border-top: 2px solid var(--grey-line); font-weight: 700; }
.mp-arten-fehl { font-size: 0.72rem; color: #b30000; white-space: nowrap; }
@media (max-width: 700px) {
  .mp-arten-balken-zelle { display: none; }
}

/* Mailprotokoll: Ansicht Total / Shop / Abstimmungstool im Titel von «Mails
   nach Art» (mit Anzahl Mails) und Kasten ausblendbar wie die Hochrechnung
   (29./30.11.2026, Wunsch Stefan) */
.mp-arten .mp-zaehler-kopf { justify-content: flex-start; align-items: center; gap: 8px 22px; }
.mp-arten .mp-zaehler-kopf .mp-hr-knopf { margin-left: auto; }
.mp-arten-zu .mp-zaehler-kopf { margin-bottom: 0; }
.mp-ansicht.filter-bar { margin: 0; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
.mp-ansicht .filter-btn { display: inline-flex; align-items: center; gap: 7px; }
.mp-ansicht-zahl { font-variant-numeric: tabular-nums; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--off-white); color: var(--text-muted); font-size: 0.74rem; }
.mp-ansicht .filter-btn.active .mp-ansicht-zahl { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* Hochrechnung: Schwelle der automatischen Mailsperre (30.11.2026, Wunsch Stefan) */
.mp-hr-auto { stroke: #7c3aed; stroke-width: 1.8; stroke-dasharray: 7 4; }
.mp-hr-auto-text { font-size: 11px; font-weight: 700; fill: #6d28d9; }
.mp-hr-leg-auto { height: 0; border-top: 2px dashed #7c3aed; }
