/* style.css - Clean & Professional Church UI */

:root {
    --primary: #2c3e50; /* Azul Escuro Sório */
    --secondary: #34495e;
    --accent: #e67e22; /* Laranja para destaque */
    --bg: #f4f6f9;
    --white: #ffffff;
    --text: #333333;
    --gray: #95a5a6;
    --success: #27ae60;
    --danger: #c0392b;
    --border-radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body { background-color: var(--bg); color: var(--text); height: 100vh; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.login-container { background: var(--white); padding: 2rem; border-radius: var(--border-radius); width: 100%; max-width: 400px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); text-align: center; }

/* Logo no Login */
.login-container .logo-img { max-width: 120px; margin-bottom: 1rem; }
.login-container h1 { font-size: 1.5rem; margin: 0.5rem 0; color: var(--primary); }

/* Dashboard Layout */
.app-container { display: flex; height: 100vh; }

/* Sidebar */
.sidebar { width: 260px; background: var(--primary); color: var(--white); display: flex; flex-direction: column; flex-shrink: 0; transition: all 0.3s; }

.sidebar .brand { 
    padding: 1.5rem; 
    font-size: 1.2rem; 
    font-weight: bold; 
    border-bottom: 1px solid rgba(255,255,255,0.1); 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    background: rgba(0,0,0,0.1);
}
.brand-logo-small { height: 35px; width: auto; }

.sidebar .user-info { padding: 2rem 1.5rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }

/* Avatar Dinâmico */
.avatar-container {
    width: 80px; 
    height: 80px; 
    margin: 0 auto 15px; 
    position: relative;
}
.avatar { 
    width: 100%; 
    height: 100%; 
    background: var(--accent); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 2rem; 
    color: white;
    overflow: hidden; /* Garante que a imagem não saia do círculo */
    border: 3px solid rgba(255,255,255,0.2);
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar nav { flex: 1; padding-top: 1rem; overflow-y: auto; }
.sidebar nav a { display: block; padding: 1rem 1.5rem; color: #bdc3c7; text-decoration: none; transition: 0.3s; display: flex; align-items: center; gap: 12px; font-size: 0.95rem; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,0.05); color: var(--white); border-left: 4px solid var(--accent); }
.sidebar nav a.logout { margin-top: auto; color: #e74c3c; border-top: 1px solid rgba(255,255,255,0.05); }
.sidebar nav a.logout:hover { background: rgba(231, 76, 60, 0.1); border-left: 4px solid #e74c3c; }

/* Content */
.content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; background: #f4f6f9; }
.content header { background: var(--white); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #e1e4e8; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.content header h2 { font-size: 1.4rem; color: var(--secondary); }
.dashboard-content { padding: 2rem; max-width: 1400px; margin: 0 auto; width: 100%; }

/* Components */
.welcome-banner { background: var(--white); padding: 2rem; border-radius: var(--border-radius); border-left: 5px solid var(--accent); margin-bottom: 2rem; box-shadow: 0 4px 6px rgba(0,0,0,0.02); display: flex; justify-content: space-between; align-items: center; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.card { background: var(--white); padding: 1.5rem; border-radius: var(--border-radius); box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: transform 0.2s, box-shadow 0.2s; border: 1px solid #f0f0f0; }
.card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px rgba(0,0,0,0.05); border-color: transparent; }
.card .icon { font-size: 2rem; color: var(--primary); margin-bottom: 1rem; opacity: 0.8; }
.card.financial .icon { color: var(--success); }
.card h4 { color: var(--gray); font-size: 0.85rem; text-transform: uppercase; margin-bottom: 0.5rem; letter-spacing: 0.5px; }
.card p { font-size: 1.8rem; font-weight: 700; color: var(--secondary); }

.module-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

/* Tables */
.table-container { background: var(--white); border-radius: var(--border-radius); overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.02); border: 1px solid #eee; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem 1.5rem; text-align: left; border-bottom: 1px solid #f0f0f0; }
th { background: #f8f9fa; font-weight: 600; color: var(--secondary); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #f8f9fa; }

/* Forms & Buttons */
.btn-primary { background: var(--primary); color: var(--white); padding: 0.7rem 1.5rem; border: none; border-radius: 6px; cursor: pointer; transition: 0.2s; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;}
.btn-primary:hover { background: #1a252f; transform: translateY(-1px); }
.btn-block { width: 100%; justify-content: center; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.9rem; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; transition: border 0.3s; background: #fff; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1); }

.btn-sm { padding: 0.4rem 0.6rem; border: none; border-radius: 3px; cursor: pointer; color: white; margin-left: 5px; }
.edit { background: var(--accent); }
.delete { background: var(--danger); }

/* Utilities */
.badge { padding: 0.35rem 0.8rem; border-radius: 50px; font-size: 0.75rem; font-weight: 700; color: white; display: inline-block; }
.badge.entry { background: var(--success); }
.badge.exit { background: var(--danger); }
.badge.role { background: #95a5a6; }
.badge.neutral { background: var(--primary); }

.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.panel { background: var(--white); padding: 1.5rem; border-radius: var(--border-radius); }
.list-item { padding: 0.8rem 0; border-bottom: 1px solid #eee; }

.alert { padding: 1rem; border-radius: 4px; margin-bottom: 1rem; }
.alert.error { background: #fadbd8; color: #721c24; border: 1px solid #f5c6cb; }
.alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert.warning { background: #fff3cd; color: #856404; }

/* MODAL STYLES (NOVO) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 5% from the top and centered */
    padding: 2rem;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    animation: slideIn 0.3s;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover,
.close:focus {
    color: var(--danger);
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {opacity: 0}
    to {opacity: 1}
}
@keyframes slideIn {
    from {transform: translateY(-50px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; }
    .sidebar nav { display: none; } /* Simplificação para mobile por enquanto */
    .grid-2-col { grid-template-columns: 1fr; }
}