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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== NAVBAR ========== */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #3498db;
}

.nav-right {
    margin-left: auto;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* ========== BOTONES ========== */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.btn-small.danger {
    color: #e74c3c;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* ========== ALERTAS ========== */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ========== FORMULARIOS ========== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* ========== AUTENTICACIÓN ========== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
}

.auth-link a {
    color: #3498db;
    text-decoration: none;
}

/* ========== DASHBOARD ========== */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h2 {
    font-size: 2rem;
    color: #2c3e50;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.dashboard-finanzas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.finanza-item h3 {
    margin-bottom: 0.5rem;
}

.finanza-item p {
    font-size: 1.45rem;
    font-weight: 700;
}

.finanza-ingresos p {
    color: #1f7a42;
}

.finanza-egresos p {
    color: #b33a2e;
}

.finanza-ahorro p {
    color: #2a9d4b;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.tareas-list {
    list-style: none;
}

.tarea-item {
    padding: 1rem;
    border-left: 4px solid #3498db;
    margin-bottom: 0.5rem;
    background-color: #f9f9f9;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tarea-item.prioridad-1 {
    border-left-color: #e74c3c;
}

.tarea-item.prioridad-2 {
    border-left-color: #f39c12;
}

.tarea-item.prioridad-3 {
    border-left-color: #95a5a6;
}

.tarea-item small {
    display: block;
    color: #7f8c8d;
    font-size: 0.85rem;
}

.estado {
    background-color: #ecf0f1;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.acciones-tarea {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tarea-bloque {
    margin-top: 1.25rem;
}

.tarea-bloque-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ========== CALENDARIO ========== */
.calendario-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.calendario-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-nav {
    padding: 0.5rem 1rem;
    background-color: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: #2c3e50;
}

.btn-nav:hover {
    background-color: #d5dbdb;
}

.mes-año {
    font-weight: bold;
    font-size: 1.1rem;
}

.calendario-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.weekday-cell {
    text-align: center;
    font-weight: 700;
    color: #4b5b6a;
    background-color: #eef2f5;
    border: 1px solid #dde4ea;
    border-radius: 6px;
    padding: 0.45rem 0.25rem;
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    min-height: 500px;
}

.calendario-day {
    background-color: #f9f9f9;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    padding: 0.75rem;
    min-height: 120px;
    transition: background-color 0.3s;
}

.calendario-day-empty {
    min-height: 120px;
    border-radius: 8px;
    background: repeating-linear-gradient(
        45deg,
        #f5f7f9,
        #f5f7f9 8px,
        #edf1f4 8px,
        #edf1f4 16px
    );
    border: 1px dashed #d6dee5;
}

.calendario-day.has-tareas {
    background-color: #e8f4f8;
    border-color: #3498db;
}

.dia-numero {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.tareas-dia {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tarea-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    background-color: #3498db;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tarea-badge.prioridad-1 {
    background-color: #e74c3c;
}

.tarea-badge.prioridad-2 {
    background-color: #f39c12;
}

.tarea-badge small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.9;
}

/* ========== TABLAS ========== */
.tareas-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.tareas-table thead {
    background-color: #ecf0f1;
}

.tareas-table th {
    padding: 1rem;
    text-align: left;
    font-weight: bold;
    color: #2c3e50;
}

.tareas-table td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.tareas-table tr:hover {
    background-color: #f9f9f9;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-ahorro {
    background-color: #e8f7e9;
    color: #1f7a42;
}

.estado-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    background-color: #ecf0f1;
    font-size: 0.85rem;
}

/* ========== UTILIDADES ========== */
.text-muted {
    color: #7f8c8d;
    font-style: italic;
}

/* ========== PRESUPUESTO ========== */
.presupuesto-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.presupuesto-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.presupuesto-header p {
    color: #5f6c79;
}

.presupuesto-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.presupuesto-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.presupuesto-notas {
    grid-column: 1 / -1;
}

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

.resumen-item h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.resumen-item p {
    font-size: 1.35rem;
    font-weight: 700;
}

.monto-entrada {
    color: #1f7a42;
}

.monto-salida {
    color: #b33a2e;
}

.monto-saldo {
    color: #1e6091;
}

.monto-ahorro {
    color: #2a9d4b;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.calendario-pagos-grid {
    margin-top: 1rem;
}

.calendario-day.has-pagos {
    border-color: #f39c12;
    background-color: #fff7ea;
}

.pago-total-dia {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #8a5a00;
}

.pago-total-pagado {
    color: #1f7a42;
}

.mov-total-dia {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.mov-total-entrada {
    color: #1f7a42;
}

.mov-total-salida {
    color: #b33a2e;
}

.pago-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    border-radius: 3px;
    background-color: #f39c12;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pago-badge small {
    font-size: 0.7rem;
    opacity: 0.95;
}

.mov-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    border-radius: 3px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mov-badge.entrada {
    background-color: #1f7a42;
}

.mov-badge.salida {
    background-color: #b33a2e;
}

.mov-badge.ahorro {
    background-color: #2a9d4b;
}

.mov-badge small {
    font-size: 0.7rem;
    opacity: 0.95;
}

.pago-action-form {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pago-action-form input[type="date"] {
    border: none;
    border-radius: 3px;
    padding: 0.25rem;
    font-size: 0.72rem;
}

.btn-pay {
    border: none;
    border-radius: 3px;
    background-color: #1f7a42;
    color: #fff;
    cursor: pointer;
}

footer {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    border-top: 1px solid #ecf0f1;
    margin-top: 3rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-finanzas {
        grid-template-columns: 1fr;
    }

    .calendario-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .tareas-table {
        font-size: 0.85rem;
    }

    .tareas-table th,
    .tareas-table td {
        padding: 0.5rem;
    }

    .presupuesto-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .presupuesto-header-actions {
        width: 100%;
    }
}
