* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f4f8;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h2 {
    color: #1e3a8a;
    font-size: 1.5rem;
}

.header p {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #2563eb;
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #1d4ed8;
}

.error-message {
    margin-top: 1rem;
    color: #dc2626;
    background-color: #fef2f2;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    text-align: center;
    display: none;
}

/* Layout del Dashboard */
.dashboard-body {
    display: block;
    background-color: #f8fafc;
}

.topbar {
    height: 60px;
    background-color: #1e3a8a;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.main-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 240px;
    background-color: #1e293b;
    color: white;
    padding: 1rem 0;
}

.sidebar ul {
    list-style: none;
}

.sidebar a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
}

.sidebar a:hover, .sidebar a.active {
    background-color: #334155;
    color: white;
}

.content {
    flex: 1;
    padding: 2rem;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Tablas */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background-color: #f1f5f9;
    color: #475569;
}

/* Botones y Modales */
.btn-primary {
    background-color: #2563eb;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary {
    background-color: #64748b;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-logout {
    background-color: #ef4444;
    color: white;
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    width: 400px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Estilos para el Dashboard / Resumen */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-left: 5px solid #2563eb;
}

.card.ingresos { border-left-color: #16a34a; }
.card.gastos { border-left-color: #dc2626; }
.card.saldo { border-left-color: #f59e0b; }

.card h3 {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.card p {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1e293b;
}

/* =========================================
   Módulo de Reportes - Diseño Administrativo
========================================= */
.admin-header {
    border-bottom: 2px solid #111827; /* Línea negra sólida */
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.admin-header h2 {
    color: #111827; /* Casi negro */
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-header p {
    color: #4b5563; /* Gris medio */
    margin: 4px 0 0 0;
    font-size: 0.9rem;
}

.financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.kpi-card {
    background-color: #ffffff;
    border: 1px solid #d1d5db; /* Borde gris claro */
    border-radius: 4px; /* Bordes apenas redondeados, más formales */
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Sombra muy sutil */
}

/* Tarjeta destacada para el Saldo */
.kpi-highlight {
    background-color: #f9fafb;
    border: 1px solid #6b7280; /* Borde más oscuro para resaltar sin colores */
}

.kpi-label {
    color: #374151;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-divider {
    border-top: 1px solid #e5e7eb;
    margin: 12px 0;
}

.kpi-value {
    color: #111827;
    font-size: 1.85rem;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Tipografía limpia */
    margin: 0;
}

@media print {
    body * {
        visibility: hidden;
    }
    #printableEstadoCuenta, #printableEstadoCuenta * {
        visibility: visible;
    }
    #printableEstadoCuenta {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 15px;
    }
    .modal {
        position: static;
        background: none;
    }
    .modal-content {
        box-shadow: none;
        border: none;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Alineación limpia para los botones de la tabla de clientes */
.data-table td:last-child {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Estilo y efecto de sombra exclusivo para el botón Estado de Cuenta */
.btn-estado-cuenta {
    background-color: #111827;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out; /* Hace que la transición de la sombra sea suave */
}

.btn-estado-cuenta:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); /* Efecto sombra elegante */
    transform: translateY(-1px); /* Sube un pixel sutilmente al pasar el cursor */
}