.grid {
    display: grid;
    grid-template-columns: 240px auto;
    grid-template-rows: 48px auto;
    grid-template-areas: "header header" "sidebar content";
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    width: 100vw;

    background-color: var(--nav-bg);

    overflow-x: hidden;
    position: relative;

    @media (max-width: 991px) {
        grid-template-columns: 64px auto;
    }

    @media (max-width: 575px) {
        grid-template-columns: auto;
        grid-template-rows: 48px auto 58px;
        grid-template-areas: "header" "content" "sidebar";
    }

    .grid-header {
        grid-area: header;
        -webkit-app-region: drag;
        app-region: drag;

        .navbar-brand,
        .navbar-content > button {
            -webkit-app-region: no-drag;
            app-region: no-drag;
        }
    }

    .grid-sidebar {
        grid-area: sidebar;
        justify-content: stretch;
        overflow: auto;
        z-index: 5;

        @media (max-width: 575px) {
            background-color: var(--nav-mobile-bg);
            z-index: 7;
            box-shadow: $box-shadow;
        }

        .navbar {
            background-color: var(--nav-bg);
            border-bottom: var(--nav-border-color) 1px solid;
            z-index: 5;

            @supports (backdrop-filter: blur(15px) saturate(125%)) {
                background-color: var(--nav-bg-acrylic);
                backdrop-filter: blur(10px) saturate(120%);
            }

            @media (max-width: 575px) {
                display: none;
            }

            @media (max-width: 991px) {
                .brand-label {
                    display: none;
                }
            }
        }

        .sidebar {
            display: flex;
            flex-direction: column;

            padding: 0 0.25rem 0.5rem 0.25rem;
            height: 100%;

            @media (max-width: 991px) {
                padding: 0 0.5rem 0.5rem;
            }

            @media (max-width: 575px) {
                flex-direction: row;
                padding: 0;
            }

            .sidebar-divider {
                @media (min-width: 576px) {
                    border-bottom: 1px solid var(--nav-border-color);
                    margin: 0.25rem 0 0.5rem 0;
                }
            }

            .sidebar-item {
                display: flex;
                flex-direction: row;
                position: relative;

                transition: $transition-base;

                border-radius: $border-radius;
                background-color: transparent;
                border: transparent 1px solid;
                width: 100%;

                text-decoration: none;
                color: var(--text);
                align-items: center;

                &:not(:last-child) {
                    margin-bottom: 0.25rem;
                }

                @media (min-width: 991px) {
                    padding: 0.4375rem 1rem 0.5625rem;
                }

                @media (max-width: 991px) {
                    height: 48px;
                    justify-content: center;
                }

                @media (max-width: 575px) {
                    background-color: transparent;
                    border-radius: 0;
                    padding: 0;
                    margin: 0;
                    height: 58px;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                    width: 100%;
                    text-align: center;

                    .ai {
                        margin-top: 0;
                    }
                }

                .sidebar-label {
                    display: block;
                    color: var(--nav-color-label);
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    min-width: 0;
                    margin-left: 1rem;

                    @media (max-width: 991px) {
                        display: none;
                    }

                    @media (max-width: 575px) {
                        font-size: 70%;
                        font-weight: 400;
                        display: block;
                        max-width: 65px;
                        line-height: 1.25;
                        margin: .25rem auto 0;
                    }
                }

                &.active {
                    svg {
                        color: $primary;
                    }

                    @media (min-width: 576px) {
                        background-color: var(--main-bg);
                        border-color: var(--main-border-color);

                        &::after {
                            position: absolute;
                            background-color: $primary;
                            left: -1px;
                            top: 30%;
                            height: 40%;
                            width: 4px;
                            border-radius: 6px;
                            content: "";
                        }
                    }
                }

                &:hover {
                    background-color: var(--main-bg);
                    color: var(--text);

                    @media (max-width: 575px) {
                        background-color: var(--nav-bar-item-hover);
                    }
                }
            }
        }
    }

    .grid-content {
        grid-area: content;
        background-color: var(--main-bg);
        border-top: var(--main-border-color) 1px solid;
        z-index: 6;
        overflow: auto;

        @media (min-width: 576px) {
            border-top-left-radius: 0.75rem;
            border-left: var(--main-border-color) 1px solid;
        }

        & > .container {
            padding-top: 0.5rem;
            padding-bottom: 0.5rem;

            &:not(:last-child) {
                margin-bottom: 1.25rem;
            }

            &:first-child:last-child {
                height: calc(100% - 57px);
            }
        }

        .navbar {
            background-color: var(--main-bg);
            border-bottom: var(--main-border-color) 1px solid;
            z-index: 6;

            @supports (backdrop-filter: blur(15px) saturate(125%)) {
                background-color: var(--main-bg-acrylic);
                backdrop-filter: blur(10px) saturate(120%);
            }
        }
    }
}
