:root { --primary: #2563eb; --secondary: #10b981; --dark: #1e293b; --bg: #f0f2f5; }
body { font-family: -apple-system, system-ui, sans-serif; margin: 0; padding: 0; background: var(--bg); color: #333; }

#tela-acesso { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.login-card { background: white; padding: 30px; border-radius: 20px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); width: 85%; max-width: 400px; text-align: center; }

.header { background: var(--dark); color: white; padding: 18px; text-align: center; font-weight: bold; font-size: 16px; position: sticky; top: 0; z-index: 99; border-bottom: 3px solid var(--primary); }
.nav { background: white; display: flex; justify-content: space-around; border-bottom: 1px solid #ddd; }
.nav-item { border: none; background: none; font-weight: bold; color: #64748b; padding: 12px 5px; font-size: 12px; text-transform: uppercase; flex: 1; text-align: center; cursor: pointer;}
.nav-item.active { color: var(--primary); border-bottom: 3px solid var(--primary); }

.container { max-width: 500px; margin: auto; padding: 15px; }
.card { background: white; padding: 20px; border-radius: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); margin-bottom: 15px; }

input { width: 100%; padding: 15px; margin-bottom: 15px; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 16px; box-sizing: border-box; background: #fafafa; }

.input-row { display: flex; gap: 8px; margin-bottom: 15px; align-items: center; }
.input-row input, .input-row select { margin-bottom: 0 !important; height: 54px; box-sizing: border-box; }

.input-qtd { width: 75px; text-align: center; flex-shrink: 0; padding: 0 5px !important; }
.select-tipo { width: 70px; flex-shrink: 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fafafa; font-size: 16px; text-align: center; color: #333; font-weight: bold; padding: 0 5px; }
.input-preco { flex-grow: 1; padding: 0 15px !important; }

.btn { width: 100%; padding: 16px; border: none; border-radius: 12px; font-weight: bold; font-size: 16px; cursor: pointer; transition: background 0.3s; }
.btn-add { background: var(--primary); color: white; margin-top: 10px; }
.btn-save { background: var(--secondary); color: white; margin-top: 15px; }
.btn-camera { background: #3b82f6; color: white; width: 54px; height: 54px; border-radius: 12px; border: none; font-size: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.btn-zap { background: #25D366; color: white; margin-top: 15px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.btn-google { background: #4285F4; color: white; margin-top: 0; display: flex; justify-content: center; align-items: center; gap: 10px; }

#dica-preco { font-size: 13px; color: #64748b; font-weight: bold; margin-bottom: 8px; margin-top: 5px; }
#sugestoes-preco { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.chip { background: #e2e8f0; color: #1e293b; border: none; padding: 8px 14px; border-radius: 20px; font-weight: bold; font-size: 14px; cursor: pointer; border: 1px solid #cbd5e1; }
.chip:active { background: #cbd5e1; }

.categoria-header { font-size: 12px; font-weight: bold; color: #94a3b8; margin: 20px 0 8px 5px; text-transform: uppercase; letter-spacing: 1px; }
.item-lista { background: white; padding: 15px; border-radius: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.03); border-left: 5px solid var(--primary); transition: opacity 0.3s; }
.item-lista.peguei { opacity: 0.5; border-left-color: #cbd5e1; }
.item-lista.peguei b { text-decoration: line-through; color: #94a3b8; }

.price-val { font-weight: bold; color: var(--primary); font-size: 16px; }
.actions { display: flex; gap: 6px; }
.btn-action { border: none; width: 36px; height: 36px; border-radius: 10px; color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; transition: background 0.3s;}

.economy-banner { background: #dcfce7; color: #166534; padding: 12px; border-radius: 12px; margin-bottom: 15px; border: 1px dashed #22c55e; text-align: center; font-size: 14px; font-weight: bold; }
.total-box { background: var(--dark); color: white; padding: 20px; border-radius: 15px; text-align: center; font-size: 22px; font-weight: bold; margin: 15px 0; }

.hist-card { width: 100%; text-align: left; font-family: inherit; background: white; padding: 18px; border-radius: 15px; margin-bottom: 12px; border: none; border-left: 5px solid var(--secondary); display: flex; justify-content: space-between; align-items: center; cursor: pointer; box-sizing: border-box; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.hist-mercado { color: var(--secondary); font-weight: bold; font-size: 14px; text-transform: uppercase; display: block; }

#loading-ocr { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 2000; font-size: 18px; font-weight: bold; text-align:center; padding: 20px; }

details { background: #f8fafc; padding: 12px; border-radius: 10px; margin-bottom: 10px; border: 1px solid #e2e8f0; }
summary { font-weight: bold; cursor: pointer; color: #1e293b; outline: none; }
details p { font-size: 14px; color: #475569; margin: 10px 0 0 0; line-height: 1.4; }

.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 15px; }
.calc-grid label { font-size: 12px; color: #64748b; display: block; text-align: center; font-weight: bold; }
.calc-grid input { width: 100%; text-align: center; padding: 10px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 16px; margin-top: 5px; background: #fff; box-sizing: border-box; margin-bottom:0;}

.chk-group { margin-bottom: 15px; font-size: 14px; color: #475569; display: flex; flex-wrap: wrap; gap: 10px 15px; align-items: center; }
.chk-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.chk-group input[type="checkbox"] { margin: 0; width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }

.hidden { display: none !important; }

.input-erro { border: 2px solid #ef4444 !important; background-color: #fef2f2 !important; transition: 0.3s; }

#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; width: 90%; max-width: 400px; pointer-events: none;}
.toast { padding: 15px; border-radius: 12px; font-weight: bold; text-align: center; color: white; box-shadow: 0 4px 15px rgba(0,0,0,0.2); animation: slideDown 0.3s ease-out, fadeOut 0.5s ease-in 2.5s forwards; }
.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

/* --- ESTILOS DO ONBOARDING --- */
.onboarding-banner { background: #e0f2fe; border: 1px dashed #3b82f6; padding: 15px; border-radius: 12px; text-align: center; margin-bottom: 15px; transition: 0.3s; }
.btn-help { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; margin-top: 15px; display: flex; justify-content: center; align-items: center; gap: 8px; }
.video-container { position: relative; width: 100%; overflow: hidden; border-radius: 10px; margin-top: 10px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 12px;}
.video-shorts { padding-bottom: 177.77%; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* --- ANIMAÇÕES DO SALDO --- */
@keyframes pulseAlert {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.saldo-alerta { border-color: #ef4444 !important; background-color: #fef2f2 !important; animation: pulseAlert 1.5s infinite; }
.saldo-ok { border-color: #10b981 !important; background-color: #f0fdf4 !important; }

/* --- ESTILO DO BALÃO DE NOVIDADE (TOOLTIP) --- */
.tooltip-novo {
    position: absolute;
    top: 110%;
    right: 0;
    background: #1e40af;
    color: white;
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 100;
    text-align: left;
    animation: bounceSoft 2s infinite;
    line-height: 1.4;
}
.tooltip-novo::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 35px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #1e40af transparent;
}
@keyframes bounceSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* --- ESTILOS DO LOADING DO LOGIN --- */
.spinner { 
    width: 30px; 
    height: 30px; 
    border: 4px solid #e2e8f0; 
    border-top: 4px solid var(--primary); 
    border-radius: 50%; 
    animation: spin 1s linear infinite; 
    margin: 0 auto 10px auto; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }