/* ==========================================================================
   Avisos de la suite (toastr) con el estilo loop-ui.
   Appflash(texto, tipo, título) → toastr[tipo] en todos los layouts de SUITELOOP/Layouts/adminLTE.
   Pisa toastr.min.css y adminlte.min.css (#toast-container .toast-*): fondo de color sólido e icono como
   background-image con !important. Tokens del shell con fallback: el login y la webview no cargan loop-ui.
   Iconos en SVG (mask-image) para no depender de cómo cargue Font Awesome cada layout.
   ========================================================================== */

#toast-container {
    --lt-ok: #12a150;
    --lt-warn: #d97706;
    --lt-err: #d92d20;
    --lt-info: #0284c7;
}
:root[data-theme="dark"] #toast-container {
    --lt-ok: #3fcf7f;
    --lt-warn: #f5b041;
    --lt-err: #f1948a;
    --lt-info: #5dade2;
}

/* Arriba a la derecha, por debajo de la cabecera de página: más arriba tapaban sus acciones (Adjuntar documento, Documentos eliminados…) */
#toast-container.toast-top-right { top: 4rem; bottom: auto; right: 16px; }

#toast-container > div.toast {
    --lt-c: var(--lt-info);
    width: 360px;
    max-width: calc(100vw - 32px);
    margin: 0 0 10px;
    padding: 12px 40px 14px 56px !important;
    border: 1px solid var(--line, #e0e5ec);
    border-left: 4px solid var(--lt-c);
    border-radius: 12px;
    background: var(--surface, #fff) !important;
    background-image: none !important;
    color: var(--tx, #1f2733) !important;
    box-shadow: 0 10px 28px -12px rgba(15, 23, 42, .35), 0 2px 6px -2px rgba(15, 23, 42, .12) !important;
    font-size: .875rem;
    line-height: 1.4;
    opacity: 1 !important;
}
#toast-container > div.toast:hover {
    box-shadow: 0 14px 32px -12px rgba(15, 23, 42, .45), 0 2px 6px -2px rgba(15, 23, 42, .15) !important;
}
:root[data-theme="dark"] #toast-container > div.toast {
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7) !important;
}
#toast-container > div.toast-success { --lt-c: var(--lt-ok); }
#toast-container > div.toast-warning { --lt-c: var(--lt-warn); }
#toast-container > div.toast-error { --lt-c: var(--lt-err); }
#toast-container > div.toast-info { --lt-c: var(--lt-info); }

/* Icono: círculo tintado (::before) + glifo SVG del color del tipo (::after) */
#toast-container > div.toast::before,
#toast-container > div.toast::after {
    content: "";
    position: absolute;
    left: 14px;
    top: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
#toast-container > div.toast::before {
    background: color-mix(in srgb, var(--lt-c) 14%, transparent);
}
#toast-container > div.toast::after {
    background: var(--lt-c);
    -webkit-mask: var(--lt-icon) center / 16px 16px no-repeat;
    mask: var(--lt-icon) center / 16px 16px no-repeat;
}
#toast-container > div.toast-info {
    --lt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M12 11v7'/%3E%3Cpath d='M12 6.5v.2'/%3E%3C/svg%3E");
}
#toast-container > div.toast-success {
    --lt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
#toast-container > div.toast-warning {
    --lt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M12 5.5v8'/%3E%3Cpath d='M12 18.3v.2'/%3E%3C/svg%3E");
}
#toast-container > div.toast-error {
    --lt-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E");
}

#toast-container .toast-title {
    margin-bottom: 2px;
    font-weight: 700;
    color: var(--tx, #1f2733);
}
#toast-container .toast-message { color: var(--tx, #1f2733); padding-top: 4px; }
#toast-container .toast-title + .toast-message { color: var(--tx-2, #55606e); padding-top: 0; }
#toast-container .toast-message a,
#toast-container .toast-message label { color: inherit; }

#toast-container .toast-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--tx-3, #6b7d92) !important;
    font-size: 1.1rem;
    font-weight: 400;
    text-shadow: none;
    opacity: 1;
}
#toast-container .toast-close-button:hover,
#toast-container .toast-close-button:focus {
    background: var(--surface-2, #f2f5f9);
    color: var(--tx, #1f2733) !important;
    opacity: 1;
}

#toast-container .toast-progress {
    left: 0;
    bottom: 0;
    height: 3px;
    background: var(--lt-c);
    opacity: .55;
}

@media (max-width: 640px) {
    #toast-container.toast-top-right { top: 12px; bottom: auto; left: 12px; right: 12px; }
    #toast-container > div.toast { width: auto; max-width: none; }

}
