:root {
  --rot: #c8102e;
  --rot-dunkel: #9b0c23;
  --text: #1c1f24;
  --text-leise: #5f6773;
  --linie: #e3e6ea;
  --flaeche: #ffffff;
  --grund: #f5f6f8;
  --gruen: #1c7c4a;
  --gelb: #a86b00;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(16, 20, 27, .06), 0 4px 14px rgba(16, 20, 27, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--grund);
}

a { color: var(--rot); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; margin: 0 0 .3rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 0 0 .4rem; }
p { margin: 0 0 .8rem; }

/* ---------- Kopfzeile ---------- */
.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--linie);
  position: sticky;
  top: 0;
  z-index: 20;
}
.kopf-innen {
  max-width: 1180px;
  margin: 0 auto;
  padding: .7rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}
.marke { display: flex; align-items: baseline; gap: .5rem; color: var(--text); font-weight: 700; }
.marke:hover { text-decoration: none; }
.marke .balken { width: 6px; height: 22px; background: var(--rot); border-radius: 2px; }
.marke small { color: var(--text-leise); font-weight: 500; font-size: .78rem; }

.navi { display: flex; gap: .15rem; flex-wrap: wrap; margin-left: auto; }
.navi a {
  color: var(--text-leise);
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 500;
}
.navi a:hover { background: var(--grund); text-decoration: none; color: var(--text); }
.navi a.aktiv { background: var(--rot); color: #fff; }

.kopf-suche { display: flex; }
.kopf-suche input {
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: .35rem .8rem;
  font-size: .9rem;
  width: 170px;
  background: var(--grund);
}

/* ---------- Layout ---------- */
.inhalt { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.kopfzeile-seite {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem;
}
.leise { color: var(--text-leise); font-size: .9rem; }
.raster { display: grid; gap: 1rem; }
.raster.zwei { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.raster.drei { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--schatten);
}
.karte + .karte { margin-top: 1rem; }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.karte-kopf h2 { margin: 0; }

/* ---------- Kennzahl-Kacheln ---------- */
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: .9rem 1rem; }
.kachel .wert { font-size: 1.8rem; font-weight: 700; line-height: 1.15; }
.kachel .titel { color: var(--text-leise); font-size: .85rem; }

/* ---------- Listen ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { padding: .7rem 0; border-top: 1px solid var(--linie); }
.liste li:first-child { border-top: none; }
.zeile { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; }
.zeile .haupt { min-width: 0; }
.zeile .haupt strong { display: block; }

/* ---------- Marken/Chips ---------- */
.marker {
  display: inline-block; font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  padding: .12rem .5rem; border-radius: 999px; background: var(--grund);
  color: var(--text-leise); border: 1px solid var(--linie); white-space: nowrap;
}
.marker.rot { background: #fdecef; color: var(--rot-dunkel); border-color: #f7ccd4; }
.marker.gruen { background: #e8f5ee; color: var(--gruen); border-color: #c7e6d6; }
.marker.gelb { background: #fdf3e2; color: var(--gelb); border-color: #f3e0bd; }
.marker.blau { background: #eaf1fb; color: #1a4f9c; border-color: #cfe0f6; }

/* ---------- Formulare ---------- */
label { display: block; font-size: .88rem; font-weight: 600; margin: .9rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--linie);
  border-radius: 8px; font: inherit; background: var(--flaeche); color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(200, 16, 46, .35); border-color: var(--rot); }
.formularzeile { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.hinweis { font-size: .82rem; color: var(--text-leise); margin-top: .25rem; }

.knopf {
  display: inline-block; border: 1px solid var(--rot); background: var(--rot); color: #fff;
  padding: .5rem 1rem; border-radius: 8px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.knopf:hover { background: var(--rot-dunkel); border-color: var(--rot-dunkel); text-decoration: none; color: #fff; }
.knopf.schlicht { background: var(--flaeche); color: var(--text); border-color: var(--linie); }
.knopf.schlicht:hover { background: var(--grund); color: var(--text); }
.knopf.klein { padding: .28rem .6rem; font-size: .85rem; }
.knopf.gefahr { background: var(--flaeche); color: var(--rot); border-color: #f0c2ca; }
.knopfzeile { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1.2rem; }

/* ---------- Filterleiste ---------- */
.filter { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter a {
  font-size: .87rem; padding: .3rem .75rem; border-radius: 999px;
  border: 1px solid var(--linie); background: var(--flaeche); color: var(--text-leise);
}
.filter a:hover { text-decoration: none; background: var(--grund); }
.filter a.aktiv { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- Tabellen ---------- */
.tabellenrahmen { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--linie); white-space: nowrap; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-leise); }
td.zahl, th.zahl { text-align: right; }
tr.summe td { font-weight: 700; border-top: 2px solid var(--linie); }

/* ---------- Meldungen ---------- */
.meldung { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .8rem; border: 1px solid; font-size: .93rem; }
.meldung.erfolg { background: #e8f5ee; border-color: #bfe3d0; color: #15603a; }
.meldung.fehler { background: #fdecef; border-color: #f5c6cf; color: var(--rot-dunkel); }
.meldung.info { background: #eaf1fb; border-color: #cfe0f6; color: #1a4f9c; }
.meldung a { word-break: break-all; }

/* ---------- Anmeldeseite ---------- */
.mitte { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.mitte .karte { width: 100%; max-width: 420px; }

/* ---------- Balken (Kennzahlen-Verlauf) ---------- */
.balkenreihe { display: flex; align-items: flex-end; gap: .5rem; height: 130px; margin-top: .8rem; }
.balkenreihe .saeule { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .3rem; height: 100%; }
.balkenreihe .stab { width: 100%; background: var(--rot); border-radius: 4px 4px 0 0; min-height: 3px; }
.balkenreihe .beschriftung { font-size: .68rem; color: var(--text-leise); }

.fuss { border-top: 1px solid var(--linie); margin-top: 2.5rem; padding: 1.2rem; text-align: center; color: var(--text-leise); font-size: .82rem; }
.leerzustand { text-align: center; color: var(--text-leise); padding: 1.6rem 1rem; }
.abschnitt { margin-top: 1.6rem; }
.stimme { display: flex; flex-direction: column; align-items: center; min-width: 54px; }
.stimme .knopf { padding: .2rem .55rem; line-height: 1.2; }
.kommentar { border-top: 1px solid var(--linie); padding: .8rem 0; }
.durchgestrichen { text-decoration: line-through; color: var(--text-leise); }

@media (max-width: 640px) {
  .kopf-suche { order: 3; width: 100%; }
  .kopf-suche input { width: 100%; }
  .navi { margin-left: 0; }
}

/* ---------- CTL-Ampel ---------- */
.ampel {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  margin-right: .4rem; vertical-align: baseline; border: 1px solid rgba(0, 0, 0, .12);
}
.ampel.gruen { background: #1c7c4a; }
.ampel.gelb { background: #e0a300; }
.ampel.rot { background: var(--rot); }
.legende { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .84rem; color: var(--text-leise); }
tr.eigenes td { background: #fdf7f8; }

/* ---------- Sortierbare Tabellenköpfe ---------- */
th a.sortierlink {
  color: inherit; text-decoration: none; display: inline-flex; align-items: center;
  gap: .2rem; white-space: nowrap;
}
th a.sortierlink:hover { color: var(--rot); text-decoration: none; }
th a.sortierlink.aktiv { color: var(--text); }
th a.sortierlink .pfeil { font-size: .8em; color: var(--rot); }

/* ---------- Passwortvorschlag ---------- */
.vorschlag code {
  background: var(--grund); border: 1px solid var(--linie); border-radius: 6px;
  padding: .15rem .45rem; font-size: .95em; letter-spacing: .04em; user-select: all;
}

/* ---------- Seite „Wissen & Ideen“ ---------- */
.sprungleiste { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; font-size: .9rem; }
.bereichstitel {
  font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-leise); border-bottom: 1px solid var(--linie);
  padding-bottom: .4rem; margin: 0 0 .9rem; scroll-margin-top: 5rem;
}
.ideenraster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.karte.idee { display: flex; flex-direction: column; }
.ideenbild {
  width: 100%; max-height: 190px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--linie); margin-bottom: .7rem; display: block;
}
.ideenfuss {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--linie); font-size: .85rem;
}
.anhangraster { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.anhangraster img { width: 100%; border-radius: 8px; border: 1px solid var(--linie); display: block; }
.stimmbalken { height: 10px; border-radius: 999px; background: var(--grund); overflow: hidden; display: flex; }
.stimmbalken span { display: block; height: 100%; }
.stimmbalken .dafuer { background: var(--gruen); }
.stimmbalken .dagegen { background: var(--rot); }
.stimmbalken .enthaltung { background: #c9ced6; }

/* ---------- Gespräche ---------- */
.navi a.glocke { position: relative; padding-right: .6rem; }
.navi a.glocke .zaehler {
  position: absolute; top: -2px; right: -4px; background: var(--rot); color: #fff;
  border-radius: 999px; font-size: .68rem; font-weight: 700; line-height: 1;
  padding: .16rem .32rem; min-width: 1.1em; text-align: center;
}
.nachricht {
  border: 1px solid var(--linie); border-radius: var(--radius); padding: .8rem 1rem;
  background: var(--flaeche); margin-bottom: .7rem;
}
.nachricht.eigene { background: #fdf7f8; border-color: #f2d8de; }
.nachricht .kopf { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .3rem; }
.nachricht .kopf strong { font-size: .95rem; }
.nachricht .text { white-space: pre-wrap; margin: 0; }
.nachricht .text .erwaehnung { color: var(--rot); font-weight: 600; }
.namensliste { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.namensliste button {
  border: 1px solid var(--linie); background: var(--grund); border-radius: 999px;
  padding: .15rem .6rem; font: inherit; font-size: .82rem; cursor: pointer; color: var(--text-leise);
}
.namensliste button:hover { border-color: var(--rot); color: var(--rot); }
.personenwahl {
  max-height: 260px; overflow-y: auto; border: 1px solid var(--linie);
  border-radius: 8px; padding: .5rem .7rem;
}
.personenwahl label { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin: .35rem 0; }
.personenwahl input { width: auto; }
.vorschau {
  display: block; margin-top: .25rem; color: var(--text-leise);
  font-size: .9rem; font-style: italic;
}

/* ---------- Teamübersicht (Führungsteam und Unterstützerteams) ---------- */
.orgraster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.orgspalte { display: flex; flex-direction: column; }
.orgkarte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--schatten);
}
.orgkarte.leitung { border-top: 3px solid var(--rot); }
.orgkarte.leer { background: var(--grund); box-shadow: none; }
.orgkarte h3 { margin: 0 0 .5rem; }
.orgstrich { width: 2px; height: 22px; background: var(--linie); margin: 0 auto; }
.person { padding: .4rem 0; border-top: 1px solid var(--linie); }
.person:first-of-type { border-top: none; }
.person strong { display: block; }
.person .leise { display: block; }

/* ---------- Social Media Manager ---------- */
.schrittliste { list-style: none; margin: 0; padding: 0; }
.schrittliste li { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; }
.schrittliste .haken {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 999px; flex: none;
  border: 1px solid var(--linie); background: var(--grund);
  font-size: .8rem; font-weight: 700; color: var(--text-leise);
}
.schrittliste li.fertig .haken { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.schrittliste li.fertig a { color: var(--text-leise); }

.medienraster { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.medienkachel {
  display: block; border: 1px solid var(--linie); border-radius: var(--radius);
  overflow: hidden; background: var(--grund); color: inherit;
}
.medienkachel:hover { border-color: var(--rot); text-decoration: none; }
.medienkachel img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.medienkachel .videofeld {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 4 / 5; background: #1c1f24; color: #fff; font-size: .85rem;
}
.medienfuss { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; padding: .4rem .5rem; font-size: .75rem; }

.medienwahl { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-bottom: .6rem; }
.medienoption { display: block; font-size: .75rem; cursor: pointer; }
.medienoption img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--linie); }
.medienoption .videofeld { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1 / 1; background: #1c1f24; color: #fff; border-radius: 6px; }
.medienoption input:checked ~ img,
.medienoption input:checked ~ .videofeld { outline: 3px solid var(--rot); outline-offset: -3px; }

.vorschau {
  background: var(--grund); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .8rem; white-space: pre-wrap; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem;
  max-height: 420px; overflow: auto; margin: 0;
}
.knopf:disabled, .knopf[disabled] {
  opacity: .45; cursor: not-allowed; background: var(--text-leise);
  border-color: var(--text-leise);
}
.knopf.schlicht:disabled { background: var(--grund); color: var(--text-leise); border-color: var(--linie); }
/* Lange Dateinamen dürfen die Kachelspalte nicht sprengen. */
.medienoption .leise {
  display: block; margin-top: .25rem; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
