/* Flash xabarlar (toast): asosiy layout va login sahifasida ishlatiladi */
.flash-stack {
    position: fixed;
    top: calc(var(--header-height, 0px) + 12px); /* login sahifasida header yo'q */
    right: 16px;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.flash {
    --flash-color: #16a34a;
    --flash-soft: rgba(22, 163, 74, 0.1);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 12px 14px 14px;
    background: #fff;
    border: 1px solid #ececf3;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    pointer-events: auto;
    animation: flash-in 0.25s ease-out;
}

.flash-error {
    --flash-color: #dc2626;
    --flash-soft: rgba(220, 38, 38, 0.1);
}

.flash-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--flash-soft);
    color: var(--flash-color);
    font-size: 16px;
}

.flash-body {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.flash-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.flash-text {
    margin-top: 2px;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.flash-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.flash-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.flash-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--flash-color);
    opacity: 0.35;
    transform-origin: left;
    animation: flash-progress var(--flash-remaining, 5000ms) linear forwards;
}

.flash.is-paused .flash-progress {
    animation-play-state: paused;
}

.flash.is-leaving {
    animation: flash-out 0.2s ease-in forwards;
}

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes flash-out {
    to { opacity: 0; transform: translateX(16px); }
}

@keyframes flash-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .flash,
    .flash.is-leaving {
        animation-duration: 0.01ms;
    }
}

.flash-list {
    margin: 2px 0 0;
    padding-left: 16px;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}
