/* ============================================================
   Toast - thông báo góc trên bên phải, dưới topbar (chỉ chữ, khung ôm vừa nội dung)
   ============================================================ */
.toast-container {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    z-index: 3000;
    display: flex; flex-direction: column; align-items: flex-end;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
/* Trong dashboard: toast nằm ngay dưới thanh topbar (header sticky, cao var(--header-h)) */
.app-body .toast-container {
    top: calc(var(--header-h, 60px) + 12px + env(safe-area-inset-top, 0px));
}
.toast {
    width: fit-content; max-width: min(360px, 100%);
    padding: 8px 14px;
    border: 1px solid transparent; border-radius: 8px;
    font-family: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.4;
    overflow-wrap: anywhere;
    box-shadow: 0 6px 18px rgba(16, 24, 40, .12);
    animation: toast-in .16s ease-out;
    transition: opacity .2s ease, transform .2s ease;
}

.toast-success { background: #ecfdf3; color: #05603a; border-color: #abefc6; }
.toast-error   { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.toast-warning { background: #fffaeb; color: #93370d; border-color: #fedf89; }
.toast-info    { background: #eff8ff; color: #175cd3; border-color: #b2ddff; }

.toast-hide { opacity: 0; transform: translateX(10px); }

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

@media (max-width: 480px) {
    .toast-container { left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); max-width: none; align-items: flex-end; }
    .toast { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; transition: none; }
}
