/* Hide "Display all" button from column visibility dropdown */
.display-all-btn {
    display: none !important;
}

/* Restore full border radius on Display button now that Display all is hidden */
.dropdown-btn-group .dropdown-toggle {
    border-radius: 0.25rem !important;
}

.description {
    width: 150px; /* Adjust as needed */
    word-wrap: break-word;
    white-space: normal;
}

/*
 * Listing DataTables: scrollX + scrollY + FixedColumns (pinned first/last).
 * Header stays in DataTables scrollHead above scrollBody (not CodyHouse single-table sticky).
 */
:root {
    --datatable-v-offset: 22rem;
}

body:has(.dt-listing-sticky) .main-content {
    overflow-x: visible;
    overflow-y: visible;
}

.dt-listing-sticky {
    max-width: 100%;
    min-width: 0;
    overflow: visible;
}

/* Scroll split: horizontal bar lives on scrollBody (under header, not window edge). */
.dt-listing-sticky .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-height: none !important;
}

/* Sticky header sticks just below the fixed navbar on page scroll */
.dt-listing-sticky .dataTables_scrollHead {
    position: sticky !important;
    top: 70px !important;
    z-index: 10 !important;
    background: #fff !important;
}

.dt-listing-sticky .dataTables_scrollHead table.dataTable,
.dt-listing-sticky .dataTables_scrollBody table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin-bottom: 0 !important;
}

.dt-listing-sticky .dataTables_scrollHead table.dataTable.table-bordered thead th,
.dt-listing-sticky .dataTables_scrollBody table.dataTable.table-bordered tbody td {
    border-color: #dee2e6 !important;
}

.dt-listing-sticky .dataTables_scrollBody table.dataTable tbody tr.bg-danger td {
    background-color: #f8d7da !important;
}

.dt-listing-sticky .dataTables_scrollBody table.dataTable tbody tr.oohd-warning-row td {
    background-color: #fff3cd !important;
}

/* FixedColumns: keep pinned cells above scrolling middle */
.dt-listing-sticky .dtfc-fixed-left,
.dt-listing-sticky .dtfc-fixed-right {
    z-index: 13;
}

.dt-listing-sticky .dataTables_scrollHead .dtfc-fixed-left,
.dt-listing-sticky .dataTables_scrollHead .dtfc-fixed-right {
    z-index: 14;
}

/* Separate last (Action) column from data columns with a left border */
.dt-listing-sticky table.dataTable thead th:last-child,
.dt-listing-sticky table.dataTable tbody td:last-child,
.dt-listing-sticky .dtfc-fixed-right th,
.dt-listing-sticky .dtfc-fixed-right td {
    border-left: 2px solid #adb5bd !important;
}

/* DataTables processing loader — match work-orders FA spinner card on all listings */
div.dataTables_wrapper {
    position: relative;
}

div.dataTables_wrapper div.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 90%;
    height: auto;
    margin: 0 !important;
    padding: 14px 24px;
    z-index: 1050 !important;
    border: 0;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    text-indent: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* Hide DataTables' built-in animation bars only (keep FA spinner markup) */
div.dataTables_wrapper div.dataTables_processing > div:not(.fa-stack) {
    display: none;
}

div.dataTables_wrapper div.dataTables_processing .fa-stack {
    width: 2em;
    height: 2em;
    line-height: 2em;
}

div.dataTables_wrapper div.dataTables_processing .fa-spinner {
    color: #556ee6;
}
