:root {
    /* Suas Cores Oficiais */
    --primary: #0b98df;      /* Azul Logo */
    --gray-brand: #929091;   /* Cinza Logo */
    
    /* Cores de Suporte */
    --danger: #e74c3c;       /* Vermelho (Despesa) */
    --warning: #f39c12;      /* Laranja (Atrasos/Edição) */
    --secondary: #2c3e50;    /* O Azul Escuro que você gostou no login */
    --bg: #f4f7f6;
    --white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }

body { background-color: var(--bg); color: var(--secondary); overflow-x: hidden; }

.hidden { display: none !important; }

/* --- LOGIN (Restaurado para o azul escuro original) --- */
#login-screen {
    height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background: var(--secondary);
}

.login-card {
    background: var(--white); 
    padding: 40px; 
    border-radius: 15px; 
    width: 90%; 
    max-width: 350px; 
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.logo i { color: var(--primary); width: 60px; height: 60px; margin-bottom: 10px; }

/* --- HEADER & MENU --- */
header {
    background: var(--secondary); 
    color: white; 
    padding: 5px 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    position: sticky; 
    top: 0; 
    z-index: 100; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#menu-btn { background: none; border: none; color: white; cursor: pointer; display: flex; align-items: center; }
#screen-title { font-size: 1.1rem; font-weight: 500; }

#side-menu {
    position: fixed; left: -280px; top: 0; width: 280px; height: 100%; 
    background: var(--white); z-index: 200; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}
#side-menu.active { left: 0; }

/* --- CABEÇALHO DO MENU (MAIS COMPACTO) --- */
.menu-header { 
    background: var(--bg); 
    text-align: center; 
    padding: 15px 20px; /* Reduzido de 30px para 15px */
    border-bottom: 1px solid #eee; 
}

/* --- AVATAR MÉDIO (DIMINUÍDO PARA GANHAR ESPAÇO) --- */
.avatar-md { 
    width: 55px; /* Reduzido de 70px para 55px */
    height: 55px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 3px solid var(--primary); 
}

.avatar-sm { 
    width: 35px; 
    height: 35px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 2px solid var(--white); 
}

/* --- LISTA DE ITENS (MAIS PRÓXIMOS) --- */
.menu-list { 
    list-style: none; 
    margin-top: 5px; /* Reduzido de 10px para 5px */
}

.menu-list li {
    padding: 10px 25px; /* Reduzido de 15px para 10px */
    display: flex; 
    align-items: center; 
    gap: 15px;
    cursor: pointer; 
    color: var(--secondary); 
    transition: 0.2s; 
    font-weight: 500;
}

.menu-list li:hover { 
    background: #f0f0f0; 
    border-left: 4px solid var(--primary); 
}

/* --- BOTÃO SAIR (AJUSTE DE MARGEM) --- */
.menu-list li.logout { 
    color: var(--danger); 
    margin-top: 10px; /* Reduzido de 20px para 10px */
    border-top: 1px solid #eee; 
}

.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: none; z-index: 150; backdrop-filter: blur(2px);
}

/* --- CONTAINER & CARDS --- */
.container { padding: 20px; padding-bottom: 80px; max-width: 1200px; margin: 0 auto; }
.card { 
    background: var(--white); padding: 20px; border-radius: 12px; margin-bottom: 15px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.03); border: 1px solid #eee; position: relative;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card h3 { font-size: 0.9rem; color: #666; margin-bottom: 5px; text-transform: uppercase; }
.summary-card .main-value { font-size: 1.8rem; font-weight: bold; margin-bottom: 10px; }
.summary-card .sub-values { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; padding-top: 10px; border-top: 1px solid #eee; }
.sub-row { display: flex; justify-content: space-between; }

.val-green { color: var(--primary); }
.val-red { color: var(--danger); }
.val-orange { color: var(--warning); }
.val-blue { color: #3498db; }

/* --- FILTROS & PAGINAÇÃO --- */
.filter-bar {
    background: white; padding: 15px; border-radius: 12px; margin-bottom: 20px;
    display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.filter-group { flex: 1; min-width: 120px; }
.filter-group label { margin-bottom: 5px; font-size: 0.8rem; font-weight: bold; color: #555; display: block;}
.filter-btn { height: 42px; width: auto; padding: 0 20px; margin: 0; background: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; }

.pagination { display: flex; justify-content: center; gap: 10px; align-items: center; margin-top: 20px; }
.page-btn { width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; background: white; border: 1px solid #ddd; color: #555; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { font-size: 0.9rem; color: #666; }

/* FORMS */
.form-row { display: flex; gap: 15px; margin-bottom: 15px; }
.form-col { flex: 1; display: flex; flex-direction: column; }
label { display: block; margin-bottom: 5px; font-size: 0.85rem; color: #555; font-weight: 600; }
input, select { 
    width: 100%; padding: 10px; border-radius: 6px; border: 1px solid #ccc; 
    font-size: 15px; height: 42px; background: #fff; outline: none;
}
input:focus, select:focus { border-color: var(--primary); }
button { 
    width: 100%; padding: 12px; background: var(--primary); color: white; 
    border: none; border-radius: 8px; font-weight: bold; cursor: pointer; margin-top: 10px; 
}

/* STATUS BADGES */
.status-badge { font-size: 0.7rem; padding: 3px 8px; border-radius: 12px; font-weight: bold; text-transform: uppercase; display: inline-block; margin-bottom: 5px; }
.status-badge.paid { background: #d4edda; color: #155724; }
.status-badge.pending { background: #fff3cd; color: #856404; }
.status-badge.overdue { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.status-badge.expected { background: #e2e3e5; color: #383d41; }
.status-toggle { display: flex; align-items: center; gap: 10px; padding: 10px; background: #f8f9fa; border-radius: 6px; border: 1px solid #eee; }
.status-toggle input { width: 20px; height: 20px; margin: 0; }

.action-btn-group { display: flex; gap: 10px; }
.btn-icon { background: none; border: none; padding: 5px; cursor: pointer; width: auto; margin: 0; }
.btn-icon.edit { color: var(--warning); }
.btn-icon.delete { color: var(--danger); }
.btn-icon.check { color: var(--primary); }
.text-despesa { color: var(--danger); }
.text-receita { color: var(--primary); }

/* MODAL */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(3px);
}
.modal-content {
    background: white; width: 90%; max-width: 500px;
    border-radius: 15px; box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}
.modal-header {
    background: var(--bg); padding: 15px 20px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 1.1rem; }
.close-btn { background: none; border: none; width: auto; color: #999; margin: 0; padding: 0; cursor: pointer;}
.modal-body { padding: 20px; }
/* Cores para os Badges de Status */
.status-badge.paid { 
    background: #d4edda; 
    color: #155724; 
} /* Verde para Quitada/Recebido */

.status-badge.pending { 
    background: #fff3cd; 
    color: #856404; 
} /* Amarelo para Pendente (dentro do prazo) */

.status-badge.overdue { 
    background: #f8d7da; 
    color: #721c24; 
    border: 1px solid #f5c6cb; 
} /* Vermelho para Atrasado */

.status-badge.expected { 
    background: #e1f5fe; 
    color: #01579b; 
} /* Azul claro para "A Receber" */
.login-card input {
    margin-bottom: 12px;
}

.login-card #btn-signup:hover {
    text-decoration: underline;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

#btn-spinner {
    display: inline-block;
}

#btn-spinner.hidden {
    display: none;
}

@media (max-width: 600px) {
    .form-row { flex-direction: column; gap: 10px; margin-bottom: 10px; }
    .form-row.dates { flex-direction: row; }
    .dashboard-grid { grid-template-columns: 1fr; }
}
