/* Wirtschaftsrat — Gestaltung
   Schriftgrade: 11 / 12 / 13 / 14 / 22 px     Abstände: 4 / 8 / 12 / 16 / 24 / 40 px */

:root {
  --blau: #0f2a55;
  --text: #111827;
  --grau: #4b5563;
  --linie: #c9d0da;
  --rand: #aeb7c4;
  --flaeche: #e9edf2;
  --rot: #d43f3f;
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; background: var(--flaeche); color: var(--text);
  font: 14px/1.45 var(--schrift);
}
.wr-seite { max-width: 1180px; margin: 0 auto; padding: 0 24px 64px; }
a { color: var(--blau); }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px; border: 1px solid #9aa5b4; border-radius: 8px;
  background: #fff; color: #1f2937; font: 500 14px/1.2 var(--schrift);
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: #eef2f7; }
.btn:active { transform: translateY(1px); }
.btn-primaer { background: var(--blau); border-color: var(--blau); color: #fff; }
.btn-primaer:hover { background: #18397a; }
.btn-klein { padding: 2px 9px; font-size: 13px; }
.btn-gefahr-rand { border-color: #d36b6b; color: #b42323; }
.btn-gefahr-rand:hover { background: #fdf2f2; }
/* Löschen in Listen: weißes Kreuz auf rotem Grund */
.btn-x {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: var(--rot); color: #fff; font: 600 13px/1 var(--schrift); cursor: pointer;
}
.btn-x:hover { background: #b83030; }

/* ---------- Aktionsleiste ---------- */
.wr-leiste {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  margin: 0 -24px; padding: 12px 24px;
  background: var(--flaeche); border-bottom: 1px solid #c3cad5;
}
.wr-kopf { flex: 1 1 auto; min-width: 0; margin-left: 4px; }
.wr-ueberzeile {
  display: block; font-size: 11px; line-height: 1.2; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--grau); margin-bottom: 4px;
}
.wr-titel {
  display: block; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em;
  color: var(--blau); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wr-abmelden { margin: 0; }
.wr-hinweis { margin: 12px 0 0; font-size: 13px; color: var(--grau); }

.wr-savestate {
  font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px;
}
.wr-savestate:empty { display: none; }
.wr-savestate.is-saving { color: #4b5563; background: #dfe5ed; }
.wr-savestate.is-saved  { color: #17693a; background: #dcf2e4; }
.wr-savestate.is-dirty  { color: #8a5a00; background: #fdf1d6; }
.wr-savestate.is-error  { color: #a12626; background: #fde4e4; }

/* ---------- Abschnitte ---------- */
.wr-abschnitt, .wr-portalkopf h2 {
  font-size: 13px; line-height: 1.3; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blau); margin: 0;
}
.wr-abschnitt { margin: 40px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--blau); }
.wr-portalkopf {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  margin: 40px 0 16px; padding-bottom: 12px; border-bottom: 2px solid var(--blau);
}
.wr-portalkopf h2 { flex: 1 1 12rem; }
.wr-portalkopf .btn { margin-left: auto; }
.wr-statuswahl { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #374151; }
.wr-statuswahl select { width: auto; min-width: 15rem; }

/* ---------- Felder ---------- */
.wr-feld {
  width: 100%; padding: 6px 10px; border: 1px solid var(--rand); border-radius: 8px;
  background: #fff; color: var(--text); font: 14px/1.4 var(--schrift);
}
.wr-feld:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px rgba(15,42,85,0.15); }
.wr-feld:required { border-left: 3px solid #5b7096; }
.wr-feld[readonly] { background: #f3f5f8; color: var(--grau); }
textarea.wr-feld { resize: vertical; line-height: 1.55; }
.wr-feld.wr-ok { border-color: #15803d; box-shadow: 0 0 0 3px rgba(21,128,61,0.18); }
.wr-feld.wr-fehler { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }
.wr-fett { font-weight: 600; }
.wr-blau { color: var(--blau); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blau); }

.wr-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
/* Beschriftung + Feld: feste Beschriftungsspalte = gemeinsame Fluchtlinie */
.wr-zeile { display: grid; grid-template-columns: 9rem minmax(0, 1fr); align-items: start; gap: 0 8px; margin-bottom: 8px; }
.wr-zeile > span:first-child { padding-top: 8px; font-size: 13px; line-height: 1.3; font-weight: 600; color: #1f2937; hyphens: auto; }
.wr-zeile-breit { margin-top: 0; }
.wr-haken { align-items: center; }
.wr-haken > span:first-child { padding-top: 0; }
.wr-haken input { justify-self: start; }
.wr-plzort { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 8px; }
.wr-oben { display: block; margin-top: 8px; }
.wr-oben > span {
  display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: #374151;
}
.wr-fehlerliste {
  margin: 16px 0 0; padding: 10px 14px; border: 1px solid #e8a3a3; border-radius: 8px;
  background: #fdeeee; color: #8f1d1d; font-size: 13px;
}

/* ---------- Tabellen ---------- */
.wr-tabellenrahmen { overflow-x: auto; }
.wr-tabelle {
  width: 100%; border-collapse: separate; border-spacing: 0; background: #fff;
  border: 1px solid #d3d9e1; border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(16,24,40,0.12);
}
.wr-tabelle th {
  padding: 10px 12px; background: #dfe5ed; color: #1f2937; text-align: left; vertical-align: bottom;
  font-size: 12px; line-height: 1.3; font-weight: 600; border-bottom: 1px solid #b9c2ce;
}
.wr-tabelle th a { color: inherit; text-decoration: none; }
.wr-tabelle th a:hover { text-decoration: underline; text-underline-offset: 3px; }
.wr-tabelle td { padding: 6px 12px; vertical-align: middle; border-top: 1px solid #e3e7ed; }
.wr-tabelle tbody tr:first-child td { border-top: 0; }
.wr-tabelle .wr-schmal { width: 1%; white-space: nowrap; text-align: center; }
.wr-tabelle .wr-mitte { text-align: center; }
.wr-tabelle form { margin: 0; }
.wr-leerzeile td { text-align: center; color: #6b7280; font-style: italic; padding: 14px; }
.wr-dateispalte { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: #374151; overflow-wrap: anywhere; }

.wr-uebersicht th.wr-mitte { width: 1%; padding-left: 6px; padding-right: 6px; hyphens: manual; }
.wr-uebersicht td.wr-mitte { padding-left: 6px; padding-right: 6px; }
.wr-uebersicht tbody tr[data-href] { cursor: pointer; }
.wr-uebersicht tbody tr[data-href]:hover { background: #eef2f8; }

/* Portale: feste Spaltenverhältnisse (siehe colgroup); in schmalen Fenstern scrollt die Tabelle im Rahmen */
.wr-portal { table-layout: fixed; min-width: 760px; }
.wr-portal td { padding-left: 8px; padding-right: 8px; }
.wr-portal .wr-feld { padding: 4px 8px; border-radius: 6px; }
.wr-portal .wr-combo > input { padding-right: 30px; }

/* Passbild in Listen: kleines Hochformat */
.wr-avatar { display: block; width: 32px; height: 41px; border-radius: 4px; object-fit: cover; border: 1px solid var(--linie); background: #eef0f3; }
/* … und anklickbar: Klick öffnet die Dateiauswahl */
.wr-avatar-knopf { display: block; margin: 0 auto; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; }
.wr-avatar-knopf:hover .wr-avatar, .wr-avatar-knopf:focus-visible .wr-avatar { outline: 2px solid var(--blau); outline-offset: 1px; }
.wr-avatar-knopf.laedt { opacity: 0.45; cursor: progress; }
/* Kein Foto: graue Kopf-Silhouette (als eingebettete Grafik, keine Zusatzdatei) */
.wr-avatar-leer, .wr-bild-hoch .wr-thumb-leer {
  background: #e9edf2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 41'%3E%3Ccircle cx='16' cy='15.5' r='7.2' fill='%23a9b1be'/%3E%3Cpath d='M2.5 41c0-9.4 5.6-14.6 13.5-14.6S29.5 31.6 29.5 41z' fill='%23a9b1be'/%3E%3C/svg%3E") center bottom / cover no-repeat;
}
.wr-bild-hoch .wr-thumb-leer { border-style: solid; border-color: var(--linie); font-size: 0; }   /* Text „Kein Bild“ entfällt hier */
.wr-bild .wr-thumb { cursor: pointer; }
.wr-bild .wr-thumb:hover { outline: 2px solid var(--blau); outline-offset: 1px; }

/* ---------- Bilder ---------- */
.wr-bilder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.wr-bilder-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wr-bildtitel { margin-bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blau); }
.wr-bild { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid #c3cad5; border-radius: 8px; background: #fff; }
.wr-thumb { display: block; border-radius: 6px; background: #f1f3f6; }
.wr-thumb-leer {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed #b9c2ce; color: #6b7280; font-size: 12px; font-style: italic;
}
.wr-bild-quer .wr-thumb { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }          /* Landesverband: Querformat */
.wr-bild-hoch .wr-thumb { width: 112px; height: 144px; object-fit: cover; }                /* Passbild: Hochformat 7:9 */
.wr-bild-unterschrift .wr-thumb { width: 200px; max-width: 100%; height: 80px; object-fit: contain; background: #fff; }
.wr-dateiname { font-size: 12px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wr-dateiname:empty::before { content: "\00a0"; }   /* Zeile freihalten: Kästen bleiben gleich hoch */
.wr-bildknoepfe { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wr-bildknoepfe input[type="file"] { flex: 1 1 auto; min-width: 0; font: 12px var(--schrift); }

/* ---------- Kombifeld: freier Text + Vorschläge ---------- */
.wr-combo { position: relative; }
.wr-combo > input { padding-right: 32px; }
.wr-combo-btn {
  position: absolute; top: 1px; right: 1px; bottom: 1px; width: 28px; padding: 0;
  border: 0; border-left: 1px solid #d3d9e1; border-radius: 0 7px 7px 0;
  background: #f4f6f9; color: #1f2937; font-size: 12px; cursor: pointer;
}
.wr-combo-btn:hover { background: #e3e9f1; }
.wr-combo-liste {
  position: fixed; z-index: 50; max-height: 260px; overflow: auto; margin: 0; padding: 4px 0;
  list-style: none; background: #fff; border: 1px solid var(--rand); border-radius: 8px;
  box-shadow: 0 8px 20px rgba(16,24,40,0.16);
}
.wr-combo-liste li { padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.wr-combo-liste li:hover, .wr-combo-liste li.ist-aktiv { background: #e6edf7; }
.wr-combo-liste li.ist-aktuell { font-weight: 600; }
.wr-combo-liste li.wr-combo-leer { color: var(--grau); font-style: italic; cursor: default; white-space: normal; max-width: 22rem; }

/* ---------- Löschen klar abgesetzt ---------- */
.wr-gefahr {
  display: flex; align-items: center; gap: 16px; margin-top: 40px; padding-top: 16px;
  border-top: 1px solid var(--linie); font-size: 13px; color: var(--grau);
}

/* ---------- Übersicht ---------- */
.wr-legende { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 16px 0; font-size: 13px; color: #374151; }
.wr-legende-sektionen { margin-top: -8px; font-size: 12px; color: var(--grau); }
.wr-legende-sektionen strong { font-weight: 600; color: #374151; }
.wr-suche { display: flex; gap: 8px; margin-bottom: 16px; }
.wr-leerseite { margin: 64px 0; text-align: center; font-size: 15px; color: var(--grau); }

/* ---------- Meldungen ---------- */
.wr-meldungen { position: fixed; top: 12px; right: 12px; z-index: 60; display: grid; gap: 8px; max-width: 26rem; }
.wr-meldung { padding: 10px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--linie); box-shadow: 0 6px 16px rgba(16,24,40,0.14); font-size: 13px; }
.wr-meldung-success { border-color: #9fd3b1; background: #e9f7ee; color: #17693a; }
.wr-meldung-error { border-color: #e8a3a3; background: #fdeeee; color: #8f1d1d; }

/* ---------- Anmeldung ---------- */
.wr-anmeldeseite { background: var(--blau); }
.wr-anmeldung {
  max-width: 24rem; margin: 12vh auto 0; padding: 32px; border-radius: 12px; background: #fff;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}
.wr-anmeldung h1 { margin: 0 0 16px; font-size: 22px; font-weight: 600; color: var(--blau); }
.wr-anmeldung .btn { width: 100%; margin-top: 24px; padding: 9px 12px; }
.wr-anmeldung .wr-fehlerliste { margin: 0 0 8px; }

/* ---------- Schmale Fenster ---------- */
@media (max-width: 860px) {
  /* Übersicht: weniger Polster, damit alle Spalten Platz haben */
  .wr-uebersicht th, .wr-uebersicht td { padding-left: 6px; padding-right: 6px; }
  .wr-uebersicht th.wr-mitte, .wr-uebersicht td.wr-mitte { padding-left: 2px; padding-right: 2px; }
  .wr-uebersicht .btn-klein { padding: 2px 7px; }
  .wr-bilder { gap: 16px; }
}
@media (max-width: 760px) {
  .wr-spalten { grid-template-columns: minmax(0, 1fr); }
  .wr-bilder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wr-titel { font-size: 18px; }
}
@media (max-width: 520px) {
  .wr-seite { padding: 0 12px 48px; }
  .wr-leiste { margin: 0 -12px; padding: 8px 12px; flex-wrap: wrap; }
  .wr-bilder, .wr-bilder-2 { grid-template-columns: minmax(0, 1fr); }
  .wr-zeile { grid-template-columns: 1fr; }
  .wr-zeile > span:first-child { padding-top: 0; }
}
