:root {
  /* Wird aus der Konfiguration überschrieben, siehe src/Design.php. */
  --akzent: #1f4e79;
  --akzent-marke: #1f4e79;
  --akzent-dunkel: #17395a;
  --akzent-hell: #eef3f9;
  --auf-akzent: #ffffff;
  --akzent-text: #1f4e79;

  --gruen: #16704a;
  --gruen-hell: #e6f4ec;
  --rot: #a41f18;
  --rot-hell: #fdeceb;
  --gelb: #7a5300;
  --gelb-hell: #fdf3e2;

  --text: #14181d;
  --grau: #4d5865;
  --grau-hell: #6b7684;
  --linie: #e4e8ee;

  --schatten: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px -12px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  background: #f5f7fa;
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------ Kopfzeile */

.fkopf {
  background: var(--akzent); color: var(--auf-akzent);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; padding-top: calc(12px + env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 10;
}
.fkopf-links strong { display: block; font-size: 15.5px; letter-spacing: -.01em; }
.fkopf-links span { font-size: 14px; }
.fkopf-rechts { display: flex; align-items: center; gap: 8px; }

/* Online ist der Normalfall und bleibt zurückhaltend. Offline muss
   auffallen - im Kellergang der Klinik ist das der Zustand, in dem der
   Fahrer wissen muss, dass er auf gespeicherte Daten schaut. */
.netz {
  font-size: 12.5px; font-weight: 700; padding: 5px 13px; border-radius: 999px;
  background: #ffd75e; color: #241a00; white-space: nowrap;
}
.netz.online { background: #fff; color: var(--akzent-text); font-weight: 600; }
.puffer {
  font-size: 12.5px; font-weight: 700; min-width: 26px; text-align: center;
  padding: 4px 10px; border-radius: 999px; background: #e0a300; color: #241a00;
}

/* ------------------------------------------------------------ Struktur */

.seite { padding: 16px; max-width: 640px; margin: 0 auto; }
.block {
  background: #fff; border: 0; border-radius: 16px;
  padding: 20px; margin-bottom: 16px; box-shadow: var(--schatten);
}
.blockkopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.blockkopf h2 { flex: 1; min-width: 0; margin: 0; }
.blockkopf button { flex: 0 0 auto; }

h1 { font-size: 23px; margin: 0 0 16px; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: -.01em; }

.hinweis { font-size: 14.5px; color: var(--grau); }
.hinweis.mitte { text-align: center; }
.fehlertext { color: var(--rot); font-size: 15px; font-weight: 600; }

label { display: block; font-size: 14.5px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password] {
  width: 100%; padding: 15px 14px; font-size: 18px;
  border: 1px solid var(--linie); border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none; border-color: var(--akzent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 20%, transparent);
}

button {
  font: inherit; font-weight: 650; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--linie); background: #fff; color: var(--akzent-text);
  padding: 13px 18px; transition: background .15s, transform .1s, box-shadow .15s;
}
button:active { transform: translateY(1px); }
button.gross { display: block; width: 100%; padding: 18px; font-size: 18.5px; margin-top: 12px; }
button.primaer {
  background: var(--akzent); color: var(--auf-akzent); border-color: var(--akzent);
  box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--akzent) 70%, transparent);
}
button.primaer:active { background: var(--akzent-dunkel); }
button.neben:hover { background: var(--akzent-hell); }
button.klein { padding: 9px 14px; font-size: 14px; border-radius: 999px; }
button:disabled { opacity: .5; }

/* ------------------------------------------------------------ Ampel */

.ampel {
  padding: 32px 20px; text-align: center; border-radius: 18px; margin-bottom: 16px;
  border: 0;
}
.ampel.gut      { background: var(--gruen-hell); box-shadow: inset 0 0 0 2px var(--gruen); }
.ampel.schlecht { background: var(--rot-hell);   box-shadow: inset 0 0 0 2px var(--rot); }
.ampel.warnung  { background: var(--gelb-hell);  box-shadow: inset 0 0 0 2px var(--gelb); }

.ampel-symbol {
  font-size: 46px; line-height: 1; font-weight: 800;
  width: 88px; height: 88px; margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ampel.gut .ampel-symbol      { background: var(--gruen); color: #fff; }
.ampel.schlecht .ampel-symbol { background: var(--rot);   color: #fff; }
.ampel.warnung .ampel-symbol  { background: var(--gelb);  color: #fff; }
.ampel.gut .ampel-text      { color: var(--gruen); }
.ampel.schlecht .ampel-text { color: var(--rot); }
.ampel.warnung .ampel-text  { color: var(--gelb); }
.ampel-text { font-size: 23px; font-weight: 800; margin-top: 16px; letter-spacing: -.02em; }

.station { line-height: 1.35; }
.station .klinik { font-size: 13.5px; color: var(--grau-hell); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.station .bez { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; }
.station .lage { font-size: 17px; color: var(--grau); }

.meldung-hinweis {
  margin-top: 14px; padding: 13px 15px; border-radius: 12px;
  background: var(--gelb-hell); border: 0; border-left: 4px solid var(--gelb);
  color: #5f4100; font-size: 15px;
}

/* ------------------------------------------------------------ Listen */

.sendung {
  border: 1px solid var(--linie); border-radius: 14px; padding: 16px; margin-bottom: 12px;
  background: #fff;
}
.sendung .nr { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 16px; color: var(--grau); }
.sendung .ziel { font-size: 15.5px; }
.sendung .pakete { font-size: 16px; font-weight: 700; margin-top: 6px; }
.sendung.fremd { background: #fbfcfd; border-color: color-mix(in srgb, var(--rot) 22%, #fff); }
.sendung.fremd .ziel { color: var(--rot); font-weight: 700; }
.sendung .station { margin-bottom: 8px; }

.liste { max-height: 52vh; overflow-y: auto; margin: 12px 0; }
.liste button {
  display: block; width: 100%; text-align: left; margin-bottom: 10px;
  border-color: var(--linie); color: inherit; font-weight: 400; padding: 14px 16px;
}
.liste button:hover { background: var(--akzent-hell); }
.liste button strong { display: block; font-size: 17.5px; font-weight: 650; }
.liste button span { font-size: 14px; color: var(--grau); }

/* ------------------------------------------------------------ Scanner */

.scanner-rahmen {
  position: relative; width: 100%; max-width: 640px; margin: 0 auto;
  aspect-ratio: 3 / 4; background: #000; overflow: hidden; border-radius: 18px;
}
#video { width: 100%; height: 100%; object-fit: cover; }
.scanner-ziel {
  position: absolute; inset: 18% 12%; border: 3px solid rgba(255,255,255,.92);
  border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.38);
}
