/* Delmunch toast notifications */
.dm-toast-root {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1105;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(100vw - 2rem, 400px);
    pointer-events: none;
}

.dm-toast-root--left {
    top: calc(var(--dm-header-height, 72px) + 0.75rem);
    right: auto;
    left: calc(var(--dm-sidebar-width, 280px) + 1.25rem);
}

body.sidebar-collapsed .dm-toast-root--left {
    left: calc(var(--dm-sidebar-collapsed, 72px) + 1.25rem);
}

.dm-toast {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
    opacity: 0;
    transform: translateX(1.25rem);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
}

.dm-toast--show {
    opacity: 1;
    transform: translateX(0);
}

.dm-toast--hide {
    opacity: 0;
    transform: translateX(1.25rem);
}

.dm-toast-root--left .dm-toast {
    transform: translateX(-1.25rem);
}

.dm-toast-root--left .dm-toast--show {
    transform: translateX(0);
}

.dm-toast-root--left .dm-toast--hide {
    transform: translateX(-1.25rem);
}

.dm-toast__main {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1rem 0.85rem;
}

.dm-toast--success {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #bbf7d0;
}

.dm-toast--error {
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
    border-color: #fecaca;
}

.dm-toast--warning {
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
    border-color: #fde68a;
}

.dm-toast--info {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    border-color: #bfdbfe;
}

.dm-toast--clickable {
    cursor: pointer;
}

.dm-toast__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1.05rem;
    line-height: 1;
}

.dm-toast--success .dm-toast__icon {
    color: #15803d;
    background: #dcfce7;
}

.dm-toast--error .dm-toast__icon {
    color: #b91c1c;
    background: #fee2e2;
}

.dm-toast--warning .dm-toast__icon {
    color: #b45309;
    background: #fef3c7;
}

.dm-toast--info .dm-toast__icon {
    color: #1d4ed8;
    background: #dbeafe;
}

.dm-toast__body {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.05rem;
}

.dm-toast__title {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dm-toast--success .dm-toast__title {
    color: #15803d;
}

.dm-toast--error .dm-toast__title {
    color: #b91c1c;
}

.dm-toast--warning .dm-toast__title {
    color: #b45309;
}

.dm-toast--info .dm-toast__title {
    color: #1d4ed8;
}

.dm-toast__message {
    margin: 0;
    color: #1f2937;
    font-size: 0.92rem;
    line-height: 1.45;
    font-weight: 500;
}

.dm-toast__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.dm-toast__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #4b5563;
}

.dm-toast__progress {
    height: 4px;
    background: rgba(15, 23, 42, 0.06);
}

.dm-toast__progress-bar {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    animation: dm-toast-progress var(--dm-toast-duration, 5000ms) linear forwards;
}

.dm-toast--success .dm-toast__progress-bar {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.dm-toast--error .dm-toast__progress-bar {
    background: linear-gradient(90deg, #f87171 0%, #dc2626 100%);
}

.dm-toast--warning .dm-toast__progress-bar {
    background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
}

.dm-toast--info .dm-toast__progress-bar {
    background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
}

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

@keyframes dm-toast-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

[data-theme="dark"] .dm-toast {
    border-color: #374151;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .dm-toast--success {
    background: linear-gradient(180deg, #14532d 0%, #1f2937 100%);
    border-color: #166534;
}

[data-theme="dark"] .dm-toast--error {
    background: linear-gradient(180deg, #7f1d1d 0%, #1f2937 100%);
    border-color: #991b1b;
}

[data-theme="dark"] .dm-toast--warning {
    background: linear-gradient(180deg, #78350f 0%, #1f2937 100%);
    border-color: #92400e;
}

[data-theme="dark"] .dm-toast--info {
    background: linear-gradient(180deg, #1e3a8a 0%, #1f2937 100%);
    border-color: #1d4ed8;
}

[data-theme="dark"] .dm-toast__message {
    color: #f3f4f6;
}

[data-theme="dark"] .dm-toast__close {
    color: #9ca3af;
}

[data-theme="dark"] .dm-toast__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}

[data-theme="dark"] .dm-toast__progress {
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 991.98px) {
    .dm-toast-root--left {
        left: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .dm-toast-root {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }

    .dm-toast-root--left {
        top: calc(var(--dm-header-height, 72px) + 0.5rem);
        right: 0.75rem;
        left: 0.75rem;
    }
}
