/*
 * Die Pflegeoberfläche.
 *
 * ═══ Wofür sie gestaltet ist ═══
 *
 * Ein Sekretariat, das zwischen zwei Anrufen einen Termin ändert — oft an
 * einem alten Bildschirm, oft mit der Maus, manchmal am Handy. Also: grosse
 * Ziele, hoher Kontrast, keine Bewegung, die etwas verdeckt, und an jeder
 * Stelle sichtbar, was passiert, wenn man drückt.
 *
 * Bewusst KEINE Webschrift. Diese Fläche ist ein Werkzeug, keine Visitenkarte
 * — sie soll auf einem müden Rechner sofort dastehen, nicht 200 ms später mit
 * der richtigen Schrift.
 */

:root {
  --papier: oklch(98.4% 0.005 95);
  --flaeche: oklch(100% 0 0);
  --tinte: oklch(24% 0.015 250);
  --leise: oklch(48% 0.012 250);
  --linie: oklch(89% 0.008 250);
  --tun: oklch(46% 0.11 160);
  --tun-hell: oklch(96% 0.02 160);
  --alarm: oklch(48% 0.15 28);
  --alarm-hell: oklch(96.5% 0.02 28);

  --rand: clamp(1rem, 4vw, 2.5rem);
  --ziel: 2.75rem;
  --rundung: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-thema='hell']) {
    --papier: oklch(19% 0.012 250);
    --flaeche: oklch(23% 0.014 250);
    --tinte: oklch(94% 0.006 250);
    --leise: oklch(72% 0.012 250);
    --linie: oklch(33% 0.014 250);
    --tun: oklch(72% 0.13 160);
    --tun-hell: oklch(28% 0.04 160);
    --alarm: oklch(76% 0.13 28);
    --alarm-hell: oklch(29% 0.05 28);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font: 400 clamp(1rem, 0.97rem + 0.15vw, 1.0625rem)/1.55
        system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--rand);
  border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
}

.marke {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--leise);
}

main { max-width: 54rem; margin: 0 auto; padding: var(--rand); }

h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.15; margin: 0 0 0.4rem; text-wrap: balance; }
h2 { font-size: 1.2rem; margin: 0 0 0.25rem; }

.fuehrung { color: var(--leise); margin: 0 0 1.5rem; max-width: 46ch; }

.tafel {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--rundung);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

label { display: block; font-weight: 600; font-size: 0.9375rem; margin: 1.1rem 0 0.3rem; }
label:first-of-type { margin-top: 0; }

.hinweis-feld { color: var(--leise); font-size: 0.875rem; margin: 0.25rem 0 0; }

input, textarea, select {
  width: 100%;
  min-height: var(--ziel);
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--papier);
  border: 1px solid var(--linie);
  border-radius: 6px;
}

textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }

input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible {
  outline: 3px solid var(--tun);
  outline-offset: 2px;
}

/* Zu lang ist kein Fehler, den man erst beim Speichern erfährt. */
.zuviel { border-color: var(--alarm); }
.zaehler { font-size: 0.8125rem; color: var(--leise); text-align: right; }
.zaehler[data-zuviel] { color: var(--alarm); font-weight: 600; }

button {
  min-height: var(--ziel);
  padding: 0 1.1rem;
  font: inherit;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: inherit;
  cursor: pointer;
}

button:hover:not(:disabled) { border-color: var(--tinte); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.tun { background: var(--tun); border-color: var(--tun); color: var(--papier); }
.tun:hover:not(:disabled) { filter: brightness(1.08); }

.still { border-color: transparent; background: none; color: var(--leise); font-weight: 400; }
.still:hover { color: var(--tinte); }

#anmeldeform button { margin-top: 1.1rem; width: 100%; }

.gesagt { margin: 1rem 0 0; padding: 0.7rem 0.9rem; border-radius: 6px; }
.gesagt:empty { display: none; }
.gesagt { background: var(--tun-hell); }
.gesagt[data-art='alarm'] { background: var(--alarm-hell); color: var(--alarm); }

.reiter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.5rem 0; }
.reiter button[data-aktiv] { background: var(--tinte); border-color: var(--tinte); color: var(--papier); }

.bereichskopf {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.achtung {
  background: var(--alarm-hell);
  color: var(--alarm);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
}

.eintrag {
  border: 1px solid var(--linie);
  border-radius: var(--rundung);
  padding: 1.1rem;
  margin-bottom: 1rem;
  background: var(--flaeche);
}

.eintragskopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--linie);
}

.nummer { font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--leise); }
.werkzeuge { display: flex; gap: 0.3rem; }
.werkzeuge button { min-width: var(--ziel); padding: 0 0.6rem; }
.werkzeuge button[data-weg] { color: var(--alarm); }

.gruppe { margin: 1.75rem 0; }
.gruppe > h2 { padding-bottom: 0.4rem; border-bottom: 2px solid var(--linie); }

.befunde { margin: 0; padding-left: 1.2rem; }
.befunde li { margin: 0.2rem 0; }
.wo { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875rem; color: var(--leise); }

.punkte { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; }
.punkte input { flex: 1; }
