.anj-base-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    max-width: none;
    position: relative;
    table-layout: fixed;

    &,
    & thead,
    & tbody,
    & tr,
    & th,
    & td {
        background-color: inherit;
    }

    > thead th {
        color: var(--anj-neutral-dark);
        cursor: default;
        font-size: $font-size-sm;
        transition: border-color $animation-length, color $animation-length, transform $animation-length;

        &.anj-overflow-header {
            .anj-column-caption {
                overflow: visible;
                white-space: normal;
            }
        }

        > span {
            display: inline-block;
            line-height: 1;
            max-width: 100%;
            padding-right: 0.25rem;
            overflow: hidden;
            text-overflow: ellipsis;
            text-transform: uppercase;
        }
    }

    > tbody th,
    > tbody td {
        cursor: default;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: border-color $animation-length;

        &.anj-pinned-left {
            z-index: 1;
        }

        &.anj-overflow-cell {
            overflow: visible;
            white-space: normal;
        }
    }

    > thead th,
    > tbody th,
    > tbody td {
        border-bottom: 1px solid var(--anj-border);
        border-left: 0;
        border-right: 0;
        border-top: 0;
        padding: $table-cell-padding-y $table-cell-padding-x;
        vertical-align: top;
        white-space: nowrap;

        &:focus {
            border-bottom-color: $blue-gray-400;
            outline: none;
        }

        &.anj-pinned-left,
        &.anj-pinned-right {
            position: sticky;
        }

        &.anj-pin-border {
            &.anj-pinned-left {
                border-right: 1px solid transparent;
            }

            &.anj-pinned-right {
                border-left: 1px solid transparent;
            }
        }

        anj-button {
            margin: -0.75rem 0 !important;
        }
    }

    > thead {
        th {
            position: sticky;
            top: 0;
            z-index: 1;

            &:focus {
                .anj-column-caption {
                    color: var(--anj-text);
                }
            }

            &.anj-pinned-left,
            &.anj-pinned-right {
                z-index: 2;
            }
        }
    }

    @supports not (position: sticky) {
        .anj-header-cell,
        .anj-pinned-left,
        .anj-pinned-right {
            position: relative;
            bottom: auto !important;
            left: auto !important;
            right: auto !important;
            top: auto !important;
        }
    }
}
