tbody,
td,
tfoot,
th,
thead,
tr {
    border: 0 solid;
    border-color: inherit;
}

.table {
    vertical-align: top;
    width: 100%;
    // Set table space 0
    border-spacing: 0;

    &-card {
        >div {
            border-top-left-radius: var(--border1);
            border-top-right-radius: var(--border1);
        }
    }

    &.table-minimal {
        thead {
            background: transparent;

            tr th {
                padding: .6rem .8rem;
                font-weight: 500;
                font-size: var(--p-small);
                border-bottom: 1px dashed var(--transp-1);
                color: var(--text-300);
            }
        }

        tbody tr td {
            padding: .5rem .8rem;
            border-bottom: 1px dashed var(--transp-1);
        }

        tbody tr:last-of-type td {
            border-bottom: 0;
        }
    }

    thead {
        vertical-align: bottom;
        background-color: var(--transp-05);

        tr {
            th {
                border-top: 0;
                color: var(--text-400);
                font-size: var(--p-small);
                font-weight: 500;
                vertical-align: baseline;
                border-bottom: 1px solid var(--transp-1);
                padding: 1.25em 15px;
                cursor: default;

                .table-th {
                    display: inline-flex;
                    align-items: center;
                    gap: .5rem;
                    flex-direction: row;
                    transition: .3s;
                    cursor: pointer;
                }

                &:first-child:not(.selection-col) {
                    padding-left: 1.5rem;
                }

                &.sortable {
                    cursor: pointer;

                    &:hover {
                        color: var(--text);
                    }

                    .sort-icon {
                        display: inline-flex;
                    }
                }
            }
        }
    }

    tbody {
        vertical-align: inherit;

        tr {
            td {
                border-top: 0;
                font-size: var(--p-small);
                padding: .8rem 1rem;
                vertical-align: middle;
                word-break: break-all;

                &:first-child:not(.selection-col) {
                    padding-left: 1.5rem !important;
                }
            }
        }
    }

    tbody {
        tr {
            >td {
                border-bottom: 1px solid var(--transp-1);
                padding: 8px 15px;
            }

            &:last-of-type>td {
                border-bottom: 0;
            }
        }
    }

    &.table-compact {
        tbody {
            tr {
                >td:first-child:not(.selection-col) {
                    padding-left: 0.4rem !important;
                }
            }
        }
    }

    &__pagination {
        @extend .flex-row, .align-center;

        &-item {
            @extend .flex-center;

            width: 36px;
            height: 36px;
            border: 1px solid var(--transp-1);
            border-left-width: 0;
            color: var(--text-200);
            @include transition();

            a,
            span {
                @extend .flex-center;

                height: 100%;
                width: 100%;
                color: inherit;
                font-size: var(--p-small);

                &.link-icon {
                    font-size: var(--h5);
                }
            }

            &:not(.disabled) {
                &:hover {
                    background-color: var(--transp-1);
                    color: var(--text-100);
                }

                &.active {
                    color: var(--text-900);
                    background-color: var(--accent);
                }
            }

            &.disabled {
                pointer-events: none;
                opacity: .7;
            }

            &:first-child {
                border-top-left-radius: var(--border1);
                border-bottom-left-radius: var(--border1);
                border-left-width: 1px;
            }

            &:last-child {
                border-top-right-radius: var(--border1);
                border-bottom-right-radius: var(--border1);
            }
        }
    }

    &__footer {
        @extend .d-flex, .flex-row, .align-center, .flex-between;

        border-top: 1px solid var(--transp-1);
        padding: .8rem 1rem;
        padding-left: 1.5rem;
    }

    &__columns {
        @extend .flex-column;

        gap: 10px;

        padding: .7rem;

        label {
            width: 100%;
        }
    }

    &__search {
        max-width: 400px;
    }
}

tr.row-selected {
    background: rgba(125, 175, 255, 0.08);
}

tr.row-selected>td {
    background: rgba(125, 175, 255, 0.08);
}

td.selection-col,
th.selection-col {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    padding-right: 10px;
}

th.selection-col+th,
td.selection-col+td {
    padding-left: 6px;
}

.table-compact>:not(caption)>*>* {
    padding: .4rem !important
}

.sortable-column {
    cursor: pointer;

    a {
        color: inherit;

        &:hover {
            color: var(--primary);
        }
    }

    .sort-indicator {
        display: inline-flex;
        align-items: center;
        transition: opacity 0.2s ease-in-out;
    }

    &:hover {
        .sort-indicator {
            opacity: 1 !important;
        }
    }
}

.bulk-actions-floating {
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 999px;
        overflow: hidden;

        .me-1 {
            margin: 0 !important;
        }

        .btn-label {
            display: none !important;
        }

        svg {
            width: 18px;
            height: 18px;
        }
    }
}


.bulk-actions-floating {
    @extend .blur-bg;

    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 1050;
    display: none;
    border: 1px solid var(--transp-1);
    border-radius: var(--border1);
    background-color: var(--transp-2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 8px 10px;
    max-width: min(720px, calc(100vw - 24px));
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.98);
    transition: opacity .18s ease, transform .2s ease;
    pointer-events: none;
}

.bulk-actions-floating .bulk-actions-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bulk-actions-floating .bulk-actions-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 70vw;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bulk-actions-floating .bulk-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--transp-05);
    color: var(--text-400);
    font-size: var(--p-small);
    white-space: nowrap;
}

.bulk-actions-floating.is-visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    pointer-events: auto;
}

.bulk-actions-floating.is-hiding {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.98);
    pointer-events: none;
}

.bulk-actions-floating .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    font-size: 0;
    text-indent: -9999px;
    overflow: hidden;
}

.bulk-actions-floating .btn .me-1 {
    margin: 0 !important;
}

.bulk-actions-floating .btn svg {
    width: 18px;
    height: 18px;
}

.bulk-actions-floating .btn.btn-outline-primary,
.bulk-actions-floating .btn.btn-primary,
.bulk-actions-floating .btn.btn-accent,
.bulk-actions-floating .btn.btn-success,
.bulk-actions-floating .btn.btn-warning,
.bulk-actions-floating .btn.btn-error {
    border-color: var(--transp-1);
    background: var(--bg);
    color: var(--text-400);
}

@media (max-width: 768px) {
    .bulk-actions-floating {
        left: 12px;
        right: 12px;
        bottom: 12px;
        border-radius: var(--border2);
        padding: 8px;
        transform: translateY(10px) scale(0.98);
    }

    .bulk-actions-floating.is-visible {
        transform: translateY(0) scale(1);
    }

    .bulk-actions-floating.is-hiding {
        transform: translateY(10px) scale(0.98);
    }

    .bulk-actions-floating .bulk-actions-scroll {
        max-width: 100%;
    }
}