/* Statistics - Export button */

/* Export CTA Button Component (Figma node 27184:186381) */
.c-exportBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 45px;
  padding: 0 25px;
  border-radius: 40px;
  border: 1px solid #1E1E1C;
  background-color: #FFFFFF;
  color: #1E1E1C;
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 100%;
  letter-spacing: -0.6px;
  cursor: pointer;
  outline: none;
  pointer-events: auto !important;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.c-exportBtn__text {
  color: #1E1E1C;
}

html[data-page=statistics] .section__exportWrapper,
html[data-page=customer-operating-units-statistics] .section__exportWrapper,
html[data-page=biller-operating-units-statistics] .section__exportWrapper {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

/* Inside pages with DataTables (Clean flex space-between layout) */
.section__filterBar {
  display: flex !important;
  position: relative !important;
  z-index: 20 !important;
  width: 100% !important;
}

.dataTables_filterWrapper,
div.dataTables_wrapper .dataTables_filterWrapper {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  z-index: 10 !important;
}

@media (min-width: 1024px) {
  .section__filterBar {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 15px !important;
    margin-top: 20px !important;
  }

  .section__filterBar .filterDropdowns {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    margin: 0 !important;
    flex-wrap: wrap !important;
    pointer-events: none !important;
  }

  .section__filterBar .filterDropdowns .filterDropdown {
    pointer-events: none !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }

  .section__filterBar .filterDropdowns .c-selectNative,
  .section__filterBar .filterDropdowns .c-selectCustom,
  .section__filterBar .filterDropdowns .c-selectCustom__trigger,
  .section__filterBar .filterDropdowns .c-selectCustom__options,
  .section__filterBar .filterDropdowns .c-selectCustom__option,
  .section__filterBar .filterDropdowns .c-multiselect__trigger,
  .section__filterBar .filterDropdowns .c-multiselect__options {
    pointer-events: auto !important;
  }

  .dataTables_filterWrapper,
  div.dataTables_wrapper .dataTables_filterWrapper {
    position: static !important;
    top: auto !important;
    right: auto !important;
    margin: 0 0 0 auto !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }

  .dataTables_filterWrapper .section__exportWrapper,
  div.dataTables_wrapper .dataTables_filterWrapper .section__exportWrapper {
    width: 130px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    display: flex !important;
  }

  .dataTables_filterWrapper .dataTables_filter,
  div.dataTables_wrapper .dataTables_filterWrapper .dataTables_filter {
    flex-shrink: 0 !important;
    position: static !important;
    margin: 0 !important;
  }

  .section__filterBar + .dataTable__container,
  .section__table .dataTable__container {
    margin-top: 30px !important;
  }
}

@media (max-width: 1023.98px) {
  .section__filterBar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 15px !important;
    margin-top: 15px !important;
  }

  .section__filterBar .filterDropdowns {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 0 !important;
    margin-left: calc(0px - var(--leftMargin)) !important;
    width: var(--viewportWidth) !important;
    padding: 0 20px !important;
    height: auto !important;
    min-height: 45px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    box-sizing: border-box !important;
  }

  .section__filterBar .filterDropdowns::-webkit-scrollbar {
    display: none !important;
  }

  .section__filterBar .filterDropdowns.is-dropdownOpen,
  .section__filterBar .filterDropdowns:has(.c-selectCustom.isActive) {
    overflow: visible !important;
    z-index: 100 !important;
  }

  .dataTables_filterWrapper,
  div.dataTables_wrapper .dataTables_filterWrapper {
    width: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    position: relative !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
  }

  .dataTables_filterWrapper:has(.c-exportDropdown.is-open),
  .dataTables_filterWrapper.is-dropdownOpen,
  div.dataTables_wrapper .dataTables_filterWrapper:has(.c-exportDropdown.is-open),
  div.dataTables_wrapper .dataTables_filterWrapper.is-dropdownOpen {
    z-index: 50 !important;
  }

  .dataTables_filterWrapper .section__exportWrapper:not(.isAbove1023),
  div.dataTables_wrapper .dataTables_filterWrapper .section__exportWrapper:not(.isAbove1023) {
    position: static !important;
    width: 130px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    display: flex !important;
  }

  .dataTables_filterWrapper .dataTables_filter,
  div.dataTables_wrapper .dataTables_filterWrapper .dataTables_filter {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    position: static !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  .dataTables_filterWrapper .dataTables_filter label,
  .dataTables_filterWrapper .dataTables_filter input,
  div.dataTables_wrapper .dataTables_filterWrapper .dataTables_filter label,
  div.dataTables_wrapper .dataTables_filterWrapper .dataTables_filter input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
  }

  /* opens under the Export button, capped at 425px on tablets (phones still get the full width) */
  .dataTables_filterWrapper .c-exportDropdown,
  div.dataTables_wrapper .dataTables_filterWrapper .c-exportDropdown {
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    max-width: 425px !important;
  }

  .section__filterBar + .dataTable__container,
  .section__table .dataTable__container {
    margin-top: 20px !important;
  }
}

/* Restore search input styles after filterWrapper is moved outside div.dataTables_wrapper */
.dataTables_filterWrapper .dataTables_filter {
  position: relative !important;
  /* background-image: url("assets/images/vectors/icon_search.svg") !important; */
  background-image: url("../../../../assets/images/vectors/icon_search.svg") !important;
  background-size: 15px auto !important;
  background-position: 25px 15px !important;
  background-repeat: no-repeat !important;
  text-align: left !important;
}

.dataTables_filterWrapper .dataTables_filter input {
  width: 150px;
  padding: 0 25px 0 50px !important;
  height: 45px !important;
  border-radius: 40px !important;
  border: 1px solid #dadada !important;
  background: transparent !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.dataTables_filterWrapper .section__exportWrapper {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  position: relative !important;
}

.dataTables_filterWrapper .c-exportBtn {
  width: 130px !important;
  height: 45px !important;
  padding: 0 30px !important;
  box-sizing: border-box !important;
}

@media(max-width: 1023.98px) {
    html[data-page=statistics] .section__exportWrapper {
        margin-left: 0 !important;
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }

    /* CU filter bar is a row: export sits beside the year select, must not take 100% width */
    html[data-page=statistics] #centralUnit .section__exportWrapper {
        position: static !important;
        margin-left: auto !important;
        width: auto !important;
    }

    .dataTables_filterWrapper .section__exportWrapper.isAbove1023 {
        display: none !important;
    }
}

/* Pages with two tables (e.g. Central Unit monthly / daily) toggle the inactive table's search with jQuery
   .hide()/.show() (inline display:none). The display:flex !important rules above must not override that. */
.dataTables_filterWrapper[style*="display: none"],
div.dataTables_wrapper .dataTables_filterWrapper[style*="display: none"] {
  display: none !important;
}
