/* plan-aufbau.css: Contentplan im neuen Aufbau (gehoert zu plan-aufbau.js). Alles gilt nur unter html.vl-rahmen; was erst nach dem
 * Umhaengen gilt, zusaetzlich unter html.vl-plan-aufbau. Nur Token der Seite (theme.js), keine Farbwerte, kein order. Fokusring aus theme.js. */
html.vl-rahmen.vl-plan-aufbau #cp-kopf h1 { display: none; }   /* nur nach dem Umhaengen: bricht es ab, bleibt die Seite nicht ohne Ueberschrift */
html.vl-rahmen :is(.vl-pk, .vl-faecher) [hidden], html.vl-rahmen :is(.vl-fach, .vl-kein, .vl-chips)[hidden] { display: none !important; }

/* Kopfzeile */
html.vl-rahmen .vl-pk { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 12px; }
html.vl-rahmen .vl-pk-titel { margin: 0; min-width: 0; font: 600 17px/1.3 var(--font-body, 'Funnel Display', system-ui, sans-serif); letter-spacing: 0; text-transform: none; color: var(--text-primary); }
html.vl-rahmen .vl-pk-kw { margin-left: 4px; font-size: 13px; font-weight: 400; white-space: nowrap; color: var(--text-secondary); }
html.vl-rahmen.vl-plan-laedt :is(.vl-pk-nav, .vl-pk-rechts) { visibility: hidden; }   /* bis die Seite fertig ist: Platz bleibt, nichts Falsches */
html.vl-rahmen .vl-pk-nav { display: flex; align-items: center; gap: 4px; }
html.vl-rahmen .vl-pk-nav :is(.rp-woche-pfeil, .rp-heute-knopf, #month-nav button) {
  min-height: 44px; box-sizing: border-box; background: none !important; border: 1px solid var(--kontur) !important; color: var(--text-primary); font-size: 14px !important; letter-spacing: 0; text-transform: none;   /* theme.js setzt 13 px mit !important */
}
html.vl-rahmen .vl-pk-nav :is(.rp-woche-pfeil, #month-nav button[aria-label]) { width: 44px; height: 44px; }
html.vl-rahmen .vl-pk-nav :is(.rp-heute-knopf, #month-nav button:not([aria-label])) { margin-left: 4px; padding: 0 16px; }
html.vl-rahmen .vl-pk-nav :is(.rp-woche-pfeil, .rp-heute-knopf, #month-nav button):hover { border-color: var(--text-primary) !important; opacity: 1; }
html.vl-rahmen.vl-plan-aufbau #rp-woche-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; min-width: 0; }  
html.vl-rahmen .vl-pk-rechts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; min-width: 0; }
html.vl-rahmen :is(.vl-pk-knopf, #btn-series, #btn-new) {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; box-sizing: border-box; border-radius: 999px;
  font-size: 14px !important; font-weight: 600 !important; line-height: 1.2; letter-spacing: 0 !important; text-transform: none !important; white-space: nowrap;
}
html.vl-rahmen .vl-pk-knopf .material-symbols-outlined { font-size: 18px; }
html.vl-rahmen .vl-pk-knopf[aria-expanded="true"] { background: var(--sel-bg) !important; box-shadow: inset 0 0 0 1px var(--sel-line) !important; border-color: var(--sel-line) !important; color: var(--sel-fg) !important; }
html.vl-rahmen #vl-pk-ansicht .material-symbols-outlined:last-child { font-size: 20px; transition: transform .15s ease; }
html.vl-rahmen #vl-pk-ansicht[aria-expanded="true"] .material-symbols-outlined:last-child { transform: rotate(180deg); }
html.vl-rahmen .vl-pk-l { color: inherit; opacity: .8; }
html.vl-rahmen .vl-pk-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 999px; background: var(--sel-bg); box-shadow: inset 0 0 0 1px var(--text-primary); color: var(--text-primary); font-size: 13px; font-weight: 600; line-height: 1; }
html.vl-rahmen .vl-pk-rechts .relative > button { width: 44px; height: 44px; }

/* Faecher */
html.vl-rahmen .vl-fach { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 32px; margin: 0 0 16px; padding: 16px 24px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-s1); }
html.vl-rahmen .vl-fg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
html.vl-rahmen .vl-fg-l { font-size: 13px; line-height: 1.2; color: var(--text-secondary); }
html.vl-rahmen :is(.vl-fg, .vl-pk-rechts) #cp-ansichten { display: flex !important; flex-wrap: wrap; gap: 8px; padding: 0 !important; border: 0 !important; border-radius: 0; background: none !important; }
html.vl-rahmen .vl-fg .rp-umschalter { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; border-radius: 0; background: none; }
html.vl-rahmen :is(.vl-fg, .vl-pk-rechts) :is(#cp-ansichten > button, .rp-umschalter button, #btn-abo) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px !important; border-radius: 999px; border: 1px solid var(--kontur); background: none; color: var(--text-primary);
  font-size: 14px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important;
}
html.vl-rahmen :is(.vl-fg, .vl-pk-rechts) :is(#cp-ansichten > button.vl-gewaehlt, .rp-umschalter button.an) { background: var(--sel-bg) !important; color: var(--sel-fg) !important; border-color: var(--sel-line) !important; box-shadow: inset 0 0 0 1px var(--sel-line); }
/* gewaehlt: ein Haekchen vor dem Text, damit es nicht nur an der Farbe haengt */
html.vl-rahmen :is(.vl-fg, .vl-pk-rechts) :is(#cp-ansichten > button.vl-gewaehlt, .rp-umschalter button.an)::before {
  content: ''; flex: none; box-sizing: border-box; width: 6px; height: 11px; margin: -3px 10px 0 2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
html.vl-rahmen .vl-fach:focus:not(:focus-visible) { outline: none; }
html.vl-rahmen .vl-fach #filter-wrap { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
html.vl-rahmen .vl-fach #filter-wrap :is(.field-sm, select) { min-height: 44px; box-sizing: border-box; font-size: 14px; max-width: 100%; }
html.vl-rahmen .vl-fach #f-search { width: 180px !important; }   /* das Feld traegt eine feste Breite im style */
html.vl-rahmen .vl-fach #vl-f-ende { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }   /* "Verworfene" und "Zurücksetzen" bleiben in einer Reihe zusammen */
html.vl-rahmen .vl-fach :is(#f-trash-wrap, #f-reset) { min-height: 44px; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text-secondary) !important; }
html.vl-rahmen .vl-fach #f-reset { padding: 0 16px; border: 1px solid var(--kontur); border-radius: 999px; font-weight: 600; white-space: nowrap; }
html.vl-rahmen.vl-plan-aufbau :is(#filter-bereich, #cph-filter, button[onclick="toggleFilters()"]) { display: none !important; }
html.vl-rahmen.vl-plan-aufbau .rp-kopfzeile { display: none; }

/* kleine Zeile unter der Kopfzeile: Firma, Rolle, Freigeber */
html.vl-rahmen.vl-plan-aufbau #cp-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px !important; min-height: 28px; }
html.vl-rahmen.vl-plan-aufbau #cp-kopf > div:first-child { display: contents; }
html.vl-rahmen.vl-plan-aufbau #cp-kopf :is(.mt-1, #approver-row) { margin-top: 0; }
html.vl-rahmen.vl-plan-aufbau #cp-werkzeug:empty { display: none; }
html.vl-rahmen :is(#cp-company, #presence-bar) { color: var(--text-secondary) !important; }
html.vl-rahmen.vl-plan-aufbau :is(#cp-company, #presence-bar, #role-badge) { font-size: 13px !important; }   /* .tag steht in theme.js auf 11 px !important */

/* Kein Treffer und leere Woche */
html.vl-rahmen .vl-kein { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: var(--text-secondary); }
html.vl-rahmen .vl-kein-knopf { min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600; }
html.vl-rahmen.vl-plan-keintreffer .rp-leerhinweis { display: none !important; }
html.vl-rahmen .rp-leerhinweis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 16px; padding: 0; border-radius: 0; background: none; font-size: 15px; line-height: 1.5; color: var(--text-secondary); }
html.vl-rahmen .rp-leerhinweis .rp-link { display: inline-flex; align-items: center; width: auto; min-height: 44px; margin: 0; padding: 0 16px; box-sizing: border-box; border: 1px solid var(--kontur); border-radius: 999px; font-size: 14px; font-weight: 600; background: none; cursor: pointer; }
html.vl-rahmen .rp-leerhinweis .rp-link:hover { border-color: var(--text-primary); }
html.vl-rahmen #view-planung > .rp-legende { margin: 12px 0 0; font-size: 13px; color: var(--text-secondary); }

/* aktive Filter als Chips unter der Kopfzeile */
html.vl-rahmen .vl-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
html.vl-rahmen .vl-chip { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; box-sizing: border-box; padding: 0 0 0 16px; border: 1px solid var(--kontur); border-radius: 999px; font-size: 14px; line-height: 1.2; color: var(--text-primary); }
html.vl-rahmen .vl-chip-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.vl-rahmen .vl-chip-l { color: var(--text-secondary); }
html.vl-rahmen .vl-chip-x { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; margin: -1px -1px -1px 0; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--text-secondary); font-size: 20px; line-height: 1; cursor: pointer; }
html.vl-rahmen .vl-chip-x:hover { color: var(--text-primary); }

/* Platz: Kalender bis 768 passt in die Breite; im Monat der Planung kommt die rechte Spalte unter das Raster, wenn sie sonst Tage abschneidet */
@media (min-width: 768px) { html.vl-rahmen .cal-grid { min-width: 0; } }
/* genau eine Zeile, die klebt: ab 1280 px mit schmaler Leiste, ab 1440 px mit breiter (dort fehlt sonst der Platz, der Titel wuerde gekuerzt).
 * Sonst zwei Zeilen (Pfeile und Titel, darunter die Knoepfe) und nichts klebt. Beide Bloecke sind bis auf die Bedingung gleich. */
@media (min-width: 1280px) {
  html.vl-rahmen.vl-rahmen-schmal.vl-plan-aufbau .vl-pk { position: sticky; top: calc(var(--vlr-band) + var(--vlr-zeile)); z-index: 30; flex-wrap: nowrap; margin: -8px -24px 4px; padding: 8px 24px; background: transparent; }   /* unter Rahmen (49), Fach (90) und Dialogen */
  html.vl-rahmen.vl-rahmen-schmal.vl-plan-aufbau .vl-pk.vl-pk-klebt { background: var(--bg-body); box-shadow: 0 1px 0 var(--line); }
  html.vl-rahmen.vl-rahmen-schmal.vl-plan-aufbau .vl-pk-titel { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.vl-rahmen.vl-rahmen-schmal.vl-plan-aufbau .vl-pk-nav { flex: none; }
  html.vl-rahmen.vl-rahmen-schmal.vl-plan-aufbau .vl-pk-rechts { flex: none; flex-wrap: nowrap; }
  html.vl-rahmen.vl-rahmen-schmal.vl-plan-aufbau #pool-aside { top: calc(var(--vlr-band) + var(--vlr-zeile) + var(--vl-pk-h, 60px) + 12px); max-height: calc(100vh - var(--vlr-band) - var(--vlr-zeile) - var(--vl-pk-h, 60px) - 28px); }
  html.vl-rahmen.vl-rahmen-schmal .vl-fach { scroll-margin-top: calc(var(--vl-pk-h, 60px) - 8px); }   /* geoeffnet kommt das Fach unter die klebende Zeile (zusammen mit scroll-padding der Seite) */
}
@media (min-width: 1440px) {
  html.vl-rahmen:not(.vl-rahmen-schmal).vl-plan-aufbau .vl-pk { position: sticky; top: calc(var(--vlr-band) + var(--vlr-zeile)); z-index: 30; flex-wrap: nowrap; margin: -8px -24px 4px; padding: 8px 24px; background: transparent; }   /* unter Rahmen (49), Fach (90) und Dialogen */
  html.vl-rahmen:not(.vl-rahmen-schmal).vl-plan-aufbau .vl-pk.vl-pk-klebt { background: var(--bg-body); box-shadow: 0 1px 0 var(--line); }
  html.vl-rahmen:not(.vl-rahmen-schmal).vl-plan-aufbau .vl-pk-titel { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.vl-rahmen:not(.vl-rahmen-schmal).vl-plan-aufbau .vl-pk-nav { flex: none; }
  html.vl-rahmen:not(.vl-rahmen-schmal).vl-plan-aufbau .vl-pk-rechts { flex: none; flex-wrap: nowrap; }
  html.vl-rahmen:not(.vl-rahmen-schmal).vl-plan-aufbau #pool-aside { top: calc(var(--vlr-band) + var(--vlr-zeile) + var(--vl-pk-h, 60px) + 12px); max-height: calc(100vh - var(--vlr-band) - var(--vlr-zeile) - var(--vl-pk-h, 60px) - 28px); }
  html.vl-rahmen:not(.vl-rahmen-schmal) .vl-fach { scroll-margin-top: calc(var(--vl-pk-h, 60px) - 8px); }   /* geoeffnet kommt das Fach unter die klebende Zeile (zusammen mit scroll-padding der Seite) */
}
@media (max-width: 1279px) {
  html.vl-rahmen .vl-pk-rechts { width: 100%; justify-content: flex-start; margin-left: 0; }
  html.vl-rahmen .vl-pk-rechts > :last-child { margin-left: auto; }
}
@media (min-width: 1280px) and (max-width: 1439px) {
  html.vl-rahmen:not(.vl-rahmen-schmal) .vl-pk-rechts { width: 100%; justify-content: flex-start; margin-left: 0; }
  html.vl-rahmen:not(.vl-rahmen-schmal) .vl-pk-rechts > :last-child { margin-left: auto; }
}
/* steht nach den Bloecken oben, damit die Spalte unter dem Raster nicht klebt (gleiche Gewichtung, spaeter gewinnt) */
@media (min-width: 1024px) {
  html.vl-rahmen.vl-plan-aufbau.vl-plan-schmal #main-grid { grid-template-columns: minmax(0, 1fr); }
  html.vl-rahmen.vl-plan-aufbau.vl-plan-schmal #pool-aside { position: static; max-height: none; overflow: visible; padding-bottom: 0; }
}
html.vl-rahmen .vl-pk-marke { height: 1px; margin: 0 0 -1px; visibility: hidden; pointer-events: none; }
@media (max-width: 1599px) { html.vl-rahmen #vl-pk-ansicht .vl-pk-l { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }

@media (max-width: 767px) {
  html.vl-rahmen :is(.vl-pk-titel, .vl-pk-nav, #vl-pk-ansicht .vl-pk-l) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  html.vl-rahmen .vl-pk { gap: 0; }
  html.vl-rahmen :is(.vl-pk-knopf, #btn-series, #btn-new) { padding: 0 16px; }
  html.vl-rahmen .vl-pk-rechts #btn-new:has(.material-symbols-outlined) { width: 44px; padding: 0; justify-content: center; }
  html.vl-rahmen .vl-fach { padding: 16px; gap: 16px; }
  html.vl-rahmen .vl-fg { flex: 1 1 100%; }
  html.vl-rahmen .vl-fg-abo { display: none; }
  html.vl-rahmen.vl-plan-aufbau #cp-kopf { min-height: 0; margin: 0 0 8px !important; }
  html.vl-rahmen.vl-plan-aufbau #cp-kopf:not(:has(#company-switch:not([style*="display: none"]):not([style*="display:none"]))) { display: none; }
  html.vl-rahmen .vl-fach #filter-wrap { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  html.vl-rahmen .vl-fach :is(#filter-wrap > .relative, #vl-f-ende) { grid-column: 1 / -1; }
  html.vl-rahmen .vl-fach :is(#filter-wrap select, #f-search) { width: 100% !important; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { html.vl-rahmen #vl-pk-ansicht .material-symbols-outlined:last-child { transition: none; } }
