/* Tableaux responsives */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
}

.table {
    width: 100%;
    font-size: var(--font-size-sm);
}

.table caption {
    caption-side: top;
    padding: var(--space-3) var(--space-4);
    font-weight: var(--font-weight-semibold);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table thead {
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
}

.table th,
.table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.table--striped tbody tr:nth-child(even) {
    background: var(--color-surface-alt);
}

.table--striped tbody tr:nth-child(even):hover {
    background: rgba(255, 255, 255, 0.06);
}

.table__empty {
    text-align: center;
    padding: var(--space-6) !important;
    color: var(--color-text-muted);
}

.table__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

@media (max-width: 768px) {
    .table--responsive thead {
        display: none;
    }

    .table--responsive tbody tr {
        display: block;
        margin-bottom: var(--space-4);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        overflow: hidden;
    }

    .table--responsive tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3);
        border-bottom: 1px solid var(--color-border);
    }

    .table--responsive tbody td:last-child {
        border-bottom: none;
    }

    .table--responsive tbody td::before {
        content: attr(data-label);
        font-weight: var(--font-weight-semibold);
        color: var(--color-text-muted);
        flex-shrink: 0;
    }
}
