:root {
  /* Diese vier Werte überschreibt die Anwendung aus der Konfiguration
     (siehe src/Design.php). Hier stehen nur die Voreinstellungen. */
  --akzent: #1f4e79;
  --akzent-dunkel: #17395a;
  --akzent-hell: #eef3f9;
  --auf-akzent: #ffffff;
  --akzent-text: #1f4e79;
  --gruen: #1c7a43;
  --gruen-hell: #e7f5ec;
  --rot: #b3261e;
  --rot-hell: #fdecea;
  --gelb: #8a6100;
  --gelb-hell: #fdf4e0;
  --rand: #d3dae2;
  --text: #1a1a1a;
  --grau: #5c6873;
  --flaeche: #ffffff;
  --hintergrund: #f4f6f9;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--hintergrund);
}

/* ---------------------------------------------------------- Kopf */

.kopf { background: var(--akzent); color: var(--auf-akzent); }
.kopf-innen {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 26px; min-height: 58px; flex-wrap: wrap;
}
.marke { color: var(--auf-akzent); text-decoration: none; font-weight: 700; font-size: 17px; line-height: 1.2; display: flex; align-items: center; gap: 10px; }
.marke span { display: block; font-weight: 400; font-size: 12px; opacity: .8; }
.marke img { height: 32px; width: auto; display: block; background: #fff; border-radius: 4px; padding: 3px 5px; }
.anmeldekarte img.logo { max-height: 54px; width: auto; margin-bottom: 14px; }
.kopf nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.kopf nav a {
  color: var(--auf-akzent); opacity: .78; text-decoration: none; padding: 7px 12px;
  border-radius: var(--radius); font-size: 14px;
}
.kopf nav a:hover { background: color-mix(in srgb, var(--auf-akzent) 14%, transparent); opacity: 1; }
.kopf nav a.an { background: color-mix(in srgb, var(--auf-akzent) 22%, transparent); opacity: 1; font-weight: 600; }
.abmelden { display: flex; align-items: center; gap: 10px; margin: 0; }
.wer { font-size: 13px; opacity: .85; }
.abmelden button {
  background: transparent; border: 1px solid color-mix(in srgb, var(--auf-akzent) 45%, transparent);
  color: var(--auf-akzent); padding: 5px 11px; border-radius: var(--radius); cursor: pointer; font-size: 13px;
}
.abmelden button:hover { background: color-mix(in srgb, var(--auf-akzent) 16%, transparent); }

main { max-width: 1120px; margin: 0 auto; padding: 24px 20px 56px; }

.fuss {
  max-width: 1120px; margin: 0 auto; padding: 0 20px 32px;
  color: var(--grau); font-size: 12px;
}

/* ---------------------------------------------------------- Typografie */

h1 { font-size: 23px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
h3 { font-size: 15px; margin: 18px 0 6px; }
.unter { color: var(--grau); margin: 0 0 22px; }
.klein { font-size: 13px; color: var(--grau); }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }

/* ---------------------------------------------------------- Flaechen */

.karte {
  background: var(--flaeche); border: 1px solid var(--rand);
  border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
}
.karte > h2:first-child, .karte > h3:first-child { margin-top: 0; }

.raster { display: grid; gap: 18px; }
@media (min-width: 860px) {
  .raster.zwei { grid-template-columns: 1.15fr .85fr; align-items: start; }
}

.kennzahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kennzahl { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 14px 16px; }
.kennzahl .wert { font-size: 27px; font-weight: 700; color: var(--akzent-text); line-height: 1.1; }
.kennzahl .titel { font-size: 13px; color: var(--grau); margin-top: 2px; }
.kennzahl.warnung .wert { color: var(--rot); }

/* ---------------------------------------------------------- Meldungen */

.meldung {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px;
  border: 1px solid var(--rand); background: var(--flaeche); font-size: 14px;
}
.meldung.erfolg  { background: var(--gruen-hell); border-color: #b6ddc5; color: #10502c; }
.meldung.fehler  { background: var(--rot-hell);   border-color: #f0bdb8; color: #8c1c16; }
.meldung.hinweis { background: var(--gelb-hell);  border-color: #e8d59c; color: #6b4b00; }
.meldung.info    { background: var(--akzent-hell); border-color: color-mix(in srgb, var(--akzent) 25%, #fff); color: var(--akzent-text); }

/* ---------------------------------------------------------- Formulare */

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--rand);
  border-radius: var(--radius); font: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--akzent); outline-offset: 1px; border-color: var(--akzent);
}
.feld { margin-bottom: 14px; }
.felder { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.scanfeld { font-family: ui-monospace, Consolas, monospace; font-size: 19px; letter-spacing: .04em; }

button, .knopf {
  display: inline-block; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--akzent); background: var(--akzent); color: var(--auf-akzent);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
}
button:hover, .knopf:hover { background: var(--akzent-dunkel); border-color: var(--akzent-dunkel); }
.knopf.neben, button.neben {
  background: #fff; color: var(--akzent-text); border-color: var(--akzent-text);
}
.knopf.neben:hover, button.neben:hover { background: var(--akzent-hell); }
.knopf.klein, button.klein { padding: 6px 12px; font-size: 13px; }
.knopfreihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------- Tabellen */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--grau); font-weight: 700; }
tbody tr:hover { background: #fafbfd; }
td.zahl, th.zahl { text-align: right; }
.tabellen-huelle { overflow-x: auto; }

.marke-status {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.marke-status.offen      { background: var(--gelb-hell); color: var(--gelb); }
.marke-status.zugestellt { background: var(--gruen-hell); color: var(--gruen); }
.marke-status.abweichung { background: var(--rot-hell); color: var(--rot); }

/* ---------------------------------------------------------- Protokoll */

.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li {
  position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--rand);
}
.verlauf li:last-child { border-left-color: transparent; padding-bottom: 0; }
.verlauf li::before {
  content: ""; position: absolute; left: -7px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--akzent); border: 2px solid #fff;
}
.verlauf li.abweichung::before { background: var(--rot); }
.verlauf .zeit { font-size: 12px; color: var(--grau); }
.verlauf .was { font-weight: 600; }
.verlauf .detail { font-size: 13px; color: var(--grau); }

/* ---------------------------------------------------------- Anmeldung */

.anmeldeseite {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--akzent); padding: 20px;
}
.anmeldekarte {
  background: #fff; border-radius: 12px; padding: 32px; width: 100%; max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.anmeldekarte h1 { font-size: 21px; margin-bottom: 2px; }
.anmeldekarte button { width: 100%; margin-top: 6px; }

/* ---------------------------------------------------------- Druck */

.druckseite { font-family: system-ui, sans-serif; padding: 12mm; color: #000; background: #fff; }
.druckhinweis { background: var(--akzent-hell); border: 1px solid #c3d5e8; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.scanliste { width: 100%; border-collapse: collapse; }
.scanliste td { border-bottom: 1px solid #bbb; padding: 4mm 2mm; vertical-align: middle; }
.scanliste .bez { font-size: 13pt; font-weight: 700; }
.scanliste .zusatz { font-size: 10pt; color: #333; }
.scanliste .code { text-align: right; }

.schild {
  border: 2px solid #000; border-radius: 4mm; padding: 8mm;
  width: 92mm; margin: 0 4mm 6mm 0; display: inline-block; vertical-align: top;
  text-align: center; page-break-inside: avoid; break-inside: avoid;
}
.schild .klinik { font-size: 11pt; text-transform: uppercase; letter-spacing: .06em; }
.schild .bez { font-size: 20pt; font-weight: 800; line-height: 1.15; margin: 2mm 0; }
.schild .ort { font-size: 12pt; margin-bottom: 4mm; }
.schild canvas, .schild img { width: 46mm; height: 46mm; image-rendering: pixelated; }
.schild .fuss { font-size: 8pt; color: #333; margin-top: 3mm; }

@media print {
  .kopf, .fuss, .nicht-drucken { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .druckseite { padding: 0; }
}
