/* Date picker (components/date-picker/): the calendar panel and the date field that opens it.
   The calendar classes (ef-cal-*) are the Events filter's design, now shared. */

.ef-dropdown--calendar {
  width: 320px;
  padding-bottom: 8px;
}

.gf-calendar .ef-cal-header {
  padding: 10px 12px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gf-calendar .ef-cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e9edf2;
  background: #f8fafc;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
  padding: 0;
}

.gf-calendar .ef-cal-nav-btn:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.gf-calendar .ef-cal-selects {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
}

.gf-calendar .ef-cal-month-title {
  flex: 1;
  min-width: 0;
  font-size: var(--gf-text-body);
  font-weight: var(--gf-weight-semibold);
  color: #101828;
  text-align: center;
}

.gf-calendar .ef-cal-select-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
  flex: 0 0 auto;
}

.gf-calendar .ef-cal-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #e9edf2;
  border-radius: 999px;
  background: #f8fafc;
  cursor: pointer;
  font-family: var(--gf-font);
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-semibold);
  color: #0f172a;
  transition: all 160ms cubic-bezier(0.2, 0, 0, 1);
  outline: none;
}

.gf-calendar .ef-cal-select-btn:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.gf-calendar .ef-cal-select-btn svg {
  flex-shrink: 0;
  pointer-events: none;
}

.gf-calendar .ef-cal-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 130px;
  max-height: 180px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e9edf2;
  border-radius: 14px;
  box-shadow:
    0 12px 24px -4px rgba(16, 24, 40, 0.12),
    0 4px 6px -2px rgba(16, 24, 40, 0.04);
  padding: 4px;
  z-index: 100000;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.gf-calendar .ef-cal-dropdown-menu--years {
  min-width: 90px;
}

.gf-calendar .ef-cal-dropdown-menu::-webkit-scrollbar {
  width: 5px;
}

.gf-calendar .ef-cal-dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}

.gf-calendar .ef-cal-dropdown-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.gf-calendar .ef-cal-dropdown-item {
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--gf-font);
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-medium);
  color: #334155;
  cursor: pointer;
  transition:
    background 160ms cubic-bezier(0.2, 0, 0, 1),
    color 160ms cubic-bezier(0.2, 0, 0, 1);
  white-space: nowrap;
}

.gf-calendar .ef-cal-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.gf-calendar .ef-cal-dropdown-item.is-active {
  background: #2966F4;
  color: #ffffff;
  font-weight: var(--gf-weight-semibold);
}

.gf-calendar .ef-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 2px 8px 4px;
  gap: 0;
}

.gf-calendar .ef-cal-weekdays span {
  text-align: center;
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-medium);
  color: #98a2b3;
  padding: 2px 0;
}

.gf-calendar .ef-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 8px;
  gap: 2px;
}

.gf-calendar .ef-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: var(--gf-text-caption);
  color: #101828;
  cursor: pointer;
  transition:
    background 160ms cubic-bezier(0.2, 0, 0, 1),
    color 160ms cubic-bezier(0.2, 0, 0, 1);
}

.gf-calendar .ef-cal-day:hover {
  background: #f2f4f7;
}

.gf-calendar .ef-cal-day.is-other-month {
  color: #d0d5dd;
  cursor: default;
}

.gf-calendar .ef-cal-day.is-other-month:hover {
  background: transparent;
}

.gf-calendar .ef-cal-day.is-today {
  font-weight: var(--gf-weight-bold);
  color: #2966f4;
}

.gf-calendar .ef-cal-day.is-today:not(.is-staged) {
  border: 1px solid #2966f4;
  background: #ffffff;
}

.gf-calendar .ef-cal-day.is-staged {
  background: #2966f4;
  color: #ffffff;
  font-weight: var(--gf-weight-semibold);
}

.gf-calendar .ef-cal-day.is-staged:hover {
  background: #2054CC;
}

.gf-calendar .ef-cal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 6px 12px 2px;
}

.gf-calendar .ef-cal-apply {
  box-sizing: border-box;
  padding: 6px 16px;
  border: none;
  border-radius: 16px;
  background: #2966f4;
  color: #ffffff;
  font-family: inherit;
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-semibold);
  cursor: pointer;
  transition: background 160ms cubic-bezier(0.2, 0, 0, 1);
}

.gf-calendar .ef-cal-apply:hover {
  background: #2054CC;
}

.gf-calendar .ef-cal-day:disabled,
.gf-calendar .ef-cal-day.is-disabled {
  color: #d0d5dd;
  cursor: default;
}

.gf-calendar .ef-cal-day.is-disabled:hover {
  background: transparent;
}

.gf-calendar .ef-cal-apply:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Date field: the trigger takes the host form's input look through triggerClass. */
.gf-date-field {
  position: relative;
  width: 100%;
}

.gf-date-field .gf-date-field__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gf-date-field .gf-date-field__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #667085;
}

.gf-date-field .gf-date-field__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #101828;
}

.gf-date-field .gf-date-field__value.is-placeholder {
  color: #98a2b3;
}

.gf-date-field .gf-date-field__chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: #667085;
  transition: transform 160ms cubic-bezier(0.2, 0, 0, 1);
}

.gf-date-field.is-open .gf-date-field__chevron {
  transform: rotate(180deg);
}

.gf-date-field.is-open .meeting-create-select-btn {
  border-color: #3263ef;
  box-shadow: 0 0 0 3px rgba(50, 99, 239, 0.12);
}

.gf-date-field__popover {
  position: fixed;
  top: calc(100% + 6px);
  left: 12px;
  z-index: 100300;
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 6px 6px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 40px -8px rgba(16, 24, 40, 0.24), 0 8px 16px -6px rgba(16, 24, 40, 0.14);
}

.gf-date-field__popover--side-time {
  box-sizing: border-box;
  width: 640px;
  max-width: min(640px, calc(100vw - 24px));
  padding: 0;
  border-radius: 20px;
}

.gf-calendar--side-time {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  grid-template-rows: 74px minmax(342px, auto) 64px;
  min-width: 0;
  min-height: 480px;
}

.gf-calendar__selection-head {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 1;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 20px;
  border-bottom: 1px solid #eaecf0;
}
.gf-calendar__selection-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.gf-calendar__selection-copy strong { color: #182230; font-size: var(--gf-text-title-card); line-height: var(--gf-leading-title-card); }
.gf-calendar__selection-copy span { color: #475467; font-size: var(--gf-text-body); line-height: var(--gf-leading-body); }
.gf-calendar__quick-dates { display: flex; flex: none; align-items: center; gap: 6px; }
.gf-calendar__quick-dates button { min-height: 32px; padding: 0 12px; border: 1px solid #dfe3ea; border-radius: 999px; background: #fff; color: #344054; font: inherit; font-size: var(--gf-text-caption); font-weight: var(--gf-weight-medium); white-space: nowrap; cursor: pointer; }
.gf-calendar__quick-dates button.is-active { border-color: #2966f4; background: #f4f7ff; color: #245cf5; }
.gf-calendar__quick-dates button:disabled { color: #98a2b3; cursor: not-allowed; }

.gf-calendar__selection-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.gf-calendar__selection-copy strong {
  color: #182230;
  font-size: var(--gf-text-card);
  line-height: 24px;
}

.gf-calendar__selection-copy span {
  color: #475467;
  font-size: var(--gf-text-caption);
  line-height: 20px;
}

.gf-calendar__quick-dates {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.gf-calendar__quick-dates button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #dfe3ea;
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-medium);
  white-space: nowrap;
  cursor: pointer;
}

.gf-calendar__quick-dates button.is-active {
  border-color: #2966f4;
  background: #f4f7ff;
  color: #245cf5;
}

.gf-calendar__quick-dates button:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.gf-calendar--side-time > .gf-calendar__date-panel {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  padding: 12px 16px 16px;
  border-right: 1px solid #eaecf0;
}

.gf-calendar--side-time > .gf-calendar__date-panel .ef-cal-header {
  padding: 2px 0 10px;
}

.gf-calendar--side-time .ef-cal-month-title {
  flex: 1;
  order: -1;
  font-size: var(--gf-text-body);
  text-align: left;
}

.gf-calendar--side-time > .gf-calendar__date-panel .ef-cal-weekdays {
  padding: 0 0 4px;
}

.gf-calendar--side-time > .gf-calendar__date-panel .ef-cal-days {
  padding: 0;
  gap: 2px 0;
}

.gf-calendar--side-time .ef-cal-day {
  width: 40px;
  height: 40px;
  justify-self: center;
  border-radius: 50%;
  font-size: var(--gf-text-caption);
}

.gf-calendar--side-time .ef-cal-day.is-staged {
  box-shadow: 0 3px 7px rgba(41, 102, 244, 0.25);
}
.gf-calendar--side-time > .gf-calendar__date-panel .ef-cal-header { padding: 2px 0 10px; }
.gf-calendar--side-time .ef-cal-month-title { flex: 1; order: -1; font-size: var(--gf-text-body); text-align: left; }
.gf-calendar--side-time > .gf-calendar__date-panel .ef-cal-weekdays { padding: 0 0 4px; }
.gf-calendar--side-time > .gf-calendar__date-panel .ef-cal-days { padding: 0; gap: 2px 0; }
.gf-calendar--side-time .ef-cal-day { width: 40px; height: 40px; justify-self: center; border-radius: 50%; font-size: var(--gf-text-caption); }
.gf-calendar--side-time .ef-cal-day.is-staged { box-shadow: 0 3px 7px rgba(41, 102, 244, 0.25); }

.gf-calendar--side-time > .gf-calendar__times {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  margin: 0;
  padding: 14px 16px 16px;
  border: 0;
}

.gf-calendar__dayparts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  min-height: 36px;
  padding: 3px;
  border-radius: 999px;
  background: #f0f2f5;
}

.gf-calendar__dayparts button {
  min-width: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475467;
  font: inherit;
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-medium);
  cursor: pointer;
}

.gf-calendar__dayparts button.is-active {
  background: #fff;
  color: #182230;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.14);
}
.gf-calendar__dayparts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; min-height: 36px; padding: 3px; border-radius: 999px; background: #f0f2f5; }
.gf-calendar__dayparts button { min-width: 0; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: #475467; font: inherit; font-size: var(--gf-text-caption); font-weight: var(--gf-weight-medium); cursor: pointer; }
.gf-calendar__dayparts button.is-active { background: #fff; color: #182230; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.14); }

.gf-calendar.gf-calendar--side-time .gf-calendar__time-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 216px;
  margin-top: 12px;
}

.gf-calendar--side-time .gf-calendar__time {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  background: #fff;
  font-size: var(--gf-text-caption);
  text-align: center;
}

.gf-calendar--side-time .gf-calendar__time.is-active {
  border-color: #3263ef;
  background: #3263ef;
  color: #fff;
}

.gf-calendar--side-time .gf-calendar__time.is-busy,
.gf-calendar--side-time .gf-calendar__time.is-busy:hover {
  border-color: #eaecf0;
  background: #f7f8fa;
  color: #98a2b3;
  text-decoration: line-through;
}

.gf-calendar__custom-time {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  color: #667085;
}

.gf-calendar__custom-time svg { flex: none; }

.gf-calendar__custom-time input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #182230;
  font: inherit;
  font-size: var(--gf-text-caption);
}

.gf-calendar__custom-time:focus-within {
  border-color: #3263ef;
  box-shadow: 0 0 0 3px rgba(50, 99, 239, 0.12);
}
.gf-calendar--side-time .gf-calendar__time { min-height: 36px; padding: 0 8px; border: 1px solid #dfe3ea; border-radius: 12px; background: #fff; font-size: var(--gf-text-caption); text-align: center; }
.gf-calendar--side-time .gf-calendar__time.is-active { border-color: #3263ef; background: #3263ef; color: #fff; }
.gf-calendar--side-time .gf-calendar__time.is-busy, .gf-calendar--side-time .gf-calendar__time.is-busy:hover { border-color: #eaecf0; background: #f7f8fa; color: #98a2b3; text-decoration: line-through; }
.gf-calendar__custom-time { display: flex; align-items: center; gap: 8px; height: 40px; margin-top: 10px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 999px; color: #667085; }
.gf-calendar__custom-time svg { flex: none; }
.gf-calendar__custom-time input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #182230; font: inherit; font-size: var(--gf-text-caption); }
.gf-calendar__custom-time:focus-within { border-color: #3263ef; box-shadow: 0 0 0 3px rgba(50, 99, 239, 0.12); }

.gf-calendar--side-time > .ef-cal-footer {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin: 0;
  padding: 10px 20px;
  border-top: 1px solid #eaecf0;
}

.gf-calendar__timezone {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  min-width: 0;
  overflow: hidden;
  background: #f2f4f7;
  color: #667085;
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-regular);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gf-calendar__timezone svg {
  flex: none;
}

.gf-calendar__footer-actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.gf-calendar__footer-actions.is-time-actions > button {
  box-sizing: border-box;
  width: 100px !important;
  height: 36px !important;
  min-height: 36px !important;
}

.gf-calendar .gf-calendar__cancel {
  padding: 0 12px;
  border: 1px solid #e4e7ec;
  border-radius: 999px;
  background: #ffffff;
  color: #344054;
  font: inherit;
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-semibold);
  cursor: pointer;
}

/* The popover renders the calendar component through a display: contents host. */
.gf-date-field__popover > .gf-contents {
  display: contents;
}

/* The element hosting the field fills its row, like the inputs around it (some forms lay fields
   out in flex columns that would otherwise shrink it to its text). */
[x-component="date-picker/field"] {
  display: block;
  width: 100%;
}

/* Optional time part (time: {…}): half-hour slots under the days. */
.gf-calendar .gf-calendar__times {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 8px 0;
  padding-top: 8px;
  border-top: 1px solid #eaecf0;
}

.gf-calendar .gf-calendar__times-label {
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-semibold);
  color: #101828;
}

.gf-calendar__times-heading {
  display: flex;
  align-items: center;
}

.gf-calendar .gf-calendar__time-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  min-height: 0;
  max-height: 124px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.gf-calendar .gf-calendar__time {
  min-height: 34px;
  padding: 6px 12px 6px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #101828;
  font: inherit;
  font-size: var(--gf-text-caption);
  font-weight: var(--gf-weight-medium);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.gf-calendar .gf-calendar__time:hover {
  background: #f8fafc;
}

.gf-calendar .gf-calendar__time.is-active {
  border-color: #2966f4;
  background: #eef2ff;
  color: #2966f4;
  font-weight: var(--gf-weight-semibold);
}

.gf-calendar .gf-calendar__time.is-busy,
.gf-calendar .gf-calendar__time.is-busy:hover {
  border-color: transparent;
  background: #f7f8fa;
  color: #98a2b3;
  text-decoration: line-through;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .gf-date-field__popover--side-time {
    width: calc(100vw - 24px);
  }

  .gf-calendar--side-time {
    display: flex;
    flex-direction: column;
  }

  .gf-calendar--side-time > .gf-calendar__times {
    margin: 0;
    padding: 14px 16px;
    border-top: 0;
    border-left: 0;
  }

  /* Same specificity as the column rule above, or the side-by-side layout wins on a phone.
     Three to a row, so "10:30 AM" still fits at the 16px floor. */
  .gf-calendar.gf-calendar--side-time .gf-calendar__time-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 116px;
  }

  .gf-calendar--side-time .gf-calendar__time {
    padding: 6px 8px;
    text-align: center;
  }

  .gf-calendar--side-time > .gf-calendar__date-panel {
    border-right: 0;
    border-bottom: 1px solid #eaecf0;
  }

  .gf-calendar__selection-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .gf-calendar__quick-dates { width: 100%; }
  .gf-calendar__quick-dates button { flex: 1; padding: 0 8px; }

  .gf-calendar--side-time > .gf-calendar__times {
    margin: 0;
    padding: 14px 16px;
    border-top: 0;
  }

  .gf-calendar--side-time > .ef-cal-footer {
    flex-wrap: wrap;
  }

  .gf-calendar--side-time .gf-calendar__timezone { flex: 1 1 100%; }

  .gf-calendar__footer-actions.is-time-actions {
    width: 100%;
  }

  .gf-calendar__footer-actions.is-time-actions > button {
    width: calc(50% - 4px);
  }
}

/* Keep every date/time label at the global 16px floor, regardless of dashboard overrides. */
.gf-date-field__popover .gf-calendar {
  font-size: max(16px, var(--gf-text-caption)) !important;
}

.gf-date-field__popover .gf-calendar :is(button, input, span, strong) {
  font-size: max(16px, var(--gf-text-caption)) !important;
}

.gf-date-field__popover .gf-calendar__selection-copy strong {
  font-size: max(18px, var(--gf-text-card)) !important;
}

@media (max-width: 560px) {
  .gf-date-field__popover .gf-calendar__footer-actions.is-time-actions > button {
    width: calc(50% - 4px) !important;
  }
}
