.data-table {
    width: 100%;
    border: 0;
    color: var(--data-table-fg);
    border-collapse: collapse;
    --data-table-padding: 7px;
}

.data-table--checkbox-grid {
    --data-table-padding: 1px 10px;
    width: auto;
}

.data-table-wrapper {
    overflow-x: auto;
}

/* header */
.data-table > tr > th,
.data-table > thead > tr > th,
.data-table > tbody > tr > th,
.data-table > tfoot > tr > th {
    background-color: var(--data-table-th-bg);
    border-bottom: var(--data-table-thead-border);
    text-align: left;
    padding: var(--data-table-padding);
    font-size: 12px;
    font-weight: bold;
}

/* cell */
.data-table > tr > td,
.data-table > thead > tr > td,
.data-table > tbody > tr > td,
.data-table > tfoot > tr > td {
    padding: var(--data-table-padding);
    font-size: 14px;
}

.data-table > tr:not(:last-child) > td,
.data-table > thead > tr:not(:last-child) > td,
.data-table > tbody > tr:not(:last-child) > td,
.data-table > tfoot > tr:not(:last-child) > td {
    border-bottom: var(--data-table-tr-border);
}

.data-table tr:nth-child(even) > td {
    background-color: var(--data-table-tr-even-bg);
}

.data-table tr:nth-child(odd) > td {
    background-color: var(--data-table-tr-odd-bg);
}

/* hovered row */
.data-table > tr:hover > td,
.data-table > thead > tr:hover > td,
.data-table > tbody > tr:hover > td,
.data-table > tfoot > tr:hover > td {
    background-color: var(--data-table-tr-hover-bg);
}

/* footer */
.data-table > tfoot > tr > td {
    border-top: var(--data-table-tfoot-border);
    font-weight: bold;
    font-size: 12px;
}

/* Actions */
.data-table__actions {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.data-table__action > :not(.dialog) {
    @media (hover: hover) {
        visibility: hidden;
    }

    .data-table tr:hover & {
        visibility: visible;
    }
}

/* Bottom-left-most table header which doesn't have a following tbody, tfoot nor pagination */
.data-table-wrapper:not(:has(+ .pagination)) >.data-table
    > thead:not(:has(+ tbody > tr)):not(:has(~ tfoot > tr))
    > tr:last-of-type
    > th:first-of-type,
/* Bottom-left-most tbody table row cell which doesn't have a following tfoot nor pagination */
.data-table-wrapper:not(:has(+ .pagination)) >.data-table > tbody:not(:has(~ tfoot > tr)) > tr:last-of-type td:first-of-type,
/* Bottom-left-most tfoot table row cell which doesn't have a following pagination */
.data-table-wrapper:not(:has(+ .pagination)) >.data-table > tfoot > tr:last-of-type > td:first-of-type {
    border-bottom-left-radius: var(--data-table-border-radius);
}

/* Unhidden bottom-right-most table cell on bon earning calculation page */
.data-table-wrapper:not(:has(+ .pagination)) >.data-table
    tr:last-of-type
    td:not([style='display: none;']):has(+ td[style='display: none;']),
/* Bottom-right-most table header which doesn't have a following tbody, tfoot nor pagination */
.data-table-wrapper:not(:has(+ .pagination)) >.data-table
    > thead:not(:has(+ tbody > tr)):not(:has(~ tfoot > tr))
    > tr:last-of-type
    > th:last-of-type,
/* Bottom-right-most tbody table row cell which doesn't have a following tfoot nor pagination */
.data-table-wrapper:not(:has(+ .pagination)) >.data-table > tbody:not(:has(~ tfoot > tr)) > tr:last-of-type td:last-of-type,
/* Bottom-right-most tfoot table row cell which doesn't have a following pagination */
.data-table-wrapper:not(:has(+ .pagination)) >.data-table > tfoot > tr:last-of-type > td:last-of-type {
    border-bottom-right-radius: var(--data-table-border-radius);
}
