:root {
  --dx-primary: #00415f;
  --dx-primary-dark: #00364f;
  --dx-primary-soft: #e4f1f7;
  --dx-bg: #edf5f9;
  --dx-surface: #ffffff;
  --dx-surface-soft: #f8fbfd;
  --dx-border: #d8e5ec;
  --dx-border-strong: #bcd1dc;
  --dx-text: #203643;
  --dx-muted: #6d818c;
  --dx-blue: #5792b4;
  --dx-green: #55b86a;
  --dx-red: #d9535f;
  --dx-orange: #c26416;
  --dx-turquoise: #168c98;
  --dx-rental: #8a5a35;
  --dx-rental-soft: #e7ddd3;
  --dx-yellow: #fff2b2;
  --dx-purple: #70429a;
  --dx-sperrung: #f5dde0;
  --dx-shadow: 0 10px 30px rgba(31, 52, 64, 0.12);
  --dx-radius: 10px;
  --topbar-height: 42px;
  --scheduler-row-height: 100px;
  --scheduler-event-height: 72px;
  --scheduler-slot-min-width: 85px;
  --scheduler-event-height-private: calc(var(--scheduler-event-height) / 2);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--dx-text);
  background: var(--dx-bg);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.dx-app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.dx-topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: var(--dx-primary);
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  flex: 0 0 auto;
}

.dx-topbar__brand {
  display: flex;
  align-items: center;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: lowercase;
}

.dx-topbar__brand span {
  color: #e94a4a;
}

.dx-topbar__spacer {
  flex: 1 1 auto;
}

.dx-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.95;
  white-space: nowrap;
}

.scheduler-page {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 24px 20px 24px;
}

.scheduler-header,
.scheduler-toolbar,
.scheduler-legend,
.scheduler-card {
  width: 100%;
  max-width: none;
}

.scheduler-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.scheduler-title-block {
  min-width: 280px;
}

.scheduler-eyebrow {
  margin-bottom: 2px;
  color: var(--dx-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scheduler-title-block h1 {
  margin: 0;
  color: var(--dx-primary-dark);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 600;
}

.scheduler-title-block p {
  margin: 6px 0 0 0;
  color: var(--dx-muted);
  font-size: 14px;
}

.scheduler-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.view-switch,
.toolbar-right {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--dx-border-strong);
  border-radius: 8px;
  background: var(--dx-surface);
}

.toolbar-right-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.zoom-control {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--dx-border-strong);
  border-radius: 8px;
  color: var(--dx-primary-dark);
  background: var(--dx-surface);
  font-size: 12px;
  white-space: nowrap;
}

.zoom-control input {
  width: 220px;
  accent-color: var(--dx-blue);
}

.zoom-control output {
  min-width: 54px;
  color: var(--dx-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.zoom-presets {
  display: inline-flex;
  align-items: center;
}
.zoom-presets .zoom-preset-btn {
  min-width: 44px;
  padding: 6px 8px;
  font-size: 12px;
}

.segmented-button {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-right: 1px solid var(--dx-border-strong);
  color: var(--dx-primary-dark);
  background: transparent;
  cursor: pointer;
}

.segmented-button:last-child {
  border-right: 0;
}

.segmented-button:hover {
  background: var(--dx-primary-soft);
}

.segmented-button.is-active {
  background: var(--dx-blue);
  color: #ffffff;
}

.toggle-card {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--dx-border-strong);
  border-radius: 8px;
  background: var(--dx-surface);
  color: var(--dx-primary-dark);
  cursor: pointer;
  user-select: none;
}

.toggle-card input {
  width: 16px;
  height: 16px;
  accent-color: var(--dx-blue);
}

.button,
.icon-button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button {
  padding: 7px 13px;
  font-weight: 600;
}

.button-secondary {
  color: #ffffff;
  background: var(--dx-primary);
}

.button-secondary:hover {
  background: var(--dx-primary-dark);
}

.button-light {
  color: var(--dx-primary-dark);
  border-color: var(--dx-border-strong);
  background: var(--dx-surface);
}

.button-light:hover {
  background: var(--dx-primary-soft);
}

.icon-button {
  width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: var(--dx-primary-dark);
  font-size: 26px;
  line-height: 1;
}

.icon-button:hover {
  background: var(--dx-primary);
}

.scheduler-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-radius);
  background: var(--dx-surface);
  box-shadow: 0 4px 14px rgba(31, 52, 64, 0.08);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-center {
  min-width: 0;
  text-align: center;
}

.calendar-title {
  color: var(--dx-primary-dark);
  font-size: 22px;
  font-weight: 700;
}

.calendar-subtitle {
  margin-top: 2px;
  color: var(--dx-muted);
  font-size: 12px;
}

.scheduler-legend {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 12px;
  overflow-x: auto;
  white-space: nowrap;
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-radius);
  background: rgba(255, 255, 255, 0.68);
}

.legend-group-label {
  display: inline-flex;
  align-items: center;
  color: var(--dx-primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.legend-separator {
  display: inline-block;
  width: 26px;
  min-width: 26px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 9px;
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.dx-topbar__brand img {
  display: block;
  width: auto;
  height: 30px;
}

.dx-topbar__icon {
  display: inline-flex;
  width: 26px;
  align-items: center;
  justify-content: center;
  color: #dcebf2;
  font-size: 21px;
  line-height: 1;
}

.dx-topbar__icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.legend-placeholder,
.legend-placeholder-vermietung,
.legend-sperrung {
  border-radius: 0;
  color: var(--dx-text) !important;
}

.legend-placeholder { background-color: var(--dx-yellow) !important; }
.legend-placeholder-vermietung { background-color: var(--dx-rental-soft) !important; }
.legend-sperrung { background-color: var(--dx-sperrung) !important; color: #7b2932 !important; }
.legend-lesson-standard { background-color: #168a50 !important; }
.legend-lesson-club { background-color: #2563a6 !important; }
.legend-diverses,
.legend-sonstiges { background-color: var(--dx-orange) !important; }
.legend-event { background-color: var(--dx-turquoise) !important; }
.legend-vermietung { background-color: var(--dx-rental) !important; }
.legend-private { background-color: var(--dx-purple) !important; }

.scheduler-page.scheduler-view-rooms .legend-private {
  display: none;
}

.scheduler-card {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-radius);
  background: var(--dx-surface);
  box-shadow: var(--dx-shadow);
}

#calendar {
  min-height: 0;
  flex: 1 1 auto;
  width: 100%;
}

#calendar .fc {
  height: 100%;
  color: var(--dx-text);
  font-size: 13px;
}

#calendar .fc-theme-standard td,
#calendar .fc-theme-standard th,
#calendar .fc-scrollgrid {
  border-color: var(--dx-border);
}

#calendar .fc-resource-timeline-divider {
  width: 4px;
  background: var(--dx-border);
}

#calendar .fc-datagrid-header,
#calendar .fc-timeline-header-row,
#calendar .fc-col-header-cell {
  background: var(--dx-surface-soft);
}

#calendar .fc-datagrid-cell-main {
  display: flex;
  align-items: center;
  min-height: var(--scheduler-row-height);
  padding: 8px 12px;
}

#calendar .fc-datagrid-cell-frame,
#calendar .fc-timeline-lane-frame {
  min-height: var(--scheduler-row-height);
}

#calendar .fc-timeline-lane,
#calendar .fc-datagrid-cell {
  height: var(--scheduler-row-height);
}

#calendar .fc-timeline-slot {
  min-width: var(--scheduler-slot-min-width);
}

/* FullCalendar places normal timed events in an absolute-positioned harness.
   We force one centered event band per room row. */
#calendar .fc-timeline-event-harness {
  display: flex;
  align-items: center;
}


#calendar .fc-event {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(31, 52, 64, 0.2);
  z-index: 5;
}

#calendar .fc-timeline-event-harness .fc-event:not(.fc-bg-event) {
  width: 100% !important;
  min-height: var(--scheduler-event-height);
  height: var(--scheduler-event-height);
  display: flex;
  align-items: center;
}

#calendar .fc-timeline-event-harness:has(.fc-event:not(.fc-bg-event):not(.sperrung-event)) {
  top: calc((var(--scheduler-row-height) - var(--scheduler-event-height)) / 2 + 8px) !important;
}


#calendar .fc-bg-event {
  z-index: 1 !important;
}

#calendar .placeholder-event,
#calendar .sperrung-event {
  border-radius: 0;
  box-shadow: none;
}

#calendar .placeholder-event {
  opacity: 0.88 !important;
  color: #30383d !important;
}

#calendar .sperrung-event {
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--dx-sperrung) !important;
  border: 0 !important;
  color: #5a242b !important;
  opacity: 0.84 !important;
  z-index: 1 !important;
}

.scheduler-event {
  min-height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5px 9px;
  overflow: hidden;
  color: #ffffff;
  line-height: 1.15;
}

.scheduler-event__time {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.96;
}

.scheduler-event__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 400;
}

.scheduler-event--lesson-placeholder,
.scheduler-event--sperrung {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 6px 8px;
  color: #30383d;
  text-shadow: none;
}

.scheduler-event__time--placeholder {
  color: #30383d;
  font-size: 12px;
  font-weight: 700;
  opacity: 1;
}

.scheduler-event__title--sperrung {
  color: #5a242b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.scheduler-event--kurs,
.scheduler-event--lesson,
.scheduler-event--club,
.scheduler-event--event,
.scheduler-event--sonstiges,
.scheduler-event--diverses,
.scheduler-event--private,
.scheduler-event--privat,
.scheduler-event--vermietung {
  justify-content: center;
}

.scheduler-page.placeholder-edit-active .scheduler-card {
  border-color: var(--dx-blue);
  box-shadow: 0 0 0 3px rgba(87, 146, 180, 0.2), var(--dx-shadow);
}

.scheduler-page.placeholder-edit-active .toggle-card {
  background: var(--dx-primary-soft);
  border-color: var(--dx-blue);
}

#toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  left: 50%;
  width: min(760px, calc(100vw - 40px));
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 9999;
}

.toast {
  width: 100%;
  padding: 15px 22px;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  opacity: 1;
  transform: translate(-50%, 0);
  transition: opacity 260ms ease, transform 260ms ease;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
}

.toast-success {
  background: #2f9d55;
}

.toast-error {
  background: #d44b57;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .dx-app-shell {
    min-height: 100vh;
    height: auto;
  }

  .scheduler-page {
    min-height: calc(100vh - var(--topbar-height));
    padding: 14px;
  }

  .scheduler-header {
    flex-direction: column;
  }

  .scheduler-actions {
    justify-content: flex-start;
  }

  .scheduler-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .toolbar-left,
  .toolbar-right,
  .toolbar-right-group {
    justify-content: center;
    flex-wrap: wrap;
  }

  .scheduler-card {
    min-height: 560px;
  }
}


/* Ensure normal timed events and their placeholders scale with exactly the same time axis. */
#calendar .fc-timeline-event-harness:not(:has(.sperrung-event)) .fc-event:not(.fc-bg-event) {
  left: 0 !important;
  right: 0 !important;
}

/* Sperrungen are shown as full-height blocked ranges, visually similar to placeholders. */
#calendar .scheduler-event--sperrung {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 7px 9px;
}


/* Background ranges: Platzhalter and Sperrung use the same time scaling. */
#calendar .fc-bg-event.placeholder-event,
#calendar .fc-bg-event.sperrung-event {
  inset: 0 !important;
}

#calendar .fc-bg-event.sperrung-event {
  background: var(--dx-sperrung) !important;
  color: #5a242b !important;
}


/* Cosmetics 6: Sperrung is rendered as a visible, non-editable timed event
   styled like a full-row blocked range. This is more reliable than FullCalendar
   background events for this test case. */
#calendar .fc-timeline-event-harness:has(.sperrung-event) {
  top: 0 !important;
  height: var(--scheduler-row-height) !important;
}

#calendar .fc-timeline-event-harness .fc-event.sperrung-event {
  width: 100% !important;
  height: var(--scheduler-row-height) !important;
  min-height: var(--scheduler-row-height) !important;
  left: 0 !important;
  right: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--dx-sperrung) !important;
  border: 0 !important;
  color: #5a242b !important;
  opacity: 0.88 !important;
  z-index: 2 !important;
}

#calendar .fc-event.sperrung-event .scheduler-event {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 7px 9px;
  color: #5a242b;
}


/* JSON snapshot view additions */
.scheduler-event__title--compact-line1 {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scheduler-event__title--compact-line2 {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.98;
}

#calendar .scheduler-type-kurs,
#calendar .scheduler-type-lesson {
  background-color: #13a750 !important;
  border-color: #13a750 !important;
}

#calendar .scheduler-type-club {
  background-color: #1664d9 !important;
  border-color: #1664d9 !important;
}

#calendar .scheduler-type-event {
  background-color: var(--dx-turquoise) !important;
  border-color: var(--dx-turquoise) !important;
}

#calendar .scheduler-type-sonstiges,
#calendar .scheduler-type-diverses {
  background-color: var(--dx-orange) !important;
  border-color: var(--dx-orange) !important;
}

#calendar .scheduler-type-vermietung {
  background-color: var(--dx-rental) !important;
  border-color: var(--dx-rental) !important;
}

#calendar .scheduler-type-private,
#calendar .scheduler-type-privat {
  background-color: var(--dx-purple) !important;
  border-color: var(--dx-purple) !important;
}

#calendar .fc-event.sperrung-event .scheduler-event {
  justify-content: center;
  align-items: center;
  text-align: center;
}

#calendar .fc-event.sperrung-event .scheduler-event__title--sperrung {
  color: #7b333b;
  font-size: 13px;
}


#calendar .fc-timeline-slot-cushion {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.15;
}

#calendar .fc-timeline-slot-cushion > * {
  white-space: nowrap;
}


/* Personenansicht: zwei feste Zeilen pro Person.
   Hauptzeile: Kurse/Events/Diverses; Privat-Zeile: Privat-Termine.
   Die tatsächliche Zeilenhöhe wird zusätzlich in app.js gesetzt, weil FullCalendar
   linke Ressourcentabelle und rechte Timeline als getrennte Tabellen rendert. */
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-body tr,
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-body tr,
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-lane,
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell,
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-lane-frame,
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell-frame,
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell-main {
  height: 78px !important;
  min-height: 78px !important;
}

/* Privat-Unterzeile: halb so hoch wie die normale Personenzeile. */
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-lane[data-resource-id$="__private"],
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"],
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-lane[data-resource-id$="__private"] .fc-timeline-lane-frame,
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-frame,
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-main {
  height: 39px !important;
  min-height: 39px !important;
}

/* Dicke Trennlinie nach jeder Personengruppe: sie liegt am Ende der Privat-Zeile. */
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-lane[data-resource-id$="__private"],
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] {
  box-shadow: inset 0 -3px 0 var(--dx-border-strong);
}

/* Label "Privat": gleich links ausgerichtet wie der Personenname,
   gleich gross, aber bewusst schwächer eingefärbt und nicht fett. */
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-main {
  align-items: center;
  justify-content: flex-start;
  padding: 2px 12px 2px 8px;
  color: #7f8b94;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

/* FullCalendar setzt den eigentlichen Text zusätzlich in einen inneren "cushion".
   Dieser hat eine eigene Einrückung. Deshalb muss auch dieser innere Container
   zurückgesetzt werden, sonst bleibt "Privat" weiter nach rechts verschoben. */
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-cushion {
  margin-left: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* Privat label vertical centering fix */
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-frame {
  display: flex;
  align-items: center;
}

.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-main {
  display: flex;
  align-items: center !important;
  justify-content: flex-start;
  height: 100% !important;
  min-height: 0 !important;
  width: 100%;
  padding: 0 12px 0 30px !important;
  color: #7f8b94;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-cushion {
  display: flex;
  align-items: center;
  min-height: 100%;
  margin-left: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  line-height: 1;
}


/* Privat-Termine müssen ebenfalls kleiner und innerhalb der halbhohen Privat-Zeile zentriert werden. */
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-event-harness:has(.scheduler-type-private),
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-event-harness:has(.scheduler-type-privat) {
  top: 4px !important;
}

.scheduler-page.scheduler-view-persons #calendar .fc-timeline-event-harness .fc-event.scheduler-type-private,
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-event-harness .fc-event.scheduler-type-privat {
  min-height: 31px !important;
  height: 31px !important;
}

.scheduler-page.scheduler-view-persons #calendar .scheduler-type-private .scheduler-event,
.scheduler-page.scheduler-view-persons #calendar .scheduler-type-privat .scheduler-event {
  padding: 2px 8px;
  line-height: 1.05;
}

.scheduler-page.scheduler-view-persons #calendar .scheduler-type-private .scheduler-event__time,
.scheduler-page.scheduler-view-persons #calendar .scheduler-type-privat .scheduler-event__time {
  font-size: 10.5px;
}

.scheduler-page.scheduler-view-persons #calendar .scheduler-type-private .scheduler-event__title,
.scheduler-page.scheduler-view-persons #calendar .scheduler-type-privat .scheduler-event__title {
  font-size: 12px;
}

.scheduler-page.scheduler-view-rooms #calendar .fc-timeline-body tr,
.scheduler-page.scheduler-view-rooms #calendar .fc-datagrid-body tr,
.scheduler-page.scheduler-view-rooms #calendar .fc-timeline-lane,
.scheduler-page.scheduler-view-rooms #calendar .fc-datagrid-cell,
.scheduler-page.scheduler-view-rooms #calendar .fc-timeline-lane-frame,
.scheduler-page.scheduler-view-rooms #calendar .fc-datagrid-cell-frame,
.scheduler-page.scheduler-view-rooms #calendar .fc-datagrid-cell-main {
  height: 100px !important;
  min-height: 100px !important;
}


/* Appointment text should stay readable: regular weight, not bold. */
#calendar .scheduler-type-kurs .scheduler-event__title,
#calendar .scheduler-type-lesson .scheduler-event__title,
#calendar .scheduler-type-club .scheduler-event__title,
#calendar .scheduler-type-event .scheduler-event__title,
#calendar .scheduler-type-sonstiges .scheduler-event__title,
#calendar .scheduler-type-diverses .scheduler-event__title,
#calendar .scheduler-type-vermietung .scheduler-event__title,
#calendar .scheduler-type-private .scheduler-event__title,
#calendar .scheduler-type-privat .scheduler-event__title,
#calendar .scheduler-type-kurs .scheduler-event__time,
#calendar .scheduler-type-lesson .scheduler-event__time,
#calendar .scheduler-type-club .scheduler-event__time,
#calendar .scheduler-type-event .scheduler-event__time,
#calendar .scheduler-type-sonstiges .scheduler-event__time,
#calendar .scheduler-type-diverses .scheduler-event__time,
#calendar .scheduler-type-vermietung .scheduler-event__time,
#calendar .scheduler-type-private .scheduler-event__time,
#calendar .scheduler-type-privat .scheduler-event__time,
#calendar .scheduler-event__title--compact-line1,
#calendar .scheduler-event__title--compact-line2 {
  font-weight: 400 !important;
}


/* Placeholder editing context menu and dialogs */
.placeholder-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 240px;
  padding: 6px;
  border: 1px solid var(--dx-border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(31, 52, 64, 0.26);
}

.placeholder-context-menu__item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--dx-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.placeholder-context-menu__item:hover {
  background: var(--dx-primary-soft);
}

.placeholder-context-menu__item.is-danger {
  color: #b00020;
}

.placeholder-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(23, 35, 42, 0.34);
}

.placeholder-dialog-backdrop[hidden],
.placeholder-context-menu[hidden] {
  display: none;
}

.placeholder-dialog {
  width: min(440px, 100%);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgba(31, 52, 64, 0.36);
  overflow: hidden;
}

.placeholder-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  color: #ffffff;
  background: var(--dx-primary);
}

.placeholder-dialog__header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.placeholder-dialog__close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.placeholder-dialog__body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.placeholder-dialog__field {
  display: grid;
  gap: 6px;
}

.placeholder-dialog__field span {
  color: var(--dx-primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.placeholder-dialog__field input,
.placeholder-dialog__field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--dx-border);
  border-radius: 8px;
  color: var(--dx-text);
  background: #ffffff;
}

.placeholder-dialog__field input[readonly],
.placeholder-dialog__field input[disabled] {
  color: var(--dx-muted);
  background: var(--dx-surface-soft);
}

.placeholder-dialog__confirm {
  margin: 0;
  color: var(--dx-text);
  font-size: 15px;
}

.placeholder-dialog__summary {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--dx-surface-soft);
  color: var(--dx-muted);
}

.placeholder-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--dx-border);
}

.scheduler-page.placeholder-edit-active #calendar .placeholder-editable-event {
  cursor: move;
  outline: 2px dashed rgba(35, 100, 130, 0.55);
  outline-offset: -2px;
}

.scheduler-page.placeholder-edit-active #calendar .placeholder-editable-event .fc-event-resizer {
  display: block;
}

/* Bearbeitbare Platzhalter bleiben wie Sperrungen über die volle Raumzeile sichtbar. */
.scheduler-page.scheduler-view-rooms.placeholder-edit-active #calendar .fc-timeline-event-harness:has(.placeholder-editable-event) {
  top: 0 !important;
  height: var(--scheduler-row-height) !important;
}

.scheduler-page.scheduler-view-rooms.placeholder-edit-active #calendar .fc-timeline-event-harness .fc-event.placeholder-editable-event {
  width: 100% !important;
  height: var(--scheduler-row-height) !important;
  min-height: var(--scheduler-row-height) !important;
  left: 0 !important;
  right: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}


/* Vermietung placeholder is intentionally different from Vermietung appointment.
   Placeholder: light grey area. Appointment: brown appointment. */
#calendar .scheduler-type-vermietung-placeholder,
#calendar .scheduler-type-ph-vermietung,
#calendar .scheduler-type-rental-placeholder,
#calendar .rental-placeholder-editable-event {
  background-color: var(--dx-rental-soft) !important;
  border-color: #c8ccd0 !important;
  color: #30383d !important;
}

#calendar .scheduler-type-vermietung-placeholder .scheduler-event,
#calendar .scheduler-type-ph-vermietung .scheduler-event,
#calendar .scheduler-type-rental-placeholder .scheduler-event {
  color: #30383d;
  text-shadow: none;
}

#calendar .scheduler-type-vermietung-placeholder .scheduler-event__title,
#calendar .scheduler-type-vermietung-placeholder .scheduler-event__time,
#calendar .scheduler-type-ph-vermietung .scheduler-event__title,
#calendar .scheduler-type-ph-vermietung .scheduler-event__time,
#calendar .scheduler-type-rental-placeholder .scheduler-event__title,
#calendar .scheduler-type-rental-placeholder .scheduler-event__time {
  color: #30383d;
}


.placeholder-dialog__hint {
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--dx-muted);
  background: var(--dx-surface-soft);
  font-size: 12px;
  line-height: 1.35;
}


/* Vermietung-Platzhalter: Typ wird über Farbe erklärt.
   Deshalb wird nur die Zeit links oben angezeigt, damit spätere Vermietung-Termine
   sauber auf der Fläche liegen können. */
#calendar .scheduler-event--vermietung-placeholder,
#calendar .scheduler-event--ph-vermietung,
#calendar .scheduler-event--rental-placeholder {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 6px 8px;
  color: #30383d;
  text-shadow: none;
}

#calendar .scheduler-event__time--rental-placeholder {
  color: #30383d;
  font-size: 12px;
  font-weight: 400;
  opacity: 1;
}






.placeholder-dialog__field textarea {
  width: 100%;
  min-height: 96px;
  padding: 8px 10px;
  border: 1px solid var(--dx-border);
  border-radius: 8px;
  color: var(--dx-text);
  background: #ffffff;
  resize: vertical;
  font-family: inherit;
}

.person-picker {
  display: flex;
  gap: 8px;
}

.person-picker select {
  flex: 1 1 auto;
}

.person-picker__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
}

.person-picker__chip {
  border: 1px solid var(--dx-border);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--dx-primary-soft);
  color: var(--dx-primary-dark);
  cursor: pointer;
  font-size: 12px;
}

.person-picker__chip::after {
  content: " ×";
  opacity: 0.75;
}



.scheduler-view-persons .scheduler-type-sonstiges,
.scheduler-view-persons .scheduler-type-diverses,
.scheduler-view-persons .scheduler-type-vermietung {
  cursor: pointer;
}

.readonly-dialog textarea[readonly] {
  background: var(--dx-surface-soft);
  color: var(--dx-text);
}

.readonly-dialog__field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 520px) {
  .readonly-dialog__field-row {
    gap: 8px;
  }
}


.placeholder-context-menu__item.is-disabled,
.placeholder-context-menu__item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


.scheduler-view-persons .scheduler-type-private,
.scheduler-view-persons .scheduler-type-privat {
  cursor: pointer;
}


.placeholder-dialog__row--two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

@media (max-width: 560px) {
  .placeholder-dialog__row--two {
    grid-template-columns: 1fr;
  }
}


.scheduler-page.scheduler-view-persons #calendar .scheduler-type-private,
.scheduler-page.scheduler-view-persons #calendar .scheduler-type-privat {
  cursor: move;
}






/* Personenansicht Split-Row: normale Personen-Termine bleiben in der 78px-Hauptzeile zentriert.
   Privat-Termine haben weiter oben eine eigene, kleinere Regel für die 39px-Privat-Zeile. */
.scheduler-page.scheduler-view-persons #calendar .fc-timeline-event-harness:has(.fc-event:not(.fc-bg-event):not(.sperrung-event):not(.scheduler-type-private):not(.scheduler-type-privat)) {
  top: calc((78px - var(--scheduler-event-height)) / 2) !important;
}

.scheduler-page.scheduler-view-persons #calendar .fc-timeline-event-harness .fc-event:not(.fc-bg-event):not(.scheduler-type-private):not(.scheduler-type-privat) {
  min-height: var(--scheduler-event-height);
  height: var(--scheduler-event-height);
}

.scheduler-page.scheduler-view-persons #calendar .scheduler-event {
  justify-content: center;
}


.toolbar-right-group {
  flex-wrap: wrap;
}

.toggle-card-compact {
  min-height: 36px;
  font-size: 12px;
  white-space: nowrap;
}


/* Definitive vertical alignment for the "Privat" sub-row label */
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-frame {
  height: 39px !important;
  min-height: 39px !important;
  display: flex;
  align-items: center !important;
}

.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-main {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  height: 39px !important;
  min-height: 39px !important;
  padding: 0 12px 0 8px !important;
  color: #7f8b94 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
}

.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-cushion {
  display: flex !important;
  align-items: center !important;
  width: 100%;
  height: 39px !important;
  min-height: 39px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}


/* Final alignment correction for the "Privat" label:
   keep vertical centering, but use the same visual left guide as "Personen" and the person name. */
.scheduler-page.scheduler-view-persons #calendar .fc-datagrid-cell[data-resource-id$="__private"] .fc-datagrid-cell-main {
  padding-left: 30px !important;
}


/* Prototype role/login simulation */
.prototype-login-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 35, 45, 0.42);
  z-index: 20000;
}

.prototype-login-dialog {
  width: min(520px, calc(100vw - 48px));
  padding: 24px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.prototype-login-dialog h2 {
  margin: 0 0 8px 0;
  color: var(--dx-primary-dark);
  font-size: 22px;
}

.prototype-login-dialog__text {
  margin: 0 0 18px 0;
  color: var(--dx-muted);
  line-height: 1.45;
}

.prototype-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px 0;
  color: var(--dx-primary-dark);
  font-weight: 600;
}

.prototype-login-field input,
.prototype-login-field select {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--dx-border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--dx-text);
}

.prototype-login-hint {
  margin: 8px 0 18px 0;
  padding: 10px 12px;
  border-left: 4px solid var(--dx-blue);
  border-radius: 8px;
  background: var(--dx-primary-soft);
  color: var(--dx-primary-dark);
  font-size: 13px;
  line-height: 1.4;
}

.prototype-login-actions {
  display: flex;
  justify-content: flex-end;
}

.prototype-user-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--dx-border-strong);
  border-radius: 8px;
  background: #eef6fa;
  color: var(--dx-primary-dark);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.toggle-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.toggle-card.is-disabled input {
  cursor: not-allowed;
}


/* Prototype user shown in the DanceX topbar where the real logged-in user appears. */
#topbar-user {
  font-weight: 650;
}

#topbar-tenant {
  opacity: 0.95;
}

.prototype-user-badge { display: none !important; }

/* Aktuelle Uhrzeit in der zuverlässigen Tagesansicht deutlich sichtbar halten. */
#calendar .fc-timeline-now-indicator-container {
  z-index: 30;
}

#calendar .fc-timeline-now-indicator-line {
  border-left-width: 3px;
  margin-left: -2px;
}

#calendar .fc-timeline-now-indicator-arrow {
  border-width: 8px 7px 0;
  margin-left: -8px;
}
