/* Sidebar logout + back-to-top — partagé plateforme / tenants */

.mip-sidebar-logout-footer {
    flex-shrink: 0;
    padding: 10px 12px 14px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.16), transparent);
    position: relative;
    z-index: 2;
}

.mip-sidebar-logout-btn,
a.logout-btn.mip-sidebar-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    margin: 0;
    border: 1px solid rgba(254, 202, 202, 0.28);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.14), rgba(127, 29, 29, 0.24));
    color: #fecaca;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.25;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.mip-sidebar-logout-btn__ico,
.mip-sidebar-logout-btn .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    font-size: 0.95rem;
    opacity: 0.95;
}

.mip-sidebar-logout-btn:hover,
a.logout-btn.mip-sidebar-logout-btn:hover {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.28), rgba(185, 28, 28, 0.36));
    color: #ffffff;
    border-color: rgba(252, 165, 165, 0.55);
    transform: translateY(-1px);
    box-shadow:
        0 8px 22px rgba(127, 29, 29, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.mip-sidebar-logout-btn:focus-visible,
a.logout-btn.mip-sidebar-logout-btn:focus-visible {
    outline: 2px solid rgba(252, 165, 165, 0.75);
    outline-offset: 2px;
}

.mip-back-to-top {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 1200;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: linear-gradient(145deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow:
        0 8px 24px rgba(5, 150, 105, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(0.9);
    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.2s ease;
}

[dir='rtl'] .mip-back-to-top {
    left: max(20px, env(safe-area-inset-left, 0px) + 16px);
    right: auto;
}

[dir='ltr'] .mip-back-to-top {
    right: max(20px, env(safe-area-inset-right, 0px) + 16px);
    left: auto;
}

.mip-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.mip-back-to-top:hover {
    box-shadow:
        0 12px 28px rgba(5, 150, 105, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transform: translateY(-2px) scale(1.03);
}

.mip-back-to-top.is-visible:hover {
    transform: translateY(-2px) scale(1.03);
}

.mip-back-to-top:focus-visible {
    outline: 2px solid rgba(16, 185, 129, 0.65);
    outline-offset: 3px;
}

.mip-back-to-top__ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

.mip-back-to-top[hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .mip-back-to-top {
        width: 42px;
        height: 42px;
    }
}
