/* FL Buddy 7 – zentraler Master/Detail Split-Workspace */
:root{--flb-detail-width:clamp(430px,42vw,760px);--flb-detail-gap:10px}
@media (min-width:1101px){
 body:has(.flb-split-target.show) .main-content,body:has(.flb-split-target.open) .main-content,body:has(.flb-split-target:not([hidden])[aria-hidden="false"]) .main-content{margin-right:calc(var(--flb-detail-width) + var(--flb-detail-gap))!important;width:auto!important;transition:margin-right .18s ease;min-width:0!important}
 .flb-split-target.show,.flb-split-target.open,.flb-split-target:not([hidden])[aria-hidden="false"]{position:fixed!important;top:100px!important;right:10px!important;bottom:10px!important;left:auto!important;width:var(--flb-detail-width)!important;height:auto!important;min-height:0!important;max-height:none!important;display:block!important;padding:0!important;margin:0!important;background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;z-index:180!important;overflow:hidden!important;pointer-events:none!important}
 .flb-split-target.show>*,.flb-split-target.open>*,.flb-split-target:not([hidden])[aria-hidden="false"]>*{pointer-events:auto!important;position:relative!important;inset:auto!important;width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;margin:0!important;border-radius:16px!important;overflow:auto!important;scrollbar-width:none!important;box-sizing:border-box!important;box-shadow:none!important;border:1px solid #28535b!important;background:#0b3037!important}
 .flb-split-target.show>*::-webkit-scrollbar,.flb-split-target.open>*::-webkit-scrollbar{display:none!important}
 #appointmentModal .appointment-modal{padding:18px 16px 14px!important}
 #appointmentModal .appointment-modal-head{padding-bottom:10px!important;margin-bottom:0!important;align-items:center!important;position:sticky!important;top:0!important;background:#0b3037!important;z-index:5!important}
 #appointmentModal .appointment-modal-head h2{font-size:21px!important;margin:2px 0 3px!important}
 #appointmentModal .appointment-modal-head p{margin:0!important}
 #appointmentModal .appointment-modal-head button{flex:0 0 auto!important;margin:0 1px 0 8px!important}
 #appointmentModal .appointment-type-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:5px!important;margin:10px 0!important}
 #appointmentModal .appointment-type{padding:7px 3px!important;border-radius:11px!important;gap:2px!important;min-width:0!important}
 #appointmentModal .appointment-type .type-icon{width:27px!important;height:27px!important;border-radius:8px!important}
 #appointmentModal .appointment-type .type-icon svg{width:14px!important;height:14px!important}
 #appointmentModal .appointment-type strong{font-size:8px!important;white-space:nowrap!important}
 #appointmentModal .appointment-type small{display:none!important}
 #appointmentModal .appointment-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px 10px!important}
 #appointmentModal .field-wide{grid-column:1/-1!important}
 #appointmentModal .field input,#appointmentModal .field select,#appointmentModal .field textarea{margin-top:4px!important;padding:9px 10px!important}
 #appointmentModal .field .input-with-icon input{padding-left:46px!important}
 #appointmentModal .field textarea{min-height:52px!important}
 #appointmentModal .appointment-options{grid-template-columns:1fr!important}
 #appointmentModal .appointment-check,#appointmentModal .appointment-warning{margin-top:8px!important;padding:9px 11px!important}
 #appointmentModal .appointment-actions{position:sticky!important;bottom:-14px!important;background:#0b3037!important;padding:9px 0 1px!important;margin-top:10px!important;z-index:4!important}
 body.flb7-workspace #fullStudentRecordModal.show{top:88px!important;right:10px!important;bottom:10px!important;left:auto!important;width:var(--flb-detail-width)!important;height:auto!important;padding:0!important;background:transparent!important;z-index:180!important}
 body.flb7-workspace #fullStudentRecordModal.show .student-record-modal.flb-record-workspace{height:100%!important;min-height:0!important;border-radius:16px!important;overflow:auto!important;scrollbar-width:none!important}
 /* Kalender: verfügbare Breite/Höhe nutzen, keine sichtbaren Standard-Scrollleisten. */
 #page-kalender .calendar-layout{grid-template-columns:minmax(0,1fr) clamp(190px,18vw,260px)!important;gap:10px!important;min-width:0!important}
 #page-kalender .week-calendar{height:calc(100dvh - 235px)!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;scrollbar-width:none!important;min-width:0!important}
 html body #page-kalender .week-calendar::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
 html body #page-kalender .week-calendar{scrollbar-width:none!important;-ms-overflow-style:none!important}
 #page-kalender .calendar-grid{min-width:0!important;width:100%!important;grid-template-columns:clamp(38px,4vw,54px) repeat(6,minmax(0,1fr))!important}
 #page-kalender .day-head{padding:8px 3px!important;min-width:0!important}
 #page-kalender .cal-event{left:3px!important;right:3px!important;padding-left:6px!important;padding-right:6px!important}
 #page-kalender .cal-event.flb-booked-event{border:2px solid #e89a35!important;box-shadow:0 0 0 1px rgba(232,154,53,.22),0 7px 16px rgba(2,20,25,.12)!important}
 #page-kalender .sunset-line{display:block!important;opacity:1!important;z-index:7!important;border-top:2px dashed #e3a03d!important;background:transparent!important}
 #page-kalender .sunset-line span{background:#8a5b1f!important;color:#fff!important;font-weight:800!important;z-index:8!important}
}
@media (min-width:1101px) and (max-width:1450px){
 :root{--flb-detail-width:clamp(420px,40vw,620px)}
 #page-kalender .calendar-layout{grid-template-columns:minmax(0,1fr)!important}
 #page-kalender .calendar-side{display:none!important}
 #appointmentModal .appointment-type-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 #appointmentModal .appointment-type small{display:block!important;font-size:7px!important}
}
@media(max-width:1100px){.flb-split-target.show,.flb-split-target.open,.flb-split-target:not([hidden])[aria-hidden="false"]{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}}

/* FL Buddy 7 – Fix 4: Theorie ebenfalls im rechten Detailbereich */
@media (min-width:1101px){
 body.flb-theory-detail-open .main-content{margin-right:calc(var(--flb-detail-width) + var(--flb-detail-gap))!important;width:auto!important;min-width:0!important;transition:margin-right .18s ease}
 #theoryLiveBackdrop:not([hidden]){position:fixed!important;top:100px!important;right:10px!important;bottom:10px!important;left:auto!important;width:var(--flb-detail-width)!important;height:auto!important;display:block!important;padding:0!important;margin:0!important;background:transparent!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;z-index:181!important;overflow:hidden!important}
 #theoryLiveBackdrop:not([hidden]) .theory-live-modal{position:relative!important;inset:auto!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;padding:18px 16px 14px!important;border-radius:16px!important;overflow:auto!important;scrollbar-width:none!important;box-sizing:border-box!important;box-shadow:none!important;border:1px solid #28535b!important;background:#0b3037!important}
 #theoryLiveBackdrop:not([hidden]) .theory-live-modal::-webkit-scrollbar{display:none!important}
 #theoryLiveBackdrop .theory-live-modal>header{position:sticky!important;top:-18px!important;z-index:6!important;background:#0b3037!important;padding:12px 0 10px!important;margin:0 0 8px!important;align-items:center!important}
 #theoryLiveBackdrop .theory-live-modal>header h2{font-size:21px!important;margin:2px 0!important}
 #theoryLiveBackdrop .theory-live-modal>header button{width:40px!important;height:40px!important;border-radius:12px!important;flex:0 0 40px!important}
 #theoryLiveBackdrop .theory-live-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px 10px!important}
 #theoryLiveBackdrop .theory-live-grid label.wide{grid-column:1/-1!important}
 #theoryLiveBackdrop .theory-live-grid input,#theoryLiveBackdrop .theory-live-grid select{min-height:44px!important;padding:9px 10px!important}
 #theoryLiveBackdrop .theory-live-students{margin-top:12px!important}
 #theoryLiveBackdrop #theoryLiveStudentChoices{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
 #theoryLiveBackdrop .theory-live-modal footer{position:sticky!important;bottom:-14px!important;background:#0b3037!important;padding:10px 0 1px!important;margin-top:10px!important;z-index:5!important}

 /* Tätigkeiten: nur tätigkeitsbezogene Felder, Auswahlkachel zeigt den aktiven Zustand zuverlässig. */
 #appointmentModal .appointment-type:has(input:checked){border-color:#2ed6c3!important;box-shadow:inset 0 0 0 1px #2ed6c3!important;background:#10434a!important}
 #appointmentModal .appointment-type:has(input[value="Tätigkeit"]:checked) .type-icon{background:#1a5c57!important;color:#52e2ce!important}
 #appointmentModal label:has(#appointmentActivity),#appointmentModal .appointment-activity-field{grid-column:1/-1!important}
}


/* FL Buddy 7 – Fix 6: Samstag immer vollständig lesbar */
#liveCalendarGrid .day-head.weekend,
#liveCalendarGrid .day-head.weekend span,
#liveCalendarGrid .day-head.weekend strong,
#liveCalendarGrid .day-head.weekend small{
  opacity:1!important;
  filter:none!important;
  visibility:visible!important;
}

/* Fix 7 – konsolidiert auf dem tatsächlich deployten Repo-Stand */
@media (min-width:1101px){
 html body #page-kalender .week-calendar{scrollbar-width:none!important;-ms-overflow-style:none!important}
 html body #page-kalender .week-calendar::-webkit-scrollbar{display:none!important;width:0!important;height:0!important;background:transparent!important}
 html body #page-kalender .week-calendar::-webkit-scrollbar-thumb{display:none!important;background:transparent!important}
 #appointmentModal .appointment-modal-head{padding-top:12px!important}
}
#liveCalendarGrid .day-head.weekend{opacity:1!important;color:#eefafa!important;background:#10343b!important}
#liveCalendarGrid .day-head.weekend span,#liveCalendarGrid .day-head.weekend strong,#liveCalendarGrid .day-head.weekend small{opacity:1!important;color:inherit!important;filter:none!important}
