﻿/* ==============
  Tables
===================*/
th {
    font-weight: 500;
}

.table>tbody>tr>td,
.table>tfoot>tr>td,
.table>thead>tr>td {
    padding: 15px 11px;
    white-space: nowrap;
    font-size: 14px;
}
.table-responsive {
    &::-webkit-scrollbar {
        height: 6px;
    }
    &::-webkit-scrollbar-track {
        background-color: rgba(243, 243, 243, 0.52);
    }
    &::-webkit-scrollbar-thumb {
        background-color: rgba(184, 184, 184, 0.753);
    }
} 
table {
    tr {
        td {
            white-space: nowrap;
            padding: 4px;

            @media (max-width: 991px) {
                font-size: 14px;
            }
        }
    }
}

.table>thead>tr>th {
    padding: 10px 11px !important;
    white-space: nowrap;
}

.table-hover tbody tr:hover,
.table-striped tbody tr:nth-of-type(odd),
.thead-default th {
    background-color: $gray-100;
}

.table td,
.table th {
    vertical-align: middle;

}

.table-vertical {
    td {
        vertical-align: middle;
    }
}

.table-sm {

    th,
    td {
        padding: .3rem !important;
    }
}

div.dataTables_wrapper {
    .dataTables_info {
        padding-top: 7px !important;
    }

    .dataTables_paginate {
        .paginate_button {
            padding: 7px 10px;
            transition: .3s;
            border-radius: .25rem;
            border: none !important;
            line-height: 16px;

            &:hover {
                background: $secondary;
            }

            &.current {
                background: $secondary;
                color: #fff !important;
                border: none;

                &:hover {
                    background: $primary;
                    color: #fff;
                    border: none;
                }
            }
        }

        ul {
            &.pagination {
                @media (max-width: 767px) {
                    justify-content: center !important;
                }
            }
        }
    }
}

.dataTables_wrapper {
    .dataTables_length {
        margin-top: 7px;
        padding-top: 0;
    }
}


.dataTables_wrapper input[type="search"] {
    height: 40px !important;
    border: 1px solid #ddd !important;
    padding: 6px !important;
}

.table-border-less {
    tr {
        td {
            border-top: 0;
            padding: 0;
            vertical-align: top;
            padding-bottom: 8px;

            .ic-select-checkbox {
                padding: 0 20px;
            }
        }
    }
}

.ic-table-responsive-heading {
    .form-control {
        height: auto;
        border: none;
        padding: 2px;
    }

    @media (min-width: 1441px)and (max-width:1920px) {
        .table {
            thead>tr {
                th {
                    font-size: 14px;
                    padding: 5px !important;
                }
            }

            td {
                font-size: 14px;
            }
        }
    }

    @media (min-width: 992px)and (max-width:1440px) {
        .table {
            thead>tr {
                th {
                    font-size: 12px;
                    padding: 5px !important;
                }
            }

            td {
                font-size: 12px;
            }
        }
    }
}

/* == Responsive Table ==*/
table.focus-on {
    tbody {
        tr.focused {
            th {
                background-color: $primary;
                color: $white;
            }

            td {
                background-color: $primary;
                color: $white;
            }
        }
    }
}

.table-rep-plugin {
    .btn-toolbar {
        display: block;
    }

    .table-responsive {
        border: none !important;
    }

    .btn-group.float-right .dropdown-menu {
        right: 0;
        transform: none !important;
        top: 100% !important;
    }

    tbody {
        th {
            font-size: 14px;
            font-weight: normal;
        }
    }

    .checkbox-row {
        padding-left: 40px;

        label {
            display: inline-block;
            padding-left: 5px;
            position: relative;

            &::before {
                -o-transition: 0.3s ease-in-out;
                -webkit-transition: 0.3s ease-in-out;
                background-color: $white;
                border-radius: 3px;
                border: 1px solid $gray-300;
                content: "";
                display: inline-block;
                height: 17px;
                left: 0;
                margin-left: -20px;
                position: absolute;
                transition: 0.3s ease-in-out;
                width: 17px;
                outline: none !important;
            }

            &::after {
                color: $gray-200;
                display: inline-block;
                font-size: 11px;
                height: 16px;
                left: 0;
                margin-left: -20px;
                padding-left: 3px;
                padding-top: 1px;
                position: absolute;
                top: -1px;
                width: 16px;
            }
        }

        input[type="checkbox"] {
            cursor: pointer;
            opacity: 0;
            z-index: 1;
            outline: none !important;

            &:disabled+label {
                opacity: 0.65;
            }
        }

        input[type="checkbox"]:focus+label {
            &::before {
                outline-offset: -2px;
                outline: none;
            }
        }

        input[type="checkbox"]:checked+label {
            &::after {
                content: "\f00c";
                font-family: 'Font Awesome 5 Free';
                font-weight: 900;
            }
        }

        input[type="checkbox"]:disabled+label {
            &::before {
                background-color: $gray-100;
                cursor: not-allowed;
            }
        }

        input[type="checkbox"]:checked+label {
            &::before {
                background-color: $primary;
                border-color: $primary;
            }

            &::after {
                color: $white;
            }
        }
    }

    .fixed-solution {
        .sticky-table-header {
            top: 70px !important;
        }
    }
}

.ic-table-return {
    .form-control {
        width: 200px;
    }
}

.ic-table-mobile-device {
    margin: 20px -12px;

    .col-sm-6 {
        @media (max-width: 991px) {
            -ms-flex: 0 0 100%;
            flex: 0 0 100%;
            max-width: 100%;

        }
    }

    .ic-purchase-print {
        tr {
            td {
                padding: 4px 0;
                font-size: 14px;
            }
        }
    }
}


.ic-invoice-addess {
    P {
        font-size: 14px;
    }
}

@media (max-width: 1600px) {
    .ic-purchase-print tr td:first-child {
        width: 50%
    }
}

/******** table editable **********/

.table-editable {
    .editable-input {
        .form-control {
            height: 2rem;
        }
    }

    .editable-buttons {
        .btn {
            &.btn-sm {
                font-size: 12px;
            }
        }
    }

    tbody {
        td {
            &.focus {
                box-shadow: inset 0 0 1px 1px $primary !important;
            }
        }
    }