@import "_Mixins.scss";
@import "_Sizes.scss";

.divided-content-main .document-body.table-has-fiscal-data {
    height: calc(100% - 180px);
}

.dataTables_wrapper {
    min-height: 250px;
}

.document-list {
    height: calc(100% - 50px);
    overflow: hidden;
}

.document-list-no-footer {
    height: calc(100% - 5px);
}

.document-list-double-footer-xs {
    @media (max-width: $max-screen-xs) {
        height: calc(100% - 100px);
    }
}

.divided-content-main {
    .document-head, .document-footer {
        margin-right: -20px;
        margin-left: -20px;
        width: calc(100% + 40px);
    }

    .document-footer {
        width: 100%;

        @media (max-width: $max-screen-sm) {
            position: relative;
            margin-left: -20px;
            margin-right: -20px;
            width: calc(100% + 40px);
        }
    }

    .document-body {
        position: relative;
        height: calc(100% - 150px);

        &.main-partial-view {
            height: 100%;
        }

        &.document-body-with-info {
            height: calc(100% - 180px);
        }

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

        .document-table {
            height: calc(100% - 110px);
        }

        @media (min-width:$min-screen-sm) and (max-width: $max-screen-sm) {
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        @media (max-width: $max-screen-sm) {
            min-height: 300px;
            height: 100%;
        }
    }
}

.document-head, .document-footer {
    .document-head-disabled-input {
        background-color: $disabled-header-field;
    }

    .document-head-highlight-input {
        background-color: $accent-color;
        color: $light-color;
        font-size: 24px;
        overflow: hidden;

        .form-group > label {
            color: $light-color;
            display: block;
        }

        .form-group > div {
            margin-top: 4px;
        }

        .font-sm {
            font-size: 16px;
        }
    }

    & > div {
        border: 0;
        border-right: 1px solid $divider-color;
        padding-right: 10px;
        padding-left: 10px;
        min-height: 66px;
        max-height: 66px;

        .form-group {
            padding-top: 8px;
            margin-bottom: 0;
        }

        label {
            font-size: 13px;
            font-weight: 500;
            letter-spacing: 0;
            color: $main-text-color;
            margin: 0;
            display: inline-flex;
            @include overflow-ellipsis();
        }

        input, textarea {
            font-weight: 600;
            font-size: 14px;
            background-color: transparent;

            option {
                background-color: $input-background-color;
            }

            &:disabled {
                border: 0;
            }
        }

        select {
            font-weight: 600;
            font-size: 14px;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: $caret-down-icon;
            background-size: .45em;
            background-position: calc(100%) center;
            background-repeat: no-repeat;
            text-overflow: ellipsis;
            padding-right: 20px;
        }

        h4 {
            line-height: 21px;
            font-weight: 600;
            font-size: 14px;
            color: $main-text-color;
            @include overflow-ellipsis();
        }

        &.padding-left-none {
            padding-left: 0px;
        }

        &.p-r-0 {
            padding-right: 0px;
        }
    }
}

.document-footer-sm > div {
    min-height: 46px;
    max-height: 46px;
    z-index: 2;

    .form-group {
        margin-top: 13px;

        b {
            font-weight: 600;
        }
    }

    &.document-head-highlight-input {
        .form-group {
            @include overflow-ellipsis();

            & > label {
                font-size: 14px;
                display: inline;
                vertical-align: top;
            }

            span {
                font-size: 14px;
                vertical-align: top;
                font-weight: 400;
            }
        }
    }
}

.divided-content .document-head > div:last-child, .divided-content .document-footer > div:last-child {
    border-right: 0;

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

.document-head {
    margin-bottom: 20px;

    input, select, .selectpicker + button.btn-default, .form-control {
        border-width: 0;
        padding-left: 0;
        padding-right: 0;

        &.error-input-item {
            border-bottom-width: 1px;
        }

        &.custom-select {
            padding-right: 5px;
        }
    }

    .input-group-addon {
        border: 0;
    }

    & > div {
        border-bottom: 2px solid $divider-color;
    }

    &:after {
        content: "";
        position: relative;
        width: 100%;
        border-bottom: 2px solid $divider-color;
        bottom: 2px;
        z-index: 2;
    }

    &.margin-b-none {
        margin-bottom: 0px;
    }

    .doctype-prev-next-display {
        min-height: 35px;
        max-height: 35px;
    }
}

.document-footer {
    position: absolute;
    width: calc(100% + 30px);
    bottom: 0;

    &:after {
        content: "";
        position: relative;
        width: 100%;
    }

    & > div {
        border-bottom-width: 0;
        border-top: 2px solid $divider-color;
        background-color: $default-header-field;

        .form-group {
            label {
                font-weight: 600;
            }

            i {
                padding-bottom: 15px;
                padding-top: 6px;
                display: block;

                @media (max-width: $max-screen-xs) {
                    display: inline-block;
                }
            }
        }
    }

    input, select, .selectpicker + button.btn-default, .form-control {
        border-width: 0;
        padding-left: 0;
        padding-right: 0;

        &.error-input-item {
            border-bottom-width: 1px;
        }
    }

    input {
        padding-right: 3px;
        padding-left: 3px;
    }
}

.invoice-text {
    color: black;
}

.invoice-partner {
    border-bottom: 2px solid black;
    margin-bottom: 2px;
    color: black;
}

.invoice-head {
    border-bottom: 2px solid black;
    margin-bottom: 2px;
    padding-bottom: 5px;
    margin-top: 15px;
    margin-bottom: 60px;
    color: black;

    & .invoice-number {
        font-size: 23px;
        padding-bottom: 5px;
        border-bottom: 10px solid black;
    }

    & .invoice-head-data {
        position: absolute;
        margin-top: 15px;

        & .invoice-head-copy-data {
            margin-top: 10px;
        }
    }
}

.invoice-fisc-sales-book-data {
    margin-top: -30px;
}

#tax-table tbody > tr > td:not(:first-child),
#payment-table tbody > tr > td:not(:first-child) {
    text-align: right;
}

#tax-table thead > tr > th:not(:first-child),
#payment-table thead > tr > th:not(:first-child) {
    text-align: right;
}

.table-stacked {
    border-bottom: 0;
}

.dashed-table th {
    border-right: 1px dashed black !important;
}

.invoice-table {
    border-bottom: 2px solid black;
    margin-bottom: 0;

    & th {
        background-color: #adadad;
        color: black;
        border-top: 2px solid black !important;
        border-bottom: 2px solid black !important;
        padding-top: 3px !important;
        padding-bottom: 3px !important;
    }

    & th:last-child {
        border-right: none !important;
    }

    & td {
        color: black;
    }
}

.invoice-total {
    & td {
        font-weight: bold;
    }

    & tr td:nth-child(2) {
        background-color: #ececec;
        color: black;
    }

    & tr td:last-child {
        border-bottom: 0 !important;
        color: black;
    }

    & tr:last-child td:not(:first-child) {
        border-top: 4px solid black;
    }

    & tr:last-child td:not(:first-child) {
        border-bottom: 2px solid black !important;
    }

    & > tbody > tr > td:first-child {
        text-align: right;
    }

    & > tbody > tr > td {
        border: 0 none;
    }

    & > tbody > tr > td:last-child {
        border-bottom: 1px solid #DDDDDD;
        text-align: right;
        width: 15%;
    }
}

.invoice-data {
    overflow: hidden;
    white-space: nowrap;
}

.invoice-data > div {
    display: inline-block;
}

#invoice-loader, #invoice-error {
    position: absolute;
    width: 100%;
    z-index: 99;
    top: 25%;
}

.product-content {
    .divided-content {
        .divided-content-main {
            .divided-content-toggle {
                top: 30px;
            }
        }
    }
}
