:root {
    /* --- Base Colors (Deep Space & Neon) --- */
    --bg-dark: #000000;
    --primary: #FFD028; /* Ouro Solar */
    --primary-dim: rgba(255, 208, 40, 0.15);
    --primary-glow: rgba(255, 208, 40, 0.4);
    
    --danger: #FF453A;
    --safe: #32D74B;
    
    /* --- Text --- */
    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* --- Glassmorphism Config (Ultra Premium) --- */
    --glass-bg: rgba(15, 15, 20, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-blur: 30px;
    
    --radius-xl: 32px;
    --radius-md: 16px;
    --radius-pill: 100px;
    
    --transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);

    /* --- Variáveis Admin --- */
    --card-bg: rgba(20, 20, 25, 0.7);
    --sidebar-bg: rgba(12, 12, 14, 0.75);
    --sidebar-border: rgba(255, 255, 255, 0.06);
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    background: radial-gradient(circle at 50% -20%, #1a1a2e 0%, #000 70%);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Utilitários --- */
.hidden { display: none !important; opacity: 0; pointer-events: none; }
.view { width: 100%; height: 100%; position: absolute; top: 0; left: 0; transition: opacity 0.5s ease; opacity: 0; pointer-events: none;}
.view.active { opacity: 1; pointer-events: all; }

/* =========================================
   --- LOGIN VIEW ---
   ========================================= */
#login-view {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: radial-gradient(circle at center, rgba(255, 208, 40, 0.05), transparent 40%);
}
.login-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    padding: 4rem;
    border-radius: var(--radius-xl);
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: floatUp 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.brand-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    letter-spacing: -2px;
    background: linear-gradient(180deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-title span { color: var(--primary); -webkit-text-fill-color: var(--primary); }
.login-desc { color: var(--text-muted); margin-bottom: 2rem; font-size: 0.95rem; }

/* =========================================
   --- MAIN APP LAYOUT (Sidebar & Content) ---
   ========================================= */
#app-view {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    padding: 24px;
    gap: 24px;
    background: #050505; 
}

/* --- Sidebar --- */
.sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    z-index: 20;
    transition: var(--transition);
}

.sidebar .brand-title { font-size: 1.8rem; text-align: left; margin-bottom: 1.5rem; }

/* User Badge (Clicável) */
.user-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.user-badge:hover { 
    border-color: var(--glass-border); 
    background: rgba(255,255,255,0.06); 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.user-badge img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.user-info h4 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.user-info span { font-size: 0.75rem; color: var(--primary); letter-spacing: 0.5px; text-transform: uppercase; }

.user-badge::after {
    content: 'EDITAR';
    position: absolute;
    right: 10px;
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0;
    transition: var(--transition);
    letter-spacing: 1px;
}
.user-badge:hover::after { opacity: 1; }

/* Navigation Buttons */
.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 16px 20px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}
.nav-btn span { font-size: 1.4rem; transition: var(--transition); }
.nav-btn:hover { color: #fff; background: rgba(255,255,255,0.04); }
.nav-btn.active { 
    background: var(--primary-dim); 
    color: var(--primary); 
    box-shadow: 0 0 20px rgba(255, 208, 40, 0.05);
    border: 1px solid rgba(255, 208, 40, 0.1);
}
.nav-btn.logout { margin-top: auto; color: var(--danger); opacity: 0.8; }
.nav-btn.logout:hover { background: rgba(255, 69, 58, 0.1); opacity: 1; }

/* --- Câmera e HUD --- */
.content {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: #000;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    display: flex;
}
.video-wrapper { width: 100%; height: 100%; position: relative; }

/* Câmera Limpa (Sem mirror, sem scanlines) */
.output_canvas { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    /* opacity e transform removidos para imagem limpa */
}
.video-wrapper::after { display: none; }

/* HUD Pills */
.hud-top {
    position: absolute; top: 30px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 12px; z-index: 10; width: 90%; justify-content: center;
}
.hud-metric {
    background: rgba(10, 10, 10, 0.7); backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 24px; border-radius: var(--radius-pill);
    display: flex; align-items: center; gap: 12px; min-width: 140px; justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hud-metric small { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; display: block; }
.hud-metric span.value { font-size: 1rem; font-weight: 700; color: var(--text-main); }

/* Status Colors */
.value.safe { color: var(--safe) !important; text-shadow: 0 0 10px rgba(50, 215, 75, 0.4); }
.value.warning { color: var(--primary) !important; text-shadow: 0 0 10px rgba(255, 208, 40, 0.4); }
.value.danger { color: var(--danger) !important; text-shadow: 0 0 15px rgba(255, 69, 58, 0.6); animation: pulseText 0.5s infinite alternate; }

/* Overlays & FABs */
.danger-overlay {
    position: absolute; inset: 0; background: radial-gradient(circle, transparent 40%, rgba(255, 59, 48, 0.9) 100%);
    display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 50; animation: alertPulse 1s infinite;
}
.danger-overlay h1 { font-size: 6rem; font-weight: 900; letter-spacing: 10px; margin: 0; color: #fff; text-transform: uppercase; }

.btn-primary {
    background: var(--primary); color: #000; border: none; padding: 14px 28px; border-radius: 12px; font-weight: 700; cursor: pointer; font-size: 1rem; transition: var(--transition); display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 4px 15px rgba(255, 208, 40, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(255, 208, 40, 0.5); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.2); padding: 12px 24px; border-radius: 12px; cursor: pointer; transition: var(--transition);
}
.btn-secondary:hover { background: rgba(255,255,255,0.2); }

.fab-btn {
    position: absolute; right: 30px; bottom: 30px; width: 56px; height: 56px; border-radius: 20px; background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); color: #fff; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: var(--transition); z-index: 30; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.fab-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
#btn-fab-lunch { bottom: 100px; }
#btn-fab-lunch.active { background: var(--primary); color: #000; box-shadow: 0 0 20px var(--primary-glow); animation: pulse 2s infinite; }

/* Modais */
.modal {
    position: fixed; 
    inset: 0; 
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(15px); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 200; 
    transition: opacity 0.3s ease;
    /* Impedir cliques quando estiver invisivel */
    opacity: 0;
    pointer-events: none; 
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    /* Garante que o fundo glass e a borda tenham o arredondamento */
    border-radius: 24px !important; 
    overflow: hidden; /* Garante que o conteúdo interno não vaze nos cantos */
    border: 1px solid var(--glass-border); /* Reforça a borda sutil */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); /* Sombra para profundidade */
}

/* Inputs Genéricos */
.profile-selector { padding: 0 0 1rem 0; display: flex; flex-direction: column; gap: 8px; }
.glass-input {
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: var(--text-main); padding: 10px 12px; border-radius: 12px; font-size: 0.9rem; cursor: pointer; appearance: none;
}
.sidebar select.glass-input {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M4.516%207.548c0.436-0.446%201.043-0.481%201.576%200l3.908%203.748%203.894-3.748c0.533-0.481%201.141-0.446%201.574%200s0.436%201.048%200%201.5l-4.437%204.269c-0.287%200.276-0.586%200.31-0.841%200.297-0.255%200.013-0.554-0.021-0.841-0.297l-4.437-4.269c-0.436-0.452-0.436-1.159%200-1.605z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}

hr { border: none; border-top: 1px solid var(--glass-border); margin: 1rem 0; }

/* novos estilos do HUD para o gráfico  */

.hud-graph-container {
    background: rgba(10, 10, 10, 0.7); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px); 
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; /* Um pouco menos arredondado que as pills laterais */
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hud-graph-container canvas {
    width: 120px;
    height: 40px;
    display: block;
}

.hud-graph-container small {
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-top: 2px;
    font-weight: 700;
}

/* =========================================
   --- ADMIN & DASHBOARD STYLES ---
   ========================================= */

.admin-layout { display: grid; grid-template-columns: 260px 1fr; height: 100vh; overflow: hidden; }
.dashboard-container { padding: 30px; overflow-y: auto; background: #020203; display: flex; flex-direction: column; gap: 30px; }
.admin-view { display: none; animation: fadeIn 0.4s ease; width: 100%; height: 100%; flex-direction: column; } /* Flex para centralização do perfil */
.admin-view.active { display: flex; }

/* Header Dash */
.header-dash {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
}

/* KPI Cards (Glass HUD) */
.kpi-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px !important; margin-bottom: 30px !important; }

.kpi-card { 
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(20,20,20,0.4) 100%); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-radius: 20px; padding: 24px; position: relative; overflow: hidden; 
    display: flex; flex-direction: column; justify-content: space-between; 
    min-height: 160px; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
}
.kpi-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.15); box-shadow: 0 15px 35px rgba(0,0,0,0.4); }

.kpi-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; z-index: 2; }
.kpi-value { font-size: 3rem; font-weight: 800; color: #fff; margin: 10px 0; line-height: 1; z-index: 2; text-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.kpi-trend { align-self: flex-start; font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 20px; display: flex; align-items: center; gap: 6px; z-index: 2; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); }
.kpi-bg-icon { position: absolute; right: -20px; bottom: -20px; font-size: 8rem; opacity: 0.05; transform: rotate(-15deg); z-index: 0; pointer-events: none; transition: all 0.5s ease; }
.kpi-card:hover .kpi-bg-icon { opacity: 0.1; transform: rotate(0deg) scale(1.1); }

/* Variações KPI */
.kpi-card.danger { border-bottom: 2px solid var(--danger); background: linear-gradient(180deg, rgba(255, 69, 58, 0.05) 0%, rgba(20,20,20,0.6) 100%); }
.kpi-card.danger .kpi-value { color: var(--danger); text-shadow: 0 0 20px rgba(255, 69, 58, 0.3); }
.kpi-card.danger .kpi-trend { background: rgba(255, 69, 58, 0.1); color: var(--danger); border-color: rgba(255, 69, 58, 0.2); }

.kpi-card.warning { border-bottom: 2px solid var(--primary); background: linear-gradient(180deg, rgba(255, 208, 40, 0.05) 0%, rgba(20,20,20,0.6) 100%); }
.kpi-card.warning .kpi-value { color: var(--primary); text-shadow: 0 0 20px rgba(255, 208, 40, 0.3); }
.kpi-card.warning .kpi-trend { background: rgba(255, 208, 40, 0.1); color: var(--primary); border-color: rgba(255, 208, 40, 0.2); }

.kpi-card.safe { border-bottom: 2px solid var(--safe); background: linear-gradient(180deg, rgba(50, 215, 75, 0.05) 0%, rgba(20,20,20,0.6) 100%); }
.kpi-card.safe .kpi-value { color: var(--safe); text-shadow: 0 0 20px rgba(50, 215, 75, 0.3); }
.kpi-card.safe .kpi-trend { background: rgba(50, 215, 75, 0.1); color: var(--safe); border-color: rgba(50, 215, 75, 0.2); }

.kpi-card.info { border-bottom: 2px solid #FF9500; }
.kpi-card.info .kpi-trend { background: rgba(255, 149, 0, 0.1); color: #FF9500; border-color: rgba(255, 149, 0, 0.2); }

/* Charts & Tables */
.charts-grid { display: flex !important; gap: 40px !important; min-height: 400px; height: auto; margin-bottom: 30px !important; overflow: hidden; }
.chart-box { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; position: relative; flex: 1; }
.chart-box:first-child { flex: 2; }
.chart-box:last-child { flex: 1; max-width: 500px; }

.logs-table-container { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; overflow: hidden; flex-shrink: 0; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--text-muted); padding: 12px; font-size: 0.85rem; border-bottom: 1px solid var(--glass-border); }
td { padding: 14px 12px; color: #fff; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.03); }
tr:last-child td { border: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge { padding: 4px 12px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.bg-danger { background: rgba(255, 69, 58, 0.2); color: var(--danger); }
.badge.bg-danger { background: rgba(255, 69, 58, 0.2); color: var(--danger); }

/* Equipe */
.team-grid { display: flex !important; flex-wrap: wrap; gap: 15px !important; }
.team-card { background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 16px; padding: 20px; text-align: center; flex: 0 0 250px; flex-grow: 1; }
.team-avatar { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--glass-border); margin-bottom: 15px; object-fit: cover; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.status-online { background: var(--safe); box-shadow: 0 0 10px var(--safe); }

/* Configs */
.settings-section { max-width: 600px; }
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid var(--glass-border); }
.toggle-switch { position: relative; width: 50px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #333; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }

.form-group { width: 100%; text-align: left; }
.form-group label { display: block; color: var(--text-muted); margin-bottom: 5px; font-size: 0.9rem; }
.form-input { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); padding: 10px; border-radius: 8px; color: #fff; font-family: inherit; }
.form-input:focus { border-color: var(--primary); }
.dashboard-container > * { margin-bottom: 30px !important; }

/* --- FIX DE SELECTS ADMIN (Branco) --- */
.date-filter, #user-filter, #period-filter {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-color: rgba(20, 20, 25, 0.6); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-main);
    padding: 8px 16px; padding-right: 35px; border-radius: 8px; cursor: pointer; font-family: 'Inter', sans-serif; font-size: 0.9rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
select option { background-color: #1a1a1e; color: #fff; padding: 12px; }

/* =========================================
   --- PROFILE STYLES (UNIFICADO) ---
   ========================================= */

/* Centralização do Perfil no Admin */
#view-profile .logs-table-container {
    flex: 1; /* Ocupa todo o espaço */
    width: 100%; margin: 0; padding: 0; max-width: none;
    background: transparent; border: none; box-shadow: none;
    display: flex !important; justify-content: center; align-items: center;
}

#view-profile .profile-container {
    background: rgba(20, 20, 25, 0.6); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); box-shadow: 0 20px 50px rgba(0,0,0,0.5); border-radius: 24px;
    padding: 40px 50px; width: 100%; max-width: 550px;
    display: flex; flex-direction: column; align-items: center; gap: 25px;
}

#view-profile .avatar-wrapper { margin-bottom: 10px; }
#view-profile .profile-form { width: 100%; display: flex; flex-direction: column; gap: 20px; }
#view-profile .form-group { width: 100% !important; display: flex; flex-direction: column; align-items: flex-start; }
#view-profile .form-group label { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; margin-bottom: 8px; width: 100%; }
#view-profile .glass-input { width: 100% !important; box-sizing: border-box; padding: 12px 16px; height: 45px; }
#view-profile .btn-primary { width: 100%; margin-top: 20px; height: 50px; justify-content: center; }

/* Estilos de Foto e Inputs Gerais */
.avatar-wrapper { position: relative; width: 120px; height: 120px; }
.profile-avatar-large { width: 100%; height: 100%; border-radius: 50%; border: 3px solid rgba(255, 208, 40, 0.2); box-shadow: 0 0 30px rgba(0,0,0,0.5); object-fit: cover; transition: all 0.3s ease; }
.avatar-edit-icon { position: absolute; bottom: 5px; right: 5px; background: var(--primary); color: #000; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.3); pointer-events: none; }
.profile-avatar-large:hover { border-color: var(--primary); box-shadow: 0 0 40px var(--primary-glow); }
.readonly-field { opacity: 0.6; cursor: not-allowed; background: rgba(255,255,255,0.02); border-style: dashed; }

/* Animações */
@keyframes floatUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes alertPulse { 0% { box-shadow: inset 0 0 0px var(--danger); } 50% { box-shadow: inset 0 0 100px var(--danger); } }
@keyframes pulseText { 0% { opacity: 1; } 100% { opacity: 0.6; } }
@keyframes lunchPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.7); } 70% { box-shadow: 0 0 0 20px rgba(255, 149, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }

/* --- ESTILOS DO WIZARD (Guia Rápido) --- */
.wizard-container {
    padding: 40px 30px; /* Ajuste de padding */
    text-align: center;
    position: relative;
    height: 450px; 
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Espalha o conteúdo verticalmente */
}

/* Oculta passos inativos e anima a entrada */
.wizard-step {
    display: none;
    animation: fadeIn 0.4s ease; /* Animação ligeiramente mais rápida */
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Alinha ao topo */
    flex: 1; /* Ocupa o espaço disponível acima dos dots */
}
.wizard-step.active {
    display: flex;
}

/* MUDANÇA CRÍTICA: Fixar a altura do parágrafo de texto */
.wizard-step p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
    /* Define uma altura fixa capaz de conter o maior texto (aprox 3 linhas) */
    height: 75px; 
    /* Centraliza o texto verticalmente nesse espaço fixo */
    display: flex;
    align-items: center; 
    justify-content: center;
}

/* Ajuste os controles para ficarem sempre no fundo */
.wizard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: auto; /* Empurra para o final do container */
    padding-top: 20px;
}

.wizard-image {
    width: 80px;
    height: 80px;
    background: var(--primary-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    box-shadow: 0 0 30px var(--primary-dim);
}
.wizard-image span {
    font-size: 40px;
    color: var(--primary);
}

.wizard-step h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.wizard-step p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

/* Dots de navegação */
.wizard-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 30px 0;
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}
.dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 10px;
    box-shadow: 0 0 10px var(--primary-dim);
}

.wizard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Empurra para o fundo */
}

/* --- LUNCH MODE (TRAVAMENTO DA TELA)  --- */

/* Quando o modo almoço ativa */
#app-view.lunch-mode {
    position: relative;
}

/* 1. Desfoca apenas a Sidebar */
#app-view.lunch-mode .sidebar {
    filter: blur(15px) grayscale(80%);
    pointer-events: none;
    opacity: 0.4;
    transition: all 0.5s ease;
}

/* 2. Desfoca os elementos visuais da câmera (Irmãos do botão), 
   SEM desfocar o container pai (.content), para não afetar o botão */
#app-view.lunch-mode .input_video,
#app-view.lunch-mode .output_canvas,
#app-view.lunch-mode .hud-top,
#app-view.lunch-mode #btn-fab-calibrate,
#app-view.lunch-mode .danger-overlay {
    filter: blur(15px) grayscale(80%);
    pointer-events: none; /* Impede cliques no que está atrás */
    opacity: 0.4;
    transition: all 0.5s ease;
}

/* 3. O Botão de Almoço permanece nítido e NO LUGAR DELE */
#app-view.lunch-mode #btn-fab-lunch {
    /* Não alteramos bottom/right, ele respeita o CSS original (#btn-fab-lunch) */
    z-index: 9999; /* Garante que fique acima de tudo */
    pointer-events: auto !important; /* Mantém clicável */
    
    filter: none !important;
    opacity: 1 !important;
    
    /* Apenas muda a aparência para indicar que está ativo (Pausa) */
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 50px var(--primary-glow); /* Brilho intenso para destacar no blur */
    transform: scale(1.1); /* Leve aumento para ênfase, sem sair do lugar */
    animation: pulseLunch 2s infinite;
}

/* Removemos qualquer after que altere o texto, mantendo o ícone original */
#app-view.lunch-mode #btn-fab-lunch::after {
    display: none;
}

@keyframes pulseLunch {
    0% { box-shadow: 0 0 0 0 rgba(255, 208, 40, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(255, 208, 40, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

#calibration-modal .modal-content {
    padding: 40px 30px 30px 30px; /* Mais padding no topo para o título */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(15, 15, 20, 0.9) !important; /* Um pouco mais escuro para contraste */
}

/* Corrige o posicionamento do Título H2 */
#calibration-modal h2 {
    margin-top: 0; /* Remove a margem superior padrão que causava a sobreposição com o 'X' */
    margin-bottom: 15px;
    font-size: 1.8rem;
}

/* Ajuste do texto de instrução */
#calibration-modal p#calib-instruction {
    margin-bottom: 30px;
    font-size: 1.1rem;
    height: auto; /* Garante que não herde altura fixa de outros lugares */
}

/* Garante que o botão de fechar 'X' esteja no topo direito e visível */
#calibration-modal .close-btn {
    top: 25px !important;
    right: 25px !important;
    z-index: 10;
    font-size: 1.5rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}
#calibration-modal .close-btn:hover {
    opacity: 1;
}

/* --- RELATÓRIOS & MAPA DE CALOR (UPGRADE) --- */
.heatmap-wrapper {
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    position: relative; /* Para o tooltip funcionar */
}

.heatmap-grid {
    display: grid;
    /* Nome (160px) + 24 Horas + Total (60px) */
    grid-template-columns: 160px repeat(24, 1fr) 60px; 
    gap: 6px;
    min-width: 900px;
}

/* Cabeçalhos */
.heatmap-header-cell {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    padding-bottom: 8px;
    font-family: monospace;
    opacity: 0.6;
}

/* Linha do Usuário */
.heatmap-user-label {
    font-size: 0.85rem;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid rgba(255,255,255,0.1);
    margin-right: 5px;
}

/* Totalizador (Fim da linha) */
.heatmap-total-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-left: 1px solid rgba(255,255,255,0.1);
    margin-left: 5px;
}

/* CÉLULA BASE */
.heatmap-cell {
    height: 32px;
    border-radius: 6px;
    background: rgba(255,255,255,0.02); /* Vazio */
    border: 1px solid rgba(255,255,255,0.03);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    cursor: crosshair;
}

.heatmap-cell:hover {
    transform: scale(1.15);
    z-index: 10;
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

/* --- NÍVEIS DE CALOR (HEAT LEVELS) --- */

/* Nível 1: Leve (1 incidente) - Azul Tech */
.heat-lvl-1 {
    background: rgba(0, 200, 255, 0.15);
    border-color: rgba(0, 200, 255, 0.4);
    box-shadow: inset 0 0 10px rgba(0, 200, 255, 0.05);
}

/* Nível 2: Moderado (2-3 incidentes) - Roxo Neon */
.heat-lvl-2 {
    background: rgba(180, 0, 255, 0.25);
    border-color: rgba(180, 0, 255, 0.5);
    box-shadow: inset 0 0 10px rgba(180, 0, 255, 0.1);
}

/* Nível 3: Alto (4-5 incidentes) - Magenta Hot */
.heat-lvl-3 {
    background: rgba(255, 0, 128, 0.4);
    border-color: rgba(255, 0, 128, 0.7);
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.2);
}

/* Nível 4: Crítico (6+ incidentes) - Laranja/Fogo Nuclear */
.heat-lvl-4 {
    background: rgba(255, 69, 58, 0.6);
    border-color: var(--danger);
    box-shadow: 0 0 15px var(--danger);
    animation: pulseHeat 2s infinite alternate;
}

@keyframes pulseHeat {
    from { box-shadow: 0 0 10px var(--danger); }
    to { box-shadow: 0 0 25px var(--danger); }
}

/* --- TOOLTIP FLUTUANTE CUSTOMIZADO --- */
.heatmap-tooltip {
    position: fixed;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 12px;
    border-radius: 8px;
    pointer-events: none; /* Mouse ignora ele */
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    display: none; /* Escondido por padrão */
    min-width: 150px;
    transform: translate(15px, 15px); /* Offset do mouse */
}

.heatmap-tooltip h4 {
    margin: 0 0 5px 0;
    color: #fff;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}
.heatmap-tooltip span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.heatmap-tooltip strong { color: var(--primary); }

/* --- ITEM DE LOG NO MODAL HEATMAP --- */
.log-item-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}
.log-item-card:hover {
    background: rgba(255, 255, 255, 0.08);
}
.log-time {
    font-family: monospace;
    color: var(--primary);
    font-weight: bold;
    font-size: 0.9rem;
}
.log-reason {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}
.log-type-icon {
    font-size: 1.2rem;
    color: var(--danger);
    margin-right: 10px;
    vertical-align: middle;
}

/* --- BOTÃO DE ÍCONE (Ações da Tabela) --- */
.btn-icon-danger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px; /* Área de clique maior */
    border-radius: 50%;
    transition: all 0.2s ease;
    display: inline-flex; /* Centraliza o ícone */
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.btn-icon-danger:hover {
    background: rgba(255, 69, 58, 0.15); /* Fundo vermelho suave */
    transform: scale(1.1);
}

.btn-icon-danger:active {
    transform: scale(0.95);
}

.btn-icon-danger span {
    color: var(--danger);
    font-size: 20px; /* Tamanho padronizado */
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-icon-danger:hover span {
    opacity: 1;
}

/* --- LGPD SCROLL AREA --- */
.lgpd-text-scroll p {
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 15px;
}
.lgpd-text-scroll::-webkit-scrollbar {
    width: 6px;
}
.lgpd-text-scroll::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
.lgpd-text-scroll::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

/* --- MINHA ASSINATURA --- */
.dev-footer {
    margin-top: 15px;
    font-size: 0.73rem; /* Pequeno e discreto */
    color: var(--text-muted);
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--glass-border); /* Separação sutil do botão logout */
    line-height: 1.6;
    transition: var(--transition);
}

.dev-footer:hover {
    color: #fff;
    opacity: 1;
}

.dev-footer a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s;
}

.dev-footer a:hover {
    text-decoration: underline;
    color: var(--primary); /* Efeito hover dourado */
}

.verified-badge {
    color: #1DA1F2; /* Azul verificado oficial */
    font-size: 0.85em;
    vertical-align: middle;
    margin-left: 2px;
}

/* Garante que suma visualmente quando a sidebar estiver desfocada (Lunch Mode) */
#app-view.lunch-mode .dev-footer {
    opacity: 0;
    pointer-events: none;
}

/* --- ESTILO PAINEL DE EQUIPE (TECH DESIGN) --- */

/* Container Principal (Card de Vidro) */
.tech-panel {
    background: linear-gradient(145deg, rgba(20, 20, 25, 0.9) 0%, rgba(10, 10, 12, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
}

/* Barra de Ferramentas (Topo) */
.tech-toolbar {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 15px;
    align-items: center;
    flex-shrink: 0;
}

/* Inputs Estilizados */
.tech-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    outline: none;
}
.tech-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 208, 40, 0.1);
}

/* Lista com Scroll */
.tech-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Item da Lista (Linha do Usuário) */
.tech-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-bottom: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.tech-list-item:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border-color: rgba(255, 208, 40, 0.3);
    transform: translateX(5px);
    box-shadow: -4px 0 0 var(--primary);
}

/* Badges de Cargo (Neon) */
.badge-neon {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
}

.badge-owner { 
    background: rgba(255, 69, 58, 0.15); 
    color: #FF453A; 
    border: 1px solid rgba(255, 69, 58, 0.4);
    box-shadow: 0 0 15px rgba(255, 69, 58, 0.1);
}

.badge-admin { 
    background: rgba(255, 208, 40, 0.15); 
    color: #FFD028; 
    border: 1px solid rgba(255, 208, 40, 0.4);
    box-shadow: 0 0 15px rgba(255, 208, 40, 0.1);
}

.badge-guard { 
    background: rgba(50, 215, 75, 0.15); 
    color: #32D74B; 
    border: 1px solid rgba(50, 215, 75, 0.4);
    box-shadow: 0 0 15px rgba(50, 215, 75, 0.1);
}

.badge-user {
    background: rgba(255, 255, 255, 0.1); 
    color: #fff; 
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    vertical-align: middle;
    margin-right: 10px;
}

/* Menu de Ações - Glassmorphism de Alta Definição */
.team-actions-menu {
    background: rgba(20, 20, 25, 0.8) !important;
    backdrop-filter: blur(20px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
    border-radius: 12px !important;
    padding: 6px !important;
    z-index: 1000 !important;
    min-width: 180px !important;
    /* Animação suave de entrada */
    animation: menuAppear 0.2s ease-out !important;
}

@keyframes menuAppear {
    from { opacity: 0; transform: translateY(-5px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Itens do Menu - Reset total de estilos de botão nativo */
.team-menu-item {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    padding: 10px 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    text-align: left !important;
    transition: background 0.2s ease !important;
}

.team-menu-item:hover {
    background: rgba(255, 208, 40, 0.1) !important;
    color: var(--primary) !important;
}

.team-menu-item span.material-icons-round {
    font-size: 18px !important;
    opacity: 0.8 !important;
}

/* Divisor sutil */
.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 8px;
}

#debug-lock-overlay:hover {
    background: rgba(255, 208, 40, 0.1);
}

#debug-lock-overlay:hover span {
    transform: scale(1.2);
}

#btn-re-lock:hover {
    background: #d32f2f;
}

#admin-unlock-pass:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-dim);
}

@keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }