.tf-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: var(--tf-surface-glass);
    backdrop-filter: blur(var(--tf-blur));
    border: 1px solid var(--tf-border-color);
    border-radius: var(--tf-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--tf-shadow);
    -webkit-overflow-scrolling: touch;
}

.tf-table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tf-table-scroll .tf-table,
.tf-table-scroll .tf-table-data {
    min-width: 680px;
}

.tf-table-scroll-hint {
    display: block;
    margin-bottom: var(--tf-space-2);
    color: var(--tf-text-muted);
    font-size: var(--tf-font-size-sm);
}

.tf-table,
.tf-table-data {
    width: 100%;
    border-collapse: collapse;
    color: var(--tf-text-main);
}

.tf-table-data th,
.tf-table-data td {
    padding: 0.75rem 0.9rem !important;
}

.tf-table-data th {
    font-size: var(--tf-font-size-sm);
}

.tf-table-data td {
    font-size: var(--tf-font-size-base);
}

.tf-table-compact th,
.tf-table-compact td {
    padding: 0.45rem 0.6rem !important;
    font-size: var(--tf-font-size-sm);
}

.tf-table-striped tbody tr:nth-child(even) {
    background: var(--tf-color-gray-50);
}

.tf-table tbody tr:hover,
.tf-table-data tbody tr:hover {
    background: var(--tf-table-row-hover-bg);
}

.tf-table-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--tf-space-2);
    flex-wrap: wrap;
    white-space: nowrap;
}

.tf-table-action-menu {
    display: inline-flex;
    justify-content: flex-end;
    min-width: 44px;
}

.tf-table-action-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.tf-table-action-menu .dropdown-menu {
    min-width: 11rem;
}

.tf-record-list {
    display: grid;
    gap: var(--tf-space-3);
}

.tf-record-card {
    background: var(--tf-card-bg);
    border: var(--tf-card-border);
    border-radius: var(--tf-card-radius);
    box-shadow: var(--tf-card-shadow);
    padding: var(--tf-space-4);
}

.tf-record-card-row {
    display: grid;
    gap: var(--tf-space-1);
    padding-block: var(--tf-space-2);
    border-bottom: 1px solid var(--tf-border-color-light);
}

.tf-record-card-row:last-child {
    border-bottom: 0;
}

.tf-record-card-label {
    color: var(--tf-text-muted);
    font-size: var(--tf-font-size-sm);
}

.tf-record-card-value {
    min-width: 0;
    color: var(--tf-text-main);
    overflow-wrap: anywhere;
}

.tf-record-card-actions {
    display: flex;
    flex-direction: column;
    gap: var(--tf-space-2);
    margin-top: var(--tf-space-3);
    padding-top: var(--tf-space-3);
    border-top: 1px solid var(--tf-border-color-light);
}

.tf-record-card-actions .tf-btn,
.tf-record-card-actions .btn {
    width: 100%;
}

.tf-table-card-list {
    display: block;
}

.tf-table-card-list thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.tf-table-card-list tbody,
.tf-table-card-list tr,
.tf-table-card-list td {
    display: block;
    width: 100%;
}

.tf-table-card-list tr {
    margin-bottom: var(--tf-space-3);
    padding: var(--tf-space-4);
    background: var(--tf-card-bg);
    border: var(--tf-card-border);
    border-radius: var(--tf-card-radius);
    box-shadow: var(--tf-card-shadow);
}

.tf-table-card-list td {
    display: grid;
    grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr);
    gap: var(--tf-space-2);
    padding: var(--tf-space-2) 0 !important;
    border-bottom: 1px solid var(--tf-border-color-light);
    overflow-wrap: anywhere;
}

.tf-table-card-list td:last-child {
    border-bottom: 0;
}

.tf-table-card-list td::before {
    content: attr(data-label);
    color: var(--tf-text-muted);
    font-size: var(--tf-font-size-sm);
    font-weight: var(--tf-font-weight-medium);
}

.tf-column-secondary,
.tf-column-tertiary {
    display: none;
}

@media (min-width: 768px) {
    .tf-table-actions {
        flex-wrap: nowrap;
    }

    .tf-record-card-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .tf-record-card-actions .tf-btn,
    .tf-record-card-actions .btn {
        width: auto;
    }

    .tf-table-card-list {
        display: table;
    }

    .tf-table-card-list thead {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .tf-table-card-list tbody {
        display: table-row-group;
    }

    .tf-table-card-list tr {
        display: table-row;
        margin-bottom: 0;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .tf-table-card-list td {
        display: table-cell;
        width: auto;
        padding: 0.75rem 0.9rem !important;
        border-bottom: 0;
    }

    .tf-table-card-list td::before {
        content: none;
    }

    .tf-column-secondary {
        display: table-cell;
    }
}

@media (min-width: 992px) {
    .tf-column-tertiary {
        display: table-cell;
    }
}
