/* ============================================================
   style.css — Vereinsverwaltung
   ------------------------------------------------------------
   Zentrale Design-Datei. Alle Farben, Abstaende und Formen der
   Anwendung sind hier gebuendelt. Fuer optische Anpassungen
   (Farben, Hintergrundbild, Rundungen, Schriften) genuegt es,
   diese Datei zu bearbeiten -- kein Eingriff in index.php noetig.

   GLIEDERUNG:
   1. CSS-Variablen (Design-Tokens)      -- zentrale Farbpalette
   2. Basis / Reset
   3. Layout (Sidebar, Hauptbereich, mobiler Header)
   4. Typografie (Ueberschriften, Text)
   5. Formulare (Input, Select, Textarea, Label)
   6. Buttons
   7. Badges (Status-Chips)
   8. Karten / Boxen (card-*)
   9. Tabellen
   10. Modal (Dialogfenster)
   11. Login-Seite
   12. Dashboard-Kacheln
   13. Aufgaben / Projekte
   14. Beitragsuebersicht (Halbjahres-Tabelle)
   15. Responsive Anpassungen
   ============================================================ */


/* ============================================================
   1. CSS-VARIABLEN (Design-Tokens)
   ------------------------------------------------------------
   Zentrale Stellschrauben. Farbe aendern = hier eine Zeile
   anpassen, wirkt ueberall in der Anwendung.
   ============================================================ */
:root {
  /* Primaerfarben (Vereinsfarbe / Marke) */
  --color-primary:        #1B3A6B;
  --color-primary-light:  #2d5f9e;
  --color-primary-dark:   #142c52;
  --color-accent:         #4A90D9;

  /* Statusfarben */
  --color-success:        #059669;
  --color-success-bg:     #d1fae5;
  --color-success-text:   #065f46;

  --color-danger:         #dc2626;
  --color-danger-bg:      #fee2e2;
  --color-danger-text:    #991b1b;

  --color-warning:        #d97706;
  --color-warning-bg:     #fef3c7;
  --color-warning-text:   #92400e;

  --color-info-bg:        #dbeafe;
  --color-info-text:      #1e40af;

  --color-neutral-bg:     #f3f4f6;
  --color-neutral-text:   #374151;

  --color-purple-bg:      #ede9fe;
  --color-purple-text:    #5b21b6;

  /* Flaechen / Hintergruende */
  --bg-page:              #f1f5f9;
  --bg-surface:           #ffffff;
  --bg-surface-alt:       #f8fafc;
  --bg-surface-hover:     #f9fafb;

  /* Text */
  --text-primary:         #111827;
  --text-secondary:       #374151;
  --text-muted:           #6b7280;
  --text-faint:           #9ca3af;

  /* Rahmen */
  --border-color:         #e5e7eb;
  --border-color-strong:  #d1d5db;
  --border-radius-sm:     6px;
  --border-radius-md:     8px;
  --border-radius-lg:     12px;
  --border-radius-xl:     16px;

  /* Schatten */
  --shadow-sm:            0 1px 4px rgba(0,0,0,.05);
  --shadow-md:            0 2px 8px rgba(0,0,0,.15);
  --shadow-lg:            4px 0 20px rgba(0,0,0,.15);
  --shadow-modal:         0 20px 60px rgba(0,0,0,.3);
  --shadow-login:         0 25px 60px rgba(0,0,0,.3);

  /* Schrift */
  --font-family:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout-Masse */
  --sidebar-width:        220px;
  --mobile-header-height: 56px;

  /* Login-Hintergrund (kann durch Bild ersetzt werden, siehe
     Abschnitt 11 weiter unten fuer ein Beispiel) */
  --login-gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 50%, var(--color-primary) 100%);
}


/* ============================================================
   2. BASIS / RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-family);
  background: var(--bg-page);
  color: var(--text-primary);
  overflow-x: hidden;
}

input, select, textarea, button { font-family: inherit; }

img, svg { max-width: 100%; height: auto; }

table { border-collapse: collapse; }

a { color: inherit; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; display: inline-block; }
.icon-wrap { display: inline-flex; align-items: center; line-height: 1; }


/* ============================================================
   3. LAYOUT
   ============================================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* -- Sidebar -------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 110;
  box-shadow: var(--shadow-lg);
  transition: transform .25s ease;
}
.sidebar--mobile-closed { transform: translateX(-100%); }
.sidebar--mobile-open   { transform: translateX(0); }

.sidebar__header {
  padding: 1.5rem 1.25rem 1rem;
  /* Sicherheitsabstand zur Statusleiste/Dynamic Island, sofern die
     Sidebar (z.B. nach Antippen des Hamburger-Menues auf dem
     Smartphone) bis ganz an den oberen Bildschirmrand reicht --
     siehe ausfuehrliche Erklaerung bei .mobile-header. Auf dem
     Desktop bzw. ausserhalb einer installierten PWA liefert
     env(safe-area-inset-top) 0px und hat daher keine Auswirkung. */
  padding-top: calc(1.5rem + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid rgba(255,255,255,.1);
}
/* WICHTIG: Der mobile Kopfbereich (.mobile-header, mit "Vereins-
   verwaltung" und Hamburger-Menue) liegt bewusst mit hoeherem
   z-index UEBER der Sidebar, damit er beim Aufklappen/Schliessen des
   Menues stets bedienbar bleibt. Dadurch wuerde er aber sonst genau
   das Logo im Sidebar-Kopfbereich verdecken -- dieser zusaetzliche
   Abstand schiebt den Sidebar-Kopfbereich auf mobilen Geraeten um
   die Hoehe des mobilen Headers nach unten, damit das Logo
   vollstaendig sichtbar bleibt. */
.sidebar__header--mobile {
  padding-top: calc(1.5rem + env(safe-area-inset-top, 0px) + var(--mobile-header-height));
}
.sidebar__logo   { font-size: 28px; margin-bottom: 4px; }
.sidebar__title  { font-weight: 800; font-size: 15px; line-height: 1.3; }

.sidebar__nav { flex: 1; padding: 1rem .75rem; overflow-y: auto; }

.sidebar__nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  margin-bottom: 4px;
  background: transparent;
  color: rgba(255,255,255,.7);
  font-weight: 400;
  font-size: 14px;
  text-align: left;
}
.sidebar__nav-item--active {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-weight: 700;
}

.sidebar__footer {
  padding: 1rem .75rem;
  /* Sicherheitsabstand zur "Home-Indicator"-Leiste am unteren
     Bildschirmrand neuerer iPhones. */
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar__user-block {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  margin-bottom: 8px;
  padding-left: 4px;
}
.sidebar__user-name { font-weight: 600; color: rgba(255,255,255,.9); font-size: 13px; margin-bottom: 2px; }

.sidebar__logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.7);
  font-size: 13px;
}

/* -- Mobiler Kopfbereich (Hamburger-Menue) -------------------- */
.mobile-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  /* WICHTIG: "apple-mobile-web-app-status-bar-style: black-translucent"
     (siehe index.php) sorgt bewusst fuer eine transparente, ueber
     dem Seiteninhalt liegende Statusleiste (Uhrzeit/Akku) -- fuer
     eine wirklich native App-Optik. OHNE diesen Sicherheitsabstand
     wuerde der Hamburger-Button dadurch aber genau HINTER der
     Statusleiste/Dynamic Island landen und waere nicht mehr
     antippbar (das gemeldete Problem). env(safe-area-inset-top)
     liefert die tatsaechliche, geraetespezifische Hoehe dieses
     Bereichs (variiert je nach iPhone-Modell) und wird als
     zusaetzliche Innenabstand oben sowie Gesamthoehe ergaenzt. */
  height: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: border-box;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  padding-left: 12px;
  padding-right: 12px;
  z-index: 120;
  box-shadow: var(--shadow-md);
}
.mobile-header__burger {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-shrink: 0;
}
.mobile-header__title { color: #fff; font-weight: 800; font-size: 15px; margin-left: 8px; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 105;
}

/* -- Hauptbereich ---------------------------------------------- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  min-width: 0;
  padding: 2rem;
  box-sizing: border-box;
  /* WICHTIG: bewusst "hidden" statt "auto" -- horizontales Scrollen
     soll AUSSCHLIESSLICH innerhalb einzelner breiter Tabellen
     (.table-scroll) moeglich sein, niemals fuer die gesamte Seite.
     Mit "auto" wuerde jedes zu breite Kind-Element (z.B. eine noch
     nicht in .table-scroll gekapselte Tabelle) die komplette Seite
     seitlich verschiebbar machen -- das fuehlt sich auf dem Smartphone
     nicht wie eine native App an. */
  overflow-x: hidden;
}
.main-content--mobile {
  margin-left: 0;
  /* Muss exakt der tatsaechlichen (durch den Sicherheitsabstand
     vergroesserten) Hoehe von .mobile-header entsprechen, sonst
     entsteht entweder eine Luecke oder eine Ueberlappung. */
  margin-top: calc(var(--mobile-header-height) + env(safe-area-inset-top, 0px));
  padding: 1rem;
}

.page-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  flex-direction: column;
  gap: 16px;
}
.page-loading__icon { font-size: 48px; }
.page-loading__text { font-size: 16px; color: var(--color-primary); font-weight: 600; }


/* ============================================================
   4. TYPOGRAFIE
   ============================================================ */
.page-title {
  margin: 0 0 1.5rem;
  font-size: 22px;
  font-weight: 800;
  color: var(--color-primary);
}
.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}
.card-title {
  margin: 0 0 1rem;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
}
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-small { font-size: 13px; }
.text-xs    { font-size: 12px; }
.text-strong { font-weight: 600; }


/* ============================================================
   5. FORMULARE
   ------------------------------------------------------------
   Alle Input-/Select-/Textarea-Rahmenfarben zentral hier.
   Aenderung von --border-color-strong wirkt auf JEDES Formular-
   feld der gesamten Anwendung.
   ============================================================ */
.form-field {
  margin-bottom: 1rem;
  /* WICHTIG: Grid-/Flex-Elemente haben standardmaessig "min-width:
     auto", wodurch sie NIEMALS kleiner werden als der eigene Inhalt
     -- bei einem <input type="date"> kann diese native Mindestbreite
     (besonders ausgepraegt in iOS Safari) breiter sein als die
     verfuegbare Spaltenbreite auf kleinen Bildschirmen, wodurch das
     Feld ueber den sichtbaren Bereich hinausragt, obwohl "width:100%"
     gesetzt ist. "min-width: 0" hebt diese Grenze auf und erlaubt
     dem Feld, wirklich auf die verfuegbare Breite zu schrumpfen. */
  min-width: 0;
}

.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-label__required { color: var(--color-danger); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border: 1.5px solid var(--border-color-strong);
  border-radius: var(--border-radius-md);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  background: var(--bg-surface);
  color: var(--text-primary);
  /* Einheitliche Zeilenhoehe/Mindesthoehe browserübergreifend --
     ohne diese expliziten Werte rendert Safari native <select>-
     Elemente spuerbar niedriger als <input>-Felder, waehrend
     Firefox/Chrome bereits von sich aus einheitlich hoch sind. */
  min-height: 40px;
  line-height: 1.4;
  font-family: inherit;
}
/* Native Browser-Erscheinung von <select> vollstaendig zuruecksetzen
   und durch ein einheitliches, selbst gestaltetes Aussehen (inkl.
   eigenem Pfeil-Symbol) ersetzen -- das ist der zuverlaessigste Weg,
   damit Dropdown-Felder in Chrome, Firefox UND Safari exakt gleich
   hoch und gleich gestaltet erscheinen, statt sich auf die
   unterschiedliche native Handhabung jedes Browsers zu verlassen. */
.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='M5 7l5 5 5-5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-accent);
}
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background-color: var(--bg-surface-hover);
  color: var(--text-muted);
}
.form-textarea { resize: vertical; font-family: inherit; min-height: 80px; }

.form-input--search { padding-left: 34px; }

/* ── Datumsfelder: Wrapper-Loesung gegen Ueberbreite ──────────────────
   Native <input type="date">-Elemente koennen ihre interne Anzeige
   (Tag/Monat/Jahr-Segmente) auf manchen mobilen Browsern (u.a. iOS
   Safari, teils auch Firefox) BREITER darstellen, als es die eigene
   CSS-Box erlaubt -- das geschieht auf Ebene der reinen Bildschirm-
   darstellung des nativen Steuerelements und liess sich durch
   width/max-width/min-width auf dem Feld selbst (auch mit "!important")
   nachweislich NICHT zuverlaessig verhindern.
   Die robuste Loesung: Das native Feld liegt in einem WRAPPER-Element
   mit "overflow: hidden" -- alles, was ueber die verfuegbare Breite
   hinausgeht, wird dadurch schlicht abgeschnitten, statt die Seite
   zu verbreitern. Die sichtbare Gestaltung (Rahmen, abgerundete Ecken,
   Hintergrund, Mindesthoehe) liegt auf dem WRAPPER; das native Feld
   selbst ist unsichtbar gerahmt und liegt randlos direkt darin. */
.date-input-wrap {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1.5px solid var(--border-color-strong);
  border-radius: var(--border-radius-md);
  background: var(--bg-surface);
  min-height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  /* Positionierungskontext fuer den eigenen Platzhalter-Overlay
     (siehe .date-input-wrap__placeholder weiter unten). */
  position: relative;
}
.date-input-wrap:focus-within {
  border-color: var(--color-accent);
}
.date-input-wrap--disabled {
  background-color: var(--bg-surface-hover);
}
.date-input-wrap__field {
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  /* Bewusst breiter als der Wrapper erlaubt -- der Wrapper schneidet
     den ueberstehenden Teil zuverlaessig ab (siehe Erklaerung oben).
     100% allein wuerde bei diesem Feldtyp nicht ausreichen. */
  width: 100%;
  /* Liegt bewusst UEBER dem Platzhalter-Overlay (siehe z-index dort),
     damit Klicks/Antippen weiterhin zuverlaessig den nativen
     Datepicker oeffnen. */
  position: relative;
  z-index: 1;
}
.date-input-wrap--disabled .date-input-wrap__field { color: var(--text-muted); }

/* ── Browserunabhaengiger Ersatz-Platzhalter fuer leere Datumsfelder ──
   Manche Browser bzw. Sitzungen fuellen ein LEERES, NICHT fokussiertes
   Datumsfeld optisch mit dem heutigen Tagesdatum vor, statt es leer
   bzw. mit dem Platzhalter-Format "tt.mm.jjjj" darzustellen -- dieses
   Verhalten ist browser-/sitzungsabhaengig und liess sich nicht
   zuverlaessig ueber einen browserspezifischen CSS-Trick fuer alle
   Faelle beheben.
   Die native Textanzeige wird daher nur unsichtbar gemacht, wenn das
   Feld GLEICHZEITIG (a) laut React-State keinen eigenen Wert hat UND
   (b) gerade NICHT fokussiert ist -- ":not(:focus)" ist entscheidend:
   waehrend der aktiven Eingabe (Tag/Monat/Jahr werden gerade getippt)
   bleibt die native Anzeige normal sichtbar, da ein <input type="date">
   den React-"value" erst bei einem VOLLSTAENDIGEN, gueltigen Datum
   aktualisiert -- ohne diese Ausnahme waere waehrend des Tippens
   nichts zu sehen gewesen (genau das gemeldete Problem). Der eigene
   Platzhalter-Overlay wird aus demselben Grund waehrend des Fokus
   ebenfalls ausgeblendet, damit er sich nicht mit der nativen Eingabe
   ueberlagert. */
.date-input-wrap__field:not(.has-value):not(:focus) {
  color: transparent;
}
.date-input-wrap:focus-within .date-input-wrap__placeholder {
  display: none;
}
.date-input-wrap__placeholder {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 14px;
  pointer-events: none;
  z-index: 0;
}

.form-field--relative { position: relative; }
.form-field__toggle-btn {
  position: absolute;
  right: 10px;
  top: 30px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

.form-checkbox { accent-color: var(--color-primary); width: 16px; height: 16px; }

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 1.5rem;
}
.form-grid-full { grid-column: 1 / -1; }

/* Drei gleich breite Spalten (z.B. Eskalationsstufen 1-3), die auf
   kleinen Bildschirmen responsiv untereinander stapeln (siehe
   konsolidierte mobile Regel weiter unten in Abschnitt 16). */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 1.5rem;
}

.search-field { position: relative; flex: 1; min-width: 200px; }
.search-field__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
}


/* ============================================================
   6. BUTTONS
   ------------------------------------------------------------
   Alle Buttons der Anwendung laufen ueber diese Klassen.
   Farbvarianten: btn--primary, btn--secondary, btn--danger,
   btn--success. Groesse: btn--small als Zusatzklasse.
   ============================================================ */
.btn {
  padding: 8px 18px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  transition: opacity .15s, background-color .15s;
  white-space: nowrap;
  /* Ermoeglicht die Verwendung dieser Klasse auch auf <a>-Elementen
     (z.B. Download-Links), ohne dass eine Unterstreichung erscheint. */
  text-decoration: none;
}
.btn:disabled { cursor: not-allowed; opacity: .6; }

.btn--primary   { background: var(--color-primary); color: #fff; }
.btn--secondary { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-primary); }
.btn--danger    { background: var(--color-danger); color: #fff; }
.btn--success   { background: var(--color-success); color: #fff; }

.btn--small { padding: 5px 12px; font-size: 13px; }

/* Icon-only Buttons (z.B. Bearbeiten/Loeschen in Tabellenzeilen) */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  flex-shrink: 0;
}
.icon-btn--primary { color: var(--color-primary); }
.icon-btn--danger  { color: var(--color-danger); }
.icon-btn--muted   { color: var(--text-muted); }
.icon-btn--success { color: var(--color-success); }

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
}
.link-btn--primary { color: var(--color-primary); font-weight: 600; }
.link-btn--muted   { color: var(--text-muted); font-size: 13px; }


/* ============================================================
   7. BADGES (Status-Chips)
   ------------------------------------------------------------
   Einheitliche "Pille"-Optik fuer Status wie Aktiv/Inaktiv,
   Beitragsstand, Aufgabenstatus usw.
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge--green  { background: var(--color-success-bg); color: var(--color-success-text); }
.badge--red    { background: var(--color-danger-bg);  color: var(--color-danger-text); }
.badge--amber  { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge--blue   { background: var(--color-info-bg);    color: var(--color-info-text); }
.badge--gray   { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.badge--purple { background: var(--color-purple-bg);  color: var(--color-purple-text); }


/* ============================================================
   8. KARTEN / BOXEN
   ------------------------------------------------------------
   Weisse Container-Flaechen (Formulare im Adminbereich,
   Dashboard-Hinweisboxen usw.)
   ============================================================ */
.card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
}
.card--no-padding { padding: 0; overflow: hidden; }

.card-max-sm { max-width: 420px; }
.card-max-md { max-width: 480px; }
.card-max-lg { max-width: 560px; }

.notice-box {
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
}
.notice-box--warning { background: var(--color-warning-bg); border: 1px solid #fcd34d; color: var(--color-warning-text); }
.notice-box--danger  { background: var(--color-danger-bg);  border: 1px solid #fca5a5; color: var(--color-danger-text); }
.notice-box--success { background: var(--color-success-bg); color: var(--color-success-text); }
.notice-box--empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  background: var(--bg-surface-alt);
  border-radius: var(--border-radius-lg);
  border: 1px dashed var(--border-color-strong);
}

.alert-banner {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.alert-banner--error   { background: var(--color-danger-bg);  color: var(--color-danger-text); }
.alert-banner--success { background: var(--color-success-bg); color: var(--color-success-text); }


/* ============================================================
   9. TABELLEN
   ------------------------------------------------------------
   Einheitliches Erscheinungsbild fuer alle Datentabellen
   (Mitglieder, Beitraege, Benutzerverwaltung).
   ============================================================ */
.table-wrap {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.table-scroll { overflow-x: auto; max-width: 100%; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table thead tr { background: var(--bg-surface-alt); border-bottom: 2px solid var(--border-color); }
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}
.data-table td { padding: 10px 14px; }
.data-table tbody tr { border-bottom: 1px solid var(--border-color); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table .tr--inactive { background: var(--bg-surface-hover); }

.data-table__empty-row td { padding: 32px; text-align: center; color: var(--text-faint); }

.data-table--sticky-col th:first-child,
.data-table--sticky-col td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  /* Expliziter (nicht vererbter) Hintergrund, damit beim horizontalen
     Scrollen breiter Tabellen kein durchscheinender Inhalt hinter der
     fixierten Spalte sichtbar wird -- betrifft normale Zeilen, den
     Tabellenkopf sowie inaktive Zeilen gleichermassen. */
  background: var(--bg-surface);
  box-shadow: 2px 0 4px -2px rgba(0,0,0,.12);
  /* WICHTIG: Garantierte Mindestbreite und kein Zeilenumbruch fuer
     die Aktions-Icons. Ohne dies kann die Breitenberechnung dieser
     Spalte bei manchen Browsern zu klein ausfallen (insbesondere
     wenn -- wie bei Mitgliedern -- mehrere Icons in einem Flex-
     Container nebeneinander stehen statt nur ein einzelnes Icon wie
     bei der Benutzerverwaltung), wodurch die Icons auf kleinen
     Bildschirmen verschwinden bzw. abgeschnitten werden koennen. */
  min-width: 96px;
  white-space: nowrap;
}
.data-table--sticky-col thead th:first-child {
  background: var(--bg-surface-alt);
}
.data-table--sticky-col .tr--inactive td:first-child {
  background: var(--bg-surface-hover);
}
/* Die Icon-Reihe selbst darf niemals kleiner werden als fuer ihre
   Icons benoetigt -- verhindert ein Zusammenquetschen in schmalen
   Flex-Kontexten. */
.data-table--sticky-col td:first-child .flex-row {
  flex-shrink: 0;
}


/* ============================================================
   10. MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
}
.modal-box {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  width: min(600px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-modal);
  box-sizing: border-box;
}
.modal-box--wide { width: min(900px, 96vw); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 1.5rem);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
}
.modal-header__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--color-primary); }
.modal-header__close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; flex-shrink: 0; }

.modal-body { padding: clamp(1rem, 4vw, 1.5rem); }

/* Sammelbutton-Popups (ActionMenuPopup): Buttons sollen die volle
   Popup-Breite ausfuellen und ihren Text bei Bedarf umbrechen, statt
   ueber den schmalen Rahmen hinauszuragen (Buttons sind sonst per
   .btn { white-space: nowrap } immer so breit wie ihr Text). */
.action-menu-popup__body { display: flex; flex-direction: column; gap: 10px; }
.action-menu-popup__body .btn {
  width: 100%;
  white-space: normal;
  text-align: center;
  justify-content: center;
  line-height: 1.3;
}

/* ── Anhang-Viewer (Bilder/PDFs in einem schliessbaren Overlay,
   statt per Link zu navigieren) ──────────────────────────────────
   Hintergrund: In der als App installierten PWA (Home-Bildschirm)
   gibt es keine Browser-Navigation (kein "Zurueck"-Button) -- ein per
   target="_blank" geoeffneter Anhang liess sich bisher nur durch
   Beenden der App wieder verlassen. Dieses Overlay bleibt innerhalb
   der App und laesst sich per Kreuz/Klick daneben schliessen. */
.modal-box--viewer {
  width: min(1000px, 96vw);
  height: min(900px, 92vh);
  display: flex;
  flex-direction: column;
}
.modal-box--viewer .modal-body {
  flex: 1;
  display: flex;
  padding: 0;
  overflow: hidden;
  background: #111827;
}
.attachment-viewer-frame { width: 100%; height: 100%; border: none; }
.attachment-viewer-image { max-width: 100%; max-height: 100%; margin: auto; display: block; object-fit: contain; }
.attachment-viewer-fallback { margin: auto; padding: 2rem; text-align: center; color: #e5e7eb; }
.attachment-viewer-fallback a { color: #93c5fd; }


/* ============================================================
   11. LOGIN-SEITE
   ------------------------------------------------------------
   Um ein Hintergrundbild statt des Farbverlaufs zu nutzen,
   die Zeile bei .login-page background aendern, z.B.:
     background: url('assets/vereinsheim.jpg') center/cover no-repeat;
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: var(--login-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.login-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-xl);
  padding: 2rem clamp(1.25rem, 5vw, 2.5rem);
  width: min(420px, 95vw);
  box-shadow: var(--shadow-login);
  box-sizing: border-box;
}
.login-card__header { text-align: center; margin-bottom: 2rem; }
.login-card__logo   { font-size: 48px; margin-bottom: 8px; }
.login-card__logo-img { max-width: 96px; max-height: 96px; margin: 0 auto 8px; display: block; object-fit: contain; }
.login-card__heading { margin: 0 0 4px; font-size: 24px; font-weight: 800; color: var(--color-primary); }
.login-card__subtitle { margin: 0; color: var(--text-muted); font-size: 14px; }
.login-card__footer {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ============================================================
   12. DASHBOARD-KACHELN
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.stat-card__value { font-size: 28px; font-weight: 800; }
.stat-card__label  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-card__sub { font-size: 12px; color: var(--text-faint); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-color); cursor: pointer; }
.stat-card__sub--danger { color: var(--color-danger-text); font-weight: 600; }
.stat-card__subrole { font-size: 11px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }

/* Gesamt-Kachel (z.B. "Mitglieder gesamt"): optisch von den
   einzelnen Sportgruppen-Kacheln abgesetzt durch farbigen Rahmen
   und dezenten Farbverlauf. */
.stat-card--total {
  border: 2px solid var(--color-primary);
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--color-primary-bg, #eef2ff) 100%);
}
.stat-card__value--total { color: var(--color-primary); font-size: 32px; }

/* Kachel "Zur Genehmigung": dezent lila umrandet, um sie farblich
   von den Dringlichkeits-Kacheln (rot/gelb/blau) abzusetzen. */
.stat-card--approval { border: 1px solid var(--color-purple-text); }

/* Farbvarianten der Kennzahl (ueber Modifier-Klasse, nicht Inline) */
.stat-card__value--primary { color: var(--color-primary); }
.stat-card__value--muted   { color: var(--text-muted); }
.stat-card__value--danger  { color: var(--color-danger); }
.stat-card__value--warning { color: var(--color-warning); }
.stat-card__value--purple  { color: var(--color-purple-text); }


/* ============================================================
   13. AUFGABEN / PROJEKTE
   ============================================================ */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.task-card__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.task-card__main { flex: 1; }
.task-card__title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-card__title { font-weight: 700; color: var(--color-primary); font-size: 15px; }
.task-card__desc { margin: 6px 0 8px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.task-card__meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.task-card__meta--escalation { color: var(--color-warning); }
.task-card__actions { display: flex; gap: 4px; flex-shrink: 0; }

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
}
.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  background: var(--bg-surface);
}
.project-card__header--expanded { background: #f0f4ff; }
.project-card__header-left { display: flex; align-items: center; gap: 10px; }
.project-card__title { font-weight: 700; font-size: 15px; }
.project-card__header-right { display: flex; gap: 6px; align-items: center; }
.project-card__body { padding: 0 16px 16px; border-top: 1px solid var(--border-color); }
.project-card__desc { margin: 12px 0 8px; font-size: 13px; color: var(--text-muted); }
.project-card__empty { color: var(--text-faint); font-size: 13px; margin: 12px 0 0; }

.participant-box {
  background: var(--bg-surface-alt);
  border-radius: var(--border-radius-md);
  padding: 12px;
  border: 1px solid var(--border-color);
}
.participant-box__title { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--text-secondary); }
.participant-box__item { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; padding: 2px 0; }


/* ============================================================
   14. BEITRAGSUEBERSICHT (Halbjahres-Tabelle)
   ============================================================ */
.fee-table th { position: sticky; top: 0; background: var(--bg-surface-alt); padding: 10px 12px; text-align: left; font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.fee-table.th--sticky-col { left: 0; z-index: 2; }
.fee-table.th--current { background: var(--color-info-bg); }
.fee-table.th--sum { background: var(--color-danger-bg); color: var(--color-danger-text); }
td.fee-table { padding: 8px 12px; white-space: nowrap; border-bottom: 1px solid var(--border-color); }
td.fee-table.td--sticky-col { position: sticky; left: 0; background: var(--bg-surface); font-weight: 600; }
td.fee-table.td--current { background: #f0f7ff; }

.fee-cell {
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--text-faint);
  font-weight: 400;
}
.fee-cell--has-value { color: var(--color-danger-text); font-weight: 600; }
.fee-cell--readonly { cursor: default; }

.fee-cell-edit { display: flex; gap: 6px; align-items: center; }
.fee-cell-edit__btn {
  padding: 6px;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 34px;
  min-height: 34px;
  box-sizing: border-box;
}
.fee-cell-edit__btn.icon-btn--success:hover { background: var(--color-success-bg); }
.fee-cell-edit__btn.icon-btn--danger:hover  { background: var(--color-danger-bg); }
/* Auf kleinen Bildschirmen (Tablet/Smartphone) sind Icons ohnehin
   schwerer treffsicher zu bedienen -- dort werden die Bestaetigungs-
   Icons daher noch etwas groesser dargestellt. */
@media (max-width: 640px) {
  .fee-cell-edit__btn { padding: 8px; }
}
.fee-cell-edit__input {
  width: 70px;
  flex-shrink: 0;
  padding: 3px 6px;
  border: 1.5px solid var(--color-primary);
  border-radius: 4px;
  font-size: 13px;
}

.total-open-badge {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  padding: 8px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 700;
  white-space: nowrap;
}


/* ============================================================
   15. HILFSKLASSEN (Layout / Flex)
   ============================================================ */
.flex-row            { display: flex; align-items: center; }
.flex-row--wrap       { flex-wrap: wrap; }
.flex-row--gap-sm     { gap: 6px; }
.flex-row--gap-md     { gap: 8px; }
.flex-row--gap-lg     { gap: 12px; }
.flex-row--space-between { justify-content: space-between; }
.flex-col             { display: flex; flex-direction: column; }
.flex-1               { flex: 1; }
.flex-shrink-0        { flex-shrink: 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-bar { display: flex; gap: 12px; margin-bottom: 1rem; flex-wrap: wrap; }

.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; }

.participant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.tab-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; border-bottom: 2px solid var(--border-color); }
.tab-bar__item {
  padding: 8px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2.5px solid transparent;
  font-size: 14px;
  margin-bottom: -2px;
}
.tab-bar__item--active { font-weight: 700; color: var(--color-primary); border-bottom-color: var(--color-primary); }

.legal-guardian-box {
  margin-top: 16px;
  padding: 16px;
  background: var(--color-purple-bg);
  border-radius: var(--border-radius-md);
  border: 1px solid #c4b5fd;
}
.legal-guardian-box__title { margin: 0 0 12px; color: var(--color-purple-text); }
.legal-guardian-box__subtitle { margin: 8px 0; color: var(--text-secondary); }
.address-with-copy { display: flex; align-items: flex-end; gap: 8px; }
.address-with-copy .btn { flex-shrink: 0; margin-bottom: 1rem; }

.select-inline {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 6px 28px 6px 8px;
  min-height: 32px;
  line-height: 1.3;
  border: 1px solid var(--border-color-strong);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-family: inherit;
  background-color: var(--bg-surface);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23667085' stroke-width='2'%3E%3Cpath d='M5 7l5 5 5-5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  box-sizing: border-box;
}

.group-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-hover);
  border-radius: var(--border-radius-md);
  margin-bottom: 6px;
  border: 1px solid var(--border-color);
}

.result-box {
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
}
.result-box--success { background: var(--color-success-bg); color: var(--color-success-text); }
.result-box--error    { background: var(--color-danger-bg);  color: var(--color-danger-text); }

.protocol-output {
  white-space: pre-wrap;
  font-size: 11px;
  background: rgba(0,0,0,.05);
  padding: 8px;
  border-radius: 6px;
  margin-top: 6px;
  max-height: 200px;
  overflow-y: auto;
}


/* ============================================================
   16b. AUFGABEN-DASHBOARD UND ANSICHTSSTEUERUNG
   ============================================================ */
.view-switcher { display: flex; gap: 6px; flex-wrap: wrap; background: var(--bg-surface-alt); padding: 4px; border-radius: var(--border-radius-md); border: 1px solid var(--border-color); }
.view-switcher__item {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.view-switcher__item--active { background: var(--color-primary); color: #fff; font-weight: 700; }

.cluster-group { margin-bottom: 1.5rem; }
.cluster-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface-alt);
  border-radius: var(--border-radius-md);
  margin-bottom: 10px;
  cursor: pointer;
  border: 1px solid var(--border-color);
}
.cluster-header__title { font-weight: 700; color: var(--text-secondary); font-size: 14px; flex: 1; }
.cluster-header--overdue { border-left: 4px solid var(--color-danger); }
.cluster-header--soon    { border-left: 4px solid var(--color-warning); }
.cluster-header--future  { border-left: 4px solid var(--color-info-text); }
.cluster-header--done    { border-left: 4px solid var(--color-success); }
.cluster-header--blue    { border-left: 4px solid var(--color-info-text); }
.cluster-header--amber   { border-left: 4px solid var(--color-warning); }
.cluster-header--purple  { border-left: 4px solid var(--color-purple-text); }
.cluster-header--red     { border-left: 4px solid var(--color-danger); }

.role-dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.role-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.role-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.role-card__count { font-size: 32px; font-weight: 800; color: var(--color-primary); }
.role-card__label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.upcoming-list { display: flex; flex-direction: column; gap: 8px; }
.upcoming-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  gap: 10px;
}
.upcoming-item__title { font-weight: 600; font-size: 14px; }
.upcoming-item__meta { font-size: 12px; color: var(--text-muted); }

.filter-panel { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--border-radius-lg); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.filter-panel__row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filter-chip {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--border-color-strong);
  background: var(--bg-surface);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
}
.filter-chip--active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 600; }

.project-badge-inline { font-size: 11px; background: var(--color-info-bg); color: var(--color-info-text); padding: 1px 8px; border-radius: 10px; margin-left: 6px; }

/* ============================================================
   16c. AENDERUNGSPROTOKOLL (AUDIT-LOG)
   ============================================================ */
.audit-entry {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  align-items: flex-start;
}
.audit-entry:last-child { border-bottom: none; }
.audit-entry__time { color: var(--text-faint); white-space: nowrap; min-width: 130px; font-size: 12px; }
.audit-entry__body { flex: 1; }
.audit-entry__headline { margin-bottom: 3px; }
.audit-entry__user { font-weight: 700; color: var(--color-primary); }
.audit-entry__diff { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.audit-entry__old { color: var(--color-danger-text); background: var(--color-danger-bg); text-decoration: line-through; padding: 1px 6px; border-radius: 4px; }
.audit-entry__new { color: var(--color-success-text); background: var(--color-success-bg); font-weight: 600; padding: 1px 6px; border-radius: 4px; }

/* ============================================================
   16d. DATEI-ANHAENGE
   ============================================================ */
.attachment-manager { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-color); }

/* ============================================================
   17. SPONSOREN
   ============================================================ */
.sponsor-documentation-box {
  white-space: pre-wrap;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  font-size: 13px;
  max-height: 220px;
  overflow-y: auto;
  line-height: 1.5;
}

/* ============================================================
   16e. DESIGN-EINSTELLUNGEN UND LOGO
   ============================================================ */
.design-color-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.design-color-row:last-of-type { border-bottom: none; }
.design-color-input { width: 44px; height: 32px; border: 1px solid var(--border-color-strong); border-radius: 6px; cursor: pointer; padding: 0; }
.design-asset-row { display: flex; gap: 32px; flex-wrap: wrap; }
.design-asset-preview { max-width: 160px; max-height: 80px; display: block; margin-top: 8px; border: 1px solid var(--border-color); border-radius: 6px; padding: 4px; background: #fff; }
.design-asset-preview--small { max-width: 48px; max-height: 48px; }
.sidebar__logo-img { max-width: 40px; max-height: 40px; border-radius: 6px; object-fit: contain; background: #fff; padding: 2px; }
.controller-actions { margin-top: 16px; padding: 16px; background: var(--bg-surface-alt); border-radius: var(--border-radius-lg); border: 1px solid var(--border-color); }
.attachment-manager__title { font-weight: 600; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.attachment-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-surface-alt);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}
.attachment-item__link { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; text-decoration: none; color: var(--text-secondary); }
.attachment-item__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   16. RESPONSIVE ANPASSUNGEN
   ------------------------------------------------------------
   Optimierungen fuer Tablet (<=640px) und Smartphone (<=480px),
   damit Boxen, Tabellen und Formulare auf kleinen Bildschirmen
   kompakter und besser bedienbar sind.
   ============================================================ */
@media (max-width: 640px) {
  body { font-size: 14px; }

  /* Karten/Boxen: weniger Innenabstand, damit auf schmalen
     Bildschirmen mehr Platz fuer den eigentlichen Inhalt bleibt. */
  .card { padding: 1rem; }
  .notice-box { padding: 1rem; }
  .notice-box--empty { padding: 1.75rem 1rem; }

  /* Tabellen: kompaktere Zellen und etwas kleinere Schrift, damit
     mehr Spalten in den sichtbaren Bereich passen, bevor horizontal
     gescrollt werden muss. */
  .data-table { font-size: 13px; }
  .data-table th,
  .data-table td { padding: 8px 10px; }

  /* Kachel-Raster (Dashboard, Berechtigungs-Boxen) bekommen einen
     etwas kleineren Abstand, wirkt auf kleinen Bildschirmen
     aufgeraeumter. */
  .stat-grid,
  .participant-grid { gap: 10px; }

  /* Reiterleiste (z.B. "Administration") darf auf schmalen
     Bildschirmen umbrechen, statt eine horizontale Scrollleiste
     zu erzwingen. */
  .tab-bar { flex-wrap: wrap; gap: 6px; }

  /* Modal-Kopf/-Inhalt kompakter */
  .modal-header { padding: 1rem 1rem 0.75rem; }

  /* Formularfelder-Raster: geringerer Abstand zwischen den Feldern
     UND garantiert einspaltig, unabhaengig von der minmax()-
     Mindestbreite der einzelnen Spalten -- das entzieht dem
     Zusammenspiel aus Grid-Spaltenbreite und der nativen Mindestbreite
     von Datumsfeldern jede Angriffsflaeche, da jedes Feld dann immer
     die GESAMTE verfuegbare Breite erhaelt, egal wie schmal der
     Bildschirm ist. */
  .form-grid-2,
  .form-grid-3 { grid-template-columns: 1fr; gap: 0 1rem; }

  /* WICHTIG: Eingabefelder mit Schriftgroesse unter 16px loesen auf
     iOS Safari beim Fokussieren haeufig ein automatisches Hinein-
     zoomen aus -- UNABHAENGIG vom "user-scalable=no" im Viewport-
     Meta-Tag. Auf mobilen Bildschirmen daher mindestens 16px, damit
     die Seite wirklich niemals von selbst zoomt (fuer eine
     App-aehnliche Haptik). */
  .form-input, .form-select, .form-textarea,
  .fee-cell-edit__input, .select-inline { font-size: 16px; }
}

@media (max-width: 480px) {
  /* Auf sehr kleinen Bildschirmen (Smartphones im Hochformat)
     zusaetzlich noch kompakter. */
  .main-content--mobile { padding: 0.75rem; }
  .card { padding: 0.85rem; }
  .page-title { font-size: 20px; }
  .data-table th,
  .data-table td { padding: 7px 8px; font-size: 12.5px; }
  .stat-card { padding: 14px; }
}

/* ============================================================
   18. WIKI
   ============================================================ */
.wiki-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.wiki-entry-card {
  transition: box-shadow .15s, transform .15s;
}
.wiki-entry-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ============================================================
   19. DIGITALER MITGLIEDSAUSWEIS
   ============================================================ */
.card-photo-preview {
  width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  background: var(--color-neutral-bg); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 2px solid var(--border-color);
}
.card-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.card-photo-preview__placeholder { font-size: 34px; opacity: .5; }
.card-valid-icon { display: inline-flex; align-items: center; margin-right: 6px; }


