/* ===================================
   Sistema de Finanzas de Iglesias
   Estilos CSS
   =================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    font-size: 15px;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: white;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-wrap: wrap;
    gap: 0.5rem;
}
.nav-brand a { color: white; font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.nav-menu { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.nav-link {
    color: rgba(255,255,255,0.85); padding: 0.5rem 0.8rem; border-radius: 6px;
    font-size: 0.9rem; transition: all 0.2s; text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,0.15); color: white; text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 0.8rem; }
.nav-username { font-size: 0.85rem; opacity: 0.9; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* Page */
.page-title { font-size: 1.6rem; font-weight: 700; color: #1e3a5f; margin-bottom: 1.5rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }

/* Cards */
.card { background: white; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.08); overflow: hidden; margin-bottom: 1rem; }
.card-header { background: #f8f9fa; padding: 1rem 1.5rem; border-bottom: 1px solid #e9ecef; display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 1.1rem; color: #1e3a5f; margin: 0; }
.card-body { padding: 1.5rem; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: white; border-radius: 10px; padding: 1.2rem; text-align: center; box-shadow: 0 1px 6px rgba(0,0,0,0.08); border-left: 4px solid #ddd; }
.stat-card.stat-primary { border-left-color: #2563eb; }
.stat-card.stat-success { border-left-color: #16a34a; }
.stat-card.stat-danger { border-left-color: #dc2626; }
.stat-card.stat-warning { border-left-color: #f59e0b; }
.stat-card.stat-info { border-left-color: #0891b2; }
.stat-number { font-size: 1.5rem; font-weight: 700; color: #1e3a5f; }
.stat-label { font-size: 0.85rem; color: #666; margin-top: 0.3rem; }
.stat-details { font-size: 0.8rem; margin-top: 0.5rem; }
.stat-inline { font-size: 1.3rem; font-weight: 700; padding: 0.3rem 0; }

/* Tables */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #e9ecef; font-size: 0.9rem; }
.table thead th { background: #f8f9fa; font-weight: 600; color: #555; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.3px; }
.table tbody tr:hover { background-color: #f8f9fa; }
.row-inactive { opacity: 0.5; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-small { font-size: 0.8rem; }

/* Badges */
.badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-info { background: #cffafe; color: #0891b2; }
.badge-secondary { background: #e5e7eb; color: #6b7280; }

/* Buttons */
.btn {
    display: inline-block; padding: 0.55rem 1.2rem; border: none; border-radius: 6px;
    font-size: 0.9rem; font-weight: 500; cursor: pointer; text-decoration: none;
    text-align: center; transition: all 0.2s; line-height: 1.4;
}
.btn:hover { opacity: 0.85; text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: #2563eb; color: white; }
.btn-success { background: #16a34a; color: white; }
.btn-danger { background: #dc2626; color: white; }
.btn-warning { background: #f59e0b; color: #333; }
.btn-info { background: #0891b2; color: white; }
.btn-secondary { background: #6b7280; color: white; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.btn-block { display: block; width: 100%; }

/* Alerts */
.alert { padding: 0.9rem 1.2rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; border-left: 4px solid; }
.alert-success { background: #dcfce7; color: #166534; border-color: #16a34a; }
.alert-danger { background: #fee2e2; color: #991b1b; border-color: #dc2626; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.alert-info { background: #cffafe; color: #155e75; border-color: #0891b2; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; color: #444; }
.form-group label small { font-weight: 400; color: #888; }
.form-control {
    width: 100%; padding: 0.6rem 0.9rem; border: 2px solid #e2e8f0; border-radius: 8px;
    font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s; background: white; font-family: inherit;
}
.form-control:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; }
input[type="file"].form-control { padding: 0.5rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-col { flex: 1; min-width: 200px; }
.form-actions { display: flex; gap: 0.8rem; margin-top: 1rem; }

/* Colors */
.text-success { color: #16a34a; }
.text-danger { color: #dc2626; }
.text-muted { color: #9ca3af; }

/* Spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* Login */
.login-body { background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-container { width: 100%; max-width: 420px; padding: 1rem; }
.login-card { background: white; border-radius: 16px; padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 3rem; margin-bottom: 0.3rem; }
.login-header h2 { font-size: 1.4rem; color: #1e3a5f; margin-bottom: 0.3rem; }
.login-header p { color: #666; font-size: 0.9rem; }

/* Footer */
.footer { text-align: center; padding: 1.5rem; color: #999; font-size: 0.8rem; margin-top: 2rem; border-top: 1px solid #e9ecef; }

/* Filter */
.filter-form .form-row { align-items: flex-end; }

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 0.8rem 1rem; flex-direction: column; align-items: flex-start; }
    .nav-menu { width: 100%; justify-content: flex-start; }
    .nav-link { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
    .container { padding: 1rem; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .form-row { flex-direction: column; }
    .form-col { min-width: 100%; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .table th, .table td { padding: 0.5rem; font-size: 0.8rem; }
    .btn-sm { padding: 0.2rem 0.5rem; font-size: 0.7rem; }
}
@media (max-width: 480px) {
    .login-card { padding: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr; }
}
