/* ================= Generic Modal (shared) ================= */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;

    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(3px);

    z-index: 9999;
    padding: 20px;
}

.modal[open] {
    display: grid;
}

/* generic card-style modal */
.modal-card {
    width: 100%;
    max-width: 420px;
    background: #f7f3ec;
    color: #2b2b2b;
    border: 1px solid #e6dfd5;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
    overflow: hidden;

    position: relative;
    z-index: 2;

    transform: scale(.97);
    opacity: 0;
    transition: transform .15s ease, opacity .15s ease;
}

.modal[open] .modal-card {
    transform: scale(1);
    opacity: 1;
}

.modal[open] .modal-card {
    transform: scale(1);
    opacity: 1;
}

.modal-head {
    padding: 14px 16px;
    font-weight: 700;

    /*   background: #efe9df;
    border-bottom: 1px solid #e2d8c8; */
}

.modal-body {
    padding: 22px 22px 18px;
    display: grid;
    gap: 14px;
}

.modal-foot {
    padding: 16px 22px 18px;
    /* border-top: 1px solid #e2d8c8; */
    display: flex;
    gap: 18px;
    justify-content: flex-end;
}

.modal-foot .btn {
    min-width: 90px;
}

.modal-foot .btn.ghost {
    background: #f7f3ec;
    color: #444;
    /* border: 1px solid #cfc5b6; */
}

.toast {
    min-width: 200px;
    max-width: 320px;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
    animation: toastSlide .25s ease;
}

.toast-wrap {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.toast.ok {
    background: #ffd400;
    /* caution yellow */
    color: #111;
}

.toast.warn {
    background: #f59e0b;
}

.toast.err {
    background: #ef4444;
}

@keyframes toastSlide {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@media (max-width: 600px) {

    .modal-card {
        max-width: 92vw;
        border-radius: 16px;
    }

    .modal-foot {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .modal-foot .btn {
        width: 100%;
    }
}