/* Shared data-table grid for all BloodLife portals. */
:root {
    --table-grid-border: #cbd5e1;
    --table-grid-heading: #f1f5f9;
    --table-grid-heading-text: #334155;
}

html.dark,
body.admin-dark-mode,
body.site-dark-mode {
    --table-grid-border: #475569;
    --table-grid-heading: #1e293b;
    --table-grid-heading-text: #e2e8f0;
}

/* Override page-specific borderless and separated table styles consistently. */
body table:not([role="presentation"]) {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    border: 1px solid var(--table-grid-border) !important;
}

body table:not([role="presentation"]) > :is(thead, tbody, tfoot) > tr > :is(th, td),
body table:not([role="presentation"]) > tr > :is(th, td) {
    border: 1px solid var(--table-grid-border) !important;
    padding: 0.85rem 1rem;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

body table:not([role="presentation"]) > thead > tr > th {
    background-color: var(--table-grid-heading) !important;
    color: var(--table-grid-heading-text) !important;
    font-weight: 700;
    line-height: 1.45;
    text-align: left;
    vertical-align: middle;
}

.table-responsive,
.table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Keep profile, contact, status, and action controls in distinct columns. */
#peopleManagementTable {
    min-width: 1200px;
}

#peopleManagementTable > :is(thead, tbody) > tr > :first-child {
    width: 44px;
    text-align: center;
}

#peopleManagementTable > :is(thead, tbody) > tr > :nth-child(2) { min-width: 190px; }
#peopleManagementTable > :is(thead, tbody) > tr > :nth-child(3) { min-width: 210px; }
#peopleManagementTable > :is(thead, tbody) > tr > :nth-child(4) { min-width: 195px; }
#peopleManagementTable > :is(thead, tbody) > tr > :nth-child(5) { min-width: 150px; }
#peopleManagementTable > :is(thead, tbody) > tr > :nth-child(6) { min-width: 165px; }
#peopleManagementTable > :is(thead, tbody) > tr > :nth-child(7) { min-width: 135px; }
#peopleManagementTable > :is(thead, tbody) > tr > :nth-child(8) { min-width: 190px; }

@media (max-width: 640px) {
    body table:not([role="presentation"]) > :is(thead, tbody, tfoot) > tr > :is(th, td) {
        padding: 0.7rem 0.75rem;
    }
}

@media print {
    body table:not([role="presentation"]) {
        min-width: 0 !important;
        --table-grid-border: #64748b;
        --table-grid-heading: #f1f5f9;
        --table-grid-heading-text: #0f172a;
    }

    #peopleManagementTable > :is(thead, tbody) > tr > :is(th, td) {
        min-width: 0;
    }

    .table-responsive,
    .table-wrapper {
        overflow: visible;
    }
}
