.modal--active {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     bottom: 0;
     background: rgba(0, 0, 0, 0.2);
     backdrop-filter: blur(4px);
     z-index: 999999;

     display: flex;
     align-items: center;
     justify-content: center;
     opacity: 0;
     pointer-events: none;
     transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
 }


 .modal--active__box {
     background: var(--card);
     border: 1px solid var(--border);
     border-radius: 16px;
     box-shadow:
         0 20px 25px -5px rgba(0, 0, 0, 0.1),
         0 10px 10px -5px rgba(0, 0, 0, 0.04);
     width: 90%;
     max-width: 840px;
     opacity: 0;
     transform: scale(0.95) translateY(10px);
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     will-change: transform, opacity;
 }

 .modal--open .modal--active__box {
     opacity: 1;
     transform: scale(1) translateY(0);
 }


 .modal--active__head {
     padding: 1rem 1.5rem;
     border-bottom: 1px solid var(--border);
     display: flex;
     align-items: center;
     justify-content: space-between;
 }

 .modal--active__head strong {
     font-size: 1.125rem;
     font-weight: 700;
     color: var(--text);
 }

 .iconbtn-close-error {
     width: 32px;
     height: 32px;
     border-radius: 10px;
     border: 1px solid rgba(37, 99, 235, 0.1);
     background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);
     color: var(--muted);
     cursor: pointer;
     transition: all 0.2s ease;
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 14px;
     backdrop-filter: blur(10px);
 }

.modal--open {
     opacity: 1;
     pointer-events: auto;
 }

 /* ================================
   Error Modal - Scoped Styles
   ================================ */
.modal--error .modal--active__box {
    max-width: 520px;
}

.modal--error .modal--active__head {
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(220, 38, 38, 0.02) 100%);
    border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}

.modal--error .modal--active__head strong {
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
}

.modal--error .iconbtn-close-error:hover {
     background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
     color: white;
     border-color: #ef4444;
     box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
     transform: scale(1.05);
}

.modal--error .modal--active__body {
    padding: 2rem 2rem 1.5rem 2rem;
}

.modal--error .modal--active__content {
    margin-bottom: 2rem;
}

.modal--error .modal--active__content p {
    margin: 0;
    padding: 0;
}

.modal--error .modal--active__content p:first-child {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0.875rem;
}

.modal--error .modal--active__content p:last-child {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted);
}

.modal--error .modal--active__actions {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.modal--error .modal--active__actions .btn,
.modal--error .modal--active__actions .btn--ghost {
    flex-shrink: 0;
    height: 38px;
    padding: 0 1rem;
    font-size: 0.875rem;
}

.modal--error .modal--active__actions .btn--ghost:first-child {
    margin-right: auto;
}

@media (max-width: 640px) {
    .modal--error .modal--active__actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal--error .modal--active__actions .btn,
    .modal--error .modal--active__actions .btn--ghost {
        width: 100%;
    }
    
    .modal--error .modal--active__actions .btn--ghost:first-child {
        margin-right: 0;
    }
}


 /* ================================
   Info Modal - Scoped Styles
   ================================ */
.modal--info .modal--active__box {
    max-width: 520px;
}

.modal--info .modal--active__head {
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.modal--info .modal--active__head strong {
    color: #3B82F6;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
}

.modal--info .iconbtn-close-error:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

.modal--info .modal--active__body {
    padding: 2rem 2rem 1.5rem 2rem;
}

.modal--info .modal--active__content {
    margin-bottom: 2rem;
}

.modal--info .modal--active__content p {
    margin: 0;
    padding: 0;
}

.modal--info .modal--active__content p:first-child {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0.875rem;
}

.modal--info .modal--active__content p:last-child {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted);
}

.modal--info .modal--active__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.modal--info .modal--active__actions .btn--ghost {
    flex-shrink: 0;
    height: 38px;
    padding: 0 1rem;
    font-size: 0.875rem;
    margin-left: auto; 
}


 /* ================================
   Confirm Modal - Scoped Styles
   ================================ */
.modal--confirm .modal--active__box {
    max-width: 520px;
}

.modal--confirm .modal--active__head {
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.modal--confirm .modal--active__head strong {
    color: #3B82F6; /* blue-600 */
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
}

.modal--confirm .iconbtn-close-error:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

.modal--confirm .modal--active__body {
    padding: 2rem 2rem 1.5rem 2rem;
}

.modal--confirm .modal--active__content {
    margin-bottom: 2rem;
}

.modal--confirm .modal--active__content p {
    margin: 0;
    padding: 0;
}

.modal--confirm .modal--active__content p:first-child {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0.875rem;
}

.modal--confirm .modal--active__content p:last-child {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted);
}

.modal--confirm .modal--active__actions {
    display: flex;
    gap: 0.625rem;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.modal--confirm .modal--active__actions .btn,
.modal--confirm .modal--active__actions .btn--ghost {
    flex-shrink: 0;
    height: 38px;
    padding: 0 1rem;
    font-size: 0.875rem;
}

/* ================================
   Confirm Modal - DANGER VARIANT
   ================================ */

.btn--danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white !important;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transition: all 0.2s ease;
}

.btn--danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* Header rouge */
.modal--confirm-danger .modal--active__head {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(220, 38, 38, 0.02) 100%);
    border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}

/* Titre rouge */
.modal--confirm-danger .modal--active__head strong {
    color: #dc2626;
}

/* Bouton fermer rouge */
.modal--confirm-danger .iconbtn-close-error:hover {
     background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
     color: white;
     border-color: #ef4444;
     box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
     transform: scale(1.05);
}


@media (max-width: 640px) {
    .modal--confirm .modal--active__actions {
        flex-direction: column-reverse; 
        gap: 0.5rem;
    }
    
    .modal--confirm .modal--active__actions .btn,
    .modal--confirm .modal--active__actions .btn--ghost {
        width: 100%;
    }
}

/* ================================
   Warning Modal - Scoped Styles
   (Harmonized with WebApp Theme)
   ================================ */
.modal--warning .modal--active__box {
    max-width: 520px;
}

.modal--warning .modal--active__head {
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.modal--warning .modal--active__head strong {
    color: var(--warning);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
}

.modal--warning .iconbtn-close-error:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

.modal--warning .modal--active__body {
    padding: 2rem 2rem 1.5rem 2rem;
}

.modal--warning .modal--active__content {
    margin-bottom: 2rem;
}

.modal--warning .modal--active__content p:first-child {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 0.875rem;
}

.modal--warning .modal--active__content p:last-child {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted);
}

.modal--warning .modal--active__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}


.modal--warning .modal--active__actions .btn {
    height: 38px;
    padding: 0 1.5rem;
    font-size: 0.875rem;
}