/* ── SidePanel — panneau latéral façon "blade" (préfixe sp- pour éviter tout conflit) ── */

.sp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9400;
    background: rgba(10, 18, 32, .45);
    animation: sp-fade-in .2s ease both;
}

.sp-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9500;
    width: 33vw;
    min-width: 400px;
    max-width: 560px;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: sp-slide-in .25s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes sp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes sp-slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.sp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sp-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.sp-close {
    background: var(--bg);
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.sp-close:hover { background: var(--border); color: var(--text); }

.sp-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

@media (max-width: 768px) {
    /* Sur petits écrans, pas de comportement "blade" : le panneau s'affiche
       dans le flux normal de la page (pas d'overlay ni de position fixe). */
    .sp-overlay {
        display: none;
    }

    .sp-panel {
        position: static;
        width: 100%;
        min-width: 0;
        max-width: none;
        height: auto;
        box-shadow: none;
        animation: none;
        border-top: 1px solid var(--border);
    }
}
