/* Sewami — notifikasi premium: toast & dialog konfirmasi (pengganti alert/confirm klasik) */

.notify-stack {
    position: fixed;
    right: 22px;
    top: 22px;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.notify-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 40px 18px 14px;
    background: #fff;
    border: 1px solid rgba(30, 58, 95, .10);
    border-radius: 16px;
    box-shadow: 0 18px 45px -12px rgba(15, 23, 42, .25), 0 6px 16px -8px rgba(15, 23, 42, .15);
    overflow: hidden;
    animation: notify-in .5s cubic-bezier(.2, 1.15, .4, 1) both;
}

.notify-toast.is-out {
    animation: notify-out .28s ease-in both;
}

@keyframes notify-in {
    from { opacity: 0; transform: translateX(56px) scale(.95); }
    to   { opacity: 1; transform: none; }
}

@keyframes notify-out {
    from { opacity: 1; transform: none; }
    to   { opacity: 0; transform: translateX(40px) scale(.96); }
}

.notify-ico {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    margin-top: 1px;
}

.notify-msg {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    line-height: 1.5;
    font-weight: 600;
    color: #334155;
    padding-top: 8px;
    word-break: break-word;
    user-select: none;
}

.notify-x {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.notify-x:hover {
    background: #f1f5f9;
    color: #475569;
}

.notify-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    animation-name: notify-bar;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
    opacity: .9;
}

.notify-toast:hover .notify-bar {
    animation-play-state: paused;
}

@keyframes notify-bar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

.notify-toast.t-success .notify-ico { background: rgba(16, 185, 129, .13); color: #059669; }
.notify-toast.t-success .notify-bar { background: linear-gradient(90deg, #34d399, #059669); }
.notify-toast.t-error   .notify-ico { background: rgba(239, 68, 68, .12);  color: #dc2626; }
.notify-toast.t-error   .notify-bar { background: linear-gradient(90deg, #f87171, #dc2626); }
.notify-toast.t-warning .notify-ico { background: rgba(245, 158, 11, .14); color: #d97706; }
.notify-toast.t-warning .notify-bar { background: linear-gradient(90deg, #fbbf24, #d97706); }
.notify-toast.t-info    .notify-ico { background: rgba(30, 58, 95, .10);    color: #1e3a5f; }
.notify-toast.t-info    .notify-bar { background: linear-gradient(90deg, #60a5fa, #1e3a5f); }

@media (max-width: 480px) {
    .notify-stack {
        left: 16px;
        right: 16px;
        top: calc(16px + env(safe-area-inset-top, 0px));
        width: auto;
    }
}

.notify-ov {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .5);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    animation: notify-ov-in .25s ease forwards;
}

.notify-ov.is-out {
    animation: notify-ov-out .2s ease forwards;
}

@keyframes notify-ov-in {
    to { opacity: 1; }
}

@keyframes notify-ov-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.notify-dialog {
    position: relative;
    width: 100%;
    max-width: 395px;
    background: #fff;
    border-radius: 26px;
    padding: 30px 26px 26px;
    text-align: center;
    box-shadow: 0 40px 90px -25px rgba(15, 23, 42, .55);
    transform: translateY(16px) scale(.93);
    opacity: 0;
    animation: notify-dlg-in .45s cubic-bezier(.2, 1.2, .4, 1) .04s forwards;
}

.notify-ov.is-out .notify-dialog {
    animation: notify-dlg-out .2s ease forwards;
}

@keyframes notify-dlg-in {
    to { transform: none; opacity: 1; }
}

@keyframes notify-dlg-out {
    from { transform: none; opacity: 1; }
    to   { transform: translateY(10px) scale(.96); opacity: 0; }
}

.notify-dialog-ico {
    width: 66px;
    height: 66px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: rgba(30, 58, 95, .09);
    color: #1e3a5f;
}

.notify-ov.danger .notify-dialog-ico {
    background: rgba(220, 38, 38, .10);
    color: #dc2626;
}

.notify-dialog-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
}

.notify-dialog-text {
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    color: #64748b;
    margin: 0 0 24px;
    white-space: pre-line;
}

.notify-actions {
    display: flex;
    gap: 10px;
}

.notify-btn {
    flex: 1;
    min-height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 15px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, filter .2s ease;
}

.notify-btn:active {
    transform: scale(.965);
}

.notify-btn:focus-visible {
    outline: 3px solid rgba(30, 58, 95, .35);
    outline-offset: 2px;
}

.notify-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.notify-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.notify-btn-ok {
    background: linear-gradient(135deg, #1e3a5f 0%, #2f5f95 100%);
    color: #fff;
    box-shadow: 0 12px 26px -10px rgba(30, 58, 95, .55);
}

.notify-btn-ok:hover {
    filter: brightness(1.08);
    box-shadow: 0 14px 30px -10px rgba(30, 58, 95, .65);
}

.notify-ov.danger .notify-btn-ok {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    box-shadow: 0 12px 26px -10px rgba(220, 38, 38, .55);
}

.notify-ov.danger .notify-btn-ok:hover {
    box-shadow: 0 14px 30px -10px rgba(220, 38, 38, .65);
}

@media (max-width: 400px) {
    .notify-dialog {
        padding: 26px 20px 20px;
        border-radius: 22px;
    }

    .notify-actions {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notify-toast,
    .notify-ov,
    .notify-dialog,
    .notify-toast.is-out,
    .notify-ov.is-out {
        animation-duration: .01ms !important;
    }
}
