:root {
    --midnight-core: #07111F;
    --graphite: #111827;
    --electric-blue: #2563FF;
    --neon-cyan: #00E5FF;
    --ice-white: #F5F7FA;
    --text-muted: #8B9BB4;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Sora', sans-serif; }
body { background-color: var(--midnight-core); color: var(--ice-white); display: flex; height: 100vh; overflow: hidden; }

/* Wrapper Principal */
.wrapper { display: flex; width: 100%; height: 100%; }

/* Sidebar - Premium Matte */
.sidebar { width: 260px; background: #040A14; padding: 30px; display: flex; flex-direction: column; flex-shrink: 0; border-right: 1px solid rgba(255, 255, 255, 0.03); }

/* Logo e Slogan no Topo */
.sidebar-header { text-align: center; margin-bottom: 40px; }
.logo-symbol { font-size: 36px; color: var(--neon-cyan); margin-bottom: 10px; text-shadow: 0 0 15px rgba(0, 229, 255, 0.5); }
.brand-name { font-size: 20px; font-weight: 700; color: var(--ice-white); }
.brand-slogan { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* Menu da Sidebar */
.sidebar-menu { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.sidebar-menu a { color: var(--text-muted); text-decoration: none; padding: 12px 15px; border-radius: 10px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 15px; transition: all 0.3s; }
.sidebar-menu a i { font-size: 18px; }
.sidebar-menu a:hover, .sidebar-menu a.active { background: rgba(37,99,255,0.08); color: var(--neon-cyan); }
.sidebar-menu a.active { border-left: 3px solid var(--neon-cyan); }

/* Main Content Area */
.main-content { flex-grow: 1; padding: 40px; overflow-y: auto; }
.content-header { margin-bottom: 40px; }
.content-header h1 { font-size: 26px; font-weight: 600; margin-bottom: 5px; }
.content-header p { color: var(--text-muted); font-size: 14px; }

/* Grid de Métricas (Dashboard) com Glow */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.metric-card { background: var(--graphite); padding: 25px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); transition: box-shadow 0.3s; }
.metric-card:hover { border-color: var(--neon-cyan); box-shadow: 0 0 20px rgba(0, 229, 255, 0.1); }
.metric-title { font-size: 14px; color: var(--text-muted); font-weight: 600; margin-bottom: 15px; }
.metric-value { font-size: 36px; font-weight: 700; color: var(--ice-white); }

/* Botões de Ação */
.action-buttons { display: flex; gap: 15px; margin-bottom: 40px; }
.btn-action { border: none; padding: 14px 28px; border-radius: 14px; font-weight: 600; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: all 0.3s; }
.btn-primary { background-color: var(--electric-blue); color: #fff; box-shadow: 0 4px 15px rgba(37,99,255,0.3); }
.btn-primary:hover { background-color: #1a4dcf; box-shadow: 0 6px 20px rgba(37,99,255,0.5); }
.btn-outline { background-color: transparent; color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1); }
.btn-outline:hover { border-color: var(--ice-white); color: var(--ice-white); }

/* Tabela de Logs */
.logs-container { background: var(--graphite); border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); padding: 25px; }
.logs-container h3 { margin-bottom: 20px; font-size: 16px; font-weight: 600; }
.terminal { background: #000; padding: 15px; height: 250px; width: 100%; overflow-y: auto; font-family: monospace; font-size: 12px; color: var(--text-muted); line-height: 1.6; border-radius: 10px; }

/* Estilos para os Botões de Worker (Pills) */
.workers-section { margin-bottom: 25px; display: flex; align-items: center; gap: 15px; background: rgba(0,0,0,0.2); padding: 15px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.03); }
.workers-label { font-size: 13px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.worker-pills { display: flex; gap: 8px; }
.worker-pill { background: var(--graphite); border: 2px solid rgba(255,255,255,0.05); color: var(--text-muted); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 16px; transition: all 0.3s; display: flex; align-items: center; justify-content: center; outline: none; }
.worker-pill:hover { border-color: rgba(37,99,255,0.3); color: var(--ice-white); }
.worker-pill.active { background: rgba(37,99,255,0.1); border-color: var(--neon-cyan); color: var(--neon-cyan); box-shadow: 0 0 15px rgba(0, 229, 255, 0.2); }

/* Contêiner do Gráfico Vivo */
.graph-container { background: var(--graphite); border-radius: 16px; padding: 25px; height: 350px; margin-bottom: 40px; border: 1px solid rgba(255,255,255,0.05); position: relative; }
.graph-container h3 { font-size: 16px; font-weight: 600; margin-bottom: 20px; color: var(--ice-white); }

/* --- Menu Minha Conta (Footer) --- */
.user-account-dropdown { position: relative; width: 100%; }
.user-profile-btn { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.03); padding: 12px 15px; border-radius: 12px; cursor: pointer; border: 1px solid rgba(255,255,255,0.05); transition: all 0.3s; }
.user-profile-btn:hover { background: rgba(37,99,255,0.1); border-color: rgba(37,99,255,0.3); }

.avatar-circle { width: 35px; height: 35px; background: linear-gradient(135deg, var(--electric-blue), #7C3AED); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; position: relative; }
.status-dot { position: absolute; bottom: 0; right: -2px; width: 10px; height: 10px; background: var(--neon-cyan); border-radius: 50%; border: 2px solid #040A14; box-shadow: 0 0 5px var(--neon-cyan); }

.user-info-text { display: flex; flex-direction: column; flex-grow: 1; }
.user-name { font-size: 13px; font-weight: 600; color: var(--ice-white); }
.user-role { font-size: 11px; color: var(--text-muted); }
.drop-icon { font-size: 12px; color: var(--text-muted); transition: transform 0.3s; }

/* Menu Suspenso (Dropdown) */
.dropdown-content { position: absolute; bottom: 100%; left: 0; width: 100%; background: var(--graphite); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; margin-bottom: 10px; padding: 10px; display: none; flex-direction: column; gap: 5px; box-shadow: 0 -10px 20px rgba(0,0,0,0.4); z-index: 100; }
.dropdown-content.show { display: flex; }
.dropdown-content a { color: var(--text-muted); text-decoration: none; font-size: 13px; padding: 10px 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px; transition: all 0.2s; }
.dropdown-content a:hover { background: rgba(255,255,255,0.05); color: var(--ice-white); }
.dropdown-content .divider { height: 1px; background: rgba(255,255,255,0.05); margin: 5px 0; }
.dropdown-content a.text-danger:hover { background: rgba(248,113,113,0.1); color: #f87171; }

/* --- Janelas Modais de Perfil e Senha --- */
.account-modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 2000; backdrop-filter: blur(4px); }
.account-modal.show { display: flex; }
.account-modal-content { background: var(--graphite); border: 1px solid rgba(255,255,255,0.05); padding: 30px; border-radius: 16px; width: 380px; box-shadow: 0 15px 40px rgba(0,0,0,0.6); }
.account-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.account-modal-header h3 { font-size: 16px; font-weight: 600; color: var(--ice-white); }
.close-modal-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; transition: color 0.2s; }
.close-modal-btn:hover { color: #f87171; }

.modal-form { display: flex; flex-direction: column; gap: 15px; }
.modal-input-group { display: flex; flex-direction: column; gap: 8px; }
.modal-input-group label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.modal-input-group input { padding: 12px 15px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: var(--bg-darker); color: var(--ice-white); outline: none; font-family: 'Sora'; transition: border 0.3s; }
.modal-input-group input:focus { border-color: var(--electric-blue); }

/* =========================================
   RESPONSIVIDADE MOBILE (APP)
   ========================================= */
@media (max-width: 768px) {
    /* Esconde a sidebar no celular */
    .sidebar { display: none !important; }
    
    /* Ajusta o fundo e o espaçamento principal */
    .wrapper { display: block; width: 100%; }
    .main-content { padding: 20px 15px; width: 100%; }
    
    /* Empilha os formulários e botões */
    .form-grid { grid-template-columns: 1fr; gap: 12px; }
    .btn-neon { width: 100%; margin-top: 10px; }
    
    /* Ajustes de cabeçalho e cards */
    .page-header h1 { font-size: 20px; }
    .glass-card { padding: 15px; border-radius: 12px; margin-bottom: 15px; }
    
    /* Libera a rolagem horizontal nas tabelas para não quebrar a tela */
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .premium-table th, .premium-table td { white-space: nowrap; font-size: 12px; padding: 12px 15px; }
    
    /* Ajustes específicos do Dashboard (se houver) */
    .metrics-grid { grid-template-columns: 1fr 1fr !important; }
    .action-buttons { flex-direction: column; }
    .btn-action { width: 100%; margin-bottom: 10px; }
}
