/* ============================================
   SISTEMA FINANCIERO - ESTILOS MODERNOS
   ============================================ */

/* Variables de Color */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Reset y Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* ============================================
   PÁGINA DE LOGIN
   ============================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 30px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ============================================
   LAYOUT PRINCIPAL CON SIDEBAR
   ============================================ */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark);
    color: var(--white);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    color: var(--gray);
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s;
}

.menu-item a:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 30px;
}

.menu-item a.active {
    background: var(--primary);
    border-left: 4px solid var(--white);
}

.menu-icon {
    margin-right: 15px;
    font-size: 18px;
}

/* Contenido Principal */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    background: var(--light);
    min-height: 100vh;
}

/* ============================================
   DASHBOARD - TARJETAS
   ============================================ */
.dashboard-header {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.dashboard-header h1 {
    color: var(--primary);
    font-size: 32px;
    margin-bottom: 10px;
}

.dashboard-header p {
    color: var(--gray);
}

/* Grid de Tarjetas */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
    margin-bottom: 20px;
}

.card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark);
}

.card p {
    color: var(--gray);
    font-size: 14px;
    line-height: 1.6;
}

/* Tarjetas de Estadísticas */
.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
}

.stat-card .card-icon {
    background: rgba(255, 255, 255, 0.2);
}

.stat-card h3 {
    color: var(--white);
    font-size: 36px;
    font-weight: bold;
}

.stat-card p {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--secondary);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
}

.btn-warning:hover {
    background: #d97706;
}

.print-btn {
    background: var(--secondary);
}

.print-btn:hover {
    background: #059669;
}

/* ============================================
   TABLAS
   ============================================ */
.table-container {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.titulo {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 20px;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    background: var(--primary);
    color: var(--white);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #1e40af;
}

td {
    padding: 15px;
    border: 1px solid var(--light);
}

tr:hover {
    background: var(--light);
}

td a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

td a:hover {
    text-decoration: underline;
}

/* ============================================
   MODALES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--white);
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 25px;
}

.close {
    color: var(--gray);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger);
}

/* ============================================
   NAV SIMPLE (para páginas antiguas)
   ============================================ */
nav {
    background: var(--dark);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav ul li {
    display: inline;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   BOTONES DE ACCIÓN
   ============================================ */
.botones-accion {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        padding: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header h1 {
        font-size: 24px;
    }

    .botones-accion {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #2563eb;
}

/* ============================================
   IMPRESIÓN
   ============================================ */
@media print {
    .sidebar,
    .btn,
    .acciones,
    nav,
    .botones-accion {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }

    body {
        background: white;
    }

    table, th, td {
        border: 1px solid black !important;
    }
}
