:root {
    --toast-success: #0aac76;
    --toast-danger: #eb4f4f;
    --toast-info: #1e293b;
}

@keyframes fill-progress {
    from { width: 0%; }
    to { width: 100%; }
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    max-width: calc(100vw - 32px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1090;
}

.toast {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md, 8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    padding: 12px 16px;
    min-width: 240px;
    max-width: 380px;
    font-size: 13px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    animation-name: fill-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

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

.toast-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-text {
    flex: 1;
    line-height: 1.4;
}

.toast-success {
    background-color: var(--toast-success);
    color: #ffffff;
}
.toast-success .toast-progress-bar {
    background-color: rgba(255, 255, 255, 0.65);
}

.toast-danger {
    background-color: var(--toast-danger);
    color: #ffffff;
}
.toast-danger .toast-progress-bar {
    background-color: rgba(255, 255, 255, 0.65);
}

.toast-info {
    background-color: var(--toast-info);
    color: #f8fafc;
}
.toast-info .toast-progress-bar {
    background-color: rgba(255, 255, 255, 0.45);
}

/* Rich Notification Flash Pop-up (Title + Text) */
.toast-notification {
    background-color: var(--surface-card, #ffffff);
    color: var(--on-surface, #191c1d);
    border: 1px solid var(--outline, #e2e8f0);
    border-left: 4px solid var(--secondary, #2563eb);
    box-shadow: 0 12px 28px rgba(0, 6, 102, 0.18);
    padding: 13px 14px;
    width: min(370px, calc(100vw - 32px));
}

.toast-notification .toast-progress-bar {
    background-color: var(--secondary, #2563eb);
    opacity: 0.7;
}

.toast-notif-low {
    border-left-color: var(--on-surface-muted, #454652);
}
.toast-notif-low .toast-progress-bar {
    background-color: var(--on-surface-muted, #454652);
}

.toast-notif-high {
    border-left-color: #d97706;
}
.toast-notif-high .toast-progress-bar {
    background-color: #d97706;
}

.toast-notif-critical {
    border-left-color: var(--error, #ba1a1a);
}
.toast-notif-critical .toast-progress-bar {
    background-color: var(--error, #ba1a1a);
}

.toast-notif-body {
    align-items: flex-start;
    gap: 11px;
}

.toast-notif-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md, 8px);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--secondary-container, #dbeafe);
    color: var(--secondary-dark, #1e40af);
}

.toast-notif-high .toast-notif-icon {
    background: #fef3c7;
    color: #b45309;
}

.toast-notif-critical .toast-notif-icon {
    background: var(--error-container, #ffdad6);
    color: var(--error, #ba1a1a);
}

.toast-notif-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toast-notif-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--on-surface, #191c1d);
    line-height: 1.3;
}

.toast-notif-desc {
    font-size: 12.5px;
    color: var(--on-surface-muted, #454652);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: var(--on-surface-variant, #767683);
    cursor: pointer;
    padding: 2px;
    border-radius: var(--radius-sm, 6px);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.toast-close-btn:hover {
    background: var(--surface-low, #f3f4f5);
    color: var(--on-surface, #191c1d);
}

.toast-close-btn svg.lucide {
    width: 15px;
    height: 15px;
}

@media (max-width: 480px) {
    .toast-container {
        right: 16px;
        left: 16px;
        bottom: 16px;
    }
    .toast,
    .toast-notification {
        width: 100%;
        max-width: 100%;
    }
}
