/* Native, stable anchoring: the calendar belongs to the date picker itself. */
.report-page .report-control-card {
  overflow: visible !important;
}

.report-page .report-date-picker {
  position: relative !important;
  z-index: 1000 !important;
  overflow: visible !important;
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
}

.report-page .report-date-picker > button:first-child {
  width: 250px !important;
  min-width: 250px !important;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.report-page .report-date-picker > .report-calendar-menu,
.report-page .report-date-picker > .compact-report-calendar {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto !important;
  inset: auto 0 auto auto !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1001 !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
  contain: none !important;
  box-shadow: 0 18px 50px rgba(5,72,91,.20) !important;
}

/* More usable report table height; header remains visible while scrolling. */
.report-page .order-profit-panel .report-table-wrap {
  min-height: 520px !important;
  height: clamp(520px, calc(100dvh - 235px), 760px) !important;
  max-height: none !important;
  overflow: auto !important;
  scrollbar-gutter: stable;
}

.report-page .order-profit-panel .report-table-wrap thead {
  position: sticky;
  top: 0;
  z-index: 4;
}

@media (max-width: 700px) {
  .report-page .report-date-picker > button:first-child {
    width: 220px !important;
    min-width: 220px !important;
    font-size: 12px !important;
  }
  .report-page .report-date-picker > .report-calendar-menu,
  .report-page .report-date-picker > .compact-report-calendar {
    right: -4px !important;
    max-width: calc(100vw - 24px) !important;
  }
}
