/* CXA-Baukasten · planung.css  (Woche, Disposition, Monat aus planung*.js) */

.cxa-pl { --pl-rand: var(--cxa-linie); --pl-zart: var(--cxa-linie-zart); --pl-achse: 52px; }

/* ── Kopfleiste ─────────────────────────────────────────────────────────── */
.cxa-pl-leiste { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.cxa-pl-blaettern { display: flex; gap: 4px; }
.cxa-pl-blaettern .cxa-icon { width: 16px; height: 16px; }
.cxa-pl-zeitraum { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cxa-pl-zeitraum b { font-size: var(--cxa-t-gross); font-weight: 750; }
.cxa-pl-zeitraum span { color: var(--cxa-text-2); font-size: var(--cxa-t-klein); }

/* Tag-Reiter nur auf dem Handy */
.cxa-pl-tage { display: none; }

/* ── Gemeinsam: Eintraege ───────────────────────────────────────────────── */
.cxa-pl-eintrag {
  --pl-ton: var(--cxa-marke); --pl-grund: var(--cxa-marke-hell);
  position: relative; background: var(--pl-grund); color: var(--cxa-text);
  border-left: 3px solid var(--pl-farbe, var(--pl-ton)); border-radius: var(--cxa-radius);
  font-size: 12px; line-height: 1.3; cursor: grab; user-select: none; -webkit-user-select: none;
  touch-action: pan-x pan-y; outline-offset: 1px; overflow: hidden;
}
.cxa-pl-eintrag:hover { box-shadow: var(--cxa-schatten); }
.cxa-pl-eintrag:focus-visible { outline: 2px solid var(--cxa-akzent); }
.cxa-pl-eintrag.ton-info { --pl-ton: var(--cxa-info); --pl-grund: var(--cxa-info-hell); }
.cxa-pl-eintrag.ton-ok { --pl-ton: var(--cxa-ok); --pl-grund: var(--cxa-ok-hell); }
.cxa-pl-eintrag.ton-warn { --pl-ton: var(--cxa-warn); --pl-grund: var(--cxa-warn-hell); }
.cxa-pl-eintrag.ton-fehler { --pl-ton: var(--cxa-fehler); --pl-grund: var(--cxa-fehler-hell); }
.cxa-pl-eintrag.ton-akzent { --pl-ton: var(--cxa-akzent); --pl-grund: var(--cxa-akzent-hell); }
.cxa-pl-eintrag.ton-neutral {
  --pl-ton: var(--cxa-text-3); --pl-grund: var(--cxa-flaeche-2);
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(16, 28, 45, .05) 6px 12px);
}
.cxa-pl-eintrag.konflikt { box-shadow: inset 0 0 0 1.5px var(--cxa-fehler); }
.cxa-pl-eintrag.konflikt:not(.balken) { padding-right: 17px; }
.cxa-pl-eintrag .pl-zeit { display: block; font-size: 11px; font-weight: 650; color: var(--cxa-text-2); font-variant-numeric: tabular-nums; }
.cxa-pl-eintrag .pl-titel { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.cxa-pl-eintrag .pl-unter { display: block; color: var(--cxa-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cxa-pl-warn { position: absolute; top: 3px; right: 3px; color: var(--cxa-fehler); line-height: 0; }
.cxa-pl-warn .cxa-icon { width: 13px; height: 13px; }
.cxa-pl-eintrag.cxa-zieht { opacity: .35; }
.cxa-pl-eintrag.cxa-bereit { box-shadow: var(--cxa-schatten-2); outline: 2px solid var(--cxa-akzent); }
.cxa-pl-eintrag.cxa-geist { cursor: grabbing; box-shadow: var(--cxa-schatten-3); opacity: .92; }
.cxa-pl-eintrag.chip { padding: 4px 6px; }
.cxa-pl-eintrag.chip .pl-titel { white-space: nowrap; }
.cxa-pl-eintrag.weiter-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cxa-pl-eintrag.weiter-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cxa-pl-mehr {
  font: inherit; font-size: 11.5px; font-weight: 650; color: var(--cxa-text-2); background: none; border: 0;
  padding: 2px 4px; border-radius: var(--cxa-radius); cursor: pointer; text-align: left;
}
.cxa-pl-mehr:hover { background: var(--cxa-flaeche-2); color: var(--cxa-text); }
.cxa-pl-leer { color: var(--cxa-text-3); font-size: var(--cxa-t-klein); padding: 10px 2px; }

/* ── Gitter (Woche und Disposition) ─────────────────────────────────────── */
.cxa-pl-huelle { overflow-x: auto; border: 1px solid var(--pl-rand); border-radius: var(--cxa-radius-gr); background: var(--cxa-flaeche); }
.cxa-pl-gitter { display: grid; }
.cxa-pl-ecke, .cxa-pl-kopf {
  position: sticky; top: 0; z-index: 3; background: var(--cxa-flaeche);
  border-bottom: 1px solid var(--pl-rand); padding: 8px 10px;
}
.cxa-pl-kopf { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; border-left: 1px solid var(--pl-zart); }
.cxa-pl-kopf .wt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cxa-text-3); }
.cxa-pl-kopf b { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cxa-pl-kopf .ft { flex-basis: 100%; font-size: 11px; color: var(--cxa-warn-text); font-weight: 600; }
.cxa-pl-kopf .std { margin-left: auto; font-size: 11px; color: var(--cxa-text-3); font-variant-numeric: tabular-nums; }
.cxa-pl-kopf.heute b { color: var(--cxa-auf-marke); background: var(--cxa-akzent); border-radius: 999px; padding: 0 7px; }
.cxa-pl-kopf.frei { background: var(--cxa-grund); }
.cxa-ueber.cxa-pl-band, .cxa-ueber.cxa-pl-zelle, .cxa-ueber.cxa-pl-pool, .cxa-ueber.cxa-pl-mtag { background: var(--cxa-akzent-hell) !important; }

/* ── Woche ──────────────────────────────────────────────────────────────── */
.cxa-pl-woche .cxa-pl-gitter { grid-template-columns: var(--pl-achse) repeat(var(--tage), minmax(128px, 1fr)); min-width: calc(var(--pl-achse) + var(--tage) * 128px); }
.cxa-pl-achse { position: sticky; left: 0; z-index: 2; background: var(--cxa-flaeche); font-size: 10.5px; color: var(--cxa-text-3); font-variant-numeric: tabular-nums; }
.cxa-pl-ecke { position: sticky; left: 0; z-index: 4; }
.cxa-pl-achse.band { display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; border-bottom: 1px solid var(--pl-rand); }
.cxa-pl-achse.zeiten { position: sticky; height: calc(var(--stunden) * var(--pph)); }
.cxa-pl-achse.zeiten span { position: absolute; right: 6px; transform: translateY(-50%); }
.cxa-pl-achse.zeiten span:first-child { transform: none; }
.cxa-pl-band {
  display: flex; flex-direction: column; gap: 3px; min-height: 38px; padding: 4px;
  border-left: 1px solid var(--pl-zart); border-bottom: 1px solid var(--pl-rand); cursor: copy;
}
.cxa-pl-raster {
  position: relative; height: calc(var(--stunden) * var(--pph)); border-left: 1px solid var(--pl-zart); cursor: copy;
  background-image: linear-gradient(var(--pl-zart) 1px, transparent 1px),
    linear-gradient(rgba(16, 28, 45, .03) 1px, transparent 1px);
  background-size: 100% var(--pph), 100% calc(var(--pph) / 2);
}
.cxa-pl-raster.frei, .cxa-pl-band.frei { background-color: var(--cxa-grund); }
.cxa-pl-raster.heute { background-color: rgba(255, 127, 80, .04); }
.cxa-pl-eintrag.termin { position: absolute; padding: 3px 6px 6px; }
.cxa-pl-eintrag.termin.kurz { padding-top: 1px; }
.cxa-pl-eintrag.termin.kurz .pl-zeit { display: inline; margin-right: 5px; }
.cxa-pl-eintrag.termin.kurz .pl-titel { display: inline; }
.cxa-pl-eintrag.termin.kurz .pl-unter { display: none; }
.cxa-pl-eintrag.termin.abgeschnitten { border-bottom: 2px dashed var(--pl-ton); }
.cxa-pl-griff { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; touch-action: none; }
.cxa-pl-griff::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; width: 22px; height: 3px; margin-left: -11px;
  border-radius: 2px; background: var(--pl-ton); opacity: 0; transition: opacity var(--cxa-tempo);
}
.cxa-pl-eintrag:hover .cxa-pl-griff::after, .cxa-pl-eintrag.cxa-dehnt .cxa-pl-griff::after { opacity: .55; }
.cxa-pl-eintrag.cxa-dehnt { box-shadow: var(--cxa-schatten-2); z-index: 2; }
.cxa-pl-vorschau {
  position: absolute; left: 2px; right: 2px; z-index: 1; pointer-events: none;
  border: 2px dashed var(--cxa-akzent); border-radius: var(--cxa-radius); background: rgba(255, 127, 80, .1);
  font-size: 11px; font-weight: 700; color: var(--cxa-akzent-dunkel); padding: 2px 6px; font-variant-numeric: tabular-nums;
}
@media (hover: none) { .cxa-pl-griff { height: 14px; } .cxa-pl-griff::after { opacity: .45; } }

/* ── Disposition ────────────────────────────────────────────────────────── */
.cxa-pl-dispo-flaeche { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.cxa-pl-dispo.mit-pool .cxa-pl-dispo-flaeche { grid-template-columns: minmax(0, 1fr) 230px; }
.cxa-pl-dispo .cxa-pl-gitter { grid-template-columns: minmax(170px, 200px) repeat(var(--tage), minmax(132px, 1fr)); min-width: calc(170px + var(--tage) * 132px); }
.cxa-pl-zelle > .cxa-pl-eintrag, .cxa-pl-band > .cxa-pl-eintrag { min-width: 0; }
.cxa-pl-dispo .cxa-pl-ecke { font-size: 11px; font-weight: 700; color: var(--cxa-text-3); text-transform: uppercase; letter-spacing: .06em; }
.cxa-pl-person {
  position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 9px; padding: 10px;
  background: var(--cxa-flaeche); border-bottom: 1px solid var(--pl-zart);
}
.cxa-pl-person .punkt { width: 10px; height: 10px; border-radius: 3px; background: var(--pl-farbe, var(--cxa-marke)); flex: none; }
.cxa-pl-person .name { display: flex; flex-direction: column; min-width: 0; }
.cxa-pl-person .name b { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cxa-pl-person .name small { font-size: 11px; color: var(--cxa-text-3); }
.cxa-pl-person .summe { margin-left: auto; font-size: 11px; color: var(--cxa-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cxa-pl-zelle {
  display: flex; flex-direction: column; gap: 3px; min-height: 76px; padding: 5px 5px 22px; position: relative;
  border-left: 1px solid var(--pl-zart); border-bottom: 1px solid var(--pl-zart); cursor: copy;
}
.cxa-pl-zelle.frei { background: var(--cxa-grund); }
.cxa-pl-zelle.leer:not(.frei) {
  background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(47, 125, 92, .05) 7px 14px);
}
.cxa-pl-zelle.heute { box-shadow: inset 0 2px 0 var(--cxa-akzent); }
.cxa-pl-last { position: absolute; left: 6px; right: 6px; bottom: 5px; display: flex; align-items: center; gap: 6px; pointer-events: none; }
.cxa-pl-last i { flex: 1; height: 4px; border-radius: 2px; background: var(--cxa-flaeche-2); position: relative; overflow: hidden; }
.cxa-pl-last i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--anteil) * 100%); background: var(--cxa-info); border-radius: 2px; }
.cxa-pl-last span { font-size: 10.5px; color: var(--cxa-text-3); font-variant-numeric: tabular-nums; }
.cxa-pl-zelle.voll .cxa-pl-last i::after { background: var(--cxa-warn); }
.cxa-pl-zelle.ueber .cxa-pl-last i::after { background: var(--cxa-fehler); }
.cxa-pl-zelle.ueber .cxa-pl-last span { color: var(--cxa-fehler-text); font-weight: 700; }
.cxa-pl-pool {
  border: 1px dashed var(--pl-rand); border-radius: var(--cxa-radius-gr); background: var(--cxa-flaeche);
  padding: 10px; position: sticky; top: calc(var(--cxa-kopf-hoehe) + 12px);
}
.cxa-pl-pool header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cxa-pl-pool h3 { font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.cxa-pl-pool .anzahl { font-size: 11.5px; font-weight: 700; color: var(--cxa-text-3); }
.cxa-pl-pool-liste { display: flex; flex-direction: column; gap: 5px; min-height: 60px; }

/* ── Monat ──────────────────────────────────────────────────────────────── */
.cxa-pl-monat { --pl-spur: 21px; }
.cxa-pl-mkopf, .cxa-pl-mtage { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cxa-pl-mkopf span { padding: 0 8px 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cxa-text-3); }
.cxa-pl-mraster { border: 1px solid var(--pl-rand); border-radius: var(--cxa-radius-gr); background: var(--cxa-flaeche); overflow: hidden; }
.cxa-pl-mwoche { position: relative; }
.cxa-pl-mwoche + .cxa-pl-mwoche { border-top: 1px solid var(--pl-zart); }
.cxa-pl-mtag {
  position: relative; min-height: calc(30px + var(--max) * var(--pl-spur) + 22px); padding: 4px 6px;
  display: flex; flex-direction: column; align-items: flex-start; cursor: copy;
}
.cxa-pl-mtag + .cxa-pl-mtag { border-left: 1px solid var(--pl-zart); }
.cxa-pl-mtag .nr {
  font: inherit; font-size: 13px; font-weight: 700; min-width: 24px; height: 24px; border-radius: 999px; padding: 0 6px;
  border: 0; background: none; color: var(--cxa-text); cursor: pointer; font-variant-numeric: tabular-nums;
}
.cxa-pl-mtag .nr:hover { background: var(--cxa-flaeche-2); }
.cxa-pl-mtag.heute .nr { background: var(--cxa-akzent); color: var(--cxa-auf-marke); }
.cxa-pl-mtag.frei { background: var(--cxa-grund); }
.cxa-pl-mtag.fremd .nr { color: var(--cxa-text-3); font-weight: 500; }
.cxa-pl-mtag.fremd { background-color: rgba(16, 28, 45, .02); }
.cxa-pl-mtag .ft { position: absolute; top: 8px; right: 6px; max-width: 60%; font-size: 10.5px; color: var(--cxa-warn-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cxa-pl-mtag .punkte { display: none; }
.cxa-pl-mtag .cxa-pl-mehr { margin-top: auto; }
.cxa-pl-mbalken {
  position: absolute; left: 0; right: 0; top: 30px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: calc(var(--pl-spur) - 2px); row-gap: 2px; pointer-events: none; padding: 0 3px;
}
.cxa-pl-eintrag.balken { pointer-events: auto; margin: 0 2px; padding: 2px 6px; display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.cxa-pl-eintrag.balken .pl-zeit { display: inline; }
.cxa-pl-eintrag.balken .pl-titel { min-width: 0; }
.cxa-pl-eintrag.balken .cxa-pl-warn { position: static; }
.cxa-pl-eintrag.balken.weiter-l { margin-left: -3px; }
.cxa-pl-eintrag.balken.weiter-r { margin-right: -3px; }
.cxa-pl.pl-zieht .cxa-pl-eintrag.balken { pointer-events: none; }
.cxa-pl-agenda { display: none; }

/* Tagesliste im Dialog */
.cxa-pl-tagliste { display: flex; flex-direction: column; gap: 6px; }
.cxa-pl-tagzeile {
  --pl-ton: var(--cxa-marke); font: inherit; text-align: left; display: grid; grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--cxa-linie); border-left: 3px solid var(--pl-farbe, var(--pl-ton));
  border-radius: var(--cxa-radius); background: var(--cxa-flaeche); cursor: pointer;
}
.cxa-pl-tagzeile:hover:not([disabled]) { background: var(--cxa-flaeche-2); }
.cxa-pl-tagzeile[disabled] { cursor: default; color: inherit; }
.cxa-pl-tagzeile .pl-zeit { font-size: 12px; color: var(--cxa-text-2); font-variant-numeric: tabular-nums; }
.cxa-pl-tagzeile .pl-titel { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cxa-pl-tagzeile .pl-wer { font-size: 12px; color: var(--cxa-text-3); }

/* ── Handy ──────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .cxa-pl-tage { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin-bottom: 10px; }
  .cxa-pl-tage button {
    font: inherit; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: var(--cxa-radius);
    border: 1px solid var(--cxa-linie); background: var(--cxa-flaeche); color: var(--cxa-text-2); cursor: pointer; min-height: 44px;
  }
  .cxa-pl-tage button span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
  .cxa-pl-tage button b { font-size: 15px; color: var(--cxa-text); }
  .cxa-pl-tage button.heute b { color: var(--cxa-akzent-dunkel); }
  .cxa-pl-tage button[aria-selected="true"] { background: var(--cxa-marke); border-color: var(--cxa-marke); color: var(--cxa-auf-marke); }
  .cxa-pl-tage button[aria-selected="true"] b { color: var(--cxa-auf-marke); }
  .cxa-pl-woche [data-tag]:not([data-sichtbar]), .cxa-pl-dispo [data-tag]:not([data-sichtbar]) { display: none; }
  /* Den Tag nennen schon die Reiter darueber */
  .cxa-pl-woche .cxa-pl-kopf, .cxa-pl-woche .cxa-pl-ecke, .cxa-pl-dispo .cxa-pl-kopf, .cxa-pl-dispo .cxa-pl-ecke { display: none !important; }
  .cxa-pl-woche .cxa-pl-gitter { grid-template-columns: 46px minmax(0, 1fr); min-width: 0; }
  .cxa-pl-dispo .cxa-pl-gitter { grid-template-columns: minmax(104px, 34%) minmax(0, 1fr); min-width: 0; }
  .cxa-pl-dispo.mit-pool .cxa-pl-dispo-flaeche { grid-template-columns: minmax(0, 1fr); }
  .cxa-pl-person .summe { display: none; }
  .cxa-pl-pool { position: static; }
  .cxa-pl-mtag { min-height: 54px; padding: 3px 2px; align-items: center; }
  .cxa-pl-mtag .ft, .cxa-pl-mbalken, .cxa-pl-mtag .cxa-pl-mehr { display: none; }
  .cxa-pl-mtag .punkte { display: block; color: var(--cxa-akzent); font-size: 14px; line-height: 1; letter-spacing: 1px; }
  .cxa-pl-mtag.gewaehlt .nr { outline: 2px solid var(--cxa-marke); }
  .cxa-pl-mkopf span { padding: 0 0 6px; text-align: center; }
  .cxa-pl-agenda { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
  .cxa-pl-agenda header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .cxa-pl-agenda h3 { font-size: var(--cxa-t-basis); font-weight: 700; }
  .cxa-pl-agenda .cxa-pl-eintrag.chip { padding: 8px 10px; }
}
