/**
 * SAMP v4.10.90 responsive hotfix — Reports 940 filters + search.
 * Keeps every filter/action visible when desktop width or browser zoom changes,
 * while using a compact two-column layout on phones.
 */

@media (min-width: 761px) {
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row {
    grid-template-columns:
      minmax(0, 1.08fr) minmax(0, .86fr)
      minmax(0, 1.08fr) minmax(0, .86fr)
      minmax(0, 1.02fr) minmax(0, 1.02fr)
      minmax(0, 1fr) minmax(0, 1fr)
      minmax(0, 1fr) minmax(0, .94fr)
      minmax(0, .58fr) minmax(0, .55fr)
      minmax(0, 1.75fr) !important;
    grid-auto-flow: row !important;
    grid-auto-columns: unset !important;
    grid-auto-rows: unset !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > * {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row input,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row select,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > button,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > .reports-filter-select-field {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > #reports940-search {
    align-self: end !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border: 1px solid #d8e6e7 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #173f55 !important;
    direction: rtl !important;
    text-align: right !important;
    font-size: 8px !important;
    font-weight: 650 !important;
    line-height: 1 !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > #reports940-search::placeholder {
    color: #7c8e96 !important;
    opacity: 1 !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > #reports940-search:focus {
    border-color: #52b7a4 !important;
    outline: 0 !important;
    box-shadow: 0 0 0 3px rgba(23,168,139,.09) !important;
  }

  /* Reset an older, more-specific period-bar grid rule that could push the
     Excel button beyond the left edge on medium desktop widths. */
  body:not(.auth-locked) #dashboard-view .dashboard-period-filter .reports-filter-top-row {
    direction: rtl !important;
    display: flex !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
  }

  body:not(.auth-locked) #dashboard-view .dashboard-period-filter .reports-filter-top-actions,
  body:not(.auth-locked) #dashboard-view .dashboard-period-filter .reports-filter-support-actions {
    flex: 0 0 auto !important;
    min-width: max-content !important;
  }
}

@media (min-width: 761px) and (max-width: 1120px) {
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row {
    gap: 4px !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > label,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > .reports-filter-select-field {
    font-size: 6.8px !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > .reports-filter-select-field > span {
    padding-inline: 2px !important;
    font-size: 6.8px !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row input,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row select,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > button,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > .reports-filter-select-field > select {
    padding-inline: 3px !important;
    font-size: 7px !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > .reports-filter-select-field > select {
    padding-inline-start: 18px !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > #reports940-search {
    padding-inline: 6px !important;
    font-size: 7px !important;
  }
}


@media (max-width: 760px) {
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row {
    direction: rtl;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    grid-auto-columns: unset !important;
    grid-auto-rows: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 7px !important;
    overflow: visible !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > * {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > label,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > .reports-filter-select-field {
    height: auto !important;
    grid-template-rows: auto 42px !important;
    gap: 3px !important;
    font-size: 10px !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > .reports-filter-select-field > span {
    height: auto !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row input,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row select,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > button,
  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > .reports-filter-select-field > select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    font-size: 16px !important;
  }

  body:not(.auth-locked) #dashboard-view .dashboard-period-filter .reports-filter-top-row {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  body:not(.auth-locked) #dashboard-view .dashboard-period-filter .reports-filter-top-actions,
  body:not(.auth-locked) #dashboard-view .dashboard-period-filter .reports-filter-support-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body:not(.auth-locked) #dashboard-view .dashboard-period-filter .reports-filter-top-actions > button,
  body:not(.auth-locked) #dashboard-view .dashboard-period-filter .reports-filter-support-actions > button {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-inline: 5px !important;
    font-size: 10px !important;
  }

  body:not(.auth-locked) #dashboard-view .reports-filter-bottom-row > #reports940-search {
    grid-column: 1 / -1 !important;
    align-self: stretch !important;
    height: 42px !important;
    min-height: 42px !important;
    padding-inline: 10px !important;
    font-size: 13px !important;
  }
}

