/* Only the Time Frame Filter modal. Keep the shared application colors. */
#generic-modal-time-frame-filter.modal-dialog,
#generic-modal-time-frame-filter .modal-dialog {
  width: min(440px, calc(100vw - 24px)) !important;
  max-width: min(440px, calc(100vw - 24px)) !important;
  margin: 32px auto;
}
#generic-modal-time-frame-filter .modal-content {
  border: 1px solid #d0dbe5;
  border-radius: 12px;
  box-shadow: 0 18px 55px #18324726;
  /* Calendar popup must be able to extend outside the compact dialog. */
  overflow: visible;
}
#generic-modal-time-frame-filter .modal-header {
  padding: 16px 20px;
  background: #b9c9da;
  border-bottom: 1px solid #8fa2cc;
  border-radius: 11px 11px 0 0;
}
#generic-modal-time-frame-filter .modal-body {
  padding: 24px;
  overflow: visible;
}
#generic-modal-time-frame-filter .modal-footer {
  padding: 14px 20px;
  background: #e9ecee;
  border-top: 1px solid #8fa2cc;
  border-radius: 0 0 11px 11px;
  gap: 8px;
}
#generic-modal-time-frame-filter .modal-footer .btn {
  min-width: 84px;
  min-height: 38px;
  margin: 0;
  border-radius: 7px;
  font-weight: 600;
}
#generic-modal-time-frame-filter .time-filter-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#generic-modal-time-frame-filter .time-filter-label {
  color: #425466;
  font-size: 13px;
  font-weight: 600;
}
#time-frame-filter-date-range {
  width: 100%;
  /* Callbacks set black/green inline borders. Keep their state color,
     but replace the heavy border width and neutral black appearance. */
  border-width: 1px !important;
  border-radius: 8px;
  background: #fff;
}
#time-frame-filter-date-range[style*="black"] {
  border-color: #d5dee6 !important;
}
#time-frame-filter-date-range:focus-within {
  box-shadow: 0 0 0 3px #177da51f;
}
#time-frame-filter-date-range .DateRangePicker { width: 100%; }
#time-frame-filter-date-range .DateRangePickerInput {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 4px 8px;
}
#time-frame-filter-date-range .DateInput {
  width: calc((100% - 32px) / 2);
  background: transparent;
}
#time-frame-filter-date-range .DateInput_input {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #263b4b;
  text-align: center;
  border-bottom: 2px solid transparent;
  background: transparent;
}
#time-frame-filter-date-range .DateInput_input__focused {
  border-bottom-color: var(--sg-primary, #177da5);
}
#time-frame-filter-date-range .DateRangePickerInput_arrow {
  color: #8292a1;
  padding: 0 4px;
}
#time-frame-filter-date-range .DateRangePicker_picker { z-index: 20; }
#generic-modal-time-frame-filter .time-filter-presets {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
#generic-modal-time-frame-filter .time-filter-presets .btn {
  min-height: 40px;
  padding: 8px 4px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
#generic-modal-time-frame-filter .time-filter-presets .btn-primary {
  background: #f4f7fa;
  border-color: #d9e2e9;
  color: #496171;
}
#generic-modal-time-frame-filter .time-filter-presets .btn-primary:hover {
  background: #e8f4f9;
  border-color: #9abfce;
  color: #125c7a;
}
#generic-modal-time-frame-filter .time-filter-presets .btn-success {
  background: var(--sg-primary-light, #e8f4f9);
  color: var(--sg-primary, #177da5);
  border: 2px solid var(--sg-primary, #177da5);
  padding: 7px 3px;
}
#generic-modal-time-frame-filter .btn:focus-visible {
  outline: 2px solid var(--sg-primary, #177da5);
  outline-offset: 3px;
}
@media (max-width: 380px) {
  #generic-modal-time-frame-filter .modal-body { padding: 16px 12px; }
  #generic-modal-time-frame-filter .time-filter-presets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #time-frame-filter-date-range .DateInput_input { font-size: 13px; }
}
