/* =========================================================
   AURIXXA — custom global overrides
   ========================================================= */

/* ---------------------------------------------------------
   Wide tables: the CARD (panel) that holds the table gets the
   horizontal scrollbar — at the bottom of the card — instead
   of a scrollbar glued to the table itself. Applies system
   wide (DataTables + Bootstrap .table-responsive + plain
   .table blocks).
   --------------------------------------------------------- */

/* 1) The scrollbar lives on the card body, but only for cards
      that actually contain a table (so normal cards keep their
      dropdowns/tooltips un-clipped) */
.panel_s .panel-body:has(table.table),
.panel_s .panel-body:has(.dataTables_wrapper),
.panel_s .panel-body:has(.table-responsive) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

/* 2) Kill the inner scrollbars so the overflow bubbles up to
      the card instead of scrolling inside the table wrapper */
.panel_s .panel-body .table-responsive,
.panel_s .panel-body .dataTables_wrapper,
.panel_s .panel-body .dataTables_wrapper .dataTables_scroll,
.panel_s .panel-body .dataTables_wrapper .dataTables_scrollBody {
    overflow: visible !important;
}

/* 3) Keep headers/cells from wrapping so a wide table stays
      wide (and therefore makes the card scroll) instead of
      squeezing every column into an unreadable mess */
table.table > thead > tr > th,
table.table > tbody > tr > td,
table.table > tfoot > tr > td,
table.dataTable > thead > tr > th,
table.dataTable > tbody > tr > td,
table.dataTable > tfoot > tr > td {
    white-space: nowrap;
}

/* Comfortable, visible horizontal scrollbar on the card */
.panel_s .panel-body:has(table.table)::-webkit-scrollbar,
.panel_s .panel-body:has(.dataTables_wrapper)::-webkit-scrollbar,
.panel_s .panel-body:has(.table-responsive)::-webkit-scrollbar {
    height: 10px;
}

.panel_s .panel-body:has(table.table)::-webkit-scrollbar-thumb,
.panel_s .panel-body:has(.dataTables_wrapper)::-webkit-scrollbar-thumb,
.panel_s .panel-body:has(.table-responsive)::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .25);
    border-radius: 6px;
}

/* ---------------------------------------------------------
   Handsontable grids (payroll / accounting / timesheets):
   the bundled build predates RTL support, so on RTL pages the
   column-header layer and the data body render on opposite
   sides with a big gap. Force the grid itself to LTR so the
   header stays aligned above the body; cell/header text stays
   right-aligned so Arabic still reads correctly.
   --------------------------------------------------------- */
.handsontable {
    direction: ltr;
}

.handsontable th,
.handsontable td {
    text-align: right;
}
