/* Shared price-list appearance. Keep semantic Bootstrap and legacy row states. */
:is(table, table.table, table.dataTable, table.table1) {
    --bs-table-border-color: #e4edf3;
    --bs-table-striped-bg: #f6f9fc;
    --bs-table-hover-bg: #e6f1f8;
    --bs-table-hover-color: var(--bs-body-color, #212529);
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #d5e3ed;
    border-radius: .65rem;
    background-color: #fff;
    box-shadow: 0 3px 14px #1749690c;
}
:is(table, table.table, table.dataTable, table.table1) > :is(thead, tbody, tfoot) > tr > :is(th, td) {
    padding: .6rem .8rem;
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid #e4edf3;
}
:is(table, table.table, table.dataTable, table.table1) > thead > tr > :is(th, td) {
    --bs-table-bg: #287fa9;
    --bs-table-color: #fff;
    background-color: #287fa9;
    color: #fff;
    box-shadow: none;
    font-weight: 400;
}
:is(table, table.table, table.dataTable, table.table1) > thead > tr:first-child > :first-child { border-top-left-radius: .6rem; }
:is(table, table.table, table.dataTable, table.table1) > thead > tr:first-child > :last-child { border-top-right-radius: .6rem; }
:is(table, table.table, table.dataTable, table.table1) > tbody > tr:last-child > :is(th, td) { border-bottom: 0; }
.table-hover > tbody > tr:hover {
    background-color: var(--bs-table-hover-bg);
    color: var(--bs-table-hover-color);
}
/* Bootstrap paints cell overlays; legacy backgrounds on tr alone are hidden. */
table .warning1 {
    --bs-table-bg: #fffbf0;
    --bs-table-striped-bg: #fffbf0;
    --bs-table-hover-bg: #fffbf0;
}
table .primary1 {
    --bs-table-bg: #bde4ff;
    --bs-table-striped-bg: #bde4ff;
    --bs-table-hover-bg: #bde4ff;
}
table .alertColor, table .durchstreichen {
    --bs-table-bg: #ffc7c7;
    --bs-table-striped-bg: #ffc7c7;
    --bs-table-hover-bg: #ffc7c7;
}
table .alertColor { --bs-table-color: #380000; --bs-table-hover-color: #380000; }
table :is(.warning1, .primary1, .alertColor, .durchstreichen) > :is(th, td) {
    background-color: var(--bs-table-bg);
}
/* Explicit cell states take precedence over an inherited legacy row state. */
table :is(.table-primary, .table-secondary, .table-success, .table-danger, .table-warning, .table-info, .table-light, .table-dark) {
    --bs-table-hover-bg: var(--bs-table-bg);
    --bs-table-striped-bg: var(--bs-table-bg);
}
table tr.text-danger {
    --bs-table-color: var(--bs-danger, #dc3545);
    --bs-table-hover-color: var(--bs-danger, #dc3545);
}
/* Retain the price tree's indentation, level borders and inactive markers. */
.price-list-tree .price-tree-table { border: 0; border-radius: 0; box-shadow: none; }
.table-sm > :is(thead, tbody, tfoot) > tr > :is(th, td) { padding: .4rem .6rem; }
@media (max-width: 575.98px) {
    :is(table, table.table, table.dataTable, table.table1) > :is(thead, tbody, tfoot) > tr > :is(th, td) { padding-top: .5rem; padding-bottom: .5rem; }
}

/* Keyboard-accessible sorting for tables without DataTables. */
th.office-sortable,td.office-sortable { cursor:pointer; }
.office-sortable::after { content:" ↕"; opacity:.55; font-size:.85em; white-space:nowrap; }
.office-sortable[aria-sort="ascending"]::after { content:" ↑"; opacity:1; }
.office-sortable[aria-sort="descending"]::after { content:" ↓"; opacity:1; }
.office-sortable:focus-visible { outline:2px solid #3399cc; outline-offset:-2px; }
.dataTables_wrapper .office-sortable::after,.dt-container .office-sortable::after { display:none; }

/* Offer list: keep the grid continuous, including ID and offer number. */
table.offer-list-table > tbody > tr > td { border:1px solid #e4edf3 !important; border-top:0 !important; border-left:0 !important; }
table.offer-list-table > tbody > tr > td:first-child { border-left:1px solid #e4edf3 !important; }
