.calendar {
  width: 75%;
  display: flex;
  gap: 10px;
  height: 80vh;
  overflow-y: scroll;
  overflow-x: scroll;
  position: relative;
  box-sizing: border-box;
  float: left;
}

.calendar_header {
  position: sticky;
  top: 0;
  background: var(--body-background-color);
  z-index: 11;
  min-height: 30px;
  height: auto;
  padding: 0 20px;
  box-sizing: border-box;
  width: calc(100% + 20px);
  margin-left: -10px;
  border-bottom: 2px solid var(--accordion-background);
  transition: background 0.8s, border 0.8s;
}

.calendar_footer {
  position: sticky;
  bottom: -1px;
  background: var(--body-background-color);
  z-index: 11;
  padding: 5px 10px;
  width: calc(100% + 20px);
  margin-left: -10px;
  box-sizing: border-box;
  border-top: 2px solid var(--accordion-background);
  transition: background 0.8s, border 0.8s;
}

.calendar_day {
  border-right: 2px solid var(--accordion-background);
  position: relative;
  padding-right: 10px;
  width: 100%;
  height: fit-content;
  transition: background 0.8s, border 0.8s;
  min-width: 250px;
}

.calendar_day:nth-last-child(2) {
  border-right: none;
}

.calendar_day:nth-of-type(6) .calendar_hour:not(.calendar_hour_dark),
.calendar_day:nth-of-type(7) .calendar_hour:not(.calendar_hour_dark) {
  filter: brightness(90%);
}

.calendar_day_content {
  position: relative;
}

.calendar_hour {
  height: 50px;
  position: relative;
  background-color: var(--body-background-color);
  transition: background 0.8s, border 0.8s;
}

.calendar_hour_dark {
  filter: brightness(85%);
}

.calendar_hour:nth-child(odd):after {
  content: "";
  position: absolute;
  top: -1px;
  right: 0;
  width: calc(100% - 45px);
  height: 1px;
  border-bottom: 1px solid var(--accordion-background);
}

.calendar_hour:nth-child(even):after {
  content: "";
  position: absolute;
  top: -1px;
  right: 0;
  width: calc(100% - 45px);
  height: 1px;
  border-top: 1px solid hsl(from var(--accordion-background) h s calc(l + 10));
}

.calendar_hour p {
  margin: 0;
  position: absolute;
  left: 5px;
  top: -10px;
  color: var(--accordion-background);
}

.calendar_work {
  border-left: 5px solid var(--accordion-background);
  width: calc(100% - 55px);
  background: var(--accordion-background);
  position: absolute;
  right: 5px;
  min-width: 200px;
  top: 400px;
  height: 100px;
  background: color-mix(in srgb, var(--accordion-background) 80%, transparent);
  opacity: 0.8;
  padding: 5px;
  box-sizing: border-box;
  z-index: 10;
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  min-height: calc(1 / 6 * 100px - 2px);
  box-shadow: #c6c6c6 1px 1px 3px 0px;
}

.calendar_work_handle {
  position: absolute;
  left: -8px;
  top: 0;
  height: 100%;
  width: 8px;
  background: color-mix(in srgb, var(--accordion-background) 80%, black);
  cursor: grab;
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
}

.calendar_work_button_container {
  position: absolute;
  bottom: 0;
  width: 100%;
  right: 5px;
  padding: 5px 0;
}

.calendar_work_button_container button {
  font-size: 11px;
}

.calendar_work p {
  margin: 2px 0;
}

.calendar_work[data-plan-informed="1"] {
  background: color-mix(in srgb, var(--yellow-color) 80%, transparent);
}
.calendar_work[data-plan-informed="1"] .calendar_work_handle {
  background: color-mix(in srgb, var(--yellow-color) 80%, black);
}

.calendar_work[data-plan-confirmed="1"] {
  background: color-mix(in srgb, var(--blue-color) 80%, transparent);
}
.calendar_work[data-plan-confirmed="1"] .calendar_work_handle {
  background: color-mix(in srgb, var(--blue-color) 80%, black);
}

.calendar_work[data-plan-done="1"] {
  background: color-mix(in srgb, var(--green-color) 80%, transparent);
}
.calendar_work[data-plan-done="1"] .calendar_work_handle {
  background: color-mix(in srgb, var(--green-color) 80%, black);
}

.calendar_work[data-plan-skipped="1"] {
  background: color-mix(in srgb, var(--red-color) 80%, transparent);
}
.calendar_work[data-plan-skipped="1"] .calendar_work_handle {
  background: color-mix(in srgb, var(--red-color) 80%, black);
}

.calendar_work_small {
  padding: 0 5px;
  display: flex;
  align-items: center;
}

.calendar_work_small p {
  font-size: 13px;
}

.calendar_work_small .calendar_work_button_container {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0;
}

.calendar_container {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
}

.calendar_info {
  width: 100%;
  border-bottom: 2px solid var(--accordion-background);
  padding-top: 0;
  display: flex;
  padding: 5px 10px;
  gap: 41px;
  justify-content: space-between;
}

.calendar_work_container {
  width: 100%;
  height: 2533px;
  position: absolute;
}

.work_container {
  width: 25%;
  height: 80vh;
  float: right;
  box-sizing: border-box;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 20px;
  position: relative;
  border: 2px solid var(--accordion-background);
  border-top: none;
}

.work_container h3 {
  margin-top: 0;
}

@media (max-width: 1366px) {
  .work_container {
    margin: 0;
    border: none;
  }
}
@media (min-width: 320px) and (max-width: 767px) {
  .calendar_day {
    width: 100%;
    min-width: 100%;
  }

  .calendar_container {
    flex-wrap: wrap;
  }
  .calendar {
    width: 100%;
  }
  .work_container {
    width: 100%;
    margin-top: 30px;
    margin-left: 0;
    height: auto;
    overflow-y: initial;
    min-width: initial;
  }
}

#time_marker {
  position: absolute;
  background-color: gray;
  width: 100%;
  height: 2px;
  z-index: 10;
  top: 760px;
  opacity: 0.8;
}

#time_marker_today {
  background-color: var(--red-color);
  width: 200px;
  height: 2px;
  position: absolute;
  left: 380px;
}

#time_marker_today::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background-color: var(--red-color);
  border-radius: 50%;
}

#selection {
  position: absolute;
  border: 1px solid #cbcbcb;
  background-color: rgb(176 176 176 / 20%);
  border-radius: 5px;
  display: none;
}

.unselected {
  opacity: 0.5;
}

.selected {
  opacity: 1;
}

/* ── Medewerkerbadges ── */
.employee_badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  margin: 1px 2px;
  white-space: nowrap;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  cursor: default;
}
.employee_color_1  { background:#d4edda; color:#155724; }
.employee_color_2  { background:#cce5ff; color:#004085; }
.employee_color_3  { background:#fff3cd; color:#856404; }
.employee_color_4  { background:#f8d7da; color:#721c24; }
.employee_color_5  { background:#d1ecf1; color:#0c5460; }
.employee_color_6  { background:#e2d9f3; color:#4a1e8c; }
.employee_color_7  { background:#fde8d8; color:#7d3a00; }
.employee_color_8  { background:#d5f5e3; color:#1a6131; }
.employee_color_9  { background:#fce4ec; color:#880e4f; }
.employee_color_10 { background:#e8f5e9; color:#2e7d32; }

/* Badges-container in kalenderblokken */
.calendar_work_employees {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 4px;
  padding-bottom: 24px;
}
.calendar_work.calendar_work_small .calendar_work_employees { display: none; }

/* ── Dagkoppeling in kolomkoppen ── */
.calendar_header_employees {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 2px 10px 4px;
  position: relative;
}
.day_emp_toggle_btn {
  font-size: 12px;
  line-height: 1;
  opacity: 0.5;
  padding: 1px 4px;
}
.day_emp_toggle_btn:hover { opacity: 1; }

.day_emp_dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 30;
  background: var(--body-background-color, #fff);
  border: 1px solid var(--accordion-background, #ddd);
  border-radius: var(--border-radius, 4px);
  padding: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 320px;
}
.day_emp_option { cursor: pointer; opacity: 0.45; transition: opacity .15s; }
.day_emp_option:hover,
.day_emp_option.day_emp_assigned { opacity: 1; }
