/* Control de Gastos - Estilos Simplificados */
:root {
    --primary: #5b6dff;
    --secondary: #ff7a59;
    --background: #f4f7fb;
    --card-bg: #ffffff;
    --text: #233044;
    --muted: #6b7a99;
    --danger: #ff4757;
    --border: #e0e6ed;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #5b6dff, #7a5bff);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
}

.logo i {
    font-size: 2rem;
}

.user-info {
    color: #fff;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.9rem;
}

.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Banner Demo */
.demo-banner {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 15px rgba(254, 202, 87, 0.3);
    border-left: 4px solid #fff;
}

.demo-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.demo-content {
    flex: 1;
    color: #fff;
}

.demo-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.demo-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.95;
}

.demo-content a {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
}

.demo-content a:hover {
    opacity: 0.8;
}

/* Resumen de Gastos */
.resumen-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.resumen-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #fff;
}

.resumen-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.35);
}

.resumen-card.resumen-deuda {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.25);
}

.resumen-card.resumen-deuda:hover {
    box-shadow: 0 12px 32px rgba(255, 107, 107, 0.35);
}

.resumen-card.resumen-pago {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    box-shadow: 0 8px 24px rgba(254, 202, 87, 0.25);
}

.resumen-card.resumen-pago:hover {
    box-shadow: 0 12px 32px rgba(254, 202, 87, 0.35);
}

.resumen-card.resumen-prestamo {
    background: linear-gradient(135deg, #48cae4 0%, #0077b6 100%);
    box-shadow: 0 8px 24px rgba(72, 202, 228, 0.25);
}

.resumen-card.resumen-prestamo:hover {
    box-shadow: 0 12px 32px rgba(72, 202, 228, 0.35);
}

.resumen-card.resumen-saldo {
    background: linear-gradient(135deg, #20bf6b 0%, #01baef 100%);
    box-shadow: 0 8px 24px rgba(32, 191, 107, 0.25);
}

.resumen-card.resumen-saldo:hover {
    box-shadow: 0 12px 32px rgba(32, 191, 107, 0.35);
}

.resumen-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    backdrop-filter: blur(10px);
}

.resumen-content h3 {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.resumen-valor {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(91, 109, 255, 0.05), rgba(122, 91, 255, 0.05));
}

.card-header h1 {
    font-size: 1.5rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header h1 i {
    color: var(--primary);
}

/* Banner Motivacional */
.motivacion-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    border-left: 4px solid #fff;
}

.motivacion-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.motivacion-content {
    flex: 1;
    color: #fff;
}

.motivacion-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.motivacion-content h3 i {
    color: #feca57;
}

.motivacion-content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.95;
}

.motivacion-content strong {
    color: #feca57;
    font-weight: 700;
}

.table-container {
    overflow-x: auto;
}

.gastos-table {
    width: 100%;
    border-collapse: collapse;
}

.gastos-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.gastos-table th {
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #fff;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    white-space: nowrap;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gastos-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.gastos-table tbody tr {
    transition: background 0.2s ease;
}

.gastos-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(91, 109, 255, 0.05), rgba(122, 91, 255, 0.05));
}

.gastos-table tfoot {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    font-weight: 600;
}

.total-row td {
    padding: 1.5rem 1rem;
    border-top: 2px solid var(--border);
}

.acciones {
    display: flex;
    gap: 0.5rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7a5bff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(91, 109, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4a5eef, #6a4bef);
    box-shadow: 0 6px 20px rgba(91, 109, 255, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: #fff;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #f0f0f0;
}

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

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(91, 109, 255, 0.1), rgba(122, 91, 255, 0.1));
}

.modal-header h2 {
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
}

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

.form-gasto {
    padding: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 109, 255, 0.1);
    transform: translateY(-1px);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }

    .user-info {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .demo-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem 1.5rem;
    }

    .demo-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .demo-content h3 {
        font-size: 1rem;
        justify-content: center;
    }

    .demo-content p {
        font-size: 0.9rem;
    }

    .resumen-section {
        grid-template-columns: 1fr;
    }

    .resumen-card {
        padding: 1.2rem;
    }

    .resumen-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .resumen-valor {
        font-size: 1.5rem;
    }

    .motivacion-banner {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem 1.5rem;
        margin: 1rem;
    }

    .motivacion-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .motivacion-content h3 {
        font-size: 1rem;
        justify-content: center;
    }

    .motivacion-content p {
        font-size: 0.9rem;
    }

    .gastos-table {
        font-size: 0.85rem;
    }
    
    .gastos-table th,
    .gastos-table td {
        padding: 0.5rem;
    }
    
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
}
