/* ==========================================================================
   Menu lateral (gaveta)
   ========================================================================== */

.r-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1990;
    background: rgba(0, 0, 0, .4);
    opacity: 0;
    transition: opacity .28s var(--r-ease);
}
.r-sidebar-backdrop.is-open { opacity: 1; }

.r-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 2000;
    width: min(320px, 86vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--r-line);
    box-shadow: 24px 0 60px rgba(0, 0, 0, .14);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform .34s var(--r-ease), visibility 0s linear .34s;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.r-sidebar.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .34s var(--r-ease), visibility 0s;
}
.r-sidebar:focus { outline: none; }

/* cabecalho */
.r-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 14px 18px;
    border-bottom: 1px solid var(--r-line);
}
.r-sidebar__brand img {
    max-height: 34px;
    max-width: 170px;
    object-fit: contain;
    display: block;
}
.r-sidebar__close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--r-line);
    border-radius: 10px;
    background: #fff;
    color: var(--r-ink);
    cursor: pointer;
    transition: border-color .15s, transform .25s var(--r-ease);
}
.r-sidebar__close:hover { border-color: var(--r-ink); transform: rotate(90deg); }

/* usuario logado */
.r-sidebar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 14px 6px;
    padding: 12px;
    border-radius: var(--r-radius);
    background: var(--r-panel);
    text-decoration: none;
    color: var(--r-ink);
}
.r-sidebar__user img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--r-line);
}
.r-sidebar__user strong { display: block; font-size: 15px; font-weight: 800; line-height: 1.2; }
.r-sidebar__user small { color: var(--r-ink-2); font-size: 12px; }
.r-sidebar__user:hover { color: var(--r-ink); }

/* visitante */
.r-sidebar__guest {
    margin: 14px 14px 6px;
    padding: 14px;
    border-radius: var(--r-radius);
    background: var(--r-red-soft);
}
.r-sidebar__guest p { margin: 0 0 10px; font-size: 13px; color: var(--r-ink); }
.r-sidebar__cta {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: var(--r-red);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
}
.r-sidebar__cta:hover { background: var(--r-red-dark); }

/* links */
.r-sidebar__nav ul { list-style: none; margin: 0; padding: 8px 10px; }
.r-sidebar__nav li {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity .3s var(--r-ease), transform .3s var(--r-ease);
}
.r-sidebar.is-open .r-sidebar__nav li {
    opacity: 1;
    transform: none;
    transition-delay: calc(60ms + var(--i) * 28ms);
}
.r-sidebar__nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--r-ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.r-sidebar__nav a i {
    font-size: 18px;
    width: 22px;
    text-align: center;
    color: var(--r-ink-2);
    transition: color .15s;
}
.r-sidebar__nav a:hover { background: var(--r-panel); color: var(--r-ink); }
.r-sidebar__nav a:hover i { color: var(--r-red); }
.r-sidebar__nav a.is-active { background: var(--r-red-soft); color: var(--r-red); }
.r-sidebar__nav a.is-active i { color: var(--r-red); }
.r-sidebar__nav a.is-active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--r-red);
}

.r-sidebar__logout {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: auto 20px 18px;
    padding-top: 14px;
    border-top: 1px solid var(--r-line);
    color: var(--r-ink-2);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.r-sidebar__logout:hover { color: var(--r-red); }

body.r-sidebar-lock { overflow: hidden; }
