/* ============================================================
   iResponse Pro — Global Table Dark Override
   Loaded LAST to beat datatables.min.css and components.min.css
   white-background rules (#f9f9f9, #fcfcfc, #fafafa, whitesmoke)
   ============================================================ */

/* All td/th: transparent background + light text */
table td,
table th,
.table td,
.table th,
.table > thead > tr > th,
.table > thead > tr > td,
.table > tbody > tr > th,
.table > tbody > tr > td,
.table > tfoot > tr > th,
.table > tfoot > tr > td,
.dataTable td,
.dataTable th,
div.dataTables_wrapper table td,
div.dataTables_wrapper table th {
    background-color: transparent !important;
    color: #e2e8f0 !important;
    border-color: #2a3347 !important;
}

/* thead stays dark */
.table > thead > tr > th,
table.dataTable thead th,
table.dataTable thead td {
    background-color: #1e2536 !important;
    color: #94a3b8 !important;
}

/* Row backgrounds */
.table > tbody > tr,
table.dataTable tbody tr {
    background-color: #161b27 !important;
}

.table > tbody > tr:nth-child(even),
table.dataTable tbody tr:nth-child(even),
table.dataTable.stripe tbody tr.even,
table.dataTable.display tbody tr.even {
    background-color: #131929 !important;
}

.table > tbody > tr:nth-child(odd),
table.dataTable tbody tr:nth-child(odd),
table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
    background-color: #161b27 !important;
}

/* Hover */
.table > tbody > tr:hover > td,
table.dataTable tbody tr:hover,
table.dataTable tbody tr:hover > td {
    background-color: #1e2536 !important;
}

/* Kill DataTables sorting column highlights (#fafafa / #fcfcfc / whitesmoke) */
table.dataTable.order-column tbody tr > .sorting_1,
table.dataTable.order-column tbody tr > .sorting_2,
table.dataTable.order-column tbody tr > .sorting_3,
table.dataTable.display tbody tr > .sorting_1,
table.dataTable.display tbody tr > .sorting_2,
table.dataTable.display tbody tr > .sorting_3,
table.dataTable.order-column.stripe tbody tr.odd > .sorting_1,
table.dataTable.order-column.stripe tbody tr.odd > .sorting_2,
table.dataTable.order-column.stripe tbody tr.odd > .sorting_3,
table.dataTable.order-column.stripe tbody tr.even > .sorting_1,
table.dataTable.order-column.stripe tbody tr.even > .sorting_2,
table.dataTable.order-column.stripe tbody tr.even > .sorting_3 {
    background-color: rgba(79,142,247,0.04) !important;
}

/* Selected rows */
table.dataTable tbody tr.selected,
table.dataTable tbody tr.selected > td,
table.dataTable.stripe tbody tr.odd.selected,
table.dataTable.stripe tbody tr.even.selected,
table.dataTable.display tbody tr.odd.selected > .sorting_1,
table.dataTable.display tbody tr.even.selected > .sorting_1 {
    background-color: rgba(79,142,247,0.12) !important;
    color: #e2e8f0 !important;
}

/* ============================================================
   GLOBAL DROPDOWN Z-INDEX / CLIP FIX
   Bootstrap-select menus were being cut off because ancestors
   (.portlet.light.bordered, .ir-table-card, .form-body, etc.)
   set `overflow: hidden`, and/or later siblings created higher
   stacking contexts. Applies platform-wide — does not require
   data-container="body" on each <select>.
   ============================================================ */

/* Open container sits above neighboring portlets/cards */
body .bootstrap-select.open,
body .bootstrap-select.show,
body .bootstrap-select.btn-group.open,
body .bootstrap-select.btn-group.show {
    position: relative !important;
    z-index: 10050 !important;
}

/* The dropdown menu itself — clear of modals (1050) and sticky headers */
body .bootstrap-select .dropdown-menu.open,
body .bootstrap-select .dropdown-menu.show,
body .bootstrap-select.open > .dropdown-menu,
body .bootstrap-select.show > .dropdown-menu {
    z-index: 10051 !important;
}

/* Release overflow-clipping on ancestors while a select is open.
   :has() scopes the override to the exact card/row that contains
   the open dropdown — everything else keeps its original clipping. */
.portlet:has(.bootstrap-select.open),
.portlet:has(.bootstrap-select.show),
.portlet-body:has(.bootstrap-select.open),
.portlet-body:has(.bootstrap-select.show),
.form-body:has(.bootstrap-select.open),
.form-body:has(.bootstrap-select.show),
.form-group:has(.bootstrap-select.open),
.form-group:has(.bootstrap-select.show),
.ir-table-card:has(.bootstrap-select.open),
.ir-table-card:has(.bootstrap-select.show),
.ir-table-actions:has(.bootstrap-select.open),
.ir-table-actions:has(.bootstrap-select.show),
.table-container:has(.bootstrap-select.open),
.table-container:has(.bootstrap-select.show),
.row:has(.bootstrap-select.open),
.row:has(.bootstrap-select.show),
[class*="col-"]:has(.bootstrap-select.open),
[class*="col-"]:has(.bootstrap-select.show) {
    overflow: visible !important;
}

/* Also raise the ancestor card itself so its dropdown paints above
   the next card below (e.g., create form above the processes list) */
.portlet:has(.bootstrap-select.open),
.portlet:has(.bootstrap-select.show) {
    z-index: 10040 !important;
    position: relative !important;
}

/* Status badges */
.badge-pass {
    background: rgba(34,197,94,0.15) !important;
    color: #22c55e !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}
.badge-warn {
    background: rgba(245,158,11,0.15) !important;
    color: #f59e0b !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}
.badge-fail {
    background: rgba(239,68,68,0.15) !important;
    color: #ef4444 !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}
