/* ── App toast (used for every SweetAlert notification, see js/app-toast.js) ── */
.app-toast-stack {
    position: fixed; top: 72px; right: 18px; z-index: 20000;   /* below the page header, not over its icons */
    display: flex; flex-direction: column; gap: 12px;
    pointer-events: none;
}

.app-toast {
    position: relative;
    width: 320px; max-width: calc(100vw - 32px);
    min-height: 68px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
    display: flex; align-items: center;
    overflow: hidden;
    pointer-events: auto;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    animation: app-toast-in .22s ease-out;
}
.app-toast.is-leaving { animation: app-toast-out .18s ease-in forwards; }

@keyframes app-toast-in  { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes app-toast-out { to   { opacity: 0; transform: translateX(24px); } }

/* L-shaped accent line (left + short bottom) */
.app-toast::before {
    content: "";
    position: absolute;
    left: 1px; top: 0; bottom: 0;
    width: 57px;
    border-radius: 13px 0 0 13px;
    background: var(--app-toast-accent);
}
.app-toast::after {
    content: "";
    position: absolute;
    left: 6px; top: 0; bottom: 3px;
    width: 52px;
    background: #fff;
    border-radius: 9px 0 0 10px;
}

.app-toast-icon {
    position: relative; z-index: 1;
    margin-left: 19px;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex: none;
    background: var(--app-toast-icon);
    box-shadow: 0 4px 12px var(--app-toast-shadow);
}

.app-toast-text { position: relative; z-index: 1; margin: 12px 0 12px 14px; flex: 1; min-width: 0; }
.app-toast-title { font-weight: 700; font-size: 13.5px; color: #1f2937; line-height: 1.3; }
.app-toast-msg { font-size: 12.5px; color: #4b5563; margin-top: 4px; line-height: 1.45; word-wrap: break-word; }
.app-toast-msg.is-text { white-space: pre-line; }   /* keep the line breaks of a plain-text message */

/* Long messages: wider card, icon at the top instead of floating in the middle, scroll if very long */
.app-toast--long { width: 420px; align-items: flex-start; }
.app-toast--long .app-toast-icon { margin-top: 14px; }
.app-toast--long .app-toast-close { margin-top: 14px; }
.app-toast--long .app-toast-msg { max-height: 260px; overflow-y: auto; padding-right: 4px; }
.app-toast-msg:empty { display: none; }
/* HTML written for a big SweetAlert popup must stay compact inside a toast */
.app-toast-msg p, .app-toast-msg div { margin: 0; padding: 0; }
.app-toast-msg br + br { display: none; }
.app-toast-msg [style], .app-toast-msg span[class] {
    font-size: inherit !important; padding: 0 !important; margin: 0 !important;
    background: none !important; border: 0 !important; display: inline !important;
}

.app-toast-close {
    position: relative; z-index: 1;
    margin: 0 18px 0 10px;
    background: none; border: 0; padding: 4px; cursor: pointer;
    display: flex; flex: none;
}
.app-toast-close:hover path { stroke: #475569; }

/* Variants */
.app-toast--success {
    --app-toast-accent: linear-gradient(180deg, #4ade80, #16a34a);
    --app-toast-icon:   linear-gradient(135deg, #4ade80, #16a34a);
    --app-toast-shadow: rgba(22, 163, 74, .25);
}
.app-toast--error {
    --app-toast-accent: linear-gradient(180deg, #f87171, #dc2626);
    --app-toast-icon:   linear-gradient(135deg, #f87171, #dc2626);
    --app-toast-shadow: rgba(220, 38, 38, .25);
}
.app-toast--warning {
    --app-toast-accent: linear-gradient(180deg, #fbbf24, #f59e0b);
    --app-toast-icon:   linear-gradient(135deg, #fbbf24, #f59e0b);
    --app-toast-shadow: rgba(245, 158, 11, .28);
}
.app-toast--info {
    --app-toast-accent: linear-gradient(180deg, #60a5fa, #2563eb);
    --app-toast-icon:   linear-gradient(135deg, #60a5fa, #2563eb);
    --app-toast-shadow: rgba(37, 99, 235, .25);
}

@media (max-width: 480px) {
    .app-toast-stack { top: 64px; right: 12px; left: 12px; }
    .app-toast, .app-toast--long { width: auto; }
}
