/* Planungsliste — Layout nach Screenshot 16.33.53 / 16.34.20.
 *
 * Links Optionen, oben die Pflegeleistungen der Kolonne plus Extensivflaechen,
 * darunter der Wochenkalender mit Mo-Fr als Spalten.
 */

.planung {
  display: grid;
  grid-template-columns: 190px 1fr;
  grid-template-rows: minmax(190px, 34%) 1fr;
  grid-template-areas:
    "optionen oben"
    "kalender kalender";
  gap: 6px;
  padding: 6px;
  height: 100%;
  min-height: 0;
}

/* Bei niedrigen Fenstern ragte der Bedienungs-Hinweis aus der Spalte
   heraus und ueberlappte den Kalender. Jetzt scrollt die Spalte. */
.optionen {
  grid-area: optionen;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}
.optionen .gruppe { flex: none; }
.oben     { grid-area: oben; display: grid; grid-template-columns: 1fr 260px; gap: 6px; min-height: 0; }
.kalender { grid-area: kalender; overflow: auto; min-height: 0; }

/* ---------- Optionen ---------- */
.optionen select { width: 100%; margin-bottom: 6px; }
.optionen .knopfreihe { display: flex; gap: 4px; margin-bottom: 4px; }
.optionen .knopfreihe .knopf { flex: 1; }
.optionen .knopf.breit { width: 100%; margin-bottom: 4px; }
.optionen .hinweis ul { margin: 0; padding-left: 16px; color: var(--text-leise); font-size: 11px; }
.optionen .hinweis li { margin-bottom: 2px; }

/* ---------- Obere Listen ---------- */
.oben .gruppe { display: flex; flex-direction: column; min-height: 0; }
.oben .tabellenrahmen { flex: 1; }

tr.positionszeile { background: #fbfdfb; }
tr.positionszeile:hover { background: var(--gruen-hell); }
tr.positionszeile[aria-selected="true"] { background: var(--auswahl); color: #fff; }
tr.positionszeile td { cursor: grab; }
tr.positionszeile .einzug { color: var(--rahmen); }
tr.positionszeile .posnr { font-variant-numeric: tabular-nums; font-weight: 600; }
tr.positionszeile.ueberschritten .posnr { color: var(--warnung); }
tr.positionszeile[aria-selected="true"] .einzug,
tr.positionszeile[aria-selected="true"] .leise { color: #cdd9e8; }
.leise { color: var(--text-leise); font-size: 11.5px; }

/* ---------- Kalender ---------- */
.woche { margin-bottom: 8px; }
.wochenkopf {
  font-size: 11px;
  color: var(--text-leise);
  padding: 1px 3px;
  border-bottom: 1px solid var(--rahmen-hell);
  margin-bottom: 3px;
}
.tage { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }

.tag {
  border: 1px solid var(--rahmen);
  background: var(--feld);
  min-height: 118px;
  display: flex;
  flex-direction: column;
  border-radius: 2px;
}
.tag.ziel { outline: 2px solid var(--gruen); outline-offset: -2px; background: var(--gruen-hell); }
.tag.spanne { background: var(--gruen-hell); }

.tageskopf {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 5px;
  background: linear-gradient(#fbfbfb, #efefef);
  border-bottom: 1px solid var(--rahmen-hell);
  font-size: 11px;
}
.tageskopf .wochentag { color: var(--text-leise); }

.eintraege { flex: 1; padding: 3px; display: flex; flex-direction: column; gap: 3px; }

.eintrag {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 5px;
  padding: 2px 12px 2px 5px;
  border: 1px solid var(--rahmen);
  border-radius: 2px;
  font-size: 11.5px;
  cursor: pointer;
  user-select: none;
  background: #fff;
}
.eintrag .nr { font-variant-numeric: tabular-nums; font-weight: 600; }
.eintrag .adresse { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag .flaechen { font-size: 10px; color: var(--text-leise); letter-spacing: .5px; }

/* Statusfarben — Screenshot 16.34.20 */
.eintrag.geplant       { background: var(--geplant); }
.eintrag.bestaetigt    { background: var(--bestaetigt); }
.eintrag.abgeschlossen { background: var(--abgeschlossen); color: #fff; }
.eintrag.abgeschlossen .flaechen { color: #e2f2e2; }
.eintrag.fortsetzung   { border-left: 3px solid var(--gruen); }

/* Ziehgriff am rechten Rand — zieht den Gang ueber mehrere Tage */
.eintrag .griff {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 10px;
  cursor: ew-resize;
  border-left: 1px dashed rgba(0, 0, 0, .25);
}
.eintrag .griff:hover { background: rgba(0, 0, 0, .08); }

/* ---------- Ziehen ---------- */
.schatten {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  padding: 3px 9px;
  background: var(--gruen);
  color: #fff;
  border-radius: 2px;
  font-size: 11.5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}

/* ---------- Kontextmenue ---------- */
.kontextmenue {
  position: fixed;
  z-index: 70;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--rahmen);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  border-radius: 2px;
  padding: 3px;
}
.kontextmenue button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 4px 9px;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 2px;
}
.kontextmenue button:hover { background: var(--gruen-hell); }

/* Spaltenbreiten der oberen Liste — R/P/B muessen immer sichtbar bleiben,
   sie sind der Stand, auf den Mirco beim Planen schaut. */
.oben .gruppe.wachsend table.liste { table-layout: fixed; }
.oben .gruppe.wachsend th:nth-child(1),
.oben .gruppe.wachsend td:nth-child(1)  { width: 96px; }
.oben .gruppe.wachsend th:nth-child(2),
.oben .gruppe.wachsend td:nth-child(2)  { width: 96px; }
.oben .gruppe.wachsend th:nth-child(3)  { width: auto; }
.oben .gruppe.wachsend th:nth-child(4),
.oben .gruppe.wachsend td:nth-child(4)  { width: 108px; }
.oben .gruppe.wachsend th:nth-child(5),
.oben .gruppe.wachsend td:nth-child(5),
.oben .gruppe.wachsend th:nth-child(6),
.oben .gruppe.wachsend td:nth-child(6),
.oben .gruppe.wachsend th:nth-child(7),
.oben .gruppe.wachsend td:nth-child(7),
.oben .gruppe.wachsend th:nth-child(8),
.oben .gruppe.wachsend td:nth-child(8)  { width: 84px; }
.oben .gruppe.wachsend th:nth-child(9),
.oben .gruppe.wachsend td:nth-child(9)  { width: 54px; }
.oben .gruppe.wachsend th:nth-child(n+10),
.oben .gruppe.wachsend td:nth-child(n+10) { width: 62px; }
.oben .gruppe.wachsend td { text-overflow: ellipsis; }

/* Positionszeilen spannen ueber die Textspalten, behalten aber R/P/B rechts */
tr.positionszeile td:first-child { width: auto; }

/* ---------- Dialoge (Pflegegang Hinweis, E-Mail) ---------- */
.dialoggrund {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, .25);
  display: grid;
  place-items: center;
}
.dialog {
  min-width: 330px;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--rahmen);
  border-radius: 3px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  padding: 10px 12px 12px;
}
.dialog.breit { max-width: 720px; width: 90vw; }
.dialog header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dialog header .luecke { flex: 1; }
.dialog .schliessen {
  border: 0; background: none; font-size: 17px; line-height: 1;
  cursor: pointer; color: var(--text-leise);
}
.dialog p { margin: 4px 0; }
.dialog textarea { width: 100%; font: inherit; }
.dialog .feldzeile { grid-template-columns: 70px 1fr; margin-bottom: 4px; }
.dialog footer { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.dialog footer .luecke { flex: 1; }

table.standtabelle { border-collapse: collapse; margin: 4px 0 6px 12px; }
table.standtabelle td { padding: 1px 10px 1px 0; font-variant-numeric: tabular-nums; }
table.standtabelle tr.ueber td { color: var(--warnung); font-weight: 600; }

td.klickbar { cursor: pointer; }
td.klickbar:hover { text-decoration: underline; }
