/* Fichier complet, variables */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.app-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bgc-app);
    border-right: 1px solid var(--side-border);
    z-index: 1000;
}

.app-nav__inner {
    height: var(--full-height);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 14px;
    padding: 16px;
}

.app-nav__brand {
    padding: 8px;
    color: var(--text-white);
    font-weight: var(--font-weight);
    font-size: var(--font-size-title);
    line-height: var(--line-height);
}

.app-nav__menu {
    overflow: hidden;
}

.app-nav__menu:hover {
    overflow: auto;
}

.app-nav__list {
    list-style: none;
    margin: 22px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-nav__link {
    text-decoration: none;
    color: var(--text-grey);
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 10px;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    white-space: nowrap;
}

.app-nav__link svg {
    width: var(--size-icons-xs) !important;
    height: var(--size-icons-xs) !important;
    display: block;
    color: var(--text-grey);
}

.app-nav__link > span {
    font-size: var(--font-size-title);
    line-height: var(--line-height);
}

.app-nav__link:hover,
.app-nav__link.is-active {
    color: var(--text-white);
}

.app-nav__link.is-active svg {
    color: var(--text-white);
}

.app-nav__user {
    display: block;
}

.app-nav__usercard {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    height: 74px;
    border-radius: var(--border-radius);
    background: var(--bgc-input-div);
    color: var(--text-white);
    text-decoration: none;
}

.app-nav__usercard:link,
.app-nav__usercard:visited,
.app-nav__usercard:hover,
.app-nav__usercard:focus,
.app-nav__usercard:active {
    color: var(--text-white);
    text-decoration: none;
}

.app-nav__avatar {
    width: var(--size-avatar-sm);
    height: var(--size-avatar-sm);
    border-radius: var(--middle-border);
    object-fit: cover;
    display: block;
    overflow: hidden;
    flex-shrink: 0;
}

.app-nav__userinfo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-nav__userinfo strong {
    font-size: var(--font-size-title);
    line-height: var(--line-height);
}

.app-nav__userinfo small {
    font-size: var(--font-size-text);
    line-height: var(--line-height);
    color: var(--text-grey);
}

@media (max-width: 1279px) and (min-width: 769px) {
    .app-nav__useremail {
        display: block;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        position: relative;
    }

    .app-nav__useremail::after {
        content: "…";
        position: absolute;
        right: 0;
        color: var(--text-grey);
        background: var(--bgc-input-div);
        padding-left: 4px;
    }
}

@media (max-width: 1279px) and (min-width: 769px) {
    .app-nav {
        width: var(--sidebar-min-width);
    }
}

@media (max-width: 768px) {
    .app-nav {
        top: auto;
        left: 50%;
        bottom: calc(12px + env(safe-area-inset-bottom, 0));
        transform: translateX(-50%);
        width: min(100% - 24px, 520px);
        height: auto;
        background: var(--bgc-app);
        border: 1px solid var(--side-border);
        border-radius: var(--border-radius);
        padding: 0;
    }

    .app-nav__inner {
        height: var(--dock-h);
        padding: 10px 14px;
        grid-template-rows: 1fr;
        align-items: center;
    }

    .app-nav__brand,
    .app-nav__user {
        display: none;
    }

    .app-nav__menu {
        overflow: visible;
    }

    .app-nav__list {
        margin: 0;
        padding: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        gap: clamp(10px, 4vw, 18px);
    }

    .app-nav__link {
        justify-content: center;
        width: var(--size-icons-l);
        height: var(--size-icons-l);
        padding: 0;
        gap: 0;
    }

    .app-nav__link > span {
        display: none;
    }

    .app-nav__link.is-active {
        color: var(--text-white);
    }
}

@media (max-width: 340px) {
    .app-nav {
        width: calc(100% - 16px);
    }

    .app-nav__inner {
        padding: 8px 10px;
    }

    .app-nav__link {
        width: var(--size-icons-l);
        height: var(--size-icons-l);
        border-radius: var(--border-radius);
    }
}
