/* =========================================
   CONFIGURACIÓN GENERAL
========================================= */

:root {
    --color-principal: #2563eb;
    --color-principal-hover: #1d4ed8;

    --color-fondo: #f5f7fb;
    --color-blanco: #ffffff;

    --color-texto: #172033;
    --color-texto-secundario: #64748b;

    --color-borde: #e2e8f0;

    --color-ingreso: #16a34a;
    --color-gasto: #dc2626;

    --sombra: 0 8px 25px rgba(15, 23, 42, 0.07);
}


/* =========================================
   BODY
========================================= */

body {
    margin: 0;
    padding: 0;

    background-color: var(--color-fondo);

    color: var(--color-texto);

    font-family: Arial, Helvetica, sans-serif;
}


/* =========================================
   NAVBAR
========================================= */

.navbar-principal {
    background-color: #111827;

    padding: 15px 0;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
}


.navbar-brand {
    font-size: 1.2rem;
}


.navbar-brand i {
    margin-right: 6px;
}


.navbar-nav {
    gap: 5px;
}


.nav-link {
    color: #d1d5db !important;

    padding: 8px 12px !important;

    border-radius: 7px;

    transition: 0.2s;
}


.nav-link:hover {
    background-color: #1f2937;

    color: #ffffff !important;
}


.nav-link.active {
    background-color: var(--color-principal);

    color: #ffffff !important;
}


/* =========================================
   ENCABEZADO
========================================= */

.encabezado-dashboard {
    background: linear-gradient(
        135deg,
        #111827 0%,
        #1e3a8a 100%
    );

    color: white;

    padding: 70px 0;
}


.texto-pequeno {
    color: #60a5fa;

    font-size: 0.8rem;

    font-weight: 700;

    letter-spacing: 1.5px;

    margin-bottom: 10px;
}


.encabezado-dashboard h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);

    font-weight: 800;

    line-height: 1.1;

    margin-bottom: 20px;
}


.encabezado-dashboard h1 span {
    color: #60a5fa;
}


.descripcion {
    color: #d1d5db;

    max-width: 650px;

    font-size: 1.05rem;

    line-height: 1.7;

    margin-bottom: 0;
}


/* =========================================
   BOTONES
========================================= */

.btn-principal {
    background-color: var(--color-principal);

    color: white;

    border: none;

    padding: 11px 18px;

    font-weight: 600;
}


.btn-principal:hover {
    background-color: var(--color-principal-hover);

    color: white;
}


.btn-outline-light {
    padding: 10px 18px;

    font-weight: 600;
}


.btn-secundario {
    border: 1px solid var(--color-borde);

    background-color: white;

    color: var(--color-texto);

    padding: 9px 15px;

    font-weight: 600;
}


.btn-secundario:hover {
    background-color: #f1f5f9;

    color: var(--color-texto);
}


/* =========================================
   SECCIONES
========================================= */

.seccion-dashboard {
    padding: 45px 0 20px;
}


.seccion-movimientos {
    padding: 30px 0;
}


.seccion-acciones {
    padding: 25px 0 60px;
}


/* =========================================
   TARJETAS FINANCIERAS
========================================= */

.tarjeta-financiera {
    background-color: var(--color-blanco);

    border: 1px solid var(--color-borde);

    border-radius: 14px;

    padding: 25px;

    display: flex;

    align-items: center;

    gap: 18px;

    box-shadow: var(--sombra);

    height: 100%;

    transition: transform 0.2s, box-shadow 0.2s;
}


.tarjeta-financiera:hover {
    transform: translateY(-3px);

    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10);
}


.icono-tarjeta {
    width: 55px;
    height: 55px;

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 1.5rem;

    flex-shrink: 0;
}


.tarjeta-ingresos .icono-tarjeta {
    background-color: #dcfce7;

    color: var(--color-ingreso);
}


.tarjeta-gastos .icono-tarjeta {
    background-color: #fee2e2;

    color: var(--color-gasto);
}


.tarjeta-saldo .icono-tarjeta {
    background-color: #dbeafe;

    color: var(--color-principal);
}


.titulo-tarjeta {
    color: var(--color-texto-secundario);

    margin: 0 0 5px;

    font-size: 0.9rem;

    font-weight: 600;
}


.tarjeta-financiera h2 {
    margin: 0;

    font-size: 1.7rem;

    font-weight: 800;
}


.tarjeta-financiera small {
    color: #94a3b8;
}


/* =========================================
   ENCABEZADO DE SECCIONES
========================================= */

.encabezado-seccion {
    display: flex;

    align-items: end;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.encabezado-seccion h2 {
    margin: 0 0 5px;

    font-size: 1.7rem;

    font-weight: 800;
}


.encabezado-seccion p {
    color: var(--color-texto-secundario);

    margin: 0;
}


/* =========================================
   TABLA
========================================= */

.tabla-contenedor {
    background-color: white;

    border: 1px solid var(--color-borde);

    border-radius: 14px;

    overflow: hidden;

    box-shadow: var(--sombra);
}


.tabla-movimientos {
    margin: 0;
}


.tabla-movimientos thead {
    background-color: #f8fafc;
}


.tabla-movimientos th {
    color: #475569;

    font-size: 0.85rem;

    font-weight: 700;

    padding: 16px 20px;

    white-space: nowrap;
}


.tabla-movimientos td {
    padding: 17px 20px;

    border-color: var(--color-borde);

    color: #475569;
}


.tabla-movimientos tbody tr:hover {
    background-color: #f8fafc;
}


.categoria {
    background-color: #f1f5f9;

    color: #475569;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 0.8rem;

    font-weight: 600;
}


/* =========================================
   TIPOS DE MOVIMIENTO
========================================= */

.badge-ingreso,
.badge-gasto {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 6px 10px;

    border-radius: 20px;

    font-size: 0.8rem;

    font-weight: 700;
}


.badge-ingreso {
    background-color: #dcfce7;

    color: #15803d;
}


.badge-gasto {
    background-color: #fee2e2;

    color: #b91c1c;
}


.cantidad {
    font-weight: 700;

    white-space: nowrap;
}


.cantidad.ingreso {
    color: var(--color-ingreso);
}


.cantidad.gasto {
    color: var(--color-gasto);
}


/* =========================================
   TARJETAS DE ACCIONES
========================================= */

.tarjeta-accion {
    background-color: white;

    border: 1px solid var(--color-borde);

    border-radius: 14px;

    padding: 25px;

    display: flex;

    gap: 18px;

    align-items: flex-start;

    height: 100%;

    box-shadow: var(--sombra);
}


.icono-accion {
    width: 50px;
    height: 50px;

    background-color: #dcfce7;

    color: var(--color-ingreso);

    border-radius: 10px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 1.4rem;

    flex-shrink: 0;
}


.icono-accion.icono-gasto {
    background-color: #fee2e2;

    color: var(--color-gasto);
}


.contenido-accion h3 {
    font-size: 1.15rem;

    font-weight: 700;

    margin-bottom: 7px;
}


.contenido-accion p {
    color: var(--color-texto-secundario);

    margin-bottom: 12px;
}


.contenido-accion a {
    color: var(--color-principal);

    text-decoration: none;

    font-weight: 700;
}


.contenido-accion a:hover {
    color: var(--color-principal-hover);
}


/* =========================================
   FOOTER
========================================= */

.footer {
    background-color: #111827;

    color: #9ca3af;

    padding: 25px 0;

    font-size: 0.9rem;
}


.footer strong {
    color: white;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 991px) {

    .encabezado-dashboard {
        padding: 55px 0;
    }

    .encabezado-dashboard h1 {
        font-size: 2.8rem;
    }

}


@media (max-width: 767px) {

    .encabezado-dashboard {
        padding: 45px 0;
    }


    .encabezado-dashboard h1 {
        font-size: 2.4rem;
    }


    .descripcion {
        font-size: 1rem;
    }


    .encabezado-dashboard .btn {
        margin-top: 10px;

        width: 100%;
    }


    .encabezado-seccion {
        align-items: flex-start;

        flex-direction: column;
    }


    .encabezado-seccion h2 {
        font-size: 1.5rem;
    }


    .tarjeta-financiera {
        padding: 20px;
    }


    .tarjeta-financiera h2 {
        font-size: 1.5rem;
    }


    .tabla-movimientos {
        min-width: 750px;
    }


    .tarjeta-accion {
        padding: 20px;
    }


    .footer {
        text-align: center;
    }


    .footer .text-md-end {
        text-align: center !important;

        margin-top: 10px;
    }

}

/* ==================================================
   NUEVO DISEÑO - CONTROL DE GASTOS
   Estilo acogedor y responsive
================================================== */


/* ==================================================
   CUERPO GENERAL
================================================== */

body {
    background-color: #f4f7f6;
    color: #24323d;
    font-family: Arial, Helvetica, sans-serif;
}


/* ==================================================
   NAVBAR
================================================== */

.navbar-principal {
    background: linear-gradient(135deg, #173f4f, #236477);
    padding: 14px 0;
    box-shadow: 0 4px 15px rgba(23, 63, 79, 0.15);
}


/* Logo */

.navbar-principal .navbar-brand {
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
}

.navbar-principal .navbar-brand i {
    font-size: 1.35rem;
}


/* Lista */

.navbar-principal .navbar-nav {
    list-style: none !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}


/* Enlaces */

.navbar-principal .nav-link {
    color: rgba(255, 255, 255, 0.88) !important;
    text-decoration: none !important;
    border-radius: 8px;
    padding: 9px 12px !important;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}


/* Hover */

.navbar-principal .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
}


/* Página actual */

.navbar-principal .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.18);
}


/* Botón menú móvil */

.navbar-principal .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
}

.navbar-principal .navbar-toggler:focus {
    box-shadow: none;
}


/* ==================================================
   CONTENIDO DE GASTOS
================================================== */

.formulario-gasto {
    max-width: 750px;
    margin-top: 45px;
    margin-bottom: 60px;
}


/* Texto pequeño */

.formulario-gasto .texto-pequeno {
    color: #3b8c9e;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 8px;
}


/* Título */

.titulo-formulario {
    color: #20313b;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}


/* Descripción */

.descripcion-formulario {
    color: #6c7a82;
    font-size: 1rem;
    margin-bottom: 25px;
}


/* ==================================================
   TARJETA DEL FORMULARIO
================================================== */

.tarjeta-formulario {
    background-color: #ffffff;
    border: 1px solid #e1e9e7;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(35, 72, 82, 0.08);
}


/* ==================================================
   CAMPOS
================================================== */

.formulario-gasto .form-label {
    color: #30434d;
    margin-bottom: 7px;
}


.formulario-gasto .form-control,
.formulario-gasto .form-select {
    border: 1px solid #d7e2df;
    border-radius: 9px;
    padding: 11px 13px;
    color: #24323d;
    background-color: #ffffff;
    transition: all 0.2s ease;
}


/* Cuando seleccionas un campo */

.formulario-gasto .form-control:focus,
.formulario-gasto .form-select:focus {
    border-color: #3b8c9e;
    box-shadow: 0 0 0 3px rgba(59, 140, 158, 0.12);
}


/* Símbolo de pesos */

.formulario-gasto .input-group-text {
    background-color: #eef6f4;
    border: 1px solid #d7e2df;
    color: #3b6f7b;
    font-weight: 600;
}


/* ==================================================
   BOTÓN REGISTRAR
================================================== */

.btn-registrar-gasto {
    background-color: #d86a5c;
    color: #ffffff !important;
    border: none;
    border-radius: 9px;
    padding: 12px 18px;
    font-weight: 600;
    transition: all 0.2s ease;
}


.btn-registrar-gasto:hover {
    background-color: #bd5549;
    color: #ffffff !important;
    transform: translateY(-1px);
}


.btn-registrar-gasto:active {
    transform: translateY(0);
}


/* ==================================================
   MENSAJES
================================================== */

.mensaje-formulario {
    margin-top: 20px;
}


.formulario-gasto .text-danger {
    font-size: 0.85rem;
    color: #c94b4b !important;
}


/* ==================================================
   FOOTER
================================================== */

.footer {
    background-color: #173f4f;
    color: rgba(255, 255, 255, 0.85);
    padding: 25px 0;
    margin-top: 30px;
}


.footer strong {
    color: #ffffff;
}


/* ==================================================
   RESPONSIVE - TABLETS
================================================== */

@media (max-width: 991px) {

    .navbar-principal .navbar-nav {
        margin-top: 15px;
        padding-bottom: 5px;
        align-items: stretch;
    }

    .navbar-principal .nav-link {
        padding: 10px 12px !important;
    }

}


/* ==================================================
   RESPONSIVE - CELULARES
================================================== */

@media (max-width: 576px) {

    .navbar-principal {
        padding: 12px 0;
    }

    .navbar-principal .navbar-brand {
        font-size: 1.05rem;
    }

    .navbar-principal .navbar-nav {
        gap: 2px;
    }

    .navbar-principal .nav-link {
        padding: 10px !important;
    }


    .formulario-gasto {
        margin-top: 25px;
        margin-bottom: 40px;
    }


    .titulo-formulario {
        font-size: 1.65rem;
    }


    .descripcion-formulario {
        font-size: 0.95rem;
    }


    .tarjeta-formulario {
        padding: 20px;
        border-radius: 14px;
    }


    .btn-registrar-gasto {
        padding: 12px;
    }

}

/* ==========================================
   AJUSTE DEL MENÚ PRINCIPAL
========================================== */

.navbar-principal .navbar-nav {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.navbar-principal .nav-item {
    list-style: none;
}

.navbar-principal .nav-link {
    min-width: 105px;
    justify-content: center;
    text-align: center;
    padding: 9px 14px !important;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 7px;
}

/* Evita que aparezca el botón hamburguesa en escritorio
   si Bootstrap está correctamente cargado */

@media (min-width: 992px) {

    .navbar-principal .navbar-toggler {
        display: none;
    }

}


/* ==========================================
   FORMULARIO MÁS EQUILIBRADO EN ESCRITORIO
========================================== */

.formulario-gasto {
    width: 100%;
    max-width: 1050px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 45px;
    margin-bottom: 60px;
}


/* La tarjeta ocupa todo el espacio disponible */

.tarjeta-formulario {
    width: 100%;
}


/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 991px) {

    .navbar-principal .navbar-nav {
        width: 100%;
        align-items: stretch;
        margin-top: 15px;
        gap: 3px;
    }

    .navbar-principal .nav-link {
        width: 100%;
        justify-content: flex-start;
    }

}


@media (max-width: 576px) {

    .formulario-gasto {
        width: 100%;
        margin-top: 25px;
        margin-bottom: 40px;
    }

    .tarjeta-formulario {
        padding: 20px;
    }

}