/* Verwaltung des Rückmelde-Dienstes. Farben, Schrift und Bausteine wie im Prototyp (prototyp/css/basis.css, buero.css).
   Schriften: Kopie aus prototyp/fonts (SIL Open Font License, schrift/OFL.txt). Keine Inline-Stile (CSP). */
[hidden] { display: none !important; }

@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap; src: url('schrift/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url('schrift/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: swap; src: url('schrift/barlow-700.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url('schrift/barlow-semi-condensed-700.woff2') format('woff2'); }

:root {
  --blau: #1F3A6B;
  --blau-900: #142847;
  --blau-700: #2A4C86;
  --blau-100: #E6ECF6;
  --blau-50: #F1F5FB;
  --gelb: #F2B705;
  --gelb-600: #DDA700;
  --gelb-100: #FFF3CC;
  --flaeche: #F4F6F9;
  --text: #1A1F27;
  --text-2: #475164;
  --text-3: #687285;
  --linie: #DCE1E8;
  --linie-2: #EBEEF2;
  --warn: #C2410C;
  --warn-dunkel: #8A2E08;
  --warn-100: #FDEDE4;
  --ok: #1F7A4D;
  --ok-100: #E2F2E9;
  --schatten: 0 1px 2px rgba(20, 40, 71, .06), 0 6px 18px rgba(20, 40, 71, .08);
  --schrift: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --schrift-schmal: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--flaeche);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: var(--blau); }
:focus-visible { outline: 3px solid rgba(242, 183, 5, .7); outline-offset: 2px; }
.tabular, .tabelle td.zahl { font-variant-numeric: tabular-nums; }
.gedimmt { color: var(--text-3); }

/* ---------- Kopfzeile ---------- */
.kopf { position: sticky; top: 0; z-index: 10; background: var(--blau-900); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.kopf__innen { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 24px; min-height: 56px; }
.marke { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: none; }
.marke__zeichen { display: block; border-radius: 7px; }
.marke__wort { font-family: var(--schrift-schmal); font-weight: 700; font-size: 21px; letter-spacing: .07em; text-transform: uppercase; }
.marke__zusatz { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gelb); border: 1px solid rgba(242,183,5,.5); border-radius: 4px; padding: 1px 6px; }
.nav { display: flex; gap: 2px; }
.nav__tab { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 8px; color: rgba(255,255,255,.75); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; }
.nav__tab:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav__tab.aktiv { background: rgba(255,255,255,.13); color: #fff; box-shadow: inset 0 -3px 0 var(--gelb); }
.kopf__stand { margin-left: auto; font-size: 12.5px; color: rgba(255,255,255,.6); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 1320px; margin: 0 auto; padding: 22px 24px 48px; outline: none; }
.laedt { color: var(--text-3); }
.seitenkopf { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.seitenkopf h1 { font-family: var(--schrift-schmal); font-size: 28px; }
.seitenkopf__abstand { flex: 1; }
.seitenkopf__info { font-size: 13px; color: var(--text-3); }

.karte { background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.karte + .karte { margin-top: 14px; }
.karte h2 { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.karte h2 small { font-weight: 600; font-size: 12.5px; color: var(--text-3); }
.karte__hinweis { font-size: 13px; color: var(--text-3); margin: 6px 0 0; }

.raster { display: grid; gap: 14px; align-items: start; }
.raster--zwei { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.raster--detail { grid-template-columns: minmax(0, 1fr) 380px; }

/* ---------- Kennzahlen ---------- */
.kennzahlen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kennzahl { display: block; background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 14px 16px; color: inherit; text-decoration: none; min-width: 0; }
a.kennzahl:hover { border-color: #AFBCCE; box-shadow: 0 4px 14px rgba(20,40,71,.08); }
.kennzahl__titel { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); }
.kennzahl__wert { display: block; font-family: var(--schrift-schmal); font-size: 34px; font-weight: 700; color: var(--blau); line-height: 1.1; margin: 4px 0 2px; }
.kennzahl__wert--klein { font-size: 24px; }
.kennzahl__zusatz { display: block; font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kennzahl--hervor { border-color: var(--gelb); box-shadow: inset 4px 0 0 var(--gelb); }

/* ---------- Kennzeichen ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; white-space: nowrap; background: #EDF0F4; color: var(--text-2); }
.chip--blau { background: var(--blau-100); color: var(--blau); }
.chip--gelb { background: var(--gelb-100); color: #6E5200; }
.chip--gruen { background: var(--ok-100); color: var(--ok); }
.chip--warn { background: var(--warn-100); color: var(--warn); }
.chip--grau { background: #EDF0F4; color: var(--text-2); }
.art { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.art::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--blau); flex: none; }
.art--fehler::before { background: var(--warn); }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 14.5px; line-height: 1.1;
  min-height: 38px; padding: 8px 14px; border-radius: 10px;
  border: 1.5px solid transparent; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:disabled { opacity: .45; }
.btn--gelb { background: var(--gelb); color: var(--text); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.btn--gelb:hover:not(:disabled) { background: var(--gelb-600); }
.btn--blau { background: var(--blau); color: #fff; }
.btn--blau:hover:not(:disabled) { background: var(--blau-700); }
.btn--umriss { background: #fff; border-color: var(--linie); color: var(--text); }
.btn--umriss:hover:not(:disabled) { border-color: #b4bfcd; background: var(--blau-50); }
.btn--gefahr { background: var(--warn); color: #fff; }
.btn--gefahr:hover:not(:disabled) { background: var(--warn-dunkel); }
.btn--gefahr-umriss { background: #fff; border-color: #F0C2AA; color: var(--warn); }
.btn--gefahr-umriss:hover:not(:disabled) { background: var(--warn-100); }
.btn--text { color: var(--blau); padding: 4px 0; min-height: 0; border: 0; }
.btn--text:hover { text-decoration: underline; }
.btn--klein { min-height: 30px; padding: 5px 10px; font-size: 13px; border-radius: 8px; }

/* ---------- Status-Tabelle der Übersicht ---------- */
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle td { padding: 8px 10px; border-bottom: 1px solid var(--linie-2); vertical-align: middle; }
.tabelle th.zahl, .tabelle td.zahl { text-align: right; }
.tabelle tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--linie); }
.tabelle td.zahl a { font-weight: 700; text-decoration: none; padding: 2px 6px; border-radius: 6px; }
.tabelle td.zahl a:hover { background: var(--blau-50); text-decoration: underline; }
.null { color: #B4BCC8; }

/* ---------- Roadmap ---------- */
.rangliste { list-style: none; margin: 0; padding: 0; }
.rangliste li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--linie-2); }
.rangliste li:last-child { border-bottom: 0; }
.rangliste__stimmen { font-family: var(--schrift-schmal); font-size: 22px; font-weight: 700; color: var(--blau); text-align: right; line-height: 1; }
.rangliste__stimmen small { display: block; font-family: var(--schrift); font-size: 11px; font-weight: 600; color: var(--text-3); }
.rangliste a { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rangliste a:hover { color: var(--blau); text-decoration: underline; }

/* ---------- Angaben (Zustand, Detail) ---------- */
.angaben { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 16px; margin: 0; font-size: 14px; }
.angaben dt { color: var(--text-3); font-weight: 600; }
.angaben dd { margin: 0; overflow-wrap: anywhere; }
.angaben dd small { color: var(--text-3); }
.punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #B4BCC8; vertical-align: 1px; }
.punkt--an { background: var(--ok); }
.warnung { color: var(--warn); font-weight: 600; }

/* ---------- Liste ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.segment { display: inline-flex; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 3px; }
.segment button { padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.segment button[aria-pressed="true"] { background: #fff; color: var(--blau); box-shadow: 0 1px 2px rgba(20,40,71,.12); }
.feld { min-height: 38px; border: 1.5px solid var(--linie); border-radius: 10px; padding: 7px 10px; background: #fff; }
.feld:focus { border-color: var(--blau); outline: none; box-shadow: 0 0 0 3px rgba(31,58,107,.12); }
.filter__suche { flex: 1; min-width: 200px; }
.filter__anzahl { font-size: 13px; color: var(--text-3); white-space: nowrap; }

.liste-rahmen { background: #fff; border: 1px solid var(--linie); border-radius: 12px; overflow-x: auto; }
.liste { width: 100%; border-collapse: collapse; font-size: 14px; }
.liste th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; background: #FAFBFC; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.liste td { padding: 10px 12px; border-bottom: 1px solid var(--linie-2); vertical-align: middle; }
.liste tbody tr { cursor: pointer; }
.liste tbody tr:hover { background: var(--blau-50); }
.liste tbody tr:last-child td { border-bottom: 0; }
.liste .nr { font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.liste .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.liste .titel a { color: var(--text); font-weight: 600; text-decoration: none; }
.liste .titel a:hover { color: var(--blau); text-decoration: underline; }
.liste .klein { color: var(--text-2); font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .zeit { white-space: nowrap; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.leer { padding: 28px 16px; text-align: center; color: var(--text-3); }

/* ---------- Detail ---------- */
.zurueck { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 10px; }
.zurueck:hover { text-decoration: underline; }
.detailkopf { margin-bottom: 16px; }
.detailkopf__zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13.5px; color: var(--text-3); }
.detailkopf__nr { font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.detailkopf h1 { font-family: var(--schrift-schmal); font-size: 28px; margin-top: 8px; overflow-wrap: anywhere; }
.fliesstext { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: 15px; }

.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { position: relative; padding: 0 0 14px 22px; }
.verlauf li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--blau); }
.verlauf li::after { content: ''; position: absolute; left: 8px; top: 17px; bottom: 0; width: 1px; background: var(--linie); }
.verlauf li:last-child { padding-bottom: 0; }
.verlauf li:last-child::after { display: none; }
.verlauf li.verlauf--antwort::before { background: var(--gelb); }
.verlauf__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--text-3); }
.verlauf__art { font-weight: 700; color: var(--text); font-size: 13px; }
.verlauf__text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; background: var(--flaeche); border-radius: 8px; padding: 7px 10px; }

.aktion { display: flex; flex-direction: column; gap: 8px; }
.aktion label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.aktion textarea { min-height: 76px; resize: vertical; }
.aktion .feld { width: 100%; }
.aktion__knoepfe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aktion__zustand { font-size: 14px; margin: 0 0 4px; }

/* ---------- Toast und Dialog ---------- */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; max-width: min(560px, calc(100vw - 32px)); background: var(--blau-900); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-weight: 600; font-size: 14px; }
.toast--fehler { background: var(--warn-dunkel); }
.dialog { border: 0; border-radius: 14px; padding: 20px 22px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0,0,0,.3); color: var(--text); }
.dialog::backdrop { background: rgba(20,40,71,.45); }
.dialog h2 { font-size: 18px; margin-bottom: 8px; }
.dialog p { margin: 0 0 16px; color: var(--text-2); }
.dialog__knoepfe { display: flex; justify-content: flex-end; gap: 8px; }
.zugang { max-width: 640px; }
.zugang p { margin-bottom: 10px; }
.zugang__befehl { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--grau-100, #f2f4f7); border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; overflow-wrap: anywhere; user-select: all; }
.zugang__zeile { display: flex; gap: 8px; }
.zugang__zeile .feld { flex: 1; min-width: 0; }
.zugang__hinweis { color: var(--warn-dunkel); font-weight: 600; margin-top: 8px; }
.passkeys, .protokoll { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.passkeys li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--linie); }
.passkeys li span { display: grid; gap: 2px; }
.passkeys small, .protokoll time { color: var(--text-3); font-size: 12.5px; }
.protokoll li { display: grid; grid-template-columns: 180px 1fr; gap: 10px; font-size: 13.5px; }
.klein { font-size: 12.5px; margin-top: 12px; }
.fehlerkasten { background: var(--warn-100); color: var(--warn-dunkel); border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-weight: 600; }

/* ---------- schmale Fenster ---------- */
@media (max-width: 1100px) {
  .kennzahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster--zwei, .raster--detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .kopf__innen { padding: 8px 16px; gap: 10px; min-height: 52px; }
  .marke__wort, .marke__zusatz { display: none; }
  .kopf__stand { font-size: 11.5px; }
  .inhalt { padding: 16px 16px 40px; }
  .seitenkopf h1, .detailkopf h1 { font-size: 24px; }
  .kennzahlen { gap: 10px; }
  .kennzahl { padding: 12px; }
  .kennzahl__wert { font-size: 28px; }
  .kennzahl__wert--klein { font-size: 20px; }
  .karte { padding: 14px; }
  .rangliste a { white-space: normal; }
  .filter { padding: 10px; }
  .filter__suche { min-width: 0; flex-basis: 100%; }
  .filter select { flex: 1; }

  /* Liste als Karten */
  .liste, .liste tbody, .liste tr, .liste td { display: block; }
  .liste { border: 0; background: none; }
  .liste-rahmen { background: none; border: 0; overflow: visible; }
  .liste thead { display: none; }
  .liste tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; background: #fff; border: 1px solid var(--linie); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
  .liste td { padding: 0; border: 0; }
  .liste .titel { order: -1; flex-basis: 100%; font-size: 15px; }
  .liste .klein { max-width: none; }
  .liste .stelle { flex-basis: 100%; }
  .liste td:empty, .liste td.leerfeld { display: none; }
  .liste .stand, .liste .zeit, .liste .zahl, .liste .issue { font-size: 12.5px; color: var(--text-3); text-align: left; }
  .liste .stand::before { content: 'Stand '; }
  .liste .zahl::before { content: 'Stimmen '; }
  .liste tbody tr:last-child td { border: 0; }
}
.hinweis-passkey { background: #fff7e0; border: 1px solid #f2d27a; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.hinweis-passkey p + p { margin-top: 4px; }
