/* ── 2–11. Data tables (Patients visits/history, Billing, Reports, etc.) ── */
.table-scroll {
    margin-top: var(--space-4);
    margin-left: calc(-1 * var(--space-2));
    margin-right: calc(-1 * var(--space-2));
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
}

.table-scroll > .data-table,
.table-scroll > table {
    width: max-content;
    min-width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--text-sm);
}

.data-table th,
.data-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table th {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-bottom: none;
    white-space: nowrap;
}

.data-table thead tr:first-child th:first-child {
    border-top-left-radius: var(--radius-sm, 6px);
}

.data-table thead tr:first-child th:last-child {
    border-top-right-radius: var(--radius-sm, 6px);
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.data-table tbody tr:hover {
    background: rgba(var(--color-primary-rgb), 0.06);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Legacy tables without .data-table */
.card .table-scroll table:not(.data-table) {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.card .table-scroll table:not(.data-table) th,
.card .table-scroll table:not(.data-table) td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.card .table-scroll table:not(.data-table) th {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
    background: #f8fafc;
}

