@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* --- 1. VARIÁVEIS GLOBAIS --- */
:root {
    --primary: #4F46E5; 
    --primary-dark: #4338ca;
    --primary-light: #EEF2FF;
    --bg-body: #F3F4F6;
    --bg-panel: #FFFFFF;
    --text-main: #111827;
    --text-sec: #6B7280;
    --border-color: #E5E7EB;
    --radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    --bg-body: #0F172A;
    --bg-panel: #1E293B;
    --text-main: #F9FAFB;
    --text-sec: #94A3B8;
    --border-color: #334155;
    --primary-light: rgba(79, 70, 229, 0.15);
}

/* --- 2. RESET GERAL --- */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; list-style: none; text-decoration: none; outline: none;}

body {
    background: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* --- 3. LOGIN & FORMULÁRIOS --- */
.login-body { align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.login-card {
    background: var(--bg-panel); width: 100%; max-width: 400px; padding: 40px;
    border-radius: var(--radius); box-shadow: var(--shadow-md); border: 1px solid var(--border-color);
    animation: slideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.logo-area { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 30px; }
.logo-icon { width: 40px; height: 40px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; }
.logo-text { font-size: 22px; font-weight: 700; color: var(--text-main); letter-spacing: -0.5px; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }

/* Wrapper do Ícone */
.input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.input-wrapper i { 
    position: absolute; 
    left: 14px; 
    color: var(--text-sec); 
    font-size: 20px; 
    z-index: 10; 
    pointer-events: none; 
}

/* Estilo Base dos Inputs */
.form-input, .form-control {
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    border-radius: 12px;
    font-size: 14px; 
    color: var(--text-main); 
    transition: all 0.3s; 
    background: var(--bg-body);
}

/* CORREÇÃO DE ENCAVALAMENTO */
.input-wrapper .form-control,
.input-wrapper input,
.input-wrapper select {
    padding-left: 44px !important;
}

/* CORREÇÃO DO MENU BRANCO NO SELECT */
select option {
    background-color: var(--bg-panel);
    color: var(--text-main);
}

.form-input:focus, .form-control:focus { border-color: var(--primary); background: var(--bg-panel); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.btn-login, .btn-primary {
    width: 100%; padding: 14px; background: var(--primary); color: white; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover, .btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* --- 4. SIDEBAR --- */
.dashboard-body { display: flex; width: 100%; }
.sidebar {
    width: 280px; background: var(--bg-panel); height: 100%; display: flex; flex-direction: column;
    border-right: 1px solid var(--border-color); transition: var(--transition); z-index: 50; flex-shrink: 0;
}
.logo-area-sidebar { height: 80px; display: flex; align-items: center; padding: 0 24px; gap: 12px; border-bottom: 1px solid var(--border-color); }
.nav-menu { padding: 24px 16px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-sec); margin: 0 0 10px 12px; font-weight: 600; }
.nav-item { margin-bottom: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px;
    color: var(--text-sec); font-weight: 500; transition: var(--transition); position: relative;
}
.nav-link:hover, .nav-link.active { background: var(--primary-light); color: var(--primary); }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: 20px; width: 4px; background: var(--primary); border-radius: 0 4px 4px 0; }
.user-mini-card { padding: 20px; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 12px; cursor: pointer; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.user-info h4 { font-size: 14px; color: var(--text-main); }
.user-info span { font-size: 12px; color: var(--text-sec); }

/* --- 5. DASHBOARD MAIN (CORREÇÃO DE TÍTULO AQUI) --- */
.main-content { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; position: relative; }
.top-header {
    height: 80px; background: var(--bg-panel); display: flex; justify-content: space-between; align-items: center;
    padding: 0 32px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}

/* NOVO: Estilos para o título da página */
.header-title h1 { 
    font-size: 20px; /* Reduzido de 24px para evitar quebras */
    font-weight: 700; 
    margin-bottom: 2px; 
}
.header-title p { 
    font-size: 13px; 
    color: var(--text-sec); 
    margin: 0;
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.btn-icon {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center; color: var(--text-sec);
    background: var(--bg-panel); cursor: pointer; transition: var(--transition);
}
.btn-icon:hover { background: var(--bg-body); color: var(--primary); border-color: var(--primary); }
.scroll-area { flex: 1; overflow-y: auto; padding: 32px; }

/* --- 6. PAINEL DE PERSONALIZAÇÃO & NOTIFICAÇÕES --- */
.settings-panel {
    position: fixed; top: 0; right: -320px; width: 320px; height: 100%;
    background: var(--bg-panel); border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 25px rgba(0,0,0,0.1); z-index: 100; padding: 24px;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.settings-panel.open { right: 0; }
.settings-header { display: flex; justify-content: space-between; margin-bottom: 30px; }

.color-options { display: flex; gap: 15px; margin-bottom: 30px; padding: 5px; flex-wrap: wrap; }
.color-circle { 
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer; 
    border: 3px solid rgba(0,0,0,0.05); transition: transform 0.2s; flex-shrink: 0; 
}
.color-circle:hover { transform: scale(1.15); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.notification-wrapper { position: relative; cursor: pointer; }
.badge-notify {
    position: absolute; top: -5px; right: -5px;
    background: #EF4444; color: white; border-radius: 50%;
    width: 18px; height: 18px; font-size: 10px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg-panel);
}
.notify-dropdown {
    position: absolute; top: 50px; right: 0; width: 320px;
    background: var(--bg-panel); border: 1px solid var(--border-color);
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: none; z-index: 1000; overflow: hidden; animation: slideUp 0.2s ease;
}
.notify-dropdown.show { display: block; }
.notify-header { padding: 15px; border-bottom: 1px solid var(--border-color); font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; }
.notify-list { max-height: 300px; overflow-y: auto; }
.notify-item { padding: 15px; border-bottom: 1px solid var(--border-color); display: flex; gap: 12px; transition: 0.2s; cursor: pointer; }
.notify-item:hover { background: var(--bg-body); }
.notify-item.unread { background: var(--primary-light); }
.notify-icon-box { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: white; }
.notify-icon-box.aviso { background: #3B82F6; }
.notify-icon-box.alerta { background: #F59E0B; }
.notify-icon-box.sucesso { background: #10B981; }
.notify-content h5 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.notify-content p { font-size: 12px; color: var(--text-sec); line-height: 1.4; }
.notify-time { font-size: 10px; color: var(--text-sec); margin-top: 5px; display: block;}

/* --- 7. RESPONSIVO (CORRIGIDO PARA TÍTULOS) --- */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); z-index: 40;
    display: none; opacity: 0; transition: opacity 0.3s;
}
.overlay.active { display: block; opacity: 1; }
.menu-toggle { display: none; font-size: 24px; cursor: pointer; }

@media (max-width: 992px) {
    .sidebar { position: fixed; left: -280px; }
    .sidebar.active { left: 0; }
    .menu-toggle { display: block; }
    
    /* NOVO: Ajustes para celular */
    .header-title h1 { font-size: 16px; } /* Título bem menor no celular */
    .header-title p { display: none; } /* Esconde o subtítulo para ganhar espaço */
    .top-header { padding: 0 20px; }
}

/* Container que se adapta à tela */
.form-container { 
    background: var(--bg-panel); 
    padding: 30px; 
    border-radius: var(--radius); 
    border: 1px solid var(--border-color); 
    
    /* MUDANÇA AQUI: */
    width: 100%;       /* Ocupa tudo o que der */
    max-width: 1400px; /* Limite maior para telas ultra-wide (opcional, pode tirar se quiser infinito) */
    margin: 0;         /* Remove margem automática que centralizava */
}

/* Ajuste para telas gigantes (opcional) */
@media (min-width: 1600px) {
    .form-grid {
        gap: 30px; /* Aumenta o espaço entre colunas em telas grandes */
    }
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media(max-width: 768px) { .form-grid { grid-template-columns: 1fr; } }
.error-msg { background: #FEF2F2; color: #991B1B; padding: 12px; border-radius: 8px; border: 1px solid #FEE2E2; margin-bottom: 20px; text-align: center; }
.success-msg { background: #DCFCE7; color: #166534; padding: 12px; border-radius: 8px; border: 1px solid #BBF7D0; margin-bottom: 20px; text-align: center; }

/* --- 8. LOGIN SPLIT SCREEN --- */
.split-screen { display: flex; height: 100vh; width: 100%; overflow: hidden; }
.split-left {
    flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: var(--bg-panel); padding: 40px; position: relative; z-index: 2;
}
.split-right {
    flex: 1.5; position: relative; background-color: var(--primary);
    background-image: url('https://images.unsplash.com/photo-1545324418-cc1a3fa10c00?q=80&w=2070&auto=format&fit=crop'); 
    background-size: cover; background-position: center;
}
.split-right::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6)); }
.login-card-clean { width: 100%; max-width: 380px; background: transparent; border: none; box-shadow: none; animation: slideUp 0.6s ease; }
.hero-text { position: absolute; bottom: 50px; left: 50px; color: white; z-index: 3; max-width: 500px; }
.hero-text h2 { font-size: 32px; font-weight: 700; margin-bottom: 10px; }
.hero-text p { font-size: 16px; opacity: 0.9; }
@media (max-width: 900px) { .split-right { display: none; } .split-left { flex: 1; background: var(--bg-body); } }