/* Planning modal parity (project + year + department + resource) */
.plan-modal-backdrop .modal {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 940px);
  overflow: visible;
}

.plan-modal-backdrop .modal .modal-body {
  overflow: auto;
  scrollbar-gutter: stable;
  padding-bottom: 16px;
}

.plan-modal-backdrop .modal.smart-select-open .modal-body {
  overflow: visible;
}

.plan-modal-backdrop .modal .form-grid > * {
  position: relative;
}

.plan-modal-backdrop .modal .smart-select.is-open {
  z-index: 220;
}

.plan-modal-backdrop .modal .form-grid > *:has(.smart-select.is-open) {
  z-index: 219;
}

.plan-modal-backdrop .modal .smart-select-panel {
  z-index: 221;
}

/* Users/Schedule - Profiel koppelen modal: dropdown must render above form/actions */
#assignProfileModal .modal {
  overflow: visible;
}

#assignProfileModal .modal .modal-body {
  overflow: visible;
}

#assignProfileModal .modal .smart-select-panel {
  z-index: 260;
}

.plan-modal-backdrop .modal .modal-actions {
  position: static;
  background: #fff;
  padding-bottom: 12px;
  margin-bottom: 0;
  justify-content: flex-end;
}

.plan-modal-backdrop .modal > .modal-actions {
  padding-left: 18px;
  padding-right: 18px;
  margin-top: 0;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

#projectPlanningModal .modal,
#workBreakdownModal .modal {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 940px);
  overflow: hidden;
}

#projectPlanningModal .modal .modal-body,
#workBreakdownModal .modal .modal-body {
  overflow: auto;
  scrollbar-gutter: stable;
  padding-bottom: 0;
}

#projectPlanningModal .modal.smart-select-open .modal-body,
#workBreakdownModal .modal.smart-select-open .modal-body {
  overflow: auto;
}

#projectPlanningModal .modal .smart-select.is-open,
#workBreakdownModal .modal .smart-select.is-open {
  z-index: 280;
}

#projectPlanningModal .modal .smart-select-panel,
#workBreakdownModal .modal .smart-select-panel {
  z-index: 281;
  max-height: min(220px, 30vh);
  overflow-y: auto;
}

#projectPlanningModal .modal .modal-actions,
#workBreakdownModal .modal .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 270;
  background: #fff;
  margin: 4px -18px 0;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}
