:root {
  --akzent: #0f6e68;
  --akzent-hell: #e3f1ef;
  --grund: #3b82c4;
  --grund-hell: #e4eff9;
  --behandlung: #c2410c;
  --behandlung-hell: #fdeee6;
  --text: #1f2933;
  --gedaempft: #5f6b76;
  --linie: #dde3e8;
  --flaeche: #ffffff;
  --hintergrund: #f4f6f8;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

h1 { margin: 0; font-size: 1.5rem; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gedaempft); margin: 1.5rem 0 .75rem; }

button, input, select { font: inherit; }

button {
  border: 1px solid var(--linie);
  background: var(--flaeche);
  border-radius: 8px;
  padding: .5rem .9rem;
  cursor: pointer;
}
button:hover { border-color: var(--akzent); }
button.primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
button.primaer:hover { filter: brightness(1.1); }
button.klein { padding: 0 .45rem; margin-left: auto; color: var(--gedaempft); border: none; font-size: 1.1rem; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--akzent); outline-offset: 1px; }

.kopf {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  padding: 1.25rem clamp(1rem, 3vw, 2rem);
  background: var(--flaeche);
  border-bottom: 3px solid var(--akzent);
}
.untertitel { margin: .15rem 0 0; color: var(--gedaempft); }
.aktionen { display: flex; flex-wrap: wrap; gap: .5rem; }

.hinweis {
  margin: 1rem clamp(1rem, 3vw, 2rem) 0;
  padding: .6rem 1rem;
  background: var(--akzent-hell);
  border-radius: var(--radius);
  font-size: .9rem;
}

.kennzahlen {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem;
  margin: 1rem clamp(1rem, 3vw, 2rem) 0;
}
.kennzahlen div {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .75rem 1rem; display: flex; align-items: baseline; gap: .5rem;
}
.kennzahlen span { font-size: 1.6rem; font-weight: 700; color: var(--akzent); }
.kennzahlen small { color: var(--gedaempft); }

.raster {
  display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem;
  padding: 0 clamp(1rem, 3vw, 2rem) 2rem;
}

#einsatz-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }

.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: .7rem .8rem; display: grid; gap: .35rem;
}
.karte.offen { border-left: 4px solid #d97706; }
.karte-kopf { display: flex; align-items: center; gap: .5rem; }
.karte select { width: 100%; padding: .35rem; border-radius: 6px; border: 1px solid var(--linie); }
.meta { font-size: .85rem; color: var(--gedaempft); }
.notiz { font-size: .85rem; font-style: italic; }

.chip { font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.chip.grund { background: var(--grund-hell); color: var(--grund); }
.chip.behandlung { background: var(--behandlung-hell); color: var(--behandlung); }

.neu { margin-top: 1rem; background: var(--flaeche); border: 1px dashed var(--linie); border-radius: var(--radius); padding: .6rem .8rem; }
.neu summary { cursor: pointer; font-weight: 600; color: var(--akzent); }
.neu form { display: grid; gap: .55rem; margin-top: .75rem; }
.neu label { display: grid; gap: .2rem; font-size: .85rem; color: var(--gedaempft); }
.neu input, .neu select { padding: .4rem; border: 1px solid var(--linie); border-radius: 6px; color: var(--text); }
.zeile { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.fehler { color: var(--behandlung); margin: 0; font-size: .85rem; min-height: 1em; }

/* Zeitstrahl */
.zeitachse { position: relative; height: 1.4rem; margin-left: 200px; font-size: .75rem; color: var(--gedaempft); }
.zeitachse span { position: absolute; transform: translateX(-50%); }

.zeile-tour {
  display: grid; grid-template-columns: 200px 1fr; align-items: stretch;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  margin-bottom: .6rem; overflow: hidden;
}
.person { padding: .6rem .8rem; display: grid; gap: .15rem; border-right: 1px solid var(--linie); }
.person small { color: var(--gedaempft); font-size: .78rem; }
.balken { height: 6px; background: var(--linie); border-radius: 3px; overflow: hidden; margin-top: .3rem; }
.balken div { height: 100%; background: var(--akzent); }

.spur {
  position: relative; min-height: 76px;
  background-image: repeating-linear-gradient(to right, var(--linie) 0 1px, transparent 1px calc(100% / 8));
}
.schicht { position: absolute; top: 0; bottom: 0; background: var(--akzent-hell); opacity: .6; }
.block {
  position: absolute; top: 14px; bottom: 14px; border-radius: 6px;
  padding: 0 .35rem; display: flex; align-items: center; overflow: hidden;
  font-size: .78rem; color: #fff; white-space: nowrap; cursor: default;
}
.block.grund { background: var(--grund); }
.block.behandlung { background: var(--behandlung); }
.druckliste { display: none; }

.warnungen { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.warnungen li {
  background: #fff7ed; border-left: 4px solid #d97706; padding: .5rem .8rem; border-radius: 6px; font-size: .9rem;
}
.warnungen li.ok { background: var(--akzent-hell); border-left-color: var(--akzent); }

.legende { margin-top: 1rem; font-size: .85rem; color: var(--gedaempft); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

footer { text-align: center; color: var(--gedaempft); font-size: .8rem; padding: 1rem; }

@media (max-width: 860px) {
  .raster { grid-template-columns: minmax(0, 1fr); }
  .kennzahlen { grid-template-columns: 1fr; }
  .zeitachse { display: none; }
  .zeile-tour { grid-template-columns: minmax(0, 1fr); }
  .person { border-right: none; border-bottom: 1px solid var(--linie); }
  .block span { display: none; }
}

/* Ausdruck: je Pflegekraft eine Tourenliste */
@media print {
  .aktionen, .hinweis, .einsaetze, .kennzahlen, .zeitachse, .spur, .legende, footer, .balken { display: none !important; }
  body { background: #fff; }
  .raster { display: block; padding: 0; }
  .zeile-tour { display: block; break-inside: avoid; border: 1px solid #999; }
  .druckliste { display: block; margin: 0; padding: .5rem 2rem 1rem; }
}
