/*
 * Do NOT use overflow-x: hidden here — on iOS/Android it breaks nested
 * horizontal pan on the ITable overflow-x-auto wrapper (columns look clipped
 * with no way to scroll). clip avoids page-bleed without killing child scroll.
 */
.deals-index {
  overflow-x: clip;
  max-width: 100%;
}

.deals-index-toolbar {
  margin-bottom: 1rem;
}

.deals-index-filters {
  gap: 0.5rem;
}

.deals-index-active-filters .flex {
  flex-wrap: wrap;
  gap: 0.375rem;
  overflow-x: visible;
}

/* Outer shell only — real pan lives on the inner ITable overflow-x-auto node. */
.deals-index-table {
  overflow-x: clip;
}

.deals-index-table .resizer {
  max-width: 100%;
}

/* Leads inbox: no drag-handle column; compact, content-sized columns */
.deals-index-table table[id^='table-'] {
  table-layout: auto !important;
  width: 100% !important;
  max-width: 100% !important;
}

.deals-index-table table[id^='table-'] th.table-drag-column,
.deals-index-table table[id^='table-'] td.table-drag-column {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.deals-index-table table[id^='table-'] th.table-actions-column,
.deals-index-table table[id^='table-'] td.table-actions-column {
  width: 2.75rem !important;
  min-width: 2.75rem !important;
  max-width: 2.75rem !important;
}

.deals-index-table table[id^='table-'] th.table-select-column,
.deals-index-table table[id^='table-'] td.table-select-column {
  max-width: 16rem;
}

.deals-index-table table[id^='table-'] th:not(.table-actions-column):not(.table-drag-column),
.deals-index-table table[id^='table-'] td:not(.table-actions-column):not(.table-drag-column) {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deals-index-table table[id^='table-'] td.table-select-column > div.flex.items-center > div.overflow-hidden {
  min-width: 0;
  flex: 1 1 auto;
}

@media (max-width: 639px) {
  .deals-compact-filters-modal .modal-dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100%;
  }

  .deals-compact-filters-modal .modal-content {
    min-height: 100dvh;
    border-radius: 0;
  }
}

@media (max-width: 1023px) {
  .deals-index-table table[id^='table-'] th.table-select-column,
  .deals-index-table table[id^='table-'] td.table-select-column {
    min-width: 0;
    width: auto;
    max-width: min(100vw - 2rem, 20rem);
  }

  .deals-index-table table[id^='table-'] th:first-child:not(.table-actions-column),
  .deals-index-table table[id^='table-'] td:first-child:not(.table-actions-column) {
    min-width: min(100vw - 2rem, 20rem);
  }

  .deals-index-table table[id^='table-'] th:not(.table-select-column):not(.table-actions-column),
  .deals-index-table table[id^='table-'] td:not(.table-select-column):not(.table-actions-column) {
    min-width: 5.5rem;
  }

  body:has(.stacked-table-move-bar .pointer-events-auto) #main {
    padding-bottom: 7.5rem;
  }
}
