/*Document ident table*/
.document-table {
    height: calc(100% - 300px); /*TODO: refactor heights with variables*/
    overflow: auto;

    &.full-height {
        height: 100%;
    }

    table {
        border: 0;
        position: relative;

        & table {
            width: 100%;

            & > tbody > tr > td {
                padding-top: 0;

                input, select {
                    border-right: 1px solid $table-border-color !important;

                    &:read-only {
                        border-right: 0 !important;

                        &.active-bg {
                            background-color: $input-background-color;
                            border-left: 1px solid $table-border-color;
                        }
                    }
                }
            }
        }

        & > thead > tr > th {
            background-color: $table-header-background-color;
            color: $table-font-color;
            border: 0;
            border-top: 0 !important;
            font-weight: 600;
            padding: 7px;
            vertical-align: bottom;
            position: -webkit-sticky;
            position: sticky;
            top: 0;
            z-index: 11;

            &.headerColumnWithBorder {
                border-right: 1px solid $table-border-color;
                border-bottom: 1px solid $table-border-color;
            }

            &:before {
                content: "";
                width: 100%;
                background-color: $table-border-color;
                height: 2px;
                position: absolute;
                bottom: 0;
                left: 0;
            }
        }

        & > tbody > tr {
            &:first-child td {
                padding-top: 0;

                &.actions-cell {
                    button {
                        &:before {
                            top: 0px;
                        }
                    }
                }
            }

            & > td.td-typeahead {
                & table > thead > tr > th {
                    padding: 10px;
                }

                & table > tbody > tr > td {
                    padding: 8px;
                }
            }

            & > td {
                padding: 0;
                padding-top: 5px;
                border: 0;

                &.no-space-td {
                    padding-top: 0;
                }
                /*&:nth-child(2) > * {
                    border: 1px solid $table-border-color;

                    .btn {
                        line-height: 1.3;
                    }
                }*/
                &:not(:first-child) > * {
                    border-left: 0;
                }

                label {
                    display: inline-block;
                    height: 100%;
                }

                .border-left-solid {
                    border-left: 1px solid #e5e6e7;
                }

                .no-border-right {
                    border-right: 0;
                }

                button {
                    padding-left: 8px;
                    padding-right: 8px;
                }

                input, select, .clickable-input, .select2-container {
                    border: 1px solid $table-border-color;
                    border-left: 0;

                    &.table-input-error {
                        border-bottom: 2px solid $danger-color;
                    }
                }

                &.actions-cell, .actions-cell {
                    text-align: right;
                    position: relative;
                    box-shadow: inset 0 1px 0 $table-border-color, inset 0 -1px 0 $table-border-color;

                    button {
                        border: 0;
                    }
                }

                input:read-only {
                    border-right: 0;
                }

                button:not(:last-child) {
                    border-right: 0;
                }

                &:last-child {
                    input, select, button {
                        border-right: 0;
                    }
                }

                .select2-container {
                    height: 34px;

                    .select2-selection {
                        height: 100%;

                        .select2-selection__rendered {
                            height: calc(100% + 6px);
                        }
                    }
                }
            }
        }

        .table-input-2 {
            height: 68px;
        }

        .checkbox-border {
            border-right: 1px solid $table-border-color;
        }

        .typeahead.dropdown-menu {
            width: 500px;
            min-width: unset;
            left: unset !important;
            padding-left: 10px;
        }
    }
}

/*List table*/
.list-table table, table.list-table, .dataTable {
    & > thead > tr > th {
        border-top: 2px solid $table-border-color;
        border-bottom: 2px solid $table-border-color;
        background-color: $table-header-background-color;
        color: $table-font-color;
        padding: 7px;
        cursor: pointer;
    }

    & > tbody > tr {

        & > td {
            border-top: 0;
            border-bottom: 1px solid $table-border-color;

            &.import-table {
                border-right: 1px solid $table-border-color;
            }

            &:first-child {
                border-left: 3px solid transparent;
            }
        }

        &:nth-child(even) {
            background-color: $table-even-row-background-color;
        }

        &:nth-child(odd) {
            background-color: $table-odd-row-background-color;
        }

        &:hover {
            background-color: $table-hover-row-background-color;

            td:first-child {
                border-left: 3px solid $accent-color;
            }
        }
    }

    .dataTables_scrollHeadInner {
        width: 100% !important;

        &.dt-scroller {
            width: auto !important;
        }
    }

    .dataTables_scrollHeadInner table {
        width: 100% !important;
    }
}

.project-list {
    height: 100%;
    display: flex;
    flex-direction: column;

    .dataTables_scrollHeadInner {
        width: 100% !important;
    }

    .dataTables_scrollHeadInner table {
        width: 100% !important;
    }

    @media only screen and (max-width: 400px) {
        .document-footer div:nth-child(1) {
            display: none;
        }

        .document-footer .document-head-highlight-input {
            min-width: 100%;

            .form-group {
                display: block;
            }
        }
    }
}

.width-99 {
    .dataTables_scrollHeadInner table {
        width: 99% !important;
    }
}

/*Ident search table*/
table.ident-search {
    border: 0;

    & > thead > tr > th {
        background-color: transparent;
        border: none;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0;
        color: $main-text-color;
        padding-bottom: 6px;
        padding-top: 3px;
        max-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    & > tbody > tr > td {
        padding: 0;
        border: 0;

        &:not(:first-child) input {
            border-left: 0;
        }
    }

    input, select {
        height: 44px;
        border: 1px solid $divider-color;
    }

    .select2 {
        border-top: 1px solid $divider-color;
        height: 44px;

        .selection {
            display: block;
            height: 100%;

            .select2-selection {
                display: block;
                height: 100%;
                padding-bottom: 0;
            }

            .select2-selection__rendered {
                height: 100%;
                line-height: 30px;
            }
        }
    }

    button {
        height: 44px;
        font-size: 16px;

        &#add-position {
            width: 50px;
        }
    }

    &.identTableHeader > thead > tr > th {
        background-color: $main-text-color;
        border: none;
        color: $light-color;

        &:last-child {
            background-color: transparent;
        }
    }

    .dataTables_scrollHeadInner {
        width: 100% !important;

        &.dt-scroller {
            width: auto !important;
        }
    }

    .dataTables_scrollHeadInner table {
        width: 100% !important;
    }
}
/*Any table*/
table {
    tbody {
        tr {
            &.selected-row {
                background-color: $table-selected-row-background-color;

                td {
                    background-color: $table-selected-row-background-color;

                    &:first-child {
                        border-left: 3px solid $accent-color;
                    }
                }

                &:hover {
                    td {
                        background-color: darken($table-selected-row-background-color, 5%);
                    }
                }
            }

            &.danger {
                background-color: $table-danger-row-background-color;
                color: $warning-color;

                td {
                    background-color: $table-danger-row-background-color;
                }

                &:hover {
                    td {
                        background-color: darken($table-danger-row-background-color, 5%);
                    }
                }
            }
        }
    }
}

.selected-row {
    background-color: $table-selected-row-background-color;
    border-left: 3px solid $accent-color;
}

.bootgrid-footer {
    padding-left: 0;
    padding-right: 0;

    .pagination > li > a {
        border-color: $divider-color;
    }
}

.table-responsive {
    border: 0;

    .table {
        margin-bottom: 0;
    }
}

.dataTables_scroll {
    .dataTables_scrollBody {
        border-bottom: 0;
        background-image: unset;
        background-color: #e7eaec21;
    }

    & + .dataTables_info {
        display: none;
    }
}

.dataTables_wrapper {
    padding-bottom: 0;

    .dataTables_processing {
        padding-top: 0;

        .datatables-loading {
            width: 40vmin;
            max-width: 130px;
            height: 40vmin;
            max-height: 130px;
            position: absolute;
            left: 50%;
            transform: translate(-50%, 0);
            background-image: $table-loading-animation;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: 50%;
        }
    }
}

table.bootgrid-table.simple {
    margin-bottom: 0;

    thead tr {
        border-top: 0;
        border-bottom: 2px solid $table-border-color;
        background-color: $table-header-background-color;
        color: $table-font-color;

        th, th:hover, th span, th:hover span {
            color: $table-font-color;
            background-color: $table-header-background-color;
        }
    }

    tbody {
        tr:nth-child(odd) {
            background-color: $table-odd-row-background-color;
        }

        tr:nth-child(even) {
            background-color: $table-even-row-background-color;
        }

        tr:hover, tr.selected-row {
            background-color: $table-hover-row-background-color;
        }

        tr td {
            padding: 10px 10px;
        }
    }
}

table.interactable {
    & > tbody > tr {
        cursor: pointer;
    }
}

table.display-table {
    border-collapse: separate;
    border-spacing: 0.7em 0.7em;

    tbody > tr > td {
        vertical-align: top;

        &.align-middle {
            vertical-align: middle;
        }

        &:first-child {
            min-width: 1%;
            white-space: nowrap;
        }
    }
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.3em 0.8em;
}

.dataTables_processing {
    background-color: $content-background-color;
    background-image: none;
}

table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr[role="row"] > th:first-child:before {
    display: inline-block;
    position: static;
    margin-right: 5px;
}


.filter-modal {
    width: 250px;
    height: 270px;
    background-color: $content-background-color;
    position: absolute;
    top: 0;
    z-index: 3000;
    -webkit-box-shadow: 0px 4px 13px -1px rgba(0,0,0,0.45);
    -moz-box-shadow: 0px 4px 13px -1px rgba(0,0,0,0.45);
    box-shadow: 0px 4px 13px -1px rgba(0,0,0,0.45);
}

.table-overlay-loader {
    position: absolute;
    width: 100%;
    height: 100%;
    text-align: center;
    background-color: rgba( $table-font-color, .1 );
    z-index: 99;

    & > i {
        margin: 0;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

#cashItemTable td {
    border: 1px solid #ddd;
}

#cashItemTable td:focus-within {
    border: 1px solid $success-color;
}

#cashItemTable input {
    border: none !important;
}

#tblCashItemsDiv {
    height: 100%;
}

#tblCashItems td {
    border: 1px solid #ddd;
}

#tblCashItems td:focus-within {
    border: 1px solid $success-color;
}

#tblCashItems input {
    border: none !important;
}

#payorders td:focus-within {
    border: 1px solid $success-color;
}

.table-input-cell {
    padding: 1px 10px;

    & .transparent-bg {
        background-color: transparent;
    }
}

.subjectTableContainer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.reportStockTableContainer {
    position: relative;

    .absoluteTableContainer {
        width: 100%;
        position: absolute;
    }
}

.import-table {
    height: 100%;
    overflow: auto;

    table {
        border: 0;

        & table {
            width: 100%;

            & > tbody > tr > td {
                padding-top: 0;

                input, select {
                    border-right: 1px solid $table-border-color !important;

                    &:read-only {
                        border-right: 0 !important;

                        &.active-bg {
                            background-color: $input-background-color;
                            border-left: 1px solid $table-border-color;
                        }
                    }
                }
            }
        }

        & > thead > tr > th {
            background-color: $table-header-background-color;
            color: $table-font-color;
            border: 0;
            border-top: 0 !important;
            border-bottom: 2px solid $table-border-color;
            border-right: 1px solid $divider-color;
            font-weight: 600;
            padding: 7px;
            vertical-align: bottom;

            &.headerColumnWithBorder {
                border-right: 1px solid $table-border-color;
                border-bottom: 1px solid $table-border-color;
            }
        }

        & > tbody > tr {
            &:first-child td {
                padding-top: 0;
            }

            & > td {
                padding: 0;
                border: 0;
                border-bottom: 1px solid $table-border-color;
                border-right: 1px solid $table-border-color;

                &:not(:first-child) > * {
                    border-left: 0;
                }

                label {
                    display: inline-block;
                    height: 100%;
                }

                .border-left-solid {
                    border-left: 1px solid #e5e6e7;
                }

                .no-border-right {
                    border-right: 0;
                }

                button {
                    padding-left: 8px;
                    padding-right: 8px;

                    &:first-child {
                        padding-left: 14px;
                    }

                    &:last-child {
                        padding-right: 14px;
                    }
                }

                input {
                    width: 200px;
                    background-color: transparent;
                    border: 0;

                    &.selector {
                        width: 15px;
                    }
                }

                select {
                    width: 150px;
                    border: 0;
                    background-color: transparent;
                }

                i {
                    width: 25px;
                }

                input:read-only {
                    border-right: 0;
                }

                button:not(:last-child) {
                    border-right: 0;
                }

                &:last-child {
                    border-right: 0;

                    &.fixedColBorder {
                        border-right: 1px solid $divider-color;
                    }
                }

                &.statusIcon {
                    border-right: 1px solid $divider-color;
                    border-bottom: 1px solid $divider-color;
                }
            }
        }

        .select2-container {
            width: 150px !important;

            &.table-input-error {
                border-bottom: 2px solid $danger-color;
            }

            .select2-selection__clear {
                margin-right: 5px;
            }

            .select2-selection--single {
                height: 34px;
                background-color: transparent;

                &:focus {
                    outline: none;
                }
            }
        }

        &.select2-container--focus {
            padding: 0;
        }

        .select2-container--focus, .select2-selection--single .select2-selection__rendered {
            height: 34px;
        }

        .select2-container--default .select2-selection--single .select2-selection__rendered {
            line-height: 35px;
        }

        .select2-selection--single .select2-selection__rendered {
            border: 0;
        }

        .small {
            width: 100px;
        }

        .medium {
            width: 150px;
        }

        .table-input-2 {
            height: 68px;
        }

        .checkbox-border {
            border-bottom: 0;
            padding-top: 5px;
        }
    }
}


.subject-contacts-table {
    thead > tr > th {
        border-top: 2px solid $table-border-color;
        border-bottom: 2px solid $table-border-color;
        background-color: $table-header-background-color;
        color: $table-font-color;
        padding: 7px;
        cursor: pointer;
    }

    tbody > tr {
        & > td {
            border: 0;
            border-right: 1px solid $table-border-color;
            border-bottom: 1px solid $table-border-color;
            vertical-align: middle;

            .no-padding {
                padding: 0;
            }

            .btn-table-add {
                padding: 6px 15px;
            }

            label {
                display: inline-block;
                height: 100%;
            }

            input, input:read-only {
                background-color: transparent;
                border: 0;

                &.selector {
                    width: 15px;
                }
            }

            select, select:read-only {
                border: 0;
                background-color: transparent;
            }

            i {
                width: 28px;
            }

            &:last-child {
                border-right: 0;

                &.fixedColBorder {
                    border-right: 1px solid $divider-color;
                }
            }
        }
    }
}

.commissionsTable {
    min-height: 400px
}

.price-change-price-type-col {
    min-width: 55px;
}

.table-min > tbody > tr > td, .table > tfoot > tr > td {
    padding-bottom: 0;
}

.table-expand-button {
    margin-top: 8px;

    &.rowHasDoubleCell {
        margin-top: 25px;
    }
}

.advance-payment-modal-table {
    th {
        vertical-align: middle;
    }

    .select-all {
        padding-left: 13px;
    }
}

.btn-table-add-2-rows {
    height: 76px;
    padding-top: 30px;
}

.table.list-table > thead:first-child > tr:first-child > th {
    border-top: 2px solid $divider-color !important;
}

.show-hide-dropdown {
    position: absolute;
    width: 20px;
    height: -webkit-fill-available;
    right: 0px;
    top: 0px;
    background-color: $table-header-background-color;
    border-left: 1px solid $table-border-color;
    border-bottom: 2px solid $divider-color;
    border-top: 2px solid $divider-color;
}

.show-hide-dropdown > a {
    position: absolute;
    top: 7px;
    left: 7px;
}

.show-hide-position {
    position: fixed;
    right: unset;
}

.push-left {
    right: 420px !important;
}

.showHideDropdown {
    position: absolute;
    display: block;
    z-index: 11;
    top: 0;
    right: 20px;

    & > a {
        position: absolute;
        padding: 6px;
        background-color: $table-header-background-color;

        & + ul {
            li {
                padding: 4px 6px;

                & > label {
                    width: 100%;
                }
            }
        }
    }
}

.not-select-text {
    user-select: none;
}

.hidden-column {
    display: none !important;
}

.sh-dropdown-position {
    top: 30px;
    right: 95%;
}

#travelorders-expenses td {
    padding-top: 0px;
    padding-bottom: 0px;
    place-items: center;
    text-align: center;
}

#travelorders-expenses tbody .custom-checkbox-checkmark {
    top: 5px !important;
}

#travelorders-expenses .doctype-expenses > td:last-child {
    padding-top: 7px;
}

.showhidecolumns {
    position: relative;
}

.form-horizontal #Name2 {
    resize: vertical;
}

.disabled-col {
    background-color: $input-disabled-background-color;
    padding-bottom: 0px;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none;
}

.google-api-key label,
.gtin-ident label {
    padding: 10px 0px 0px 0px;
}

.google-api-key div,
.gtin-ident div {
    padding-right: 0;
}

.custom-modal-container .custom-modal .add-modal-table {
    td {
        padding: 0;

        button {
            min-height: 30px;
        }

        &.centered {
            text-align: center;
            vertical-align: middle;
        }
    }
}

.serial-numbers-td {
    padding: 0;
    background-color: $input-disabled-background-color;
}

.tr-multirow-separator {
    border-bottom: 2px solid $table-border-color;
}

.scrollable {
    .dataTables_scrollHeadInner {
        padding-right: 0px !important;
    }

    .dtfc-fixed-left {
        z-index: 1;
    }

    table.dataTable tbody tr > .dtfc-fixed-left {
        background-color: inherit;
    }

    .dtfc-right-top-blocker {
        width: 0px !important;
    }
}

.table-bordered {
    border-color: $table-border-color;
}

.table-striped > thead > tr > th, .table-bordered > thead > tr > th {
    background-color: $table-header-background-color;
    color: $table-font-color;
    border-color: $table-border-color;
}

.table-striped > tbody > tr > td, .table-bordered > tbody > tr > td {
    border-color: $table-border-color;
}


.panel-default {
    border-color: $table-border-color;
}