@table-row-radius: 4px;

.spinner-wrapper {
    position: relative;

    .table-spinner-overlay {
        position: absolute;
        top: 0;
        z-index: 1;
        left: 5px;
        width: auto;
        right: 15px;
        height: ~"calc(100% - 85px)";
    }
}

.data-table {
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    min-height: ~"calc(100vh - 220px)";

    &.on-loading {
        overflow-x: hidden;
        overflow-y: hidden;
    }

    table {
        border-collapse: separate;
        border-spacing: 0 12px;
        table-layout: unset;
        margin-bottom: 0;

        thead th,
        tbody td {
            border-bottom: none;
            padding: 10px 24px;
        }

        thead {
            padding: 0;

            tr {
                th {
                    border: none;
                    text-transform: unset;
                    font-size: @font-size-sm;
                    text-align: left;
                    padding: 1px 24px;
                    min-width: 190px;

                    &.empty-col {
                        min-width: unset;
                    }

                    &:not(:last-child) {
                        border-right: 1px solid var(--border-200);
                    }

                    &.left-space {
                        padding-left: 44px;
                    }

                    .required-point {
                        color: var(--error-main);
                    }

                    &.long-cell {
                        min-width: 270px;
                    }

                    .checkbox-cell-wrapper {
                        display: flex;
                        justify-content: space-between;
                        align-items: baseline;

                        .form-check {
                            margin-bottom: 0;
                            padding-left: 0;
                            min-height: 1rem;

                            &:before {
                                top: 0;
                            }
                        }
                    }

                    &.avatar-cell,
                    &.checkbox-cell {
                        border-right: 0;
                        width: 60px;
                        min-width: 60px;
                    }

                    &.avatar-cell {
                        @media @md-max {
                            display: none;
                        }
                    }
                }
            }
        }

        tbody {
            tr {
                cursor: pointer;
                padding: 10px;
                .border-radius(4px);
                .box-shadow(0 1px 0 0 rgba(0, 0, 0, 0.06));
                background-color: var(--white);
                position: relative;

                @media (hover: hover) {
                    &:hover {
                        .sticky {
                            position: sticky;
                            right: 20px;
                            top: 0;
                            min-width: 0;
                            display: table-cell;
                            vertical-align: middle;


                            .icon-wraper {
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                height: 30px;
                                width: 30px;
                                background: var(--white);
                                border: 1px solid var(--border-200);
                                .border-radius(4px);
                                .box-shadow(0 1px 0 0 rgba(0, 0, 0, 0.06));

                                .icon-Delete {
                                    &:before {
                                        color: var(--primary);
                                    }
                                }
                            }
                        }
                    }
                }

                &.is-new {
                    @media @lg-max {
                        z-index: 1;
                        overflow: hidden;

                        .sticky {
                            position: sticky;
                            right: 0;
                            top: 0;
                            min-width: 0;
                            display: table-cell;
                            vertical-align: middle;
                            background-color: transparent;

                            .icon-wraper {
                                display: flex;
                                align-items: center;
                                justify-content: center;
                                height: 30px;
                                width: 30px;
                                background: var(--white);
                                border: 1px solid var(--border-200);
                                .border-radius(4px);
                                .box-shadow(0 1px 0 0 rgba(0, 0, 0, 0.06));

                                .icon-Delete {
                                    &:before {
                                        color: var(--primary);
                                    }
                                }
                            }
                        }
                    }
                }


                &:hover {
                    background-color: var(--bg-50);

                    td {
                        background-color: var(--bg-50);
                    }

                    .status-cell {
                        a:not(.nav-link) {
                            visibility: visible;
                        }
                    }
                }

                .sticky {
                    display: none;
                }

                td {
                    border-right: none;
                    border-left: none;
                    background-color: var(--white);
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    font-size: @font-size;

                    @media screen and (-ms-high-contrast: active),
                    (-ms-high-contrast: none) {
                        width: 210px;
                        vertical-align: top;
                        white-space: normal;
                        word-break: break-all;
                    }

                    &.has-preview {
                        display: flex;
                        justify-content: space-between;
                        align-items: baseline;
                    }

                    &.select-cell {
                        max-width: 210px;
                    }

                    &.checkbox-cell {
                        display: flex;
                        justify-content: space-between;
                        align-items: baseline;

                        .form-check {
                            margin-bottom: 0;
                            padding-left: 0;
                            min-height: 1rem;

                            &:before {
                                top: 0;
                            }
                        }
                    }

                    &.employee-cell {
                        color: var(--text-600);

                        &.cell-top {
                            vertical-align: top;
                            padding-top: 5px;
                            padding-bottom: 5px;
                        }

                        small {
                            display: block;
                            font-size: 80%;
                        }
                    }

                    &.status-cell {

                        @media screen and (-ms-high-contrast: active),
                        (-ms-high-contrast: none) {
                            white-space: normal;
                            word-break: normal;
                        }

                        >span {
                            display: flex;
                            justify-content: space-between;
                            align-items: baseline;
                            padding-right: 22px;

                            @media screen and (-ms-high-contrast: active),
                            (-ms-high-contrast: none) {
                                position: relative;
                            }

                            a:not(.nav-link) {
                                align-self: center;
                                visibility: hidden;
                                display: inline-block;
                                margin-left: 150px;
                                text-decoration: none;

                                @media screen and (-ms-high-contrast: active),
                                (-ms-high-contrast: none) {
                                    position: absolute;
                                    height: 100%;
                                    display: flex;
                                    align-items: center;
                                    width: 100%;
                                    left: 0px;
                                }
                            }
                        }

                        &.cell-top {
                            vertical-align: top;
                            padding-top: 5px;
                            padding-bottom: 5px;
                        }

                        small {
                            display: block;
                            font-size: 80%;
                        }
                    }

                    &:first-child {
                        border-top-left-radius: @table-row-radius;
                        border-bottom-left-radius: @table-row-radius;
                        color: var(--text-600);
                        padding-left: 10px;
                        padding-right: 2px;

                        &.avatar-cell {
                            @media @md-max {
                                display: none;
                            }
                        }
                    }

                    &:last-child {
                        border-top-right-radius: @table-row-radius;
                        border-bottom-right-radius: @table-row-radius;
                    }

                    .form-group {
                        margin-bottom: 0;
                    }

                    .field-invalid-msg {
                        display: none;
                    }

                    &.row-menu {
                        border: 1px solid var(--border-200);
                        position: relative;
                        cursor: pointer;
                        padding: 0;
                        width: 50px;
                        text-align: center;

                        &.disable {
                            opacity: .5;
                            pointer-events: none;
                        }

                        .icon-dot-menu {
                            font-size: 21px;
                            width: 50px;
                            display: inline-block;
                        }


                        .menu-box {
                            z-index: 10;
                            position: absolute;
                            top: 10px;
                            left: 30px;
                            background-color: var(--border-200);
                            .border-radius(4px);
                            .box-shadow(@box-shadow);
                            padding: 12px 0 12px 0;

                            &.top {
                                top: unset;
                                bottom: 6px;
                            }

                            .icon {
                                &:before {
                                    color: var(--text-600);
                                    width: 15px;
                                }
                            }
                        }
                    }
                }

                .vip-label {
                    font-size: 12px;
                    color: var(--success-main);
                    font-weight: @font-weight-semibold;
                    margin-left: 5px;
                    letter-spacing: 2px;

                    .icon-task-star-rating-default {
                        font-weight: @font-weight-semibold;

                        &:before {
                            color: var(--success-main);
                        }
                    }
                }

                .assignment-cell {
                    display: flex;
                    align-items: center;

                    .count {
                        display: inline-flex;
                        justify-content: center;
                        align-items: center;
                        width: 18px;
                        height: 18px;
                        .border-radius(50%);
                        background-color: var(--primary);
                        color: var(--white);
                        font-size: @font-size-xs;
                        line-height: 1;
                        margin-left: 12px;
                        padding-right: 1px;
                    }
                }

                .avatar-icon {
                    display: inline-block;
                    height: 30px;
                    width: 30px;
                    .border-radius(50%);
                    border: 1px solid;
                    text-align: center;
                    line-height: 2.3;
                    font-size: 12px;
                    font-weight: @font-weight-semibold;
                    position: relative;
                    text-transform: uppercase;

                    .icon {
                        line-height: 2.4;
                    }

                    .tooltip-inner {
                        white-space: initial;
                        text-align: left;
                        line-height: 1.3;
                        text-transform: none;
                    }

                    .icon-initiation {
                        position: absolute;
                        bottom: -6px;
                        right: -6px;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        width: 20px;
                        height: 20px;
                        background: var(--white);
                        padding: 4px;
                        .border-radius(6px);

                        &>span {
                            background-position: center;
                            background-size: contain;
                            background-repeat: no-repeat;
                            display: inline-block;
                            width: 100%;
                            height: 100%;
                        }

                        .tooltip {
                            color: var(--text-600);

                            p {
                                margin-bottom: 0;

                                &:last-child {
                                    color: var(--text-600);
                                    margin-top: 3px;
                                }

                                .capitalize {
                                    text-transform: capitalize;
                                }
                            }
                        }
                    }
                }

                &.is-new {
                    background-color: var(--bg-50);
                    color: var(--text-600);

                    td {
                        background-color: var(--bg-50);
                        color: var(--text-600);

                        &.id-cell {
                            min-height: 52px;

                            &.has-preview {
                                align-items: center;
                            }
                        }

                        .draft-badge {
                            display: inline-block;
                            padding: 3px 5px;
                            margin-left: 5px;
                            border-radius: @border-radius;
                            background-color: var(--bg-50);
                            border: 1px solid var(--border-200);
                        }

                        &:nth-last-child(2) {
                            border-top-right-radius: @table-row-radius;
                            border-bottom-right-radius: @table-row-radius;
                        }
                    }

                    &:hover {
                        .id-cell.has-preview {
                            .draft-badge {
                                display: none;
                            }
                        }
                    }
                }

                &.is-disabled {
                    background-color: var(--white);
                    color: var(--text-600);

                    td {
                        background-color: var(--white);
                        color: var(--text-600);
                    }
                }
            }
        }
    }

    &::-webkit-scrollbar {
        width: 17px;
        height: 4px;
    }

    &::-webkit-scrollbar-track,
    &::-webkit-scrollbar-thumb {
        opacity: 0.5;
        .border-radius(8px);
        background-clip: padding-box;
    }

    &::-webkit-scrollbar-track {
        background-color: var(--grey-200);
    }

    &::-webkit-scrollbar-thumb {
        background-color: var(--grey-400);
    }

    &::-webkit-scrollbar-corner {
        background-color: transparent;
    }

    &.increase-scroll-height::-webkit-scrollbar {
        height: 8px;
    }
}

.data-table-skeleton {
    padding-top: 56px;

    .react-loading-skeleton {
        margin-top: 14px;
    }
}

.table-cell-ellipsis {
    &:extend(.ellipsis-text);
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.table-cell-large {
    &:extend(.table-cell-ellipsis);
    max-width: 260px;
}