:root {
    --toast-success-bg: #ecfdf3;
    --toast-success-border: #16a34a;
    --toast-success-icon: #15803d;
    --toast-error-bg: #fef2f2;
    --toast-error-border: #dc2626;
    --toast-error-icon: #b91c1c;
    --toast-warning-bg: #fffbeb;
    --toast-warning-border: #d97706;
    --toast-warning-icon: #b45309;
    --toast-info-bg: #eff6ff;
    --toast-info-border: #2563eb;
    --toast-info-icon: #1d4ed8;
}

.app-toast-region {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}

.app-toast {
    --toast-bg: var(--toast-info-bg);
    --toast-border: var(--toast-info-border);
    --toast-icon: var(--toast-info-icon);
    pointer-events: auto;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 18px;
    align-items: start;
    gap: 10px;
    background: var(--toast-bg);
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-left: 4px solid var(--toast-border);
    border-radius: 10px;
    box-shadow: 0 16px 32px rgba(17, 24, 39, 0.14);
    padding: 11px 12px;
    color: #111827;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-toast--success {
    --toast-bg: var(--toast-success-bg);
    --toast-border: var(--toast-success-border);
    --toast-icon: var(--toast-success-icon);
}

.app-toast--error {
    --toast-bg: var(--toast-error-bg);
    --toast-border: var(--toast-error-border);
    --toast-icon: var(--toast-error-icon);
}

.app-toast--warning {
    --toast-bg: var(--toast-warning-bg);
    --toast-border: var(--toast-warning-border);
    --toast-icon: var(--toast-warning-icon);
}

.app-toast--info {
    --toast-bg: var(--toast-info-bg);
    --toast-border: var(--toast-info-border);
    --toast-icon: var(--toast-info-icon);
}

.app-toast__icon,
.app-toast__close {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-toast__icon {
    color: var(--toast-icon);
    margin-top: 1px;
}

.app-toast__icon svg,
.app-toast__close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.app-toast__body {
    min-width: 0;
}

.app-toast__title {
    font: 600 12px/16px var(--font-family-base, 'Inter', system-ui, Arial, sans-serif);
    color: #111827;
    margin: 0 0 2px;
}

.app-toast__message {
    font: 400 12px/16px var(--font-family-base, 'Inter', system-ui, Arial, sans-serif);
    color: #374151;
    margin: 0;
    white-space: pre-line;
}

.app-toast__close {
    border: 0;
    background: transparent;
    color: #6b7280;
    padding: 0;
    cursor: pointer;
    border-radius: 999px;
}

.app-toast__close:hover,
.app-toast__close:focus {
    color: #111827;
    outline: none;
}

.app-toast-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.38);
    z-index: 2050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.app-toast-confirm-backdrop.is-visible {
    display: flex;
}

.app-toast-confirm {
    width: min(420px, 100%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 24px 54px rgba(17, 24, 39, 0.22);
    border: 1px solid rgba(17, 24, 39, 0.08);
    overflow: hidden;
}

.app-toast-confirm__header,
.app-toast-confirm__footer {
    padding: 12px 14px;
}

.app-toast-confirm__header {
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.app-toast-confirm__title {
    margin: 0;
    font: 600 14px/18px var(--font-family-base, 'Inter', system-ui, Arial, sans-serif);
    color: #111827;
}

.app-toast-confirm__body {
    padding: 14px;
    font: 400 13px/18px var(--font-family-base, 'Inter', system-ui, Arial, sans-serif);
    color: #374151;
}

.app-toast-confirm__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.app-toast-confirm__btn {
    border-radius: 8px;
    padding: 7px 12px;
    font: 600 12px/16px var(--font-family-base, 'Inter', system-ui, Arial, sans-serif);
    border: 1px solid transparent;
    cursor: pointer;
}

.app-toast-confirm__btn--cancel {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.app-toast-confirm__btn--confirm {
    background: #065f46;
    color: #ffffff;
}

@media (max-width: 767.98px) {
    .app-toast-region {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 12px;
    }
}
