/* Un único aspecto para avisos del servidor y acciones AJAX. */
.flash-messages-container {
    position:fixed; top:100px; right:20px; z-index:11000;
    display:flex; flex-direction:column; gap:10px;
    width:min(380px,calc(100vw - 32px)); max-height:calc(100dvh - 124px);
    overflow-y:auto; pointer-events:none;
}
.flash-message {
    display:flex; align-items:flex-start; gap:12px;
    padding:16px 12px 16px 16px; border:1px solid #e5e5e5; border-radius:12px;
    background:#fff; color:#262626; box-shadow:0 8px 28px #00000014;
    font:14px/1.5 Arial,sans-serif; pointer-events:auto;
    animation:notice-enter .16s ease-out;
    transition:opacity .16s ease, transform .16s ease;
}
.notice-icon { display:grid; place-items:center; flex:0 0 24px; height:24px; border-radius:50%; background:#f5f5f5; font-weight:700; }
.flash-success .notice-icon { background:#000; color:#fff; }
.flash-error .notice-icon { color:#a32626; border:1px solid #a32626; background:#fff; }
.flash-warning .notice-icon { background:#f5c02e; color:#000; }
.notice-copy { flex:1; min-width:0; overflow-wrap:anywhere; }
.notice-copy strong { display:block; font-size:13px; font-weight:600; }
.notice-copy p { margin:4px 0 0; color:#666; font:13px/1.5 Arial,sans-serif; }
.notice-close { display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px; margin:-4px 0 0; padding:0; border:0; border-radius:8px; background:transparent; color:#666; font:24px/1 Arial,sans-serif; cursor:pointer; }
.notice-close:hover { background:#f5f5f5; color:#000; }
.notice-close:focus-visible { outline:2px solid #000; outline-offset:2px; }
.workspace-modal .flash-messages-container, .workspace-embedded .flash-messages-container { top:12px; right:12px; max-height:calc(100dvh - 24px); }
@keyframes notice-enter { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@media(max-width:600px) { .flash-messages-container { top:84px; right:12px; width:calc(100vw - 24px); max-height:calc(100dvh - 100px); } }

.flash-message.notice-leaving { opacity:0; transform:translateY(-4px); pointer-events:none; }
.notice-icon { position:relative; }
/* Cuatro chispas de marca, una sola vez al confirmar una acción. */
.flash-success .notice-icon::after {
    content:""; position:absolute; inset:10px; border-radius:50%; pointer-events:none;
    box-shadow:-15px -9px #f5c02e, 15px -9px #f5c02e, -12px 13px #000, 12px 13px #000;
    animation:notice-sparks .45s ease-out both;
}
.flash-error .notice-icon { animation:notice-shake .24s ease-out; }
@keyframes notice-sparks { from { opacity:.8; transform:scale(.4) rotate(-12deg); } to { opacity:0; transform:scale(1.2) rotate(12deg); } }
@keyframes notice-shake { 0%,100% { transform:translateX(0); } 30% { transform:translateX(-2px); } 65% { transform:translateX(2px); } }
@media(prefers-reduced-motion:reduce) {
    .flash-message, .notice-icon, .notice-icon::after { animation:none !important; transition:none !important; }
    .flash-success .notice-icon::after { display:none; }
}
