/* =========================================================
   TOCA DA KURAMA
   NOTIFICAÇÕES FLUTUANTES GLOBAIS

   - Sucesso e erro não ocupam espaço no layout
   - Permanecem visíveis até o usuário fechar
   - Suporta múltiplas mensagens empilhadas
   ========================================================= */

.tk-flash-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 12000;

    width: min(430px, calc(100vw - 40px));

    display: flex;
    flex-direction: column;
    gap: 12px;

    pointer-events: none;
}

.admin-shell ~ .tk-flash-stack {
    top: calc(var(--admin-topbar-height, 86px) + 18px);
}

.tk-flash-toast {
    position: relative;

    width: 100%;
    min-height: 64px;

    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;

    margin: 0 !important;
    padding: 13px 12px 13px 14px !important;

    border: 1px solid transparent !important;
    border-radius: 16px !important;

    background: #ffffff !important;
    box-shadow:
        0 18px 45px rgba(24, 25, 20, 0.16),
        0 3px 10px rgba(24, 25, 20, 0.07) !important;

    color: #20221d !important;
    line-height: 1.42;

    overflow: hidden;
    pointer-events: auto;

    animation: tk-flash-enter 0.22s ease-out both;
}

.tk-flash-toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: currentColor;
    opacity: 0.9;
}

.tk-flash-toast.is-success {
    border-color: rgba(76, 114, 75, 0.22) !important;
    background: linear-gradient(135deg, #ffffff 0%, #f5faf3 100%) !important;
    color: #315f38 !important;
}

.tk-flash-toast.is-error {
    border-color: rgba(174, 65, 55, 0.22) !important;
    background: linear-gradient(135deg, #ffffff 0%, #fff5f3 100%) !important;
    color: #9b3029 !important;
}

.tk-flash-toast-icon {
    width: 38px;
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    background: currentColor;
}

.tk-flash-toast-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tk-flash-toast-content {
    min-width: 0;
    color: #272923;
    font-size: 0.92rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.tk-flash-toast-content > :last-child {
    margin-bottom: 0 !important;
}

.tk-flash-toast-close {
    width: 32px;
    height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 10px;

    background: transparent;
    color: #777a6e;

    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1;

    cursor: pointer;
    transition:
        background 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.tk-flash-toast-close:hover,
.tk-flash-toast-close:focus-visible {
    background: rgba(32, 34, 29, 0.07);
    color: #20221d;
    outline: none;
    transform: scale(1.04);
}

.tk-flash-toast.is-leaving {
    animation: tk-flash-leave 0.18s ease-in both;
}

@keyframes tk-flash-enter {
    from {
        opacity: 0;
        transform: translate3d(18px, -8px, 0) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes tk-flash-leave {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }

    to {
        opacity: 0;
        transform: translate3d(20px, -4px, 0) scale(0.98);
    }
}

@media (max-width: 991px) {
    .admin-shell ~ .tk-flash-stack {
        top: 14px;
    }
}

@media (max-width: 575px) {
    .tk-flash-stack,
    .admin-shell ~ .tk-flash-stack {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .tk-flash-toast {
        grid-template-columns: 34px minmax(0, 1fr) 30px;
        gap: 10px;
        min-height: 58px;
        padding: 11px 10px 11px 12px !important;
        border-radius: 14px !important;
    }

    .tk-flash-toast-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tk-flash-toast,
    .tk-flash-toast.is-leaving {
        animation: none;
    }
}
