/* ============================================================
   Galaxy ERP — shared non-blocking toast / banner
   Phase-4 B3 (2026-07-07): replaces raw blocking alert() calls.
   Theme: khaki/brown to match eh2 header (#8b6f5e).
   success = green · error = red (persists longer) · info = khaki
   ============================================================ */
#galaxy-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2147483000;          /* above sticky headers / modals */
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(360px, calc(100vw - 24px));
    pointer-events: none;         /* container transparent to clicks */
}
.galaxy-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px 11px 12px;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-family: 'Inter', system-ui, -apple-system, 'Noto Sans TC', sans-serif;
    font-size: 13.5px;
    line-height: 1.45;
    box-shadow: 0 6px 22px rgba(31, 41, 55, .18), 0 1px 3px rgba(31, 41, 55, .10);
    border-left: 4px solid #8b6f5e;
    opacity: 0;
    transform: translateX(14px);
    transition: opacity .22s ease, transform .22s ease;
    word-break: break-word;
}
.galaxy-toast.is-in  { opacity: 1; transform: translateX(0); }
.galaxy-toast.is-out { opacity: 0; transform: translateX(14px); }

.galaxy-toast__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: #8b6f5e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
.galaxy-toast__msg { flex: 1; min-width: 0; }
.galaxy-toast__close {
    flex-shrink: 0;
    margin: -4px -2px 0 2px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}
.galaxy-toast__close:hover { color: #4b5563; background: rgba(0,0,0,.05); }

/* ---- variants ---- */
.galaxy-toast--success { border-left-color: #2f9e44; }
.galaxy-toast--success .galaxy-toast__icon { background: #2f9e44; }
.galaxy-toast--error   { border-left-color: #d64545; }
.galaxy-toast--error   .galaxy-toast__icon { background: #d64545; }
.galaxy-toast--info    { border-left-color: #8b6f5e; }
.galaxy-toast--info    .galaxy-toast__icon { background: #8b6f5e; }

/* ---- mobile: full-width bottom banners ---- */
@media (max-width: 560px) {
    #galaxy-toast-container {
        top: auto;
        bottom: 14px;
        left: 12px;
        right: 12px;
        max-width: none;
        align-items: stretch;
    }
    .galaxy-toast { transform: translateY(14px); font-size: 14px; }
    .galaxy-toast.is-in  { transform: translateY(0); }
    .galaxy-toast.is-out { transform: translateY(14px); }
}

@media (prefers-reduced-motion: reduce) {
    .galaxy-toast { transition: opacity .18s ease; transform: none !important; }
}
