/* Vereinsfarbe Orange RGB 245/125/50. --akzent ist ein dunklerer Ton derselben
   Farbe, damit Text/Buttons gut lesbar bleiben (Kontrast zu Weiß ≥ 4,5:1). */
:root {
  --vereinsfarbe: #f57d32;
  --akzent: #b4501a;
  --akzent-dunkel: #8c3e14;
  --akzent-hell: #fef0e7;
  --hintergrund: #faf8f6;
  --flaeche: #ffffff;
  --text: #1f2328;
  --gedaempft: #5f6670;
  --rand: #e4dfda;
  --fehler: #b42318;
  --erfolg-hg: #e7f5ec;
  --erfolg-rand: #b7e1c4;
  --warnung-hg: #fff6e0;
  --warnung-rand: #f3d58a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--hintergrund);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--akzent); }
a:hover { color: var(--akzent-dunkel); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }

/* Kopfleiste */
.kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2rem;
  padding: 0.75rem 1rem;
  background: var(--flaeche);
  border-top: 5px solid var(--vereinsfarbe);
  border-bottom: 1px solid var(--rand);
}
.kopf .marke { font-weight: 700; text-decoration: none; color: var(--akzent); font-size: 1.1rem; flex: 1; display: flex; align-items: center; gap: 0.75rem; }
.kopf .logo { height: 44px; width: auto; display: block; }
.marke-text { display: flex; flex-direction: column; line-height: 1.2; }
.marke-text small { font-size: 0.8rem; font-weight: 600; color: var(--gedaempft); }
.konto { display: flex; align-items: center; gap: 1rem; color: var(--gedaempft); }
.menue-knopf { display: none; cursor: pointer; color: var(--akzent); font-weight: 600; user-select: none; }

/* Seitenmenü links */
.rahmen { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.seitenmenue { background: var(--flaeche); border-right: 1px solid var(--rand); padding: 1rem 0; }
.seitenmenue nav { position: sticky; top: 0; }
.seitenmenue ul { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.seitenmenue a { display: block; padding: 0.45rem 1.25rem; color: var(--text); text-decoration: none; border-left: 4px solid transparent; }
.seitenmenue a:hover { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.seitenmenue a.aktiv { border-left-color: var(--vereinsfarbe); background: var(--akzent-hell); color: var(--akzent-dunkel); font-weight: 600; }
.menue-gruppe { margin: 0; }
.menue-gruppe > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 0.55rem 1.25rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gedaempft); user-select: none; }
.menue-gruppe > summary::-webkit-details-marker { display: none; }
.menue-gruppe > summary::after { content: "›"; font-size: 1.1rem; line-height: 1; transition: transform .15s; }
.menue-gruppe[open] > summary::after { transform: rotate(90deg); }
.menue-gruppe > summary:hover { color: var(--akzent-dunkel); background: var(--akzent-hell); }
.menue-gruppe[data-aktiv] > summary { color: var(--akzent-dunkel); }
.menue-gruppe > ul { margin-bottom: 0.4rem; }
.rahmen .inhalt { margin: 0; max-width: 1150px; width: 100%; }
.konto form { margin: 0; }

.inhalt { max-width: 1150px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

/* Karten und Kacheln */
.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}
.karte.schmal { max-width: 460px; margin: 2rem auto; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.kachel { text-decoration: none; color: var(--text); border-left: 4px solid var(--vereinsfarbe); }
.kachel:hover { border-color: var(--akzent); background: var(--akzent-hell); }
.kachel h2 { margin: 0 0 0.25rem; color: var(--akzent); }
.kachel p { margin: 0; color: var(--gedaempft); }

/* Alle Kästen gleich hoch – auch über mehrere Zeilen hinweg (grid-auto-rows: 1fr). */
.spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); grid-auto-rows: 1fr; gap: 1rem; }
.spalten > .karte { margin: 0; }
.spalten.frei { grid-auto-rows: auto; align-items: start; }

/* Einträge (Funktionen, Ehrungen) */
.eintrag { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rand); }
.eintrag:last-child { border-bottom: 0; }
.eintrag.vergangen strong { color: var(--gedaempft); font-weight: 600; }
a.klein, .klein { font-size: 0.85rem; }
.knopf.klein { padding: 0.2rem 0.6rem; }
.karte .kopfzeile { margin-bottom: 0.5rem; }

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kennzahlen .karte { margin: 0; border-top: 3px solid var(--vereinsfarbe); }
.kennzahlen .wert { display: block; font-size: 1.9rem; font-weight: 700; }
.kennzahlen .text { color: var(--gedaempft); }

.marken { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.marken li { background: var(--akzent-hell); color: var(--akzent-dunkel); border-radius: 999px; padding: 0.15rem 0.75rem; }

/* Kopfzeile einer Seite mit Aktionen */
.kopfzeile { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.kopfzeile h1 { margin: 0; }
/* nebeneinanderstehende Spalten: Kopfzeilen gleich hoch, damit die Tabellen auf einer Linie beginnen */
.spalten > section > .kopfzeile { min-height: 2.6rem; }
.spalten > section > .kopfzeile h2 { margin: 0; }
.spalten > section > .kopfzeile .filter { margin: 0; }
.aktionen { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.aktionen form { margin: 0; }
.aktionen button { margin: 0; }

/* Buttons */
button, .knopf {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--akzent);
  border-radius: 6px;
  background: var(--akzent);
  color: #fff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .knopf:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); color: #fff; }
.aktionen .knopf { margin: 0; }
.knopf.zweitrangig { background: var(--flaeche); color: var(--akzent); }
.knopf.zweitrangig:hover { background: var(--akzent-hell); color: var(--akzent-dunkel); }
button.gefahr { background: var(--flaeche); color: var(--fehler); border-color: var(--fehler); }
button.gefahr:hover { background: #fdecea; }
button.link { margin: 0; padding: 0; border: 0; background: none; color: var(--akzent); text-decoration: underline; }

/* Formulare */
label { display: block; margin-top: 0.75rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rand);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vereinsfarbe); outline-offset: 1px; border-color: var(--vereinsfarbe); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--akzent); }
/* Auswahllisten zum Ankreuzen (z. B. Abteilungen): Einträge in normaler Schrift wie die übrigen Eingaben */
.feld div[id^="id_"] label { font-weight: 400; margin-top: 0.3rem; }
select { line-height: 1.5; }

.formular fieldset { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; padding: 0.75rem 1.5rem 1.25rem; margin: 0 0 1rem; }
.formular legend { font-weight: 700; color: var(--akzent); padding: 0 0.4rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 1.25rem; }
.feld small { display: block; margin-top: 0.2rem; }
.feld ul:not(.errorlist) { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.feld ul:not(.errorlist) label { font-weight: normal; margin: 0; display: flex; align-items: center; gap: 0.4rem; }
.hat-fehler input, .hat-fehler select, .hat-fehler textarea { border-color: var(--fehler); }
.feld.ankreuzen label { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: normal; }
.feld.ankreuzen input { margin-top: 0.3rem; }

.filter { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.filter input { flex: 2 1 240px; width: auto; }
.filter select { flex: 1 1 160px; width: auto; }
.filter button { margin: 0; }

/* Reiter */
.reiter { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 2px solid var(--rand); margin-bottom: 1rem; }
.reiter a { padding: 0.5rem 0.9rem; text-decoration: none; color: var(--gedaempft); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.reiter a.aktiv { color: var(--akzent); border-bottom-color: var(--vereinsfarbe); font-weight: 600; }
.reiter .zahl { background: #eee9e4; border-radius: 999px; padding: 0 0.5rem; font-size: 0.85em; color: var(--text); }
.reiter a.aktiv .zahl { background: var(--akzent-hell); color: var(--akzent-dunkel); }

/* Meldungen */
.fehler, .errorlist { color: var(--fehler); }
.errorlist { padding-left: 1.1rem; margin: 0.25rem 0 0; }
.meldung { background: var(--erfolg-hg); border: 1px solid var(--erfolg-rand); padding: 0.5rem 0.75rem; border-radius: 6px; }
.meldung.warnung { background: var(--warnung-hg); border-color: var(--warnung-rand); }
.meldung.sperre { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; }
.gedaempft { color: var(--gedaempft); }
.hinweis { font-size: 0.85em; background: var(--warnung-hg); border-radius: 4px; padding: 0 0.4rem; }

/* Status-Marken */
.status { font-size: 0.8rem; vertical-align: middle; border-radius: 999px; padding: 0.15rem 0.7rem; font-weight: 600; }
.status-mitglied { background: var(--erfolg-hg); color: #1e6b3a; }
.status-antrag { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.status-ausgetreten, .status-abgelehnt { background: #eee9e4; color: var(--gedaempft); }

/* Datenlisten */
.daten { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 0; }
.daten dt { color: var(--gedaempft); }
.daten dd { margin: 0; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* Tabellen */
.tabelle { width: 100%; border-collapse: collapse; background: var(--flaeche); border: 1px solid var(--rand); }
.tabelle th, .tabelle td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rand); }
.tabelle th { background: var(--akzent-hell); color: var(--akzent-dunkel); }
.tabelle tbody tr:hover { background: #fdf9f5; }
.tabelle .zahl-spalte { text-align: right; }

.tabelle.kompakt th, .tabelle.kompakt td { padding: 0.35rem 0.6rem; }
.tabelle tr.storno td { color: var(--gedaempft); text-decoration: line-through; }
.tabelle tr.storno td:last-child { text-decoration: none; }

/* Beitragskonto */
.konto-kurz { margin-top: 1rem; }
.saldo { font-size: 1.1rem; margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border-radius: 6px; background: #f3f1ee; }
.saldo-offen { background: var(--akzent-hell); }
.saldo-offen strong { color: var(--akzent-dunkel); }
.saldo-guthaben { background: var(--erfolg-hg); }
.saldo-guthaben strong { color: #1e6b3a; }
.klein { font-size: 0.9rem; padding-left: 1.1rem; }

form.inline { display: inline; margin: 0; }
form.inline.zeile { display: flex; gap: 0.3rem; margin-top: 0.3rem; }
button.klein-knopf { margin: 0.15rem 0.2rem 0.15rem 0; padding: 0.2rem 0.55rem; font-size: 0.85rem; background: var(--flaeche); color: var(--akzent); }
button.klein-knopf:hover { background: var(--akzent-hell); color: var(--akzent-dunkel); }
input.kurz { width: 7rem; padding: 0.2rem 0.4rem; font-size: 0.85rem; }

/* Fortschrittsbalken (Budget-Ausschöpfung) */
.balken { display: inline-block; width: 6rem; height: 0.55rem; background: #eee9e4; border-radius: 999px; overflow: hidden; vertical-align: middle; }
.balken span { display: block; height: 100%; background: var(--vereinsfarbe); }
.balken.ueber span { background: var(--fehler); }
.positionen select, .positionen input { min-width: 7rem; }
.tabelle tfoot th { background: #f3f1ee; }

/* Website-CMS */
.cms-kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.75rem; }
.cms-kachel { display: block; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--text); }
.cms-kachel:hover { border-color: var(--akzent); }
.cms-kachel img, .cms-ohne-bild { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--akzent-hell); color: var(--gedaempft); font-size: 0.85rem; }
.cms-kachel.aus { opacity: 0.55; }
.cms-name { display: block; padding: 0.4rem 0.7rem 0; font-weight: 700; color: var(--akzent); }
.cms-info { display: block; padding: 0 0.7rem 0.5rem; font-size: 0.8rem; color: var(--gedaempft); }
.cms-zeile { display: flex; gap: 0.6rem; align-items: center; }
.cms-mini { width: 72px; height: 44px; object-fit: cover; border-radius: 4px; }
.cms-vorschau { display: block; max-width: 280px; max-height: 170px; object-fit: cover; border-radius: 6px; margin: 0.3rem 0; }
.cms-gruppe { border: 1px solid var(--rand); border-radius: 8px; padding: 0.25rem 1rem 0.75rem; margin-bottom: 0.75rem; background: #fff; }
.cms-gruppe.neu, .cms-galeriebild.neu { border-style: dashed; }
.cms-galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.cms-galeriebild { border: 1px solid var(--rand); border-radius: 8px; padding: 0.5rem; background: #fff; display: flex; flex-direction: column; gap: 0.35rem; }
.cms-galeriebild img, .cms-galeriebild .cms-ohne-bild { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; display: flex; align-items: center; justify-content: center; background: var(--akzent-hell); }
.cms-galeriebild input[type=file] { font-size: 0.8rem; }
.cms-loeschen { display: inline-flex !important; gap: 0.3rem; align-items: center; font-weight: normal !important; color: var(--fehler); margin-top: 0.5rem; }
input.kurz, .cms-galeriebild input[type=number] { width: 4.5rem; }

.seiten { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }

@media (max-width: 900px) {
  /* Menü auf schmalen Bildschirmen ausklappbar */
  .menue-knopf { display: inline-block; }
  .rahmen { grid-template-columns: 1fr; }
  .seitenmenue { display: none; border-right: 0; border-bottom: 1px solid var(--rand); padding: 0.5rem 0; }
  .menue-schalter:checked + .rahmen .seitenmenue { display: block; }
}

@media (max-width: 700px) {
  /* Auf dem Handy untereinander: jeder Kasten nur so hoch wie nötig */
  .spalten { grid-auto-rows: auto; }
  .tabelle { display: block; overflow-x: auto; }
  .daten { grid-template-columns: 1fr; }
  .daten dt { margin-top: 0.4rem; }
}

/* Baustein-Editor */
.editor { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.editor-liste { display: flex; flex-direction: column; gap: 0.5rem; }
.editor-karte { display: flex; gap: 0.6rem; align-items: center; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; padding: 0.5rem 0.6rem; }
.editor-karte.aus { opacity: 0.55; }
.editor-karte:target { border-color: var(--akzent); box-shadow: 0 0 0 2px var(--akzent-hell); }
.editor-karte .griff, .element-karte .griff { cursor: grab; color: var(--gedaempft); font-size: 1.2rem; user-select: none; padding: 0 0.2rem; }
.editor-karte .info { flex: 1; min-width: 0; }
.editor-karte .info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-karte .info small { color: var(--gedaempft); }
.editor-karte img { width: 56px; height: 38px; object-fit: cover; border-radius: 4px; }
.editor-karte .werkzeuge { display: flex; gap: 0.15rem; align-items: center; }
.editor-karte .werkzeuge form { margin: 0; }
.werkzeug { background: none; border: 1px solid transparent; border-radius: 4px; padding: 0.15rem 0.4rem; cursor: pointer; color: var(--akzent); font: inherit; font-size: 0.95rem; text-decoration: none; line-height: 1.4; }
.werkzeug:hover { background: var(--akzent-hell); border-color: var(--rand); }
.werkzeug.rot { color: var(--fehler); }
.ziehend { opacity: 0.35; }
.ablage-ziel { outline: 2px dashed var(--akzent); outline-offset: 2px; }
.editor-neu { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.editor-neu select { flex: 1; }
.editor-vorschau { position: sticky; top: 1rem; border: 1px solid var(--rand); border-radius: 8px; overflow: hidden; background: #fff; }
.editor-vorschau .leiste { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0.75rem; background: var(--akzent-hell); font-size: 0.85rem; }
.editor-vorschau iframe { width: 100%; height: calc(100vh - 9rem); min-height: 480px; border: 0; display: block; }
.editor-status { font-size: 0.85rem; color: var(--gedaempft); min-height: 1.2em; }
.elemente { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.75rem; }
.element-karte { border: 1px solid var(--rand); border-radius: 8px; padding: 0.5rem; background: #fff; display: flex; flex-direction: column; gap: 0.35rem; }
.element-karte.neu { border-style: dashed; }
.element-karte .element-kopf { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--gedaempft); }
.element-karte img, .element-karte .cms-ohne-bild { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; display: flex; align-items: center; justify-content: center; background: var(--akzent-hell); }
.element-karte input[type=file] { font-size: 0.8rem; }
.element-karte input[type=text], .element-karte textarea { width: 100%; box-sizing: border-box; }
@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .editor-vorschau { position: static; }
}

/* Aktuelles und Termine im CMS */
.cms-liste { width: 100%; border-collapse: collapse; background: var(--flaeche); }
.cms-liste td, .cms-liste th { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: middle; }
.cms-liste th { font-size: 0.85rem; color: var(--gedaempft); font-weight: 600; }
.cms-liste img { width: 64px; height: 40px; object-fit: cover; border-radius: 4px; display: block; }
.status { display: inline-block; font-size: 0.78rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: #e7f5ec; color: #1d6b3a; white-space: nowrap; }
.status.entwurf { background: #eee; color: #555; }
.status.geplant { background: #e8f0fb; color: #1d4f91; }
.status.aus { background: #fdecea; color: var(--fehler); }
.reiter { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.reiter a { padding: 0.3rem 0.9rem; border: 1px solid var(--rand); border-radius: 999px; text-decoration: none; background: var(--flaeche); }
.reiter a.aktiv { background: var(--akzent); border-color: var(--akzent); color: #fff; }

/* Tabellen mit gleich hohen Zeilen: feste Spaltenbreiten, Inhalt einzeilig, Überlänge mit „…“ (voller Text im Tooltip) */
.tabelle.einzeilig { table-layout: fixed; }
.tabelle.einzeilig th, .tabelle.einzeilig td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 2.6rem; box-sizing: border-box; }
.tabelle.einzeilig .hinweis { font-size: 0.75rem; padding: 0.05rem 0.4rem; }
.tabelle-rahmen { overflow-x: auto; }
.mitgliederliste { min-width: 63.5rem; }  /* Abteilungen bekommt den Rest */
.mitgliederliste .sp-nr { width: 4.5rem; }
.mitgliederliste .sp-name { width: 14rem; }
.mitgliederliste .sp-ort { width: 10rem; }
.mitgliederliste .sp-art { width: 4.5rem; }
.mitgliederliste .sp-beitrag { width: 9.5rem; }
.mitgliederliste .sp-datum { width: 7.5rem; }
/* sortierbare Spaltenköpfe: Pfeil zeigt die aktuelle Richtung */
th .sortieren { color: inherit; text-decoration: none; display: block; background: none; border: 0; padding: 0; margin: 0;
  font: inherit; cursor: pointer; text-align: inherit; width: 100%; }
th .sortieren:hover { color: var(--akzent); }
th a.sortieren:empty { min-height: 1.2em; }
th .sortieren.auf::after { content: " ▲"; font-size: .7em; }
th .sortieren.ab::after { content: " ▼"; font-size: .7em; }

/* Trainingszeiten im CMS */
.cms-zeiten select, .cms-zeiten input { width: 100%; box-sizing: border-box; }
.cms-zeiten td:nth-child(2), .cms-zeiten td:nth-child(3) { width: 7.5rem; }
.cms-zeiten td:first-child { width: 9rem; }
.editor-karte .info small { display: block; }


/* Kopfbereich bleibt beim Scrollen stehen; Seitenmenü und Editor-Vorschau rutschen darunter mit */
.kopf { position: sticky; top: 0; z-index: 50; }
.seitenmenue nav { top: 4.75rem; }
.editor-vorschau { top: 5.5rem; }
html { scroll-padding-top: 5.5rem; }

/* Korrespondenz */
.vorlage-raster { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.platzhalter-hilfe { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow-y: auto; }
.platzhalter-hilfe ul { list-style: none; margin: 0; padding: 0; }
.platzhalter-hilfe li { margin-bottom: 0.25rem; line-height: 1.3; }
.platzhalter-hilfe .platzhalter { font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; }
.brief-vorschau { white-space: pre-wrap; background: #fff; border: 1px solid var(--rand); border-radius: 6px; padding: 1rem 1.25rem; max-width: 46rem; line-height: 1.5; }
@media (max-width: 1000px) { .vorlage-raster { grid-template-columns: 1fr; } .platzhalter-hilfe { position: static; max-height: none; } }

/* Sponsoren & Spenden: Kennzahlen */
.kachel-zahl { background: var(--flaeche); border: 1px solid var(--rand); border-left: 4px solid var(--vereinsfarbe); border-radius: 8px; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.15rem; }
.kachel-zahl span { color: var(--gedaempft); font-size: 0.85rem; }
.kachel-zahl strong { font-size: 1.5rem; color: var(--akzent-dunkel); }
.kachel-zahl small { color: var(--gedaempft); }
.kacheln + .karte { margin-top: 1.25rem; }

/* ---------------------------------------------------------------- Mediathek */
.medienfeld { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.medienfeld-vorschau { width: 120px; height: 80px; border: 1px solid var(--rand); border-radius: 6px; background: #f7f5f3;
  display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; font-size: .8rem; text-align: center; }
.medienfeld-vorschau img { width: 100%; height: 100%; object-fit: cover; }
.medienfeld-leer { color: var(--gedaempft); }
.medienfeld-aktionen { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; min-width: 0; }
.medienfeld-hochladen { position: relative; overflow: hidden; display: inline-block; border: 1px solid var(--akzent); border-radius: 4px; cursor: pointer; }
.medienfeld-hochladen input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.medienfeld-name { flex-basis: 100%; color: var(--gedaempft); overflow-wrap: anywhere; }
.medienfeld-entfernen { font-size: .85rem; }
.element-karte .medienfeld { flex-direction: column; align-items: stretch; }
.element-karte .medienfeld-vorschau { width: 100%; height: 110px; }
.medien-mehrfach-vorschau { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0; }
.medien-mehrfach-vorschau img { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; }
.md-einfuegen { margin-bottom: .3rem; }

.md-dialog { width: min(980px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3); display: flex; flex-direction: column; }
.md-dialog:not([open]) { display: none; }
.md-dialog::backdrop { background: rgba(0,0,0,.45); }
.md-kopf, .md-fuss, .md-filter { display: flex; gap: .5rem; align-items: center; padding: .7rem 1rem; }
.md-kopf { justify-content: space-between; border-bottom: 1px solid var(--rand); }
.md-filter input { flex: 1; min-width: 0; }
.md-fuss { border-top: 1px solid var(--rand); justify-content: flex-end; flex-wrap: wrap; }
.md-info { color: var(--gedaempft); font-size: .85rem; margin-right: auto; }
.md-ablage, .mt-ablage { margin: 0 1rem; padding: .8rem; border: 2px dashed var(--rand); border-radius: 8px; text-align: center; color: var(--gedaempft); }
.md-ablage.ueber, .mt-ablage.ueber { border-color: var(--vereinsfarbe); background: var(--akzent-hell); }
.md-raster, .mt-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.md-raster { padding: 1rem; overflow-y: auto; min-height: 200px; }
.md-raster.laedt { opacity: .5; }
.md-kachel, .mt-kachel { display: flex; flex-direction: column; padding: 0; border: 2px solid transparent; border-radius: 6px; background: #fff;
  box-shadow: 0 0 0 1px var(--rand); cursor: pointer; text-align: left; overflow: hidden; color: inherit; text-decoration: none; font: inherit; }
.md-kachel:hover, .mt-kachel:hover, .md-kachel:focus-visible { border-color: var(--akzent); }
.md-kachel.gewaehlt { border-color: var(--vereinsfarbe); box-shadow: 0 0 0 3px var(--akzent-hell); }
.md-kachel img, .mt-kachel img, .md-symbol { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f7f5f3; display: flex;
  align-items: center; justify-content: center; font-weight: 700; color: var(--gedaempft); }
.md-titel, .mt-titel { font-size: .75rem; padding: .25rem .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-ablage { margin: 0 0 1rem; padding: 1.2rem; }
.mt-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.mt-filter .feld { margin: 0; }
.mt-gross { max-width: 100%; max-height: 420px; border-radius: 8px; background: #f7f5f3; }
.md-kachel img, .mt-kachel img { object-fit: contain; background: #fff; }
.md-raster, .mt-raster { grid-auto-rows: max-content; align-content: start; }
.md-raster { flex: 1 1 auto; }
.md-kachel { height: auto; min-height: 0; margin: 0; }
.md-filter input[type=search] { flex: 2 1 220px; width: auto; }
.md-filter select { flex: 1 1 160px; width: auto; }
.md-kachel:hover, .md-kachel.gewaehlt { background: #fff; color: inherit; }
.md-dialog button { margin-top: 0; }
.mt-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.mt-ordner { position: sticky; top: 5rem; display: flex; flex-direction: column; gap: .15rem; background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: 8px; padding: .6rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
.mt-o { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem .55rem; border-radius: 6px; text-decoration: none;
  color: inherit; border: 2px dashed transparent; overflow-wrap: anywhere; }
.mt-o span { color: var(--gedaempft); font-size: .8rem; }
.mt-o:hover { background: var(--akzent-hell); }
.mt-o.aktiv { background: var(--akzent); color: #fff; }
.mt-o.aktiv span { color: #fff; }
.mt-zieht .mt-o[data-ziel] { border-color: var(--rand); }
.mt-o.ziel { border-color: var(--vereinsfarbe) !important; background: var(--akzent-hell); color: inherit; }
.mt-ordner .klein-knopf { margin-top: .5rem; }
.mt-ordner small { margin-top: .4rem; font-size: .75rem; }
.mt-abteilung { margin-left: .8rem; font-size: .85rem; }
.mt-abteilung select { width: auto; display: inline-block; }
.mt-leiste { position: sticky; top: 4.5rem; z-index: 3; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  background: var(--akzent-hell); border: 1px solid var(--akzent); border-radius: 8px; padding: .5rem .8rem; margin-bottom: .6rem; }
.mt-leiste select { width: auto; display: inline-block; }
.mt-leiste button { margin: 0; }
.mt-tipp { margin: 0 0 .4rem; }
.mt-kachel { position: relative; }
.mt-haken { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; margin: 0; opacity: 0; transition: opacity .15s; z-index: 1; }
.mt-kachel:hover .mt-haken, .mt-kachel.gewaehlt .mt-haken { opacity: 1; }
.mt-kachel.gewaehlt { border-color: var(--vereinsfarbe); box-shadow: 0 0 0 3px var(--akzent-hell); }
.mt-kontext { position: fixed; z-index: 50; min-width: 220px; max-height: 70vh; overflow-y: auto; background: #fff;
  border: 1px solid var(--rand); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: .3rem; }
.mt-kontext button { display: block; width: 100%; margin: 0; text-align: left; background: none; border: 0; color: inherit;
  padding: .4rem .6rem; border-radius: 5px; font-weight: normal; }
.mt-kontext button:hover, .mt-kontext button:focus-visible { background: var(--akzent-hell); color: inherit; }
.mt-kontext button.eingerueckt { padding-left: 1.2rem; }
.mt-kontext button.gefahr { color: var(--fehler); border-top: 1px solid var(--rand); border-radius: 0; margin-top: .2rem; }
.mt-kontext-titel { font-size: .75rem; color: var(--gedaempft); padding: .4rem .6rem .1rem; text-transform: uppercase; letter-spacing: .03em; }
@media (max-width: 760px) { .mt-layout { grid-template-columns: 1fr; } .mt-ordner { position: static; max-height: none; } }
.medienfeld-vorschau { position: relative; }
.medienfeld-x, .element-x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; margin: 0; padding: 0; line-height: 1;
  border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; cursor: pointer; z-index: 2; }
.medienfeld-x:hover, .element-x:hover { background: var(--fehler); color: #fff; }
.element-karte { position: relative; }

/* ---------------------------------------------------------------- Text-Editor */
.ed-leiste { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; padding: .4rem; border: 1px solid var(--rand);
  border-bottom: 0; border-radius: 6px 6px 0 0; background: #f7f5f3; position: sticky; top: 4.2rem; z-index: 2; }
.ed-leiste select { width: auto; padding: .25rem .4rem; margin: 0; }
.ed-knopf { margin: 0; padding: .25rem .55rem; min-width: 2rem; background: #fff; color: var(--text, #222); border: 1px solid var(--rand);
  border-radius: 4px; font-weight: normal; line-height: 1.3; }
.ed-knopf:hover { background: var(--akzent-hell); color: var(--akzent-dunkel); border-color: var(--akzent); }
.ed-fett { font-weight: 700 !important; } .ed-kursiv { font-style: italic; } .ed-unter { text-decoration: underline; } .ed-durch { text-decoration: line-through; }
.ed-trenner { width: 1px; align-self: stretch; background: var(--rand); margin: 0 .2rem; }
.ed-flaeche { min-height: 18rem; max-height: 70vh; overflow-y: auto; padding: .8rem 1rem; border: 1px solid var(--rand); border-radius: 0 0 6px 6px;
  background: #fff; line-height: 1.6; }
.ed-flaeche:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }
.ed-flaeche h2 { font-size: 1.45rem; margin: 1rem 0 .4rem; } .ed-flaeche h3 { font-size: 1.2rem; margin: .9rem 0 .3rem; } .ed-flaeche h4 { font-size: 1.05rem; }
.ed-flaeche p { margin: 0 0 .7rem; } .ed-flaeche blockquote { border-left: 3px solid var(--vereinsfarbe); margin: .8rem 0; padding: .2rem .9rem; color: #555; }
.ed-flaeche .klein { font-size: .85em; } .ed-flaeche .gross { font-size: 1.25em; } .ed-flaeche .mitte { text-align: center; }
.ed-flaeche figure { margin: .8rem 0; padding: .4rem; border: 1px dashed var(--rand); border-radius: 6px; display: flex; gap: .6rem;
  align-items: center; cursor: pointer; user-select: none; }
.ed-flaeche figure img { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; }
.ed-flaeche figure.ed-gewaehlt { border-color: var(--fehler); box-shadow: 0 0 0 2px #fdecea; }

.mt-fokus { position: relative; display: inline-block; cursor: crosshair; max-width: 100%; }
.mt-fokus img { display: block; }
.mt-fokus-punkt { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--vereinsfarbe), 0 0 8px rgba(0,0,0,.5); pointer-events: none; }
.mt-kachel-vorschau { width: 220px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; border: 1px solid var(--rand); }
.mt-kachel-vorschau img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- einheitliche Bedienelemente */
[hidden] { display: none !important; }
.zweitrangig-knopf { background: var(--flaeche); color: var(--akzent); }
.zweitrangig-knopf:hover { background: var(--akzent-hell); color: var(--akzent-dunkel); }

/* Mediathek: alle Felder und Knöpfe einer Zeile gleich hoch und auf einer Linie */
.mt-steuer { box-sizing: border-box; height: 2.5rem; margin: 0; padding: 0 .9rem; display: inline-flex; align-items: center;
  justify-content: center; line-height: 1; font-size: .95rem; border-radius: 6px; white-space: nowrap; }
input.mt-steuer, select.mt-steuer { padding: 0 .7rem; justify-content: flex-start; }
select.mt-steuer { display: inline-block; }
.mt-schmal { width: auto; min-width: 11rem; max-width: 100%; }
.mt-anzahl { font-size: .9rem; font-weight: 600; color: var(--gedaempft); background: var(--akzent-hell); border-radius: 999px;
  padding: .15rem .65rem; vertical-align: middle; margin-left: .3rem; }
.kopfzeile .aktionen .mt-steuer { height: 2.2rem; font-size: .9rem; }

.mt-ablage { display: flex; flex-direction: column; gap: .5rem; align-items: center; text-align: center; }
.mt-ablage-zeile { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: center; }
.mt-ablage-text { color: var(--text, #222); }
.mt-datei-knopf { position: relative; overflow: hidden; cursor: pointer; }
.mt-datei-knopf input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mt-inline-label { margin: 0 0 0 .8rem; font-weight: 600; }

.mt-filter { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.mt-filter .mt-suche { flex: 1 1 160px; min-width: 0; width: auto; }
.mt-filter .mt-schmal { min-width: 8.5rem; }
.mt-zuruecksetzen { font-size: .9rem; }

.mt-leiste { gap: .6rem; padding: .5rem .7rem; }
.mt-leiste strong { margin-right: .4rem; }

.mt-ordner .mt-neu { height: 2.2rem; margin-top: .6rem; width: 100%; font-size: .9rem; }
.mt-ordner .mt-o { align-items: center; min-height: 2.2rem; box-sizing: border-box; }

.newsletter-vorschau { width: 100%; height: 760px; border: 1px solid var(--rand); border-radius: 8px; background: #f4f1ee; margin-top: .6rem; }

.ap-fokus-bereich { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: .3rem 0; }
.ap-fokus-bild { max-width: 260px; max-height: 260px; display: block; border-radius: 6px; }
.ap-kreis-vorschau { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.ap-kreis-vorschau img { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); }

/* Ansprechpartner-Verwaltung: größere Personenbilder */
.ap-listenbild, .editor-karte img.ap-listenbild { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.15); }
.ap-ohne { display: inline-flex; align-items: center; justify-content: center; background: var(--akzent-hell); color: var(--akzent);
  font-weight: 700; font-size: 1.3rem; }
.ap-fokus-bild { max-width: min(420px, 100%); max-height: 420px; }
.ap-kreis-vorschau img { width: 170px; height: 170px; }

.medienfeld-vorschau-rahmen { position: relative; }
.ap-foto-knopf { margin-top: .5rem; }

/* Ansprechpartner: Einwilligung und Freigaben */
.ap-schritt { display: flex; gap: 1rem; padding: 1rem 0; }
.ap-schritt + .ap-schritt { border-top: 1px solid var(--rand); }
.ap-schritt-nr { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--akzent); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.ap-schritt-inhalt { flex: 1; min-width: 0; }
.ap-schritt-inhalt h3 { margin: .2rem 0 .5rem; font-size: 1.05rem; }
.ap-status { display: inline-block; padding: .35rem .8rem; border-radius: 999px; font-weight: 600; font-size: .9rem; margin-bottom: .6rem; }
.ap-status.ok { background: #e7f5ec; color: #1e6b3a; }
.ap-status.fehlt { background: #fdecea; color: #a12a1f; }
.ap-zeile { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .4rem 0; }
.ap-zeile .knopf { margin: 0; }
.ap-zeile input[type=date] { width: auto; height: 2.5rem; box-sizing: border-box; }
.ap-inline { margin: 0; font-weight: 600; }
.ap-freigaben { width: 100%; border-collapse: collapse; }
.ap-freigaben th, .ap-freigaben td { padding: .55rem .4rem; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: middle; }
.ap-freigaben th { width: 30%; font-weight: 600; }
.ap-freigaben .ap-wert { color: var(--text, #222); overflow-wrap: anywhere; }
.ap-freigaben .ap-schalter { width: 1%; white-space: nowrap; }
.schalter { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-weight: normal; cursor: pointer; }
.schalter input { width: 1.1rem; height: 1.1rem; margin: 0; }
.schalter.gesperrt { opacity: .45; cursor: not-allowed; }
/* Knöpfe in Kopfzeilen immer rechtsbündig – auch wenn sie unter die Überschrift umbrechen */
.kopfzeile > .aktionen { margin-left: auto; justify-content: flex-end; }
.reiter.reiter-rechts { justify-content: flex-end; }

/* Speichern und Löschen gleich groß in einer Zeile */
.formular-knoepfe { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }
.formular-knoepfe button, .formular-knoepfe .knopf { margin: 0; min-width: 9rem; height: 2.6rem; box-sizing: border-box; display: inline-flex;
  align-items: center; justify-content: center; }
/* Zweitrangige Knöpfe (auch als <button>) hell mit farbigem Rand */
button.zweitrangig { background: var(--flaeche); color: var(--akzent); }
button.zweitrangig:hover { background: var(--akzent-hell); color: var(--akzent-dunkel); }

/* Interne Abteilungsübersicht */
.ab-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.ab-karte { margin: 0; }
.ab-karte.aus { opacity: .6; }
.ab-personen { display: grid; gap: .6rem; margin: .5rem 0; }
.ab-person { display: flex; flex-direction: column; gap: .1rem; }
.ab-person small { color: var(--gedaempft); text-transform: uppercase; font-size: .72rem; letter-spacing: .03em; }
.ab-person a { font-size: .9rem; overflow-wrap: anywhere; }
.ab-zuordnen { margin: .4rem 0; }
.ab-zuordnen summary { cursor: pointer; color: var(--akzent); font-weight: 600; font-size: .9rem; }
.ab-formular { display: grid; gap: .4rem; margin-top: .5rem; }
.ab-formular label { margin: 0; font-size: .85rem; }
.ab-formular button { justify-self: start; }
.ab-konten { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; border-top: 1px solid var(--rand); padding-top: .5rem; margin-top: .5rem; }
.ab-konto { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .9rem; }
.ab-konto form { margin: 0; }

/* Mitgliederliste: ganze Zeile anklickbar, Austritt als eigene schmale Spalte */
tr.zeile-link { cursor: pointer; }
tr.zeile-link:hover td, tr.zeile-link:focus-visible td { background: var(--akzent-hell); }
tr.zeile-link:focus-visible { outline: 2px solid var(--akzent); outline-offset: -2px; }
tr.zeile-link .zeile-ziel { color: inherit; text-decoration: none; font-weight: 600; }
tr.zeile-link a.zeile-text { color: inherit; text-decoration: none; }
.karte-link { cursor: pointer; }
.karte-link:hover, .karte-link:focus-visible { border-color: var(--akzent); background: var(--akzent-hell); outline: none; }
.mitgliederliste .sp-austritt { width: 1.6rem; }
.mitgliederliste th:nth-child(2), .mitgliederliste .sp-austritt-wert { padding-left: 0; padding-right: 0; text-align: center; overflow: visible; }
.austritt-marke { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 1.5px solid var(--fehler); color: var(--fehler); font-size: .66rem; font-weight: 700; line-height: 1; cursor: help; box-sizing: border-box; }

/* Beitragsarten: Reihenfolge per Griff bzw. ↑/↓ */
.beitragsarten .sp-griff { width: 1.6rem; padding-right: 0; }
.beitragsarten .griff { cursor: grab; color: var(--gedaempft); font-size: 1.1rem; user-select: none; }
.beitragsarten .sp-werkzeuge { width: 4.5rem; text-align: right; white-space: nowrap; }
.vorlesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tabellen mit fester Kopfzeile: eigener Scrollbereich (Bildschirmhöhe abzüglich Seitenkopf und Blätterleiste), Überschriften bleiben oben */
.tabelle-rahmen.festkopf { max-height: calc(100vh - 11.5rem); overflow: auto; border: 1px solid var(--rand); }
.festkopf .tabelle { border: 0; }
.festkopf thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--rand); }
.festkopf .cms-liste th { background: var(--flaeche); }

/* Offene Beträge / Guthaben: gleiche Spaltenbreiten in beiden Tabellen */
.tabelle.posten { table-layout: fixed; }
.tabelle.posten .sp-nr { width: 6rem; }
.tabelle.posten .sp-zahlungsart { width: 11rem; }
.tabelle.posten .sp-betrag { width: 8rem; }

/* Einzeln stehende Links (Zurück, Abbrechen, Zur Übersicht …) als Button, rechtsbündig */
.link-knopf { display: flex; justify-content: flex-end; margin: 0.5rem 0 1rem; }
.link-knopf .knopf { margin: 0; }
.archiv-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.archiv-zeile input { max-width: 15rem; }
