/* 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: auto;
}

.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;
}

.planning-timeline-date-trigger-row {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
}

.planning-timeline-date-trigger-row[hidden] {
    display: none !important;
}

.planning-timeline-date-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: auto;
}

.planning-timeline-date-trigger svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.timeline-date-picker-source-hidden {
    display: none !important;
}

.planning-timeline-date-toolbar {
    position: fixed;
    top: 74px;
    left: 50%;
    z-index: 240;
    display: none;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    width: min(920px, calc(100vw - 32px));
    min-height: 64px;
    padding: 10px 12px 10px 16px;
    border: 1px solid #bfd0e5;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 42px rgba(24, 48, 79, 0.22);
    transform: translateX(-50%);
}

.planning-timeline-date-toolbar.is-open {
    display: grid;
}

.planning-timeline-date-toolbar-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.planning-timeline-date-toolbar-title {
    overflow: hidden;
    color: #17365d;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.planning-timeline-date-toolbar-hint {
    color: #60758f;
    font-size: 12px;
}

.planning-timeline-date-toolbar-value {
    padding: 7px 10px;
    border-radius: 999px;
    background: #eaf2fb;
    color: #1f4f82;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.planning-timeline-date-toolbar-actions {
    display: flex;
    gap: 8px;
}

body.timeline-date-picker-active.timeline-date-picker-modifier-active .vis-panel.vis-center {
    cursor: crosshair !important;
}

body.planning-phase-picker-active .wb-plan-row.wb-plan-phase,
body.planning-phase-picker-active .prj-plan-row.prj-plan-phase,
body.planning-phase-picker-active .yrp-plan-row.yrp-plan-phase,
body.planning-phase-picker-active .resp-plan-row.resp-plan-phase,
body.planning-phase-picker-active .afdp-plan-row.afdp-plan-phase,
body.planning-phase-picker-active .vis-item.item-phase {
    cursor: pointer !important;
}

body.planning-phase-picker-active .wb-plan-row.wb-plan-phase:hover,
body.planning-phase-picker-active .prj-plan-row.prj-plan-phase:hover,
body.planning-phase-picker-active .yrp-plan-row.yrp-plan-phase:hover,
body.planning-phase-picker-active .resp-plan-row.resp-plan-phase:hover,
body.planning-phase-picker-active .afdp-plan-row.afdp-plan-phase:hover,
body.planning-phase-picker-active .vis-item.item-phase:hover {
    outline: 2px solid rgba(30, 110, 183, 0.78);
    outline-offset: -2px;
}

.planning-timeline-date-overlay {
    position: absolute;
    inset: 0;
    z-index: 48;
    pointer-events: none;
}

.planning-timeline-date-overlay.is-outside {
    display: none;
}

.planning-timeline-date-band {
    position: absolute;
    top: var(--timeline-date-top, 0);
    left: var(--timeline-date-left, 0);
    width: var(--timeline-date-width, 2px);
    height: var(--timeline-date-height, 100%);
    border-inline: 2px solid rgba(30, 110, 183, 0.72);
    background: rgba(54, 135, 207, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.planning-timeline-date-ghost {
    position: absolute;
    top: calc(var(--timeline-date-top, 0px) + 8px);
    left: var(--timeline-date-left, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--timeline-date-width, 2px);
    min-width: 2px;
    height: 24px;
    overflow: hidden;
    border: 1px solid #1769aa;
    border-radius: 6px;
    background: #2f7fbd;
    color: #fff;
    box-shadow: 0 4px 12px rgba(23, 69, 111, 0.24);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.planning-timeline-date-ghost.is-pending {
    border-style: dashed;
    background: rgba(47, 127, 189, 0.78);
}

.planning-timeline-date-ghost span {
    padding-inline: 8px;
}

@media (max-width: 860px) {
    .planning-timeline-date-toolbar,
    .planning-timeline-date-toolbar.is-open {
        top: 62px;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .planning-timeline-date-toolbar-value {
        justify-self: start;
    }

    .planning-timeline-date-toolbar-actions {
        justify-content: flex-end;
    }
}

#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;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 4px -18px 0;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}

#projectPlanningModal .modal .modal-actions .btn-primary,
#projectPlanningModal .modal .modal-actions .btn-secondary,
#workBreakdownModal .modal .modal-actions .btn-primary,
#workBreakdownModal .modal .modal-actions .btn-secondary {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 13px;
  font-size: 13px;
  line-height: 1.1;
  white-space: nowrap;
}

#projectPlanningModal .modal .modal-actions [id*="remove"][id*="SegmentButton"],
#workBreakdownModal .modal .modal-actions [id*="remove"][id*="SegmentButton"] {
  padding-left: 11px;
  padding-right: 11px;
}
