/* Stable Flatpickr layout used by every legacy management level. */

.flatpickr-calendar.kl-stable-datepicker {
  z-index: 2147483000 !important;
  width: min(328px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  overflow: visible !important;
  isolation: isolate;
  border: 1px solid #dfe6ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(31, 41, 55, .2);
}

.flatpickr-calendar.kl-stable-datepicker::before,
.flatpickr-calendar.kl-stable-datepicker::after {
  z-index: -1;
}

.kl-stable-datepicker .flatpickr-months {
  position: relative;
  min-height: 52px;
  padding: 7px 8px 0 !important;
  overflow: visible !important;
  border-radius: 16px 16px 0 0;
  background: #fff;
}

.kl-stable-datepicker .flatpickr-months .flatpickr-month {
  width: 100%;
  height: 44px;
  min-height: 44px;
  overflow: visible !important;
  background: #fff;
}

.kl-stable-datepicker .flatpickr-current-month {
  position: absolute !important;
  top: 7px !important;
  right: 42px !important;
  left: 42px !important;
  display: flex !important;
  width: auto !important;
  height: 38px !important;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 !important;
  overflow: visible !important;
  line-height: 1 !important;
}

.kl-stable-datepicker .kl-native-month-label,
.kl-stable-datepicker .flatpickr-monthDropdown-months {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.kl-datepicker-month-trigger {
  display: inline-flex;
  min-width: 92px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #263244;
  font: inherit;
  font-size: .94rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.kl-datepicker-month-trigger::after {
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-bottom: 0;
  border-left: 5px solid transparent;
  border-top: 6px solid #7b8797;
  content: '';
  transition: transform .15s ease;
}

.kl-stable-datepicker.kl-month-menu-open .kl-datepicker-month-trigger {
  background: #eef3ff;
  color: #355fc0;
}

.kl-stable-datepicker.kl-month-menu-open .kl-datepicker-month-trigger::after {
  transform: rotate(180deg);
}

.kl-stable-datepicker .flatpickr-current-month .numInputWrapper {
  width: 72px !important;
  min-width: 72px;
  flex: 0 0 72px;
}

.kl-stable-datepicker .flatpickr-current-month input.cur-year {
  width: 100% !important;
  min-width: 0;
  height: 34px !important;
  padding: 0 20px 0 5px !important;
  color: #263244;
  font-size: .9rem;
  font-weight: 750;
  line-height: 34px;
  text-align: center;
}

.kl-stable-datepicker .flatpickr-months .flatpickr-prev-month,
.kl-stable-datepicker .flatpickr-months .flatpickr-next-month {
  top: 8px !important;
  display: grid !important;
  width: 34px !important;
  height: 34px !important;
  place-items: center;
  padding: 7px !important;
  border-radius: 9px;
  color: #344054;
}

.kl-stable-datepicker .flatpickr-months .flatpickr-prev-month:hover,
.kl-stable-datepicker .flatpickr-months .flatpickr-next-month:hover {
  background: #eef3ff;
  color: #355fc0;
}

.kl-stable-datepicker .flatpickr-months .flatpickr-prev-month {
  left: 8px !important;
}

.kl-stable-datepicker .flatpickr-months .flatpickr-next-month {
  right: 8px !important;
}

.kl-datepicker-month-menu {
  position: absolute;
  top: 52px;
  right: 12px;
  left: 12px;
  z-index: 2147483646 !important;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  max-height: 286px;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid #dbe4f2;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(31, 41, 55, .24);
  overscroll-behavior: contain;
}

.kl-datepicker-month-menu[hidden] {
  display: none !important;
}

.kl-datepicker-month-menu button {
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #fff;
  color: #435066;
  font: inherit;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.kl-datepicker-month-menu button:hover,
.kl-datepicker-month-menu button:focus-visible {
  border-color: #c8d6ff;
  outline: none;
  background: #eef3ff;
  color: #355fc0;
}

.kl-datepicker-month-menu button[aria-selected="true"] {
  border-color: #5d87ff;
  background: #5d87ff;
  color: #fff;
}

.kl-datepicker-month-menu button:disabled {
  border-color: transparent;
  background: #f7f8fa;
  color: #b1bac7;
  cursor: not-allowed;
}

.kl-stable-datepicker .flatpickr-innerContainer {
  overflow: hidden;
  border-radius: 0 0 16px 16px;
  background: #fff;
}

.kl-stable-datepicker .flatpickr-weekdays,
.kl-stable-datepicker .flatpickr-weekdaycontainer,
.kl-stable-datepicker .flatpickr-days,
.kl-stable-datepicker .flatpickr-days .dayContainer {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
}

.kl-stable-datepicker .flatpickr-day {
  max-width: 14.285714% !important;
  flex-basis: 14.285714% !important;
}

@media (max-width: 575.98px) {
  .flatpickr-calendar.kl-stable-datepicker {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
  }

  .kl-stable-datepicker .flatpickr-current-month {
    right: 38px !important;
    left: 38px !important;
  }

  .kl-datepicker-month-trigger {
    min-width: 82px;
    padding-right: 7px;
    padding-left: 7px;
    font-size: .88rem;
  }

  .kl-stable-datepicker .flatpickr-current-month .numInputWrapper {
    width: 66px !important;
    min-width: 66px;
    flex-basis: 66px;
  }

  .kl-datepicker-month-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(330px, calc(100dvh - 150px));
  }
}
