/* Shared data-table palette. Opt-in scopes keep calendars and document/editor HTML intact. */
:root {
    --table-base-bg: #fff;
    --table-heading-bg: #eaf2f8;
    --table-heading-ink: #365b76;
    --table-heading-line: #c4d9e6;
    --table-row-line: #e3ecf2;
    --table-stripe-bg: #f5f9fc;
    --table-hover-bg: #eaf5f3;
    --table-focus-bg: #edf4fc;
    --table-selected-bg: #e3effa;
}

:is(.data-card .table-area > table, .assessment-scroll > table, .billing-lines-scroll > table, .security-table-scroll > table, .document-preview-body > table, table.calendar-attendance) {
    --table-row-bg: var(--table-base-bg);
    background: var(--table-base-bg);
}

:is(.data-card .table-area > table, .assessment-scroll > table, .billing-lines-scroll > table, .security-table-scroll > table, .document-preview-body > table, table.calendar-attendance) > :is(thead, tbody, tfoot) > tr > :is(td, th),
:is(.assessment-scroll > table, .document-preview-body > table) > tr > :is(td, th) {
    border-bottom-color: var(--table-row-line);
    background-color: var(--table-row-bg);
}

:is(.data-card .table-area > table, .assessment-scroll > table, .billing-lines-scroll > table, .security-table-scroll > table, .document-preview-body > table, table.calendar-attendance) > thead,
:is(.data-card .table-area > table, .assessment-scroll > table, .billing-lines-scroll > table, .security-table-scroll > table, .document-preview-body > table, table.calendar-attendance) > thead > tr > :is(td, th),
.assessment-scroll > table > tr > th,
#tableHead .actions-cell {
    background: var(--table-heading-bg);
    color: var(--table-heading-ink);
    border-bottom-color: var(--table-heading-line);
}

:is(.data-card .table-area > table, .assessment-scroll > table, .billing-lines-scroll > table, .security-table-scroll > table, .document-preview-body > table, table.calendar-attendance) > tbody > tr:nth-child(even),
:is(.assessment-scroll > table, .document-preview-body > table) > tr:nth-child(even) {
    --table-row-bg: var(--table-stripe-bg);
}

@media (hover: hover) {
    :is(.data-card .table-area > table, .assessment-scroll > table, .billing-lines-scroll > table, .security-table-scroll > table, .document-preview-body > table, table.calendar-attendance) > tbody > tr:hover,
    :is(.assessment-scroll > table, .document-preview-body > table) > tr:hover {
        --table-row-bg: var(--table-hover-bg);
    }
}

:is(.data-card .table-area > table, .assessment-scroll > table, .billing-lines-scroll > table, .security-table-scroll > table, .document-preview-body > table, table.calendar-attendance) > tbody > tr:focus-within,
.assessment-scroll > table > tr:focus-within {
    --table-row-bg: var(--table-focus-bg);
}

#tableBody > tr:has(.row-actions input[type="checkbox"]:checked) {
    --table-row-bg: var(--table-selected-bg);
}

/* Frozen cells stay opaque and follow the same stripe/hover/selection as their row. */
#tableBody > tr > .actions-cell {
    background: var(--table-row-bg);
    box-shadow: 1px 0 var(--table-heading-line);
}

:is(.data-card .table-area > table, .assessment-scroll > table, .billing-lines-scroll > table, .security-table-scroll > table, table.calendar-attendance) > tfoot > tr > :is(th, td) {
    background: var(--table-heading-bg);
    color: var(--table-heading-ink);
    border-top: 1px solid var(--table-heading-line);
}
