/* Main sidebar */
.main-sidebar {
    z-index: 9;
    position: relative;
    flex: 0 0 auto;
    width: 250px;
    min-height: 0;
    border-right: 1px solid #e6e6e6;
    background: #fff;
    box-shadow: inset -2px 0 0 0 rgb(0, 0, 0, 0.02);
    transition: width 0.25s ease-out;

    > .inner {
        width: 100%;
        height: 100%;
        padding: 12px 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Collapse-expand */
    > .collapse {
        display: none;
        z-index: 99;
        position: absolute;
        top: 0;
        right: -22px;
        width: 34px;
        height: calc(100vh - 50px);
        padding-top: 59px;
        opacity: 0;
        transition: opacity 0.25s ease-out;

        > .circle {
            position: relative;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.2);
            color: #333;
            cursor: pointer;
            user-select: none;

            > svg {
                position: absolute;
                top: 50%;
                left: 6px;
                width: 10px;
                transform: translateY(-50%);
                fill: currentColor;
            }

            &:hover {
                background: #2f67f3;

                > svg {
                    color: #fff;
                }
            }
        }

        &.hover {
            display: block;
        }
        &.hover.transition {
            opacity: 1;
        }
    }

    /* Views */
    .side-view {
        display: none;
        position: relative;
        left: 0;
        transition: all 0.25s ease-out;

        &.visible {
            display: block;
        }
        &.before-transition {
            display: block;
            left: -250px;
            transition: none;
        }
    }

    /* Static items */
    .static-items {
        display: none;

        .item {
            display: none;
            padding: 0 7px;

            > .button {
                display: block;
                position: relative;
                min-height: 39px;
                padding: 12px 17px;
                overflow: hidden;
                border-radius: 5px;
                background: rgba(0, 0, 0, 0.035);
                font-size: 0;
                white-space: nowrap;
                cursor: pointer;
                transition: color 0.15s ease-out, background-color 0.15s ease-out;

                > .svg-icon {
                    display: block;
                    position: absolute;
                    top: 50%;
                    left: 16px;
                    width: 17px;
                    height: 17px;
                    transform: translateY(-50%);

                    > svg {
                        width: 100%;
                        color: #2f3c51;
                        fill: currentColor;
                    }
                }
                > .title {
                    display: block;
                    padding: 0 0 0 30px;
                    color: #2f3c51;
                    font-weight: 600;
                    font-size: 13px;
                    line-height: 15px;
                }
                &:hover {
                    z-index: 2;
                    position: relative;
                    background: rgba(0, 0, 0, 0.055);
                }
            }

            &.return-back {
                display: block;

                > .button > .svg-icon {
                    width: 15px;
                    height: 15px;
                }
            }
            &.expand-sidebar {
                display: none;

                > .button > .svg-icon > svg {
                    color: #8a0387;
                }
                > .button > .title {
                    color: #8a0387;
                }
            }
            &.collapse-sidebar {
                display: none;

                > .button {
                    background: #fbf4fb;

                    > .svg-icon > svg {
                        color: #8a0387;
                    }
                    > .title {
                        color: #8a0387;
                    }
                    &:hover {
                        background: #fbf2fc;
                    }
                }
            }
        }
    }

    .side-view.secondary .static-items {
        display: block;
        margin-bottom: 15px;
    }

    .nav {
        .group {
            margin-bottom: 20px;

            &:last-child {
                margin-bottom: 0;
            }
            > .title {
                padding: 0 22px 7px 22px;
                color: #444;
                font-weight: 600;
                font-size: 10px;
                line-height: 10px;
                text-transform: uppercase;
                cursor: default;
            }
            > .short-title {
                display: none;
            }
        }
        .items {
            padding: 0 8px;

            > .item {
                display: block;
                position: relative;
                padding: 12px 17px;
                border-radius: 5px;
                font-size: 0;
                cursor: pointer;
                transition: color 0.05s ease-out, background-color 0.05s ease-out;

                > .name {
                    display: block;
                    padding: 0 0 0 30px;
                    color: #2f3c51;
                    font-weight: 600;
                    font-size: 13px;
                    line-height: 15px;
                }
                > .number {
                    position: absolute;
                    top: 50%;
                    right: 15px;
                    width: 18px;
                    height: 18px;
                    transform: translateY(-50%);
                    border: 1px solid transparent;
                    border-radius: 50%;
                    color: #eee;
                    font-weight: 600;
                    font-size: 11px;
                    line-height: 16px;
                    text-align: center;
                }
                > .svg-icon {
                    display: block;
                    position: absolute;
                    top: 50%;
                    left: 16px;
                    width: 17px;
                    height: 17px;
                    transform: translateY(-50%);

                    > svg {
                        width: 100%;
                        color: #2f3c51;
                        fill: currentColor;
                    }
                }
                &.vehicles > .svg-icon {
                    width: 20px;
                    height: 20px;
                }
                &.transport > .svg-icon {
                    width: 20px;
                    height: 20px;
                }
                &.transport-companies > .svg-icon {
                    width: 18px;
                    height: 18px;
                }
                &.warehouse-operations > .svg-icon {
                    width: 16px;
                    height: 16px;
                }
                &.create-weighting > .svg-icon {
                    width: 16px;
                    height: 16px;
                }
                &.scales > .svg-icon {
                    width: 20px;
                    height: 20px;
                }
                &.ships > .svg-icon {
                    width: 19px;
                    height: 19px;
                }
                &.materials > .svg-icon {
                    width: 21px;
                    height: 21px;
                }
                &.orders > .svg-icon {
                    width: 19px;
                    height: 19px;
                    margin-left: -1px;
                }
                &.waybills > .svg-icon {
                    width: 19px;
                    height: 19px;
                }
                &.roles > .svg-icon {
                    width: 20px;
                    height: 20px;
                }
                &.security > .svg-icon {
                    width: 19px;
                    height: 19px;
                }
                &.industrial-sites > .svg-icon {
                    width: 19px;
                    height: 19px;
                }
                &.certificate-types > .svg-icon {
                    width: 19px;
                    height: 19px;
                }
                &.translations > .svg-icon {
                    width: 19px;
                    height: 19px;
                }
                &.vac-permits > .svg-icon {
                    width: 18px;
                    height: 18px;
                }
                &.vac-journal > .svg-icon {
                    width: 19px;
                    height: 19px;
                }
                &.vac-current > .svg-icon {
                    width: 20px;
                    height: 20px;
                }
                &.warehouse-routing > .svg-icon {
                    width: 18px;
                    height: 18px;
                }
                &.work-receipt > .svg-icon {
                    width: 19px;
                    height: 19px;
                }
                &.biotop > .svg-icon {
                    width: 20px;
                    height: 20px;
                }
                &.sourcing > .svg-icon {
                    width: 18px;
                    height: 18px;
                }
                &.gate-events > .svg-icon {
                    width: 18px;
                    height: 18px;
                }

                &:hover {
                    z-index: 2;
                    position: relative;
                    background: rgba(0, 0, 0, 0.035);
                    box-shadow: inset 0 0 1px #dadada;
                }
                &.active {
                    z-index: 3;
                    position: relative;
                    background: #eaf1fd;
                    box-shadow: inset 0 0 1px #d7e6fe;

                    > .name {
                        color: #2552c1;
                    }
                    > .svg-icon svg {
                        color: #2552c1;
                    }
                }

                &.num-red > .number {
                    border-color: #ff005a;
                    color: #ff005a;
                }
                &.num-purple > .number {
                    border-color: #ce1bca;
                    color: #ce1bca;
                }
                &.num-blue > .number {
                    border-color: #034dbf;
                    color: #034dbf;
                }
                &.num-green > .number {
                    border-color: #267e54;
                    color: #267e54;
                }
                &.accounts > .svg-icon {
                    width: 18px;
                    height: 18px;
                }
                &.tools > .svg-icon {
                    width: 17px;
                    height: 17px;
                }
            }
        }
    }
}

/* Collapsed */
.main-layout.sidebar-collapsed .main-sidebar {
    width: 54px;
    border-right-color: #eaeaea;
    box-shadow: inset -2px 0 0 0 rgba(0, 0, 0, 0.015);

    > .collapse {
        display: none;
    }
    > .inner {
        padding: 5px 0;
    }

    .static-items {
        display: block;
        margin-bottom: 0;

        .item {
            padding: 0 0;

            > .button {
                display: block;
                padding: 10px 0;
                border-radius: 3px;
                background: none;
                text-align: center;
                opacity: 0.95;

                .title {
                    display: none;
                }
                .svg-icon {
                    display: inline-block;
                    position: static;
                    top: 0;
                    left: 0;
                    width: 19px;
                    height: 19px;
                    transform: none;
                    vertical-align: middle;
                }
                &:hover {
                    z-index: 2;
                    position: relative;
                    background: rgba(0, 0, 0, 0.035);
                    box-shadow: inset 0 0 1px #d5d5d5;
                }
            }

            &.expand-sidebar.desktop {
                display: block;
            }
            &.expand-sidebar.mobile {
                display: none;
            }
            &.return-back {
                display: none;
            }
        }
    }

    .side-view {
        padding: 0 5px;
    }
    .nav {
        .group {
            margin-bottom: 0;

            &.account,
            &.quick-actions {
                display: none;
            }
            > .short-title {
                display: block;
                padding: 12px 0;
                color: #0843d9;
                font-weight: 600;
                font-size: 16px;
                line-height: 16px;
                text-align: center;
                text-transform: uppercase;
                cursor: default;
            }
            > .title {
                display: none;
            }
        }
        .items {
            padding-right: 0;
            padding-left: 0;

            > .item {
                padding: 10px 0;
                border-radius: 5px;
                box-shadow: none;
                text-align: center;
                opacity: 0.95;

                > .name {
                    display: none;
                }
                > .number {
                    display: none;
                }
                > .svg-icon {
                    display: inline-block;
                    position: static;
                    top: 0;
                    left: 0;
                    width: 20px;
                    height: 20px;
                    transform: none;
                    vertical-align: middle;
                }
                &.active {
                    opacity: 1;
                }
                &:hover {
                }
            }
        }
    }
}

@media all and (max-width: 800px) {
    .main-layout .main-sidebar {
        > .collapse {
            display: none;
        }
        > .inner {
            padding: 5px 0;
        }
    }

    .main-layout:not([class*=sidebar-expanded]) .main-sidebar {
        width: 54px;
        border-right-color: #eaeaea;
        box-shadow: inset -2px 0 0 0 rgba(0, 0, 0, 0.015);

        .static-items {
            display: block;
            margin-bottom: 0;

            .item {
                padding: 0 0;

                > .button {
                    display: block;
                    padding: 10px 0;
                    border-radius: 3px;
                    background: none;
                    text-align: center;
                    opacity: 0.95;

                    .title {
                        display: none;
                    }
                    .svg-icon {
                        display: inline-block;
                        position: static;
                        top: 0;
                        left: 0;
                        width: 19px;
                        height: 19px;
                        transform: none;
                        vertical-align: middle;
                    }
                    &:hover {
                        z-index: 2;
                        position: relative;
                        background: rgba(0, 0, 0, 0.035);
                        box-shadow: inset 0 0 1px #d5d5d5;
                    }
                }

                &.expand-sidebar.desktop {
                    display: none;
                }
                &.expand-sidebar.mobile {
                    display: block;
                }
                &.return-back {
                    display: none;
                }
            }
        }

        .side-view {
            padding: 0 5px;
        }
        .nav {
            .group {
                margin-bottom: 0;

                &.account,
                &.quick-actions {
                    display: none;
                }
                > .short-title {
                    display: block;
                    padding: 12px 0;
                    color: #1651bb;
                    font-weight: 600;
                    font-size: 16px;
                    line-height: 16px;
                    text-align: center;
                    text-transform: uppercase;
                    cursor: default;
                }
                > .title {
                    display: none;
                }
            }
            .items {
                padding-right: 0;
                padding-left: 0;

                > .item {
                    padding: 10px 0;
                    border-radius: 5px;
                    box-shadow: none;
                    text-align: center;
                    opacity: 0.95;

                    > .name {
                        display: none;
                    }
                    > .number {
                        display: none;
                    }
                    > .svg-icon {
                        display: inline-block;
                        position: static;
                        top: 0;
                        left: 0;
                        width: 20px;
                        height: 20px;
                        transform: none;
                        vertical-align: middle;
                    }
                    &.active {
                        opacity: 1;
                    }
                }
            }
        }
    }

    .main-layout.sidebar-expanded .main-sidebar {
        flex: 1 1 auto;

        .side-view {
            padding: 0 7px;
        }
        .nav .group > .title {
            padding-right: 15px;
            padding-left: 15px;
        }
        .nav .items {
            padding-right: 0;
            padding-left: 0;
        }
        .static-items {
            display: block;
            margin-bottom: 5px;
        }
        .side-view.secondary .static-items {
            margin-bottom: 15px;
        }
        .static-items .item {
            margin-bottom: 3px;
            padding: 0 0;

            &:last-child {
                margin-bottom: 0;
            }
        }
        .static-items .item.collapse-sidebar {
            display: block;
        }
        .static-items .item.return-back {
            display: block;
        }
    }
    .main-layout.sidebar-expanded .main-content {
        display: none;
    }
}