/**
 * Carregamento V2 - CSS
 * Estrutura: Largada > Seleção > Execução > Finalização
 * Design: kitgenesis - Dark, Futurista, Gamificado
 */

/* === ANIMAÇÃO DE ERRO (SHAKE) === */
@keyframes shake-error {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-8px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(8px);
    }
}

/* === ANIMAÇÕES DE NAVEGAÇÃO (SCROLL) === */
@keyframes slide-up-enter {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-down-enter {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce-up {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes bounce-down {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(20px);
    }
}

.anim-slide-up {
    animation: slide-up-enter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.anim-slide-down {
    animation: slide-down-enter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* === VARIÁVEIS (herdam do app.css) === */

/* === FIX GLOBAL OVERFLOW === */
html,
body {
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
}

#carregamento-v2 {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#carregamento-v2 .app-raiz,
#carregamento-v2 .app-container {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* === CONTAINER PRINCIPAL (100% vertical/horizontal) === */
.carga-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    position: relative;
    overscroll-behavior: none;
}

.carga-main-centered {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}


/* === ESTADO INICIAL - LARGADA === */
.carga-largada {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    width: 100%;
    min-height: 60vh;
}

.carga-largada-icone {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
}

.carga-largada-icone i {
    font-size: 6rem;
    color: rgba(139, 92, 246, 0.15);
    /* filter: drop-shadow removido para performance */
    will-change: transform;
    transform: translateZ(0);
}

/* Círculos pulsantes de fundo */
.carga-largada-icone::before,
.carga-largada-icone::after {
    content: '';
    position: absolute;
    border: 2px solid rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    animation: carga-pulse-ring 3s ease-out infinite;
    pointer-events: none;
}

.carga-largada-icone::before {
    inset: -20px;
    animation-delay: 0s;
}

.carga-largada-icone::after {
    inset: -50px;
    animation-delay: 1.5s;
}

@keyframes carga-pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

.carga-largada-titulo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--app-texto);
    margin-bottom: 0.5rem;
}

.carga-largada-desc {
    font-size: 1rem;
    color: var(--app-texto-opaco);
    margin-bottom: 2.5rem;
}

.carga-btn-largada {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 2.5rem;
    background: linear-gradient(135deg, var(--app-sucesso), #059669);
    border: none;
    border-radius: var(--app-raio-grande);
    color: white;
    font-size: 1.125rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

.carga-btn-largada::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.carga-btn-largada:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 40px rgba(16, 185, 129, 0.5);
}

.carga-btn-largada:hover::before {
    left: 100%;
}

.carga-btn-largada i {
    font-size: 1.5rem;
}

/* === HEADER INFO CARREGAMENTO (Maior) === */
.carga-info-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.05));
    border: 1px solid var(--app-borda);
    border-radius: var(--app-raio);
    padding: 1.25rem 1.25rem;
    margin-bottom: 1rem;
}

.carga-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.carga-info-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-texto);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carga-info-titulo i {
    color: var(--app-marca);
    font-size: 1.125rem;
}

.carga-info-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.carga-info-id {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--app-texto-opaco);
}

.carga-btn-refresh {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--app-marca-claro);
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carga-btn-refresh:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--app-marca);
    transform: rotate(180deg);
}

.carga-btn-refresh.loading {
    animation: carga-spin 1s linear infinite;
}

@keyframes carga-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.carga-info-badges {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.carga-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.carga-badge.total {
    background: rgba(139, 92, 246, 0.15);
    color: var(--app-marca-claro);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.carga-badge.concluidos {
    background: rgba(16, 185, 129, 0.15);
    color: var(--app-sucesso);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.carga-badge.pendentes {
    background: rgba(245, 158, 11, 0.15);
    color: var(--app-alerta);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.carga-badge-veiculo {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.625rem;
    padding: 0.4rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: 'JetBrains Mono', monospace;
    min-width: 130px;
}

.carga-badge-veiculo .veiculo-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.carga-badge-veiculo .v-placa {
    color: var(--app-marca-claro);
    font-weight: 800;
    font-size: 0.9rem;
}

.carga-badge-veiculo .v-cubagem {
    color: var(--app-info);
    font-size: 0.75rem;
    font-weight: 600;
}

.carga-badge-veiculo .veiculo-desc {
    color: var(--app-text-muted);
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    text-transform: uppercase;
}

.carga-badge-sync {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--app-marca-claro);
    margin-left: auto;
    position: relative;
    z-index: 200;
    /* [FIX] Prioridade de clique */
}


.carga-badge-sync.sync-ok {
    color: var(--app-sucesso);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.carga-badge-sync.sync-pendente {
    color: var(--app-alerta);
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    animation: carga-pulse-sync 1.5s infinite;
}

.carga-badge-sync.sync-erro {
    color: var(--app-perigo);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.carga-badge-sync.sync-loading {
    color: var(--app-marca-claro);
}

@keyframes carga-pulse-sync {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.carga-badge-sync i.spinning {
    display: inline-block;
    animation: carga-spin 1s linear infinite;
}

.sync-badge-num {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--app-perigo);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: 800;
    min-width: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}



.carga-progresso-geral {
    height: 8px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.carga-progresso-geral-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--app-marca), var(--app-sucesso));
    border-radius: 9999px;
    transition: width 0.5s ease;
    position: relative;
}

.carga-progresso-geral-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: carga-shine 2s infinite;
}

@keyframes carga-shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* === DISPLAY DE CÓDIGO BIPADO (Otimizado com Botões Laterais) === */
/* === DISPLAY DE CÓDIGO BIPADO (Otimizado com Botões Laterais) === */
.carga-scan-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Distribui espaço */
    gap: 0;
    /* Remove gap para uni-los */
    max-width: 280px;
    /* Leve aumento */
    margin: 0.25rem auto 0.5rem auto;
    background: rgba(255, 255, 255, 0.05);
    /* Mais visível */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.25rem;
    /* Padding menor */
    transition: all 0.2s ease;
}

/* FIX: Scanner Display Fixed Size (Transparent inside container) */
.carga-scan-display {
    min-height: 40px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Fixed Width overrides flex: 1 */
    flex: 0 0 190px !important;
    /* Ajustado para caber */
    width: 190px;
    max-width: 190px;
    text-align: center;
    overflow: hidden;
    background: transparent;
    /* Transparente para parecer integrado */
    border-radius: 8px;
    margin-right: 0;
    /* Remove margin */
}

.carga-scan-layout.focado {
    border-color: #39ff14 !important;
    background: rgba(57, 255, 20, 0.03);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}



.carga-qty-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    /* Mantém divisor sutil */
    padding-left: 0.5rem;
    padding-right: 0.25rem;
}

.carga-qty-btn-v {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    /* [FIX] Prioridade de toque */
    z-index: 100;
}

.carga-qty-btn-v.mais {
    background: linear-gradient(135deg, var(--app-sucesso), #059669);
}

.carga-qty-btn-v.menos {
    background: linear-gradient(135deg, var(--app-perigo), #dc2626);
}

.carga-qty-btn-v:active {
    transform: scale(0.85);
}


.carga-scan-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(139, 92, 246, 0.5);
    opacity: 0;
    transition: all 0.2s ease;
}

.carga-scan-code.visivel {
    opacity: 1;
    color: rgba(139, 92, 246, 0.7);
}

.carga-scan-icon {
    position: absolute;
    right: calc(50% - 80px);
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0);
}


.carga-scan-icon.visivel {
    opacity: 1;
    transform: scale(1);
}

.carga-scan-icon.confirmado {
    color: var(--app-sucesso);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.6));
}

.carga-scan-icon.erro {
    color: var(--app-perigo);
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

/* === BADGES DE CÓDIGOS DE BARRAS VÁLIDOS === */
.carga-codigos-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-top: 0.25rem;
}

.carga-codigo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 4px;
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: #94a3b8;
    opacity: 0.7;
    transition: all 0.2s;
}

.carga-codigo-badge:hover {
    opacity: 1;
    background: rgba(99, 102, 241, 0.15);
}

.carga-codigo-badge .codigo {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.carga-codigo-badge .qty {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    padding: 0 0.25rem;
    border-radius: 2px;
    font-weight: 700;
    font-size: 0.6rem;
}

/* === PRODUTO EM EXECUÇÃO === */
.carga-produto-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1.5rem;
    position: relative;
}

/* Progresso do Item */
.carga-item-progresso {
    width: 100%;
    max-width: 320px;
    margin-bottom: 0.75rem;
}

.carga-item-progresso-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.carga-item-progresso-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--app-texto-opaco);
}

.carga-item-progresso-valores {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}

.carga-item-progresso-atual {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--app-sucesso);
}

.carga-item-progresso-total {
    font-size: 0.875rem;
    color: var(--app-texto-opaco);
}

.carga-item-progresso-bar {
    height: 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.carga-item-progresso-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--app-sucesso), #34d399);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Produto Nome */
.carga-produto-nome {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--app-texto);
    margin-bottom: 0.25rem;
    line-height: 1.2;
    max-width: 100%;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.carga-produto-codigo {
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--app-marca-claro);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid var(--app-borda);
    margin-bottom: 0.5rem;
    /* Reduced bottom margin to fit extra info */
}

/* Info Extra (Cliente/Pedido) */
.carga-produto-info-extra {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.carga-badge-cliente,
.carga-badge-pedido {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
}


.carga-badge-cliente {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.carga-badge-pedido {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.carga-badge-cliente i,
.carga-badge-pedido i {
    font-size: 1.1rem;
}


/* Badges for List Items (Modal) */
.carga-modal-item-extra {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.carga-modal-badge-mini {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

/* Botões de Ação */
.carga-acoes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 320px;
    margin-bottom: 80px;
    /* Evitar conflito com FABs centralizados */
}


.carga-btn-acao {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: var(--app-raio);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
}

/* Estado Preenchido para Separou Errado */
#btn-separou-errado.preenchido {
    background: var(--app-alerta);
    border-color: var(--app-alerta);
    color: white;
    /* Matches hover specifically */
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* FIX: Scanner Display Fixed Size */
.carga-scan-display {
    min-height: 40px;
    /* Aumentado para acomodar */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Fixed Width overrides flex: 1 */
    flex: 0 0 200px !important;
    width: 200px;
    max-width: 200px;
    text-align: center;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-right: 0.5rem;
}

.carga-scan-code {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
    line-height: normal;
}


.carga-btn-manual {
    background: linear-gradient(135deg, var(--app-marca), var(--app-marca-escuro));
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.carga-btn-manual:hover {
    transform: translateY(-2px);
    box-shadow: var(--app-brilho-marca);
}

.carga-btn-manual.ativo {
    background: linear-gradient(135deg, #059669, var(--app-sucesso));
    box-shadow: var(--app-brilho-sucesso);
}

/* Modo compacto quando item está completo */
.carga-btn-manual.completo-mode {
    font-size: 0.75rem !important;
    padding: 8px 12px !important;
    opacity: 0.8;
}

.carga-btn-ocorrencia {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--app-alerta);
}

.carga-btn-ocorrencia:hover {
    background: var(--app-alerta);
    border-color: var(--app-alerta);
    color: white;
}

/* === CONTAGEM MANUAL (com estado 100%) === */
.carga-contagem-manual {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    padding: 0 1.5rem;
    z-index: 50;
    pointer-events: none;
    align-items: center;
    /* Centraliza verticalmente os botões */
}

.carga-contagem-manual.ativo {
    display: block;
    animation: carga-fade-in 0.3s ease-out;
}

.carga-contagem-manual.ativo>* {
    pointer-events: auto;
}

/* Quando 100% - botão de diminuir fica à esquerda */
.carga-contagem-manual.completo {
    justify-content: flex-start;
}

.carga-contagem-manual.completo .carga-btn-qty-mais {
    display: none;
}

.carga-contagem-manual.completo .carga-btn-qty-menos {
    transform: scale(1.1);
}


@keyframes carga-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.carga-btn-qty {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: absolute;
    /* Changed to absolute */
    top: 50%;
    /* Center vertical default */
    transform: translateY(-50%);
    transition: all 0.2s ease;
    /* position: relative removed */
    overflow: hidden;
}

.carga-btn-qty::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    filter: blur(20px);
    opacity: 0.4;
    z-index: -1;
}

/* === BOTÕES LADO A LADO === */
.carga-btn-qty-menos,
.carga-btn-qty-mais {
    position: fixed;
    bottom: 2rem;
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    z-index: 100;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    top: auto;
    transform: none !important;
}

.carga-btn-qty-menos {
    left: calc(50% - 6.5rem);
    /* Centro - metade do botão - espaçamento */
    background: linear-gradient(135deg, var(--app-perigo), #dc2626);
    color: white;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.carga-btn-qty-mais {
    left: calc(50% + 0.5rem);
    /* Centro + espaçamento */
    background: linear-gradient(135deg, var(--app-sucesso), #059669);
    color: white;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.carga-btn-qty-menos:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.5);
}

.carga-btn-qty-mais:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

.carga-btn-qty-menos:active,
.carga-btn-qty-mais:active {
    transform: scale(0.95) !important;
}



/*.carga-btn-qty:active generic removed to avoid conflict*/

/* === BOTÃO FINALIZAR ITEM - VERDE ESCURO + BORDA NEON === */
.carga-finalizar-item {
    display: none;
    width: 100%;
    max-width: 300px;
    padding: 1.25rem 2rem;
    background: linear-gradient(145deg, #052e1c, #0a4429);
    border: 2px solid transparent;
    border-radius: 1rem;
    color: white;
    font-size: 1.125rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: visible;
    margin-top: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Borda Neon Brilhante */
.carga-finalizar-item::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(90deg,
            #10b981,
            #34d399,
            #6ee7b7,
            #34d399,
            #10b981);
    background-size: 300% 100%;
    border-radius: 1.125rem;
    z-index: -1;
    animation: carga-neon-border 2s linear infinite;
    filter: blur(1px);
}

@keyframes carga-neon-border {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}


/* Brilho Metálico */
.carga-finalizar-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.1) 25%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0.1) 75%,
            transparent 100%);
    transform: skewX(-25deg);
    animation: carga-metal-shine 2.5s ease-in-out infinite;
}

@keyframes carga-metal-shine {
    0% {
        left: -150%;
    }

    50%,
    100% {
        left: 150%;
    }
}

.carga-finalizar-item.visivel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    animation:
        carga-finalizar-glow 2s ease-in-out infinite,
        carga-finalizar-float 3s ease-in-out infinite;
}

@keyframes carga-finalizar-glow {

    0%,
    100% {
        box-shadow:
            0 0 20px rgba(16, 185, 129, 0.5),
            0 0 40px rgba(16, 185, 129, 0.3),
            0 0 60px rgba(16, 185, 129, 0.2),
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }

    50% {
        box-shadow:
            0 0 30px rgba(16, 185, 129, 0.7),
            0 0 60px rgba(16, 185, 129, 0.5),
            0 0 90px rgba(16, 185, 129, 0.3),
            inset 0 0 30px rgba(255, 255, 255, 0.15);
    }
}

@keyframes carga-finalizar-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.carga-finalizar-item:hover {
    transform: translateY(-5px) scale(1.02);
    animation: none;
    box-shadow:
        0 0 40px rgba(16, 185, 129, 0.8),
        0 0 80px rgba(16, 185, 129, 0.5),
        0 15px 40px rgba(0, 0, 0, 0.3);
}

.carga-finalizar-item i {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}


/* === BOTÃO FLUTUANTE (FAB) - Dark, Centralizado === */
.carga-fab {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1a1f35, #0d1020);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.15);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.carga-fab:hover {
    transform: translateX(-50%) scale(1.1);
    background: linear-gradient(145deg, #232942, #141827);
    border-color: rgba(139, 92, 246, 0.4);
    color: white;
}

.carga-fab:active {
    transform: translateX(-50%) scale(0.95);
}


.carga-fab-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--app-sucesso), #059669);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.375rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
    color: white;
    animation: carga-badge-pulse 2s ease-in-out infinite;
}

@keyframes carga-badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* === BOTÃO FLUTUANTE EXTRATO === */
.carga-fab-extrato {
    position: fixed;
    bottom: 24px;
    left: calc(50% - 75px);
    transform: translateX(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}


.carga-fab-extrato:hover {
    transform: translateX(-50%) scale(1.1);
    border-color: rgba(99, 102, 241, 0.5);
    color: white;
}




/* === MODAL EXTRATO === */
.carga-modal-extrato {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: linear-gradient(180deg, #0d1020, #070a12);
    border-radius: 24px 24px 0 0;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-bottom: none;
    z-index: 300;
    /* Acima do overlay (200) */
    display: none;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.carga-modal-extrato.ativo {
    display: flex;
    transform: translateY(0);
}

/* Overlay específico para extrato */
#modal-extrato-overlay.ativo {
    z-index: 290;
    /* Entre o overlay normal e o modal */
}

.carga-extrato-lista {
    flex: 1;
    overflow-y: auto;
    padding: 0 1rem 1rem;
    max-height: 50vh;
}

/* Item do Extrato */
.carga-extrato-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: slide-in 0.2s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carga-extrato-icone {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.carga-extrato-icone.incremento {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.carga-extrato-icone.decremento {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.carga-extrato-icone.selecao {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.carga-extrato-icone.finalizacao {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.carga-extrato-icone.ocorrencia {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.carga-extrato-icone.cancelamento {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.carga-extrato-icone.scan {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.carga-extrato-icone.default {
    background: rgba(100, 116, 139, 0.2);
    color: #64748b;
}

.carga-extrato-info {
    flex: 1;
    min-width: 0;
}

.carga-extrato-tipo {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carga-extrato-detalhe {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
    word-break: break-word;
}

.carga-extrato-tempo {
    font-size: 0.65rem;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.carga-extrato-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.carga-btn-carregar-mais {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.carga-btn-carregar-mais:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

.carga-btn-carregar-mais:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading no extrato */
.carga-extrato-loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.carga-extrato-loading i {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.carga-extrato-vazio {
    text-align: center;
    padding: 2rem;
    color: #64748b;
    font-size: 0.875rem;
}

/* === MODAL DE ITENS === */
.carga-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.98);
    /* backdrop-filter removido para performance no Android */
    z-index: 200;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carga-modal-overlay.ativo {
    display: block;
    opacity: 1;
}

.carga-modal-itens {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: linear-gradient(180deg, var(--app-superficie) 0%, #0a0f1e 100%);
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    z-index: 1200;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.carga-modal-itens.ativo {
    transform: translateY(0);
}

.carga-modal-handle {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
}

.carga-modal-handle span {
    width: 40px;
    height: 4px;
    background: var(--app-borda);
    border-radius: 9999px;
}

.carga-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid var(--app-borda);
}

.carga-modal-titulo {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--app-texto);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carga-modal-titulo i {
    color: var(--app-marca);
}

.carga-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--app-perigo);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.carga-modal-close:hover {
    background: var(--app-perigo);
    color: white;
}

.carga-modal-lista {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    /* Cadenced Scrolling - Snap to complete one card per swipe */
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    scroll-padding-top: 1rem;
    /* Margem superior para o snap não colar no topo */
}

.carga-modal-lista::-webkit-scrollbar {
    width: 4px;
}

.carga-modal-lista::-webkit-scrollbar-thumb {
    background: var(--app-borda);
    border-radius: 9999px;
}

/* Item na Modal */
.carga-modal-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--app-superficie-elevada);
    border: 1px solid var(--app-borda);
    border-radius: var(--app-raio);
    margin-bottom: 0.625rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    /* Snap point for cadenced scrolling */
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.carga-modal-item:hover {
    border-color: var(--app-borda-hover);
    transform: translateX(4px);
}

.carga-modal-item.selecionado {
    border-color: var(--app-marca);
    background: rgba(139, 92, 246, 0.1);
}

/* Highlight temporário ao focar no item */
.carga-modal-item.highlight-focus {
    animation: modal-item-highlight 1.5s ease-out;
}

@keyframes modal-item-highlight {
    0% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.8);
        transform: scale(1.02);
    }

    30% {
        box-shadow: 0 0 20px 5px rgba(139, 92, 246, 0.5);
    }

    100% {
        box-shadow: none;
        transform: scale(1);
    }
}

/* Item Concluído - Visual Verde */
.carga-modal-item.concluido {
    opacity: 1;
    border-color: var(--app-sucesso);
    background: rgba(16, 185, 129, 0.1);
    cursor: pointer;
}

.carga-modal-item.concluido:hover {
    background: rgba(16, 185, 129, 0.15);
    transform: translateX(4px);
}

.carga-modal-item.concluido .carga-modal-item-icone {
    background: rgba(16, 185, 129, 0.2);
    color: var(--app-sucesso);
}

/* Indicador pulsante de concluído */
.carga-modal-item.concluido::after {
    content: '✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--app-sucesso);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    color: white;
    animation: carga-pulse-check 2s ease-in-out infinite;
}

@keyframes carga-pulse-check {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }

    50% {
        transform: translateY(-50%) scale(1.1);
        box-shadow: 0 0 15px 5px rgba(16, 185, 129, 0.3);
    }
}

/* Volume Completo mas NÃO Finalizado (pode editar) */
.carga-modal-item.volume-completo {
    opacity: 1;
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.1);
    cursor: pointer;
}

.carga-modal-item.volume-completo:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: translateX(4px);
}

.carga-modal-item.volume-completo .carga-modal-item-icone {
    background: rgba(139, 92, 246, 0.2);
    color: var(--app-marca);
}

/* Indicador de volume completo (não pulsante) */
.carga-modal-item.volume-completo::after {
    content: '✓✓';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--app-marca);
    opacity: 0.7;
}

/* Item com Ocorrência - Visual Amarelo/Laranja */
.carga-modal-item.ocorrencia {
    opacity: 1;
    border-color: var(--app-alerta);
    background: rgba(245, 158, 11, 0.1);
    cursor: pointer;
}

.carga-modal-item.ocorrencia:hover {
    background: rgba(245, 158, 11, 0.15);
    transform: translateX(4px);
}

.carga-modal-item.ocorrencia .carga-modal-item-icone {
    background: rgba(245, 158, 11, 0.2);
    color: var(--app-alerta);
}

/* Indicador de ocorrência */
.carga-modal-item.ocorrencia::after {
    content: '!';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--app-alerta);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 900;
    color: #1a1a2e;
    animation: carga-pulse-alert 2s ease-in-out infinite;
}

@keyframes carga-pulse-alert {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.1);
    }
}

.carga-modal-item-icone {
    width: 44px;
    height: 44px;
    border-radius: var(--app-raio);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.carga-modal-item.pendente .carga-modal-item-icone {
    background: rgba(245, 158, 11, 0.1);
    color: var(--app-alerta);
}

.carga-modal-item.em-andamento .carga-modal-item-icone {
    background: rgba(139, 92, 246, 0.15);
    color: var(--app-marca);
}

.carga-modal-item.concluido .carga-modal-item-icone {
    background: rgba(16, 185, 129, 0.15);
    color: var(--app-sucesso);
}

.carga-modal-item-info {
    flex: 1;
    min-width: 0;
}

.carga-modal-item-nome {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--app-texto);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carga-modal-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--app-texto-opaco);
}

.carga-modal-item-qty {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.carga-modal-item-progresso {
    width: 50px;
    height: 4px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.carga-modal-item-progresso-fill {
    height: 100%;
    background: var(--app-sucesso);
}

.carga-modal-item-seta {
    color: var(--app-borda);
    font-size: 1rem;
}

/* === MODAL DE OCORRÊNCIA === */
.carga-modal-ocorrencia {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 10, 20, 0.98);
    /* backdrop-filter removido para performance no Android */
    z-index: 1200;
    padding: 1.5rem;
}

.carga-modal-ocorrencia.ativo {
    display: flex;
}

.carga-ocorrencia-content {
    width: 100%;
    max-width: 400px;
    background: var(--app-superficie);
    border: 1px solid var(--app-borda);
    border-radius: var(--app-raio-grande);
    animation: carga-slide-up 0.3s ease-out;
}

.carga-ocorrencia-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--app-borda);
}

.carga-ocorrencia-header h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--app-texto);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carga-ocorrencia-header h4 i {
    color: var(--app-alerta);
}

.carga-ocorrencia-body {
    padding: 1.25rem;
}

.carga-ocorrencia-opcoes {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.carga-ocorrencia-opcao {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--app-superficie-elevada);
    border: 1px solid var(--app-borda);
    border-radius: var(--app-raio);
    cursor: pointer;
    transition: all 0.2s ease;
}

.carga-ocorrencia-opcao:hover {
    border-color: var(--app-alerta);
    background: rgba(245, 158, 11, 0.1);
}

.carga-ocorrencia-opcao.selecionado {
    border-color: var(--app-alerta);
    background: rgba(245, 158, 11, 0.15);
}

.carga-ocorrencia-opcao i {
    font-size: 1.25rem;
    color: var(--app-alerta);
}

.carga-ocorrencia-opcao span {
    font-size: 0.9375rem;
    color: var(--app-texto);
}

.carga-ocorrencia-obs {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--app-superficie-elevada);
    border: 1px solid var(--app-borda);
    border-radius: var(--app-raio);
    color: var(--app-texto);
    font-size: 0.875rem;
    resize: none;
    min-height: 80px;
}

.carga-ocorrencia-obs:focus {
    outline: none;
    border-color: var(--app-marca);
}

.carga-ocorrencia-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--app-borda);
}

.carga-ocorrencia-footer button {
    flex: 1;
    padding: 0.875rem 1rem;
    border-radius: var(--app-raio);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* === EFEITO ÉPICO: VOLUME MÁXIMO (Reformulado) === */
.carga-alerta-max {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    pointer-events: none;
}

.carga-alerta-max.ativo {
    display: flex;
    animation: carga-alerta-screen-flash 0.6s ease-out;
}

@keyframes carga-alerta-screen-flash {

    0%,
    100% {
        background: transparent;
    }

    15%,
    45% {
        background: rgba(239, 68, 68, 0.15);
    }

    30% {
        background: rgba(239, 68, 68, 0.25);
    }
}

.carga-alerta-max-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 2.5rem 3rem;
    background: linear-gradient(145deg, rgba(30, 20, 20, 0.98), rgba(20, 10, 10, 0.98));
    border: 2px solid var(--app-perigo);
    border-radius: 1.5rem;
    animation: carga-alerta-bounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow:
        0 0 60px rgba(239, 68, 68, 0.4),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(239, 68, 68, 0.05);
}

@keyframes carga-alerta-bounce {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.1) rotate(3deg);
    }

    70% {
        transform: scale(0.95) rotate(-2deg);
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.carga-alerta-max-icone {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.2));
    border: 2px solid rgba(239, 68, 68, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: carga-alerta-shake 0.5s ease-in-out;
}

@keyframes carga-alerta-shake {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-15deg);
    }

    50% {
        transform: rotate(15deg);
    }

    75% {
        transform: rotate(-10deg);
    }
}

.carga-alerta-max-icone i {
    font-size: 2.5rem;
    color: var(--app-perigo);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.6));
}

.carga-alerta-max-texto {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.carga-alerta-max-subtexto {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

/* === EFEITO ÉPICO: ITEM CONCLUÍDO (Texto em cima) === */
.carga-sucesso-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
    pointer-events: none;
}

.carga-sucesso-overlay.ativo {
    display: flex;
    animation: carga-sucesso-bg 1.8s ease-out forwards;
}

@keyframes carga-sucesso-bg {
    0% {
        background: rgba(16, 185, 129, 0.3);
    }

    30% {
        background: rgba(16, 185, 129, 0.15);
    }

    100% {
        background: transparent;
        opacity: 0;
    }
}

.carga-sucesso-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 260px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.carga-sucesso-texto {
    order: -1;
    font-size: 1rem;
    font-weight: 800;
    color: white;
    text-shadow:
        0 0 15px rgba(16, 185, 129, 0.9),
        0 0 30px rgba(16, 185, 129, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: carga-sucesso-text 0.5s ease-out both;
}

@keyframes carga-sucesso-text {
    0% {
        transform: translateY(20px) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.carga-sucesso-icone {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--app-sucesso), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    box-shadow:
        0 0 60px rgba(16, 185, 129, 0.7),
        0 0 100px rgba(16, 185, 129, 0.4);
    animation: carga-sucesso-icon 0.6s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes carga-sucesso-icon {
    0% {
        transform: scale(0) rotate(-180deg);
    }

    60% {
        transform: scale(1.15) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}


/* === TOAST DE INCENTIVO (Gamificado - Múltiplos) === */
.carga-toast {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-size: 1.25rem;
    font-weight: 800;
    pointer-events: none;
    z-index: 600;
    white-space: nowrap;
}

.carga-toast.animando {
    animation: carga-toast-anim 1.4s ease-out forwards;
}

@keyframes carga-toast-anim {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    15% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }

    30% {
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        transform: translate(-50%, -180%) scale(0.7);
        opacity: 0;
    }
}

.carga-toast.incentivo {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
    color: white;
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

.carga-toast.quase {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
    color: white;
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5);
}

.carga-toast.final {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(124, 58, 237, 0.95));
    color: white;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

/* === PONTOS FLUTUANTES (XP) - Múltiplos === */
.carga-xp {
    position: fixed;
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--app-sucesso);
    text-shadow:
        0 0 10px rgba(16, 185, 129, 1),
        0 0 20px rgba(16, 185, 129, 0.6);
    pointer-events: none;
    z-index: 601;
    white-space: nowrap;
}

.carga-xp.animando {
    animation: carga-xp-float 1.8s ease-out forwards;
}

@keyframes carga-xp-float {
    0% {
        transform: translateY(0) scale(0.3);
        opacity: 0;
    }

    15% {
        transform: translateY(-15px) scale(1.3);
        opacity: 1;
    }

    30% {
        transform: translateY(-30px) scale(1);
    }

    100% {
        transform: translateY(-120px) scale(0.6);
        opacity: 0;
    }
}

/* Container para elementos dinâmicos */
.carga-effects-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 600;
    overflow: hidden;
}

/* === RESPONSIVIDADE === */

/* Telas menores (smartphones) */
@media (max-width: 480px) {
    .carga-main {
        padding: 0.75rem;
    }

    .carga-main-centered {
        padding: 1rem 0.75rem;
    }

    .carga-info-header {
        padding: 1rem;
    }

    .carga-info-titulo {
        font-size: 0.875rem;
    }

    .carga-badge {
        padding: 0.375rem 0.625rem;
        font-size: 0.6875rem;
    }

    /* Botões +/- menores */
    .carga-btn-qty {
        width: 65px;
        height: 65px;
        font-size: 1.5rem;
    }

    .carga-contagem-manual {
        bottom: 80px;
        padding: 0 1rem;
    }

    /* FAB menor */
    .carga-fab {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }

    /* Produto display */
    .carga-produto-nome {
        font-size: 1.5rem;
    }

    .carga-produto-codigo {
        font-size: 0.75rem;
    }

    /* Botão finalizar */
    .carga-finalizar-item {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        max-width: 260px;
    }

    /* Scan display */
    .carga-scan-code {
        font-size: 0.8125rem;
        letter-spacing: 2px;
    }

    /* Progresso item */
    .carga-item-progresso {
        max-width: 280px;
    }
}

/* Telas muito pequenas */
@media (max-width: 360px) {
    .carga-btn-qty {
        width: 55px;
        height: 55px;
        font-size: 1.25rem;
    }

    .carga-contagem-manual {
        padding: 0 0.75rem;
    }

    .carga-produto-nome {
        font-size: 1.25rem;
    }

    .carga-btn-acao {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }

    .carga-finalizar-item {
        max-width: 220px;
        padding: 0.875rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Telas médias (tablets) */
@media (min-width: 768px) {
    .carga-main {
        padding: 1.5rem;
    }

    .carga-btn-qty {
        width: 90px;
        height: 90px;
        font-size: 2.25rem;
    }

    .carga-fab {
        width: 72px;
        height: 72px;
        font-size: 1.75rem;
    }
}

/* === STATUS DISPLAY (Item Finalizado/Ocorrência) === */
.carga-status-display {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
    text-align: center;
    width: 100%;
    backdrop-filter: blur(5px);
}

.carga-status-display.visivel {
    display: flex;
    animation: fadeInUp 0.5s ease-out;
}

.carga-status-icone {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.carga-status-texto {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.carga-status-timestamp {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.4);
    padding: 0.4rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 99px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
}

.carga-status-display.finalizado {
    border-color: rgba(16, 185, 129, 0.3);
    background: linear-gradient(to bottom, rgba(16, 185, 129, 0.15), rgba(0, 0, 0, 0.4));
}

.carga-status-display.finalizado .carga-status-icone {
    color: var(--app-sucesso);
    filter: drop-shadow(0 0 20px rgba(16, 185, 129, 0.5));
}

.carga-status-display.finalizado .carga-status-texto {
    color: var(--app-sucesso);
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.carga-status-display.ocorrencia {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(to bottom, rgba(245, 158, 11, 0.15), rgba(0, 0, 0, 0.4));
}

.carga-status-display.ocorrencia .carga-status-icone {
    color: var(--app-alerta);
    filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.5));
}

.carga-status-display.ocorrencia .carga-status-texto {
    color: var(--app-alerta);
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}


/* === MODAL CANCELAMENTO === */
.carga-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.carga-modal-overlay.ativo {
    opacity: 1;
    visibility: visible;
}

.carga-modal-content {
    background: #1a1a1a;
    width: 90%;
    max-width: 400px;
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.carga-modal-overlay.ativo .carga-modal-content {
    transform: translateY(0) scale(1);
}

.carga-modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.carga-modal-icon {
    font-size: 3rem;
    color: var(--app-perigo);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.4));
}

.carga-modal-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.carga-modal-subtitulo {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.carga-modal-body textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1rem;
    color: white;
    font-size: 1rem;
    resize: none;
    margin-bottom: 2rem;
    outline: none;
    transition: all 0.2s;
    min-height: 100px;
}

.carga-modal-body textarea:focus {
    border-color: var(--app-perigo);
    background: rgba(239, 68, 68, 0.05);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.carga-modal-actions {
    display: flex;
    gap: 1rem;
}

.carga-modal-btn {
    flex: 1;
    padding: 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
}

.carga-modal-btn:active {
    transform: scale(0.95);
}

.carga-modal-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.carga-modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.carga-modal-btn.confirm {
    background: linear-gradient(135deg, var(--app-perigo), #991b1b);
    color: white;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
}

.carga-modal-btn.confirm:hover {
    filter: brightness(1.2);
    box-shadow: 0 15px 25px rgba(239, 68, 68, 0.4);
}

/* === BOTAO BADGE === */
.btn-cancelar-badge {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--app-perigo);
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.btn-cancelar-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-cancelar-badge:hover::before {
    transform: translateX(100%);
}

.btn-cancelar-badge:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    border-color: var(--app-perigo);
    transform: translateY(-2px);
}


/* === XP EFFECTS DYNAMIC === */
.carga-xp.bonus {
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.carga-xp.malus {
    color: #ef4444;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

.carga-xp.multiply {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(to bottom, #fbbf24, #d97706);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 15px rgba(245, 158, 11, 0.4));
    animation: xpPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes xpPop {
    0% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Centering Modal Overlays */
.carga-modal-overlay.ativo {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Neon Cancel Button */
.btn-cancelar-neon {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5), inset 0 0 8px rgba(239, 68, 68, 0.1);
    text-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-cancelar-neon:active {
    transform: scale(0.95);
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

.btn-cancelar-neon i {
    font-size: 1.1rem;
}

/* Ocorrencia Details Card */
.carga-ocorrencia-card {
    background: rgba(30, 35, 45, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid #f59e0b;
    /* Alerta Orange */
    border-radius: 12px;
    padding: 1.2rem;
    margin: 1.5rem auto 0 auto;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: left;
    display: none;
}

.carga-ocorrencia-card.visivel {
    display: block;
    animation: fadeInUp 0.4s ease-out;
}

.carga-ocorrencia-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.card-row {
    font-size: 0.95rem;
    color: #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    line-height: 1.4;
}

.card-row .label {
    font-weight: 600;
    color: #94a3b8;
    min-width: 60px;
}

.card-row .val {
    font-weight: 500;
    color: #f8fafc;
    text-align: right;
    word-break: break-word;
}

.card-row .val.highlight {
    color: #f59e0b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.card-row.time {
    margin-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.8rem;
    font-size: 0.85rem;
    color: #64748b;
    justify-content: flex-end;
    gap: 0.5rem;
    font-style: italic;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scanner Placeholder Viewfinder */
.carga-scan-code.placeholder {
    /* Performance: Gradients complexos podem pesar. Simplificando para border normal se persistir lag, mas mantendo por enquanto com opacity fixa */
    background:
        linear-gradient(to right, rgba(255, 255, 255, 0.5) 2px, transparent 2px) 0 0,
        linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 2px, transparent 2px) 0 0,
        linear-gradient(to left, rgba(255, 255, 255, 0.5) 2px, transparent 2px) 100% 0,
        linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 2px, transparent 2px) 100% 0,
        linear-gradient(to right, rgba(255, 255, 255, 0.5) 2px, transparent 2px) 0 100%,
        linear-gradient(to top, rgba(255, 255, 255, 0.5) 2px, transparent 2px) 0 100%,
        linear-gradient(to left, rgba(255, 255, 255, 0.5) 2px, transparent 2px) 100% 100%,
        linear-gradient(to top, rgba(255, 255, 255, 0.5) 2px, transparent 2px) 100% 100%;
    background-repeat: no-repeat;
    background-size: 15px 15px;
    opacity: 0.9 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
    width: 80%;
    margin: 0 auto;
    min-height: 60px;
    border: none !important;
    animation: smokePulse 3s infinite ease-in-out;

    /* Static Smoke Effect (Cheap) */
    text-shadow: 0 -5px 15px rgba(255, 255, 255, 0.4);

    will-change: opacity, transform;
    transform: translateZ(0);
    contain: layout paint style;
    backface-visibility: hidden;
}

.carga-scan-code.placeholder i {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0;
}

@keyframes smokePulse {
    0% {
        opacity: 0.7;
        transform: scale(0.98);
        /* text-shadow change REMOVED - Performance Bottleneck */
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }

    100% {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* Objectives Badge - With Timer */
.carga-objetivos-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 2px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 100;
    backdrop-filter: blur(8px);
    min-width: 100px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
}

.carga-objetivos-badge .meta-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
}

.carga-objetivos-badge .meta-timer i {
    font-size: 0.9rem;
    color: rgba(139, 92, 246, 0.8);
}

.carga-objetivos-badge .meta-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.carga-objetivos-badge .label {
    font-size: 0.6rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.carga-objetivos-badge .valor {
    font-size: 0.85rem;
    font-weight: 700;
    color: #e2e8f0;
    text-align: center;
}

.carga-objetivos-badge .indicador {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    transition: all 0.5s;
    display: none;
    /* Hidden, color now on border */
}

/* === ESTATÍSTICAS E METAS (RESTAURADO PARA O TOPO) === */
.carga-objetivos-badge {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
}

/* XP Badge (Agora dentro das badges de info) */
.carga-badge.xp {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff;
    font-weight: 800;
    border: none;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}



.carga-header-stats>* {
    pointer-events: auto;
}

/* Objectives Badge Adjustment */
.carga-objetivos-badge {
    position: static !important;
    margin: 0;
}

/* XP Badge */
.carga-xp-badge {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    font-size: 0.9rem;
    font-weight: 700;
    color: #e2e8f0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.carga-xp-badge i {
    color: #fbbf24;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
}

/* Gamified Occurrence Card (Redesign) */
.carga-ocorrencia-card {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-left: 3px solid #ef4444;
    border-radius: 8px;
    padding: 1rem;
    margin: 0 auto 1.5rem auto !important;
    /* Margin bottom to separate from Name */
    width: 100%;
    max-width: 340px;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
    backdrop-filter: none;
    /* Perf */
    position: relative;
    overflow: hidden;
}

/* Neon effect line */
.carga-ocorrencia-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.8), transparent);
}

.card-row .label {
    color: #f87171 !important;
    /* Light Red */
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-row .val.highlight {
    color: #ef4444 !important;
    font-weight: 700;
    font-size: 0.85rem;
    /* Menorzinha */
    background: transparent !important;
    text-transform: none;
    text-align: right;
}

.card-row .val {
    color: #fee2e2 !important;
}

@keyframes pulseTextRed {

    0%,
    100% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
    }

    50% {
        opacity: 0.8;
        text-shadow: 0 0 15px rgba(239, 68, 68, 0.8);
    }
}

/* --- Mobile / Small Screen Optimizations --- */
@media (max-width: 380px) {
    .carga-produto-nome {
        font-size: 1.1rem !important;
    }

    .carga-produto-codigo {
        font-size: 0.9rem !important;
    }

    /* Shrink Buttons */
    .carga-btn-grande {
        height: 50px !important;
        font-size: 0.95rem !important;
    }

    .carga-btn-acao {
        height: 45px !important;
    }

    .carga-header-stats {
        gap: 0.75rem;
    }


    .carga-fab {
        bottom: 10px;
        width: 55px;
        height: 55px;
        font-size: 1.2rem;
    }

    /* Adjust Card Margins */
    .carga-ocorrencia-card {
        margin-bottom: 0.5rem !important;
        padding: 0.6rem;
    }

    /* Tweak Placeholder */
    .carga-scan-code.placeholder {
        padding: 0.5rem;
        min-height: 50px;
    }
}

/* Botão Salvar Manual (Performance) */
.carga-btn-salvar-manual {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #e2e8f0;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    will-change: transform;
}

.carga-btn-salvar-manual:active {
    transform: scale(0.95);
    background: rgba(139, 92, 246, 0.2);
}

/* Tela de Loading */
.carga-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    z-index: 9999;
    display: none;
    /* Ativado via JS logic */
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.carga-loading-overlay.ativo {
    display: flex;
}

.carga-loading-content {
    text-align: center;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.carga-loading-content i {
    font-size: 3rem;
    color: #8b5cf6;
    animation: spinLoading 1s linear infinite;
}

.carga-loading-content #loading-texto {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

@keyframes spinLoading {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Loading Overlay Refined */
.carga-loading-overlay {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(10px);
}

.carga-loading-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* --- CONFIGURAÇÕES VISUAIS --- */

/* Botão no Header */
.app-btn-config {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--app-texto-muted);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 10px;
    /* Separar do título */
}

.app-btn-config:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Config Items */
.carga-config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.carga-config-item:last-child {
    border-bottom: none;
}

.carga-config-titulo {
    color: var(--app-texto-destaque);
    font-weight: 600;
    font-size: 1rem;
}

.carga-config-desc {
    color: var(--app-texto-muted);
    font-size: 0.8rem;
    margin-top: 4px;
    max-width: 220px;
    line-height: 1.3;
}

/* Switch Toggle Customizado */
.carga-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.carga-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.carga-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3f3f46;
    transition: .3s;
    border-radius: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.carga-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #e4e4e7;
    transition: .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 50%;
}

input:checked+.carga-slider {
    background-color: var(--app-marca);
    border-color: var(--app-marca);
}

input:checked+.carga-slider:before {
    transform: translateX(22px);
    background-color: #fff;
}

/* --- CLASSE PARA DESATIVAR EFEITOS CONTÍNUOS --- */
/* Esta classe é adicionada ao body via JS quando "Efeitos Contínuos" está OFF */
/* A regra genérica '*' foi removida pois bloqueava efeitos momentâneos */

/* Exceções: Transições importantes de UI (modal, toggles) podem manter, mas animações decorativas somem */
body.no-effects-continuous .carga-modal-overlay,
body.no-effects-continuous .carga-switch .carga-slider {
    transition-duration: 0.2s !important;
    /* Manter mínimo para UX */
}

/* Remover pulsações e brilhos específicos */
body.no-effects-continuous .pulsar,
body.no-effects-continuous .brilho-infinito {
    animation: none !important;
    box-shadow: none !important;
}

body.no-effects-continuous .carga-item-progresso-fill,
body.no-effects-continuous .carga-btn-manual {
    box-shadow: none !important;
    /* Remove neons pesados */
    text-shadow: none !important;
}

/* Reforço para desativar Animações Contínuas Específicas quando a config está OFF */

/* Largada - Círculos Pulsantes */
body.no-effects-continuous .carga-largada-icone::before,
body.no-effects-continuous .carga-largada-icone::after {
    animation: none !important;
    border-color: rgba(139, 92, 246, 0.2);
}

/* Barra de Progresso - Brilho */
body.no-effects-continuous .carga-progresso-geral-fill::after {
    animation: none !important;
    background: none !important;
}

/* Scan Neon */
body.no-effects-continuous .carga-scan-code.visivel {
    animation: none !important;
    text-shadow: 0 0 5px rgba(139, 92, 246, 0.5) !important;
    /* Brilho estático leve */
}

/* Botão Finalizar - Flutuação e Brilhos */
body.no-effects-continuous .carga-finalizar-item,
body.no-effects-continuous .carga-finalizar-item.visivel {
    animation: none !important;
    transform: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
}

body.no-effects-continuous .carga-finalizar-item::before,
body.no-effects-continuous .carga-finalizar-item::after {
    animation: none !important;
    display: none !important;
    /* Remove os pseudo-elementos de brilho */
}

/* Badges Pulsantes */
body.no-effects-continuous .carga-fab-badge {
    animation: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Modal Itens - Checks Pulsantes */
body.no-effects-continuous .carga-modal-item.concluido::after,
body.no-effects-continuous .carga-modal-item.ocorrencia::after {
    animation: none !important;
    box-shadow: none !important;
    transform: translateY(-50%) !important;
    /* Manter centralizado sem scale */
}

/* Efeito Highlight Focus do Modal */
body.no-effects-continuous .carga-modal-item.highlight-focus {
    animation: none !important;
    box-shadow: none !important;
}

/* === SINCRONIZAÇÃO - ESTADOS DO BOTÃO SALVAR === */
.carga-btn-salvar-manual {
    position: relative;
    transition: all 0.3s ease;
}

.carga-btn-salvar-manual .sync-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--app-alerta);
    border-radius: 9px;
    font-size: 0.625rem;
    font-weight: 800;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Estado: Sincronizado (Verde) */
.carga-btn-salvar-manual.sync-ok {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1)) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: var(--app-sucesso) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.carga-btn-salvar-manual.sync-ok i {
    color: var(--app-sucesso);
}

/* Estado: Pendente (Amarelo Pulsante) */
.carga-btn-salvar-manual.sync-pendente {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.1)) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    color: var(--app-alerta) !important;
    animation: sync-pulse-yellow 1.5s ease-in-out infinite;
}

.carga-btn-salvar-manual.sync-pendente i {
    color: var(--app-alerta);
}

@keyframes sync-pulse-yellow {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.6), 0 0 30px rgba(245, 158, 11, 0.3);
    }
}

/* Estado: Erro (Vermelho) */
.carga-btn-salvar-manual.sync-erro {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1)) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: var(--app-perigo) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    animation: sync-shake 0.5s ease-in-out;
}

.carga-btn-salvar-manual.sync-erro i {
    color: var(--app-perigo);
}

@keyframes sync-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-3px);
    }

    40% {
        transform: translateX(3px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(3px);
    }
}

/* Estado: Loading (Spinner) */
.carga-btn-salvar-manual.sync-loading {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1)) !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
    color: var(--app-marca) !important;
    pointer-events: none;
}

.carga-btn-salvar-manual.sync-loading i {
    color: var(--app-marca);
}

.carga-btn-salvar-manual.sync-loading i.spinning {
    animation: sync-spin 1s linear infinite;
}

@keyframes sync-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Toast de Sync */
.carga-toast.sync-toast {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--app-borda);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.carga-toast.sync-toast.animando {
    opacity: 1;
    transform: translateY(0);
}

.carga-toast.sync-toast.bonus {
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--app-sucesso);
}

.carga-toast.sync-toast.malus {
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--app-perigo);
}

/* === META / TIMER COMO BADGES ABSOLUTOS === */
.carga-objetivos-badge {
    display: none;
    /* Container não mais usado */
}

.meta-timer-box,
.meta-target-box {
    position: fixed;
    bottom: 20px;
    /* [FIX] Alinhado com botões inferiores */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    pointer-events: auto;
    min-width: 70px;
    z-index: 50;
}

.meta-timer-box {
    left: 1rem;
}

.meta-target-box {
    right: 1rem;
}

.meta-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--app-texto-opaco);
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.meta-conteudo {
    font-family: 'JetBrains Mono';
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--app-texto);
    display: flex;
    align-items: center;
    gap: 3px;
}

.meta-conteudo i {
    color: var(--app-marca);
    font-size: 0.8rem;
}

.meta-divider {
    display: none;
}

/* Responsividade para telas muito pequenas */
@media (max-width: 320px) {

    .meta-timer-box,
    .meta-target-box {
        padding: 0.4rem 0.5rem;
        min-width: 60px;
    }

    .meta-conteudo {
        font-size: 0.8rem;
    }

    .meta-label {
        font-size: 0.55rem;
    }
}