html,
body {
  padding: 0;
  margin: 0;
  height: 100%;
  /* fallback for Js load */
  height: var(--doc-height);
  overflow: hidden;
  font-family: 'Open Sans', sans-serif;
}

.main-scroll-container {
  margin-top: 56px;
  height: calc(100% - 56px);
  overflow-y: auto;
}

.spinner-overlay {
  z-index: 2000;
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0.5;
  transform: translate(-50%, -50%);
  transition: 1s;
}

.click-through {
  pointer-events: none;
}

.max-h-fit {
  max-height: fit-content;
}

.striped> :nth-child(even of :not([style*="display: none;"])) {
  /* Based on bootstrap table-striped styling */
  --bs-table-color-type: var(--bs-table-color);
  --bs-table-bg-type: #0000000d;
  box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
}

td.td-shrink {
  width: 0.1%;
  white-space: nowrap;
}

/* z-index */
.z-1001 {
  z-index: 1001;
}

.z-1021 {
  /* Above sticky-top */
  z-index: 1021;
}

.z-1030 {
  /*
    Exception case: above dropdown that is above sticky-top
  */
  z-index: 1030;
}

/* Alpine.js */
[x-cloak] {
  display: none !important;
}

@media (min-width: 992px) {
  .rounded-lg {
    border-radius: var(--bs-border-radius) !important;
  }
}

/* bootstrap collapse */
.btn .fa-chevron-up {
  transition: transform 0.3s ease;
}

.btn.collapsed .fa-chevron-up {
  transform: rotate(180deg);
}

/* colors */
.bg-alert-danger {
  background-color: var(--bs-danger-bg-subtle);
}

.text-alert-danger {
  color: var(--bs-danger-text-emphasis);
}

/* width utils */
.w-15px {
  width: 15px;
  min-width: 15px;
  max-width: 15px;
}

.w-min-25px {
  min-width: 25px;
}

/* bootstrap buttons */
.btn-xs {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.25rem;
  --bs-btn-font-size: 0.75rem;
}

/* bs forms */
.form-label {
  width: 100%;
}

/* Autocomplete */
.input-group {
  .autocomplete-menu {
    top: 100%;
    right: 0;
  }
}

/* React Bootstrap Typeahead */
.spinner-border {
  /* Above input:focus (z-index: 5) */
  z-index: 10;
}

/* tomselect */
.ts-dropdown [data-selectable].option {
  display: flex;
  align-items: center;
}

/* Show dropdowns over hx spinner overlay */
.ts-dropdown {
  z-index: 2100
}

/* adjust margin so height doesn't change when selecting/deselecting */
.ts-wrapper.multi .ts-control>div {
  margin: 0 3px 2px 0;
}

/* TomSelect: Prevent hidden clear button from blocking dropdown clicks */
.ts-wrapper .clear-button {
  pointer-events: none !important;
}

/* Enable clear button when focused or hovered (with items selected) */
.ts-wrapper.plugin-clear_button.focus.has-items .clear-button,
.ts-wrapper.plugin-clear_button:not(.disabled):hover.has-items .clear-button {
  pointer-events: auto !important;
}

/* Show clear button when items are selected (visible but not yet clickable until focused/hovered) */
.ts-wrapper.plugin-clear_button.has-items .clear-button {
  opacity: 1;
}

/*
 * Fix Bootstrap modal scrollbar compensation for fullscreen modals
 * Bootstrap adds padding-left/right to modals for scrollbar compensation,
 * but fullscreen modals shouldn't have this padding as they fill the viewport.
 * This affects desktop browsers at small widths (which still have scrollbars).
 * Mobile devices work correctly without this fix.
 */
.modal:has([class*="modal-fullscreen"]) {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
