:root { 
    --bg-dark: #0f172a; 
    --card-dark: #1e293b; 
    --accent: #3b82f6; 
    --purple: #8b5cf6; 
    --success: #10b981; 
    --danger: #ef4444; 
}

body { 
    background-color: var(--bg-dark); 
    color: #f8fafc; 
    font-family: 'Segoe UI', system-ui, sans-serif; 
    padding-bottom: 90px; 
    overscroll-behavior-y: none; 
    -webkit-tap-highlight-color: transparent; 
}

/* Scrollbar Personalizada */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* Tela de Bloqueio (Auth Overlay) */
#auth-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%); 
    z-index: 9999; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    flex-direction: column; 
    transition: opacity 0.5s ease; 
}

.pin-display { 
    font-size: 3rem; 
    letter-spacing: 15px; 
    margin-bottom: 30px; 
    min-height: 60px; 
    color: var(--accent); 
    font-weight: bold; 
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5); 
}

.keypad { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px; 
    max-width: 320px; 
}

.key-btn { 
    width: 75px; 
    height: 75px; 
    border-radius: 50%; 
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: white; 
    font-size: 1.8rem; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer; 
    transition: 0.2s; 
    backdrop-filter: blur(5px); 
    user-select: none; 
}

.key-btn:active { background: var(--accent); transform: scale(0.9); box-shadow: 0 0 15px var(--accent); }
.key-btn.delete { color: #ef4444; background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.key-btn.confirm { color: #10b981; background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }

/* Elementos de Interface (Cards, Textos, Inputs) */
.glass-card { 
    background: rgba(30, 41, 59, 0.6); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    border: 1px solid rgba(255, 255, 255, 0.08); 
    border-radius: 16px; 
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2); 
    transition: transform 0.3s; 
}

.glass-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.15); }
.highlight-card { background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(6, 78, 59, 0.8) 100%); border: 1px solid var(--success); }
.ai-card { background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(49, 46, 129, 0.8) 100%); border: 1px solid var(--purple); }

.brand-text { 
    background: linear-gradient(90deg, #60a5fa, #c084fc); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    font-weight: 800; 
}

.kpi-value { font-size: 2rem; font-weight: 700; letter-spacing: -1px; }
.text-xs { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; }

.form-control, .form-select { 
    background-color: rgba(15, 23, 42, 0.5); 
    border: 1px solid #334155; 
    color: white; 
    border-radius: 12px; 
    padding: 15px; 
    font-size: 1rem; 
}

.form-control:focus, .form-select:focus { 
    background-color: var(--card-dark); 
    color: white; 
    border-color: var(--accent); 
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25); 
}

/* Navegação Mobile e Sidebar Desktop */
.mobile-nav { 
    position: fixed; 
    bottom: 20px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 90%; 
    max-width: 400px; 
    background: rgba(30, 41, 59, 0.9); 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 50px; 
    display: flex; 
    justify-content: space-evenly; 
    padding: 12px 0; 
    z-index: 1000; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); 
}

.nav-item-mobile { 
    text-align: center; 
    color: #64748b; 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    transition: 0.3s; 
    position: relative; 
}

.nav-item-mobile.active { color: var(--accent); transform: translateY(-5px); }
.nav-item-mobile.active::after { 
    content: ''; 
    position: absolute; 
    bottom: -5px; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 5px; 
    height: 5px; 
    background: var(--accent); 
    border-radius: 50%; 
}

.sidebar-desktop .nav-link { 
    color: #94a3b8; 
    margin-bottom: 8px; 
    border-radius: 12px; 
    padding: 14px 20px; 
    transition: 0.3s; 
}

.sidebar-desktop .nav-link:hover, .sidebar-desktop .nav-link.active { 
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), transparent); 
    color: var(--accent); 
    font-weight: 600; 
    border-left: 3px solid var(--accent); 
}

.main-footer { 
    margin-top: 50px; 
    padding-top: 20px; 
    border-top: 1px solid #334155; 
    text-align: center; 
    color: #64748b; 
    font-size: 0.9rem; 
}

.chart-wrapper { position: relative; height: 350px; width: 100%; }

.btn-install { 
    background: linear-gradient(45deg, #FFD700, #FFA500); 
    color: #000; 
    font-weight: bold; 
    border: none; 
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.4); 
    animation: pulse 2s infinite; 
}

/* SweetAlert Customizações para Tema Escuro */
.swal2-popup { 
    background: #1e293b !important; 
    color: #f8fafc !important; 
    border: 1px solid #334155; 
    border-radius: 20px !important; 
}
.swal2-title { color: white !important; }

@keyframes pulse { 
    0% { transform: scale(1); } 
    50% { transform: scale(1.02); } 
    100% { transform: scale(1); } 
}

@media (min-width: 769px) { .mobile-nav { display: none; } }
@media (max-width: 768px) { .sidebar-col { display: none; } body { padding-bottom: 100px; } }