/* Admin-Bereich: marsch-media-Dark-Theme (Branding-Vorgaben Markus) */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #171923;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Navigation ---- */
.topnav {
  display: flex; align-items: center; gap: 4px;
  background: #1e2235; border-bottom: 1px solid #2a3050;
  padding: 10px 24px; flex-wrap: wrap;
}
.nav-brand {
  color: #8892b0; font-weight: 600; letter-spacing: 0.05em;
  margin-right: 20px; font-size: 0.95rem;
}
.topnav a {
  color: #8892b0; text-decoration: none; padding: 8px 14px;
  border-radius: 8px; font-size: 0.9rem; transition: color 0.2s, background 0.2s;
}
.topnav a:hover { color: #e2e8f0; }
.topnav a.aktiv { background: #2a3550; color: #e2e8f0; }
.nav-rechts { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-user { color: #5a6a92; font-size: 0.85rem; }

/* ---- Layout ---- */
.inhalt { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.seiten-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
h1 {
  font-size: 1.4rem; font-weight: 500; letter-spacing: 0.05em; color: #8892b0;
}
.karte {
  background: #1e2235; border: 1px solid #2a3050; border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.karten-titel {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #8892b0; font-weight: 600; margin-bottom: 16px;
}

/* ---- KPI-Kacheln ---- */
.kpi-reihe {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.kpi-karte {
  background: #1e2235; border: 1px solid #2a3050; border-radius: 12px;
  padding: 16px 20px;
}
.kpi-wert { font-size: 1.7rem; font-weight: 600; color: #4267b2; }
.kpi-label { font-size: 0.75rem; color: #8892b0; letter-spacing: 0.03em; margin-top: 2px; }
.kpi-inline { color: #8892b0; font-size: 0.9rem; }
.kpi-inline strong { color: #4267b2; font-size: 1.1rem; }

/* ---- Filter-Chips ---- */
.filter-zeile { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.filter-gruppe { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  color: #5a6a92; text-decoration: none; font-size: 0.85rem;
  border: 1px solid #2a3050; border-radius: 8px; padding: 6px 14px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter-chip:hover { color: #e2e8f0; border-color: #4267b2; }
.filter-chip.aktiv { background: #4267b2; border-color: #4267b2; color: #fff; }

/* ---- Fragen-Balken (Statistik) ---- */
.frage-zeile { margin-bottom: 14px; }
.frage-link {
  display: block; text-decoration: none; color: inherit;
  border-radius: 8px; padding: 8px 10px; margin: 0 -10px 6px;
  transition: background 0.15s;
}
.frage-link:hover { background: #222741; }
.frage-link:hover .frage-label { color: #fff; }
.titel-tipp { text-transform: none; font-weight: 400; color: #5a6a92; letter-spacing: 0; }
.frage-gross { font-size: 1.05rem; color: #e2e8f0; line-height: 1.5; }

/* Verteilungs-Zeilen (Frage-Detail: ein Balken je Bewertungsstufe) */
.vert-zeile {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  padding: 5px 10px; margin: 0 -10px; border-radius: 8px;
  transition: background 0.15s;
}
.vert-zeile:hover { background: #222741; }
.vert-aktiv { background: #2a3550; }
.vert-wert { min-width: 26px; text-align: right; font-weight: 700; }
.vert-anzahl { min-width: 92px; color: #8892b0; font-size: 0.85rem; white-space: nowrap; }
.skala-legende-admin {
  display: flex; justify-content: space-between; margin-top: 10px;
  font-size: 0.72rem; color: #5a6a92;
}

/* Freitext: Frage klein/gedämpft, Antwort als abgesetztes Zitat */
.freitext-block { margin-top: 20px; }
.freitext-frage {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #8892b0; font-weight: 600; margin-bottom: 8px;
}
.freitext {
  background: #171923; border-left: 3px solid #4267b2; border-radius: 0 8px 8px 0;
  padding: 12px 16px; color: #e2e8f0; font-size: 0.95rem; white-space: pre-wrap;
}
.freitext-leer { color: #5a6a92; font-style: italic; border-left-color: #2a3050; }
.freitext-eintrag { margin-bottom: 18px; }
.freitext-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 0.85rem; color: #e2e8f0; }
.frage-label { font-size: 0.85rem; color: #e2e8f0; margin-bottom: 6px; }
.frage-nr {
  display: inline-block; min-width: 20px; height: 20px; line-height: 20px;
  background: #2a3550; color: #8892b0; border-radius: 50%;
  text-align: center; font-size: 0.7rem; margin-right: 4px;
}
.balken-zeile { display: flex; align-items: center; gap: 12px; }
.balken-spur {
  flex: 1; height: 14px; background: #2a3550; border-radius: 7px; overflow: hidden;
}
.balken { height: 100%; background: #4267b2; border-radius: 7px; transition: width 0.3s; }
.balken-wert { min-width: 36px; text-align: right; font-weight: 600; color: #4267b2; }

/* Top-Bewertung (10): edler Grün-Verlauf (inline) + dezenter Glanz und sanftes Pulsieren */
.balken.balken-top {
  box-shadow: inset 0 1px 5px rgba(255, 255, 255, 0.4);
  animation: balken-top-puls 2.6s ease-in-out infinite;
}
@keyframes balken-top-puls {
  0%, 100% { filter: brightness(1) saturate(1); }
  50%      { filter: brightness(1.17) saturate(1.12); }
}
.wert-top {
  font-weight: 800;
  animation: wert-top-puls 2.6s ease-in-out infinite;
}
@keyframes wert-top-puls {
  0%, 100% { text-shadow: 0 0 2px rgba(46, 210, 130, 0.25); }
  50%      { text-shadow: 0 0 11px rgba(46, 210, 130, 0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .balken.balken-top, .wert-top { animation: none; }
}

/* ---- Monatsverlauf ---- */
.verlauf { display: flex; gap: 10px; align-items: flex-end; height: 140px; padding-top: 10px; }
.verlauf-spalte {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; height: 100%; position: relative;
}
.verlauf-balken { width: 70%; max-width: 48px; background: #4267b2; border-radius: 6px 6px 0 0; }
.verlauf-label { font-size: 0.7rem; color: #5a6a92; margin-top: 6px; }
.verlauf-zahl { font-size: 0.75rem; color: #8892b0; position: absolute; top: -4px; }

/* ---- Tabellen ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th {
  text-align: left; color: #8892b0; font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.05em; font-weight: 600; padding: 8px 10px;
  border-bottom: 1px solid #2a3050;
}
td { padding: 10px; border-bottom: 1px solid #232840; vertical-align: middle; }
tbody tr:hover { background: #222741; }
.detail-tabelle th { text-transform: none; font-size: 0.85rem; width: 160px; vertical-align: top; padding-top: 12px; }
.zeile-problem { background: rgba(217, 83, 79, 0.08); }
.zeile-neu { background: rgba(76, 175, 138, 0.10); }
code { background: #2a3550; padding: 2px 8px; border-radius: 6px; font-size: 0.85rem; }
.dezent { color: #5a6a92; font-size: 0.8rem; }

/* ---- Status ---- */
.status-ok { color: #4caf8a; text-decoration: none; }
.status-fehler { color: #d9534f; }
.status-offen { color: #8892b0; }
.marke-chip {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
}
.marke-bw { background: rgba(203, 181, 131, 0.15); color: #cbb583; }
.marke-fw { background: rgba(209, 10, 17, 0.18); color: #ff8a8e; }

/* ---- Formulare ---- */
.formular-reihe { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.feld { display: flex; flex-direction: column; gap: 5px; min-width: 180px; flex: 1; }
.feld-label { font-size: 0.75rem; color: #8892b0; letter-spacing: 0.03em; }
input, select, textarea {
  background: #2a3550; border: 1px solid #3a4a70; border-radius: 8px;
  color: #e2e8f0; padding: 10px 14px; font: inherit; font-size: 0.9rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #4267b2; }
input::placeholder, textarea::placeholder { color: #7a8aac; }
textarea { width: 100%; resize: vertical; }
.klein-input { padding: 6px 10px; font-size: 0.8rem; width: 150px; }

/* Kleiner Text-Editor (Fett/Kursiv/Unterstrichen) */
.rte { border: 1px solid #3a4a70; border-radius: 8px; overflow: hidden; background: #2a3550; }
.rte-toolbar { display: flex; gap: 4px; padding: 6px; background: #232a42; border-bottom: 1px solid #3a4a70; }
.rte-btn {
  width: 32px; height: 30px; padding: 0; border: 1px solid #3a4a70; border-radius: 6px;
  background: #2a3550; color: #cfd8ec; font-size: 0.95rem; font-weight: 700; cursor: pointer;
  line-height: 1; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.rte-btn:hover { border-color: #4267b2; color: #ffffff; background: #31406a; }
.rte-editor {
  min-height: 96px; padding: 10px 14px; color: #e2e8f0; font: inherit; font-size: 0.9rem;
  line-height: 1.5; outline: none; background: #2a3550;
}
.rte-editor:focus { box-shadow: inset 0 0 0 1px #4267b2; }
.rte-editor b { font-weight: 700; }

/* Platzhalter-Übersicht */
.platzhalter-liste { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.platzhalter-liste li { color: #b8c2dc; font-size: 0.9rem; }
code {
  background: #2a3550; border: 1px solid #3a4a70; border-radius: 5px;
  padding: 1px 7px; font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.85rem; color: #8ec7ff;
}

/* Passwortfeld mit Auge-Umschalter (anzeigen/verbergen) */
.pw-field { position: relative; display: flex; align-items: stretch; }
.pw-field > input { width: 100%; padding-right: 38px; }
.pw-field.klein { flex: 0 0 auto; }
.pw-field.klein > input { padding-right: 34px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 2px; cursor: pointer;
  color: #5a6a92; display: flex; align-items: center; line-height: 1;
  outline: none;
}
.pw-toggle:hover, .pw-toggle.an { color: #4267b2; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; }

/* ---- Buttons ---- */
.btn-primaer {
  background: #4267b2; color: #fff; border: none; border-radius: 8px;
  padding: 10px 22px; font-weight: 600; cursor: pointer; font: inherit; font-size: 0.9rem;
  transition: background 0.2s;
}
.btn-primaer:hover { background: #5179c8; }
.btn-primaer.voll { width: 100%; margin-top: 16px; }
.btn-sekundaer {
  background: none; border: 1px solid #2a3050; color: #5a6a92; border-radius: 8px;
  padding: 10px 22px; font-weight: 600; cursor: pointer; font: inherit; font-size: 0.9rem;
  text-decoration: none; display: inline-block;
  transition: border-color 0.2s, color 0.2s;
}
.btn-sekundaer:hover { border-color: #4267b2; color: #e2e8f0; }
.btn-sekundaer.klein { padding: 5px 12px; font-size: 0.78rem; font-weight: 500; }
.btn-sekundaer.kopiert { border-color: #4caf8a; color: #4caf8a; }
.link-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }

/* Live-Filter über der Einreichungsliste */
.listen-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.listen-suchfeld { flex: 1; min-width: 200px; }
.listen-select, .listen-datum { flex: 0 0 auto; }
.listen-anzahl { margin-left: auto; white-space: nowrap; }

/* Löschen-Button (Zwei-Klick, kein Popup) */
.zeilen-aktionen { display: flex; gap: 8px; align-items: center; }
.loesch-form { margin: 0; display: inline; }
.loesch-btn {
  border: 1px solid #3a4a70; background: none; color: #8892b0; cursor: pointer;
  border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 0.78rem; line-height: 1;
  white-space: nowrap; transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.loesch-btn:hover { border-color: #d9534f; color: #e06a66; }
.loesch-btn.scharf { border-color: #d9534f; background: #d9534f; color: #fff; font-weight: 600; }

/* ---- Formular-Verwaltung (Fragen bearbeiten) ---- */
.frage-edit {
  border: 1px solid #2a3050; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px;
}
.frage-inaktiv { opacity: 0.55; border-style: dashed; }
.frage-edit-form { display: flex; gap: 10px; align-items: flex-start; }
.frage-edit-form textarea { flex: 1; }
.frage-edit-meta { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.frage-edit-meta .dezent { margin-right: auto; }
.frage-edit-meta .inline-form { margin-left: 0; }

/* ---- Meldungsboxen ---- */
.warnbox {
  background: rgba(241, 196, 15, 0.08); border: 1px solid rgba(241, 196, 15, 0.4);
  color: #e8c964; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 0.9rem;
}
.warnbox a { color: #e8c964; font-weight: 600; }
.okbox {
  background: rgba(76, 175, 138, 0.08); border: 1px solid rgba(76, 175, 138, 0.4);
  color: #4caf8a; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 0.9rem;
}
.fehler-zeile { color: #d9534f; font-size: 0.85rem; margin-bottom: 12px; }
.leer-hinweis { color: #7a8aac; font-size: 0.9rem; }

/* ---- Footer (DEV/LIVE + Version, Markus-Konvention) ---- */
.fuss {
  display: flex; align-items: center; gap: 14px; justify-content: center;
  padding: 14px 24px; color: #5a6a92; font-size: 0.75rem; letter-spacing: 0.03em;
  border-top: 1px solid #2a3050;
}
.env-badge {
  padding: 2px 10px; border-radius: 20px; font-weight: 700; letter-spacing: 0.08em;
}
.env-dev { background: rgba(241, 196, 15, 0.15); color: #e8c964; border: 1px solid rgba(241, 196, 15, 0.5); }
.env-live { background: rgba(76, 175, 138, 0.15); color: #4caf8a; border: 1px solid rgba(76, 175, 138, 0.5); }

/* ---- Login ---- */
.login-body { justify-content: center; align-items: center; }
.login-karte {
  background: #1e2235; border: 1px solid #2a3050; border-radius: 12px;
  padding: 36px 32px; width: 100%; max-width: 380px; margin: auto;
}
.login-karte h1 { margin-bottom: 4px; }
.untertitel { font-size: 0.85rem; color: #5a6a92; letter-spacing: 0.03em; margin-bottom: 24px; }
.login-karte form { display: flex; flex-direction: column; gap: 6px; }
.login-karte input { margin-bottom: 10px; }
.login-fuss { border-top: none; }

@media (max-width: 640px) {
  .formular-reihe { flex-direction: column; align-items: stretch; }
  .inhalt { padding: 20px 14px; }
  .topnav { padding: 8px 12px; }
}
