/* Pillan360 · notificaciones y diálogos de sistema. */
#toast-container {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    align-items: flex-end;
    max-width: min(92vw, 28rem);
    pointer-events: none;
}
.pillan-toast {
    --pillan-toast-color: #2563eb;
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    width: max-content;
    min-width: min(18rem, 86vw);
    max-width: min(28rem, 92vw);
    padding: .72rem .78rem;
    border: 1px solid color-mix(in srgb, var(--pillan-toast-color) 72%, white 8%);
    border-left-width: 4px;
    border-radius: .8rem;
    color: white;
    background: rgba(15, 23, 42, .96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .42);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(.7rem) scale(.98);
    transition: opacity .22s ease, transform .22s ease;
}
.pillan-toast.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.pillan-toast-icon { width: 1.15rem; height: 1.15rem; color: var(--pillan-toast-color); }
.pillan-toast-text { font-size: .75rem; line-height: 1.35; font-weight: 750; overflow-wrap: anywhere; }
.pillan-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: .45rem;
    color: rgb(148, 163, 184);
    transition: background-color .15s ease, color .15s ease;
}
.pillan-toast-close:hover { color: white; background: rgba(148, 163, 184, .18); }
.pillan-toast-close svg { width: .9rem; height: .9rem; }
.light-mode .pillan-toast { color: rgb(15, 23, 42); background: rgba(248, 250, 252, .97); }
.light-mode .pillan-toast-close:hover { color: rgb(15, 23, 42); }

.pillan-system-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, .72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity .18s ease;
}
.pillan-system-dialog-overlay.is-visible { opacity: 1; }
.pillan-system-dialog {
    width: min(30rem, 100%);
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, .62);
    border-radius: 1rem;
    background: rgba(15, 23, 42, .98);
    color: rgb(226, 232, 240);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .58);
    transform: translateY(.7rem) scale(.98);
    transition: transform .18s ease;
}
.pillan-system-dialog-overlay.is-visible .pillan-system-dialog { transform: translateY(0) scale(1); }
.pillan-system-dialog-header {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem 1.1rem .75rem;
}
.pillan-system-dialog-header h3 { margin: 0; font-size: 1rem; line-height: 1.25; font-weight: 900; }
.pillan-system-dialog-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: .7rem;
    color: rgb(125, 211, 252);
    background: rgba(14, 116, 144, .22);
    border: 1px solid rgba(56, 189, 248, .35);
}
.pillan-system-dialog-icon svg { width: 1.25rem; height: 1.25rem; }
.pillan-system-dialog-warning .pillan-system-dialog-icon { color: rgb(251, 191, 36); background: rgba(180, 83, 9, .22); border-color: rgba(251, 191, 36, .36); }
.pillan-system-dialog-error .pillan-system-dialog-icon { color: rgb(248, 113, 113); background: rgba(153, 27, 27, .24); border-color: rgba(248, 113, 113, .38); }
.pillan-system-dialog-success .pillan-system-dialog-icon { color: rgb(74, 222, 128); background: rgba(21, 128, 61, .22); border-color: rgba(74, 222, 128, .36); }
.pillan-system-dialog-question .pillan-system-dialog-icon { color: rgb(167, 139, 250); background: rgba(109, 40, 217, .22); border-color: rgba(167, 139, 250, .36); }
.pillan-system-dialog-body { padding: .35rem 1.1rem 1rem; }
.pillan-system-dialog-body p { margin: 0; color: rgb(203, 213, 225); font-size: .8rem; line-height: 1.55; white-space: pre-line; }
.pillan-system-dialog-textarea {
    display: block;
    width: 100%;
    min-height: 10rem;
    margin-top: .8rem;
    resize: vertical;
    padding: .8rem;
    border: 1px solid rgba(100, 116, 139, .65);
    border-radius: .65rem;
    background: rgba(2, 6, 23, .75);
    color: rgb(226, 232, 240);
    font: 500 .75rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    outline: none;
}
.pillan-system-dialog-textarea:focus { border-color: rgb(59, 130, 246); box-shadow: 0 0 0 3px rgba(59, 130, 246, .2); }
.pillan-system-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    padding: .85rem 1.1rem 1.05rem;
    border-top: 1px solid rgba(100, 116, 139, .28);
}
.pillan-system-dialog-btn {
    min-width: 6.5rem;
    padding: .58rem .9rem;
    border-radius: .6rem;
    font-size: .72rem;
    line-height: 1;
    font-weight: 850;
    transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.pillan-system-dialog-btn:hover { transform: translateY(-1px); }
.pillan-system-dialog-btn-primary { color: white; background: rgb(37, 99, 235); border: 1px solid rgb(96, 165, 250); }
.pillan-system-dialog-btn-primary:hover { background: rgb(29, 78, 216); }
.pillan-system-dialog-btn-secondary { color: rgb(226, 232, 240); background: rgba(51, 65, 85, .8); border: 1px solid rgba(100, 116, 139, .7); }
.pillan-system-dialog-btn-secondary:hover { background: rgba(71, 85, 105, .95); }
.light-mode .pillan-system-dialog { color: rgb(15, 23, 42); background: rgba(248, 250, 252, .99); }
.light-mode .pillan-system-dialog-body p { color: rgb(51, 65, 85); }
.light-mode .pillan-system-dialog-textarea { color: rgb(15, 23, 42); background: white; }
.light-mode .pillan-system-dialog-btn-secondary { color: rgb(30, 41, 59); background: rgb(226, 232, 240); }
@media (max-width: 520px) {
    #toast-container { right: .6rem; bottom: .6rem; }
    .pillan-toast { min-width: min(17rem, 92vw); }
    .pillan-system-dialog-actions { flex-direction: column-reverse; }
    .pillan-system-dialog-btn { width: 100%; }
}
