/* DataTables layout fixes for horizontally scrolling (scrollX) tables.
   Loaded after dataTables.min.css.

   DataTables 2.x markup:
     .dt-container > .dt-layout-row > .dt-layout-cell   (search / info / paging)
                   > .dt-layout-row.dt-layout-table     (the scrolling table)
   Legacy 1.x selectors are kept as harmless no-ops. */

/* Toolbar rows (search, length, info, paging) must never inherit the
   horizontal scroller, or they get clipped along with the first column. */
.dt-container .dt-layout-row:not(.dt-layout-table),
.dt-container .dt-layout-cell,
.dataTables_wrapper > .dataTables_filter,
.dataTables_wrapper > .dataTables_length,
.dataTables_wrapper > .dataTables_info,
.dataTables_wrapper > .dataTables_paginate {
    overflow: visible;
}

/* Only the table body scrolls sideways. */
.dt-container .dt-scroll-body,
.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
}

/* A stray .table-responsive around a scrollX table nests a second scroller and
   clips the toolbar; tables.js strips the class and we neutralise it here. */
.table-responsive-unwrapped {
    overflow: visible !important;
}

/* Keep cells on one line so rows stay readable while scrolling sideways. */
.dt-container table.table.text-nowrap > thead > tr > th,
.dt-container table.table.text-nowrap > tbody > tr > td {
    white-space: nowrap;
}

/* Search input: readable width, right aligned. */
.dt-container .dt-search input,
.dataTables_wrapper .dataTables_filter input {
    width: auto;
    min-width: 200px;
    display: inline-block;
}

/* --- Actions dropdown must render ON TOP OF and OUTSIDE the table ---------
   A scrolling ancestor (overflow:auto) clips its descendants no matter how high
   their z-index, so z-index alone cannot fix this. tables.js moves an open menu
   to <body> and positions it under its button; these rules style that state. */

/* Above the dark table header, the DataTables scroller and the app header
   (this theme uses z-index 1002 for the topbar, 1030-1056 for sticky layers). */
.dropdown-menu.show,
.dt-container .dropdown-menu.show {
    z-index: 1100;
}

/* A menu moved out to <body> is positioned by tables.js in page coordinates. */
body > .dropdown-menu.dropdown-detached {
    position: absolute;
    z-index: 1100;
    margin: 0;
}

/* Bootstrap only paints a menu when it carries .show; tables.js adds it on the
   next frame so the menu can be measured before it becomes visible. */
body > .dropdown-menu.dropdown-detached.show {
    display: block;
}

/* The action cell must never clip its own menu. */
.dt-container td .dropdown,
.dt-container td .dropdown.position-static {
    overflow: visible;
}
