/* RS-Abrechnung — Oberfläche in der physio+-CI (Farben/Schriften wie im Rezeption-Tool).
 *
 * ⚠ KONTRAST-REGELN AUS DER CI:
 *   · Anthrazit ist die Textfarbe, nicht Schwarz. Auf hellen Flächen immer Anthrazit.
 *   · Nie weißer Text auf Physio-Grün oder Physio-Blau (zu wenig Kontrast) — dafür Tiefblau
 *     bzw. Grün-Dunkel als Fläche.
 *   · Koralle nur als Signalfläche; für kleine Schrift und Knöpfe Koralle-Dunkel #B03A28.
 * ⚠ JEDER Knopf setzt seine Schriftfarbe ausdrücklich (sonst färbt eine allgemeine Regel
 *   Sonderknöpfe mit — GF-Assistenz-Learning).
 * ⚠ Keine style-Attribute im HTML: die Content-Security-Policy verbietet sie.
 */

@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/poppins-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/poppins-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/mulish-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/mulish-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Mulish'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/mulish-latin-700-normal.woff2') format('woff2'); }

:root {
  --blau: #2DAAE1;
  --gruen: #9BBF17;
  --anthrazit: #24333B;
  --tiefblau: #14536B;
  --gruen-dunkel: #6F8C10;
  --gruen-hell: #EAF2CE;
  --nebel: #EAF6FC;
  --koralle-dunkel: #B03A28;
  --koralle-hell: #FBE4DF;
  --gelb-hell: #FFF4D6;
  --gelb-dunkel: #7A5600;
  --weiss: #FFFFFF;

  --text: var(--anthrazit);
  --text-leise: #5A6B73;
  --rand: #CBD8DE;
  --radius: 14px;
  --radius-klein: 10px;
  --schatten: 0 1px 2px rgba(36, 51, 59, .06), 0 4px 16px rgba(36, 51, 59, .06);
  --font-head: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-text: 'Mulish', system-ui, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font-text); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--nebel); overflow-wrap: break-word;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .6rem; color: var(--anthrazit); }
h1 { font-size: 1.45rem; font-weight: 800; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; margin-top: 1rem; }
p { margin: 0 0 .7rem; }
a { color: var(--tiefblau); }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 2px; border-radius: 4px; }
.versteckt { display: none !important; }
.leise { color: var(--text-leise); }
.klein { font-size: .85rem; }
.sprungmarke { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--weiss); padding: .5rem 1rem; }
.sprungmarke:focus { left: 1rem; }

/* ---------------------------------------------------------------- Rahmen */
.kopf { background: var(--weiss); border-bottom: 1px solid var(--rand); position: sticky; top: 0; z-index: 10; }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: .6rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.marke { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; color: var(--tiefblau); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1; }
nav a, .wer a { color: var(--anthrazit); text-decoration: none; padding: .45rem .75rem; border-radius: 999px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
nav a:hover, .wer a:hover { background: var(--nebel); }
nav a.aktiv, .wer a.aktiv { background: var(--tiefblau); color: var(--weiss); }
.wer { display: flex; align-items: center; gap: .5rem; }
.nur-admin { display: none !important; }
body.admin .nur-admin { display: inline-flex !important; }
.inhalt { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.inhalt:focus { outline: none; }
.inhalt.beschaeftigt { cursor: progress; }
.fuss { max-width: 1200px; margin: 0 auto; padding: 0 1rem 2rem; font-size: .8rem; color: var(--text-leise); }

.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.karte {
  background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten);
  padding: 1.1rem 1.25rem; margin-bottom: 1rem;
}
.karte.schmal { width: min(420px, 100%); }
.karte.warnung { background: var(--gelb-hell); }
.titelzeile { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.titelzeile h1, .titelzeile h2 { margin: 0; }
.spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1rem; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kachel {
  background: var(--weiss); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1rem 1.25rem;
  text-decoration: none; color: var(--anthrazit); display: flex; flex-direction: column;
}
.kachel .zahl { font-family: var(--font-head); font-size: 2rem; font-weight: 800; color: var(--tiefblau); line-height: 1.1; }
.kachel:hover { outline: 2px solid var(--blau); }

/* ---------------------------------------------------------------- Formulare */
label { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .92rem; margin-bottom: .6rem; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--anthrazit); background: var(--weiss);
  border: 1px solid #9FB6C0; border-radius: var(--radius-klein); padding: .5rem .65rem; min-height: 44px; width: 100%;
}
textarea { min-height: auto; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: #F3F6F7; color: var(--anthrazit); }
input.kurz { width: 6rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.formular { display: flex; flex-direction: column; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1rem; }
.zeile { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; }
.zeile label { margin-bottom: .4rem; }
.zeile .breit { flex: 1 1 260px; }
.kurz-feld { max-width: 240px; }
.filter { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; }
.filter label { flex: 1 1 220px; margin: 0; }

/* Checkboxen: ganze Zeile ist Trefferfläche, mind. 44 px hoch (Rezeption-Learning). */
.haken { flex-direction: row; align-items: center; gap: .65rem; min-height: 44px; font-weight: 400; cursor: pointer; margin: 0; padding: .2rem .25rem; border-radius: 8px; }
.haken:hover { background: var(--nebel); }
.haken input { width: 1.25rem; height: 1.25rem; min-height: 0; flex: none; accent-color: var(--tiefblau); }
.haken-liste { display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- Knöpfe */
.knopf {
  font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .5rem 1rem; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 2px solid var(--tiefblau); background: var(--weiss); color: var(--tiefblau);
}
.knopf:hover { background: var(--nebel); color: var(--tiefblau); }
.knopf.haupt { background: var(--tiefblau); color: var(--weiss); }
.knopf.haupt:hover { background: #0F4155; color: var(--weiss); }
.knopf.gruen { background: var(--gruen-dunkel); border-color: var(--gruen-dunkel); color: var(--weiss); }
.knopf.gruen:hover { background: #5A720C; color: var(--weiss); }
.knopf.gefahr { background: var(--weiss); border-color: var(--koralle-dunkel); color: var(--koralle-dunkel); }
.knopf.gefahr:hover { background: var(--koralle-hell); color: var(--koralle-dunkel); }
.knopf.leise { border-color: transparent; background: transparent; color: var(--tiefblau); }
.knopf.leise:hover { background: var(--nebel); color: var(--tiefblau); }
.knopf.klein { min-height: 36px; padding: .25rem .75rem; font-size: .88rem; }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.knopfleiste { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }

/* ---------------------------------------------------------------- Tabellen */
.tabelle-rahmen { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabelle th, .tabelle td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
.tabelle thead th { font-family: var(--font-head); font-weight: 700; font-size: .82rem; background: var(--nebel); white-space: nowrap; }
.tabelle tfoot th { border-top: 2px solid var(--anthrazit); border-bottom: 0; }
.tabelle .zahl { text-align: right; white-space: nowrap; }
.tabelle.zeitraeume input { min-width: 9.5rem; }
.tabelle.zeitraeume input.kurz { min-width: 0; width: 5.5rem; text-align: right; }
.tabelle td.fehlt { color: var(--koralle-dunkel); font-weight: 700; }

/* ---------------------------------------------------------------- Status & Meldungen */
.plakette {
  display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--nebel); color: var(--tiefblau); white-space: nowrap;
}
.plakette.offen { background: var(--nebel); color: var(--tiefblau); }
.plakette.abgeschlossen, .plakette.ok { background: var(--gruen-hell); color: #4F650A; }
.plakette.abgerechnet { background: #E3E8EA; color: var(--anthrazit); }
.plakette.fehler, .plakette.storno { background: var(--koralle-hell); color: var(--koralle-dunkel); }
.plakette.warnung { background: var(--gelb-hell); color: var(--gelb-dunkel); }
h1 .plakette { vertical-align: middle; font-family: var(--font-text); }

.meldung { padding: .6rem .8rem; border-radius: var(--radius-klein); margin: 0 0 .7rem; }
.meldung.fehler { background: var(--koralle-hell); color: var(--koralle-dunkel); font-weight: 600; }
.meldung.warnung { background: var(--gelb-hell); color: var(--gelb-dunkel); }
.meldung.info { background: var(--weiss); border-left: 4px solid var(--blau); box-shadow: var(--schatten); }
.meldung.ok { background: var(--gruen-hell); color: #4F650A; font-weight: 600; }
.meldungen { margin: 0 0 .6rem; padding-left: 1.2rem; }
.meldungen li { margin-bottom: .25rem; }
.meldungen.fehler li { color: var(--koralle-dunkel); font-weight: 600; }
.meldungen.warnung li { color: var(--gelb-dunkel); }
.pruefung:empty { display: none; }

.liste { list-style: none; padding: 0; margin: 0; }
.liste li { padding: .5rem 0; border-bottom: 1px solid var(--rand); display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: center; }
.liste li:last-child { border-bottom: 0; }

dl.angaben { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 .5rem; }
dl.angaben dt { color: var(--text-leise); }
dl.angaben dd { margin: 0; }

details { border-top: 1px solid var(--rand); padding: .4rem 0; }
details:first-of-type { border-top: 0; }
summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
details > form { padding: .5rem 0 .25rem; }
.neu-satz { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rand); align-items: end; }

.geheimnis { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rand); }
.schluessel { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; font-weight: 700; letter-spacing: .05em; background: var(--nebel); padding: .6rem .8rem; border-radius: var(--radius-klein); user-select: all; }

.toast {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 50;
  max-width: min(640px, calc(100% - 2rem)); padding: .75rem 1.1rem; border-radius: var(--radius-klein);
  box-shadow: 0 8px 24px rgba(36, 51, 59, .25); background: var(--anthrazit); color: var(--weiss); font-weight: 600;
}
.toast.fehler { background: var(--koralle-dunkel); color: var(--weiss); }
.toast.warnung { background: var(--gelb-hell); color: var(--gelb-dunkel); border: 1px solid #E5C76B; }

@media (max-width: 640px) {
  .kopf { position: static; }
  .karte { padding: .9rem; }
  .tabelle { font-size: .85rem; }
}
