/* =========================================================
   VIZIUNEAI - FACTURACIÓN
   ========================================================= */


/* =========================================================
   RESET
   ========================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin-top: 4%;
    font-family: Arial, Helvetica, sans-serif;
    background: #07111f;
    color: #ffffff;
    line-height: 1.5;
}


/* =========================================================
   ENLACES
   ========================================================= */

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   CABECERA
   ========================================================= */

.facturacion-header {
    width: 100%;
    padding: 30px 20px;
}

.cabecera-contenido {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.cabecera-contenido h1 {
    margin-bottom: 5px;

    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.5px;

    color: #ffffff;
}

.cabecera-contenido p {
    font-size: 15px;
    color: #8fa3b8;
}


/* =========================================================
   ACCIONES CABECERA
   ========================================================= */

.cabecera-acciones {
    display: flex;
    align-items: center;
    gap: 12px;
}


/* =========================================================
   BOTONES
   ========================================================= */

.boton-principal,
.boton-secundario {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 0 18px;

    border-radius: 8px;

    font-size: 14px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.boton-principal {
    background: #00f3ff;
    color: #04101c;

    border: 1px solid #00f3ff;

    box-shadow:
        0 0 15px rgba(0, 243, 255, 0.12);
}

.boton-principal:hover {
    transform: translateY(-1px);

    box-shadow:
        0 0 22px rgba(0, 243, 255, 0.25);
}

.boton-secundario {
    background: rgba(255, 255, 255, 0.03);
    color: #d8e5f0;

    border: 1px solid rgba(255, 255, 255, 0.12);
}

.boton-secundario:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(0, 243, 255, 0.35);
}


/* =========================================================
   CONTENEDOR PRINCIPAL
   ========================================================= */

.facturacion-contenedor {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto;
    padding: 35px 20px 60px;
}


/* =========================================================
   ESTADÍSTICAS
   ========================================================= */

.estadisticas {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 30px;
}

.estadistica {
    min-height: 120px;

    padding: 22px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    background: rgba(12, 27, 45, 0.9);

    border: 1px solid rgba(0, 243, 255, 0.12);
    border-radius: 12px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.18);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

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

    border-color: rgba(0, 243, 255, 0.3);
}

.estadistica-titulo {
    font-size: 13px;
    color: #8fa3b8;
}

.estadistica strong {
    font-size: 28px;
    font-weight: 700;

    color: #00f3ff;
}


/* =========================================================
   FILTROS
   ========================================================= */

.filtros {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        220px;

    gap: 18px;

    margin-bottom: 25px;

    padding: 20px;

    background: rgba(12, 27, 45, 0.75);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.campo-busqueda,
.campo-filtro {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filtros label {
    font-size: 13px;
    font-weight: 600;

    color: #9db0c2;
}

.filtros input,
.filtros select {
    width: 100%;
    height: 44px;

    padding: 0 13px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;

    outline: none;

    background: #091827;
    color: #ffffff;

    font-size: 14px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.filtros input::placeholder {
    color: #64788c;
}

.filtros input:focus,
.filtros select:focus {
    border-color: rgba(0, 243, 255, 0.55);

    box-shadow:
        0 0 0 3px rgba(0, 243, 255, 0.08);
}


/* =========================================================
   CONTENEDOR TABLA
   ========================================================= */

.tabla-contenedor {
    overflow: hidden;

    background: rgba(12, 27, 45, 0.9);

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;

    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.2);
}

.tabla-cabecera {
    min-height: 70px;

    padding: 18px 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.tabla-cabecera h2 {
    font-size: 19px;
    font-weight: 600;
}

.tabla-cabecera span {
    font-size: 13px;
    color: #7f94a8;
}


/* =========================================================
   TABLA RESPONSIVE
   ========================================================= */

.tabla-responsive {
    width: 100%;
    overflow-x: auto;
}

#tablaFacturas {
    width: 100%;
    min-width: 1050px;

    border-collapse: collapse;
}

#tablaFacturas thead {
    background: rgba(255, 255, 255, 0.025);
}

#tablaFacturas th {
    padding: 15px 16px;

    text-align: left;

    font-size: 12px;
    font-weight: 600;

    color: #7f94a8;

    text-transform: uppercase;
    letter-spacing: 0.5px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#tablaFacturas td {
    padding: 16px;

    font-size: 14px;

    color: #d9e4ed;

    border-bottom: 1px solid rgba(255, 255, 255, 0.055);

    vertical-align: middle;
}

#tablaFacturas tbody tr {
    transition:
        background 0.2s ease;
}

#tablaFacturas tbody tr:hover {
    background: rgba(0, 243, 255, 0.025);
}

#tablaFacturas tbody tr:last-child td {
    border-bottom: none;
}


/* =========================================================
   NÚMERO FACTURA
   ========================================================= */

#tablaFacturas td strong {
    color: #ffffff;
}


/* =========================================================
   ESTADOS
   ========================================================= */

.estado {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 82px;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 12px;
    font-weight: 600;
}

.estado-emitida {
    color: #64f7d3;

    background: rgba(46, 213, 157, 0.1);

    border: 1px solid rgba(46, 213, 157, 0.2);
}

.estado-borrador {
    color: #ffd166;

    background: rgba(255, 209, 102, 0.08);

    border: 1px solid rgba(255, 209, 102, 0.18);
}

.estado-anulada {
    color: #ff7f8a;

    background: rgba(255, 82, 102, 0.08);

    border: 1px solid rgba(255, 82, 102, 0.18);
}


/* =========================================================
   ACCIONES FACTURA
   ========================================================= */

.acciones-factura {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.boton-accion {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;
    padding: 0 10px;

    border-radius: 6px;

    background: rgba(255, 255, 255, 0.035);

    border: 1px solid rgba(255, 255, 255, 0.1);

    color: #b9c9d7;

    font-size: 12px;
    font-weight: 600;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.boton-accion:hover {
    background: rgba(0, 243, 255, 0.07);

    border-color: rgba(0, 243, 255, 0.3);

    color: #00f3ff;
}


/* =========================================================
   SIN FACTURAS
   ========================================================= */

.sin-facturas {
    padding: 70px 25px;

    text-align: center;
}

.sin-facturas-icono {
    margin-bottom: 15px;

    font-size: 48px;
    opacity: 0.8;
}

.sin-facturas h3 {
    margin-bottom: 8px;

    font-size: 21px;
    font-weight: 600;
}

.sin-facturas p {
    max-width: 480px;

    margin: 0 auto 25px;

    font-size: 14px;

    color: #8195a8;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

.tabla-responsive::-webkit-scrollbar {
    height: 8px;
}

.tabla-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

.tabla-responsive::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.2);

    border-radius: 10px;
}

.tabla-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.35);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .estadisticas {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 700px) {
    
    

    .facturacion-header {
        padding: 22px 15px;
    }

    .cabecera-contenido {
         margin-top: 50px;
        flex-direction: column;
        align-items: stretch;
    }

    .cabecera-contenido h1 {
        font-size: 27px;
    }

    .cabecera-contenido p {
        font-size: 14px;
    }

    .cabecera-acciones {
        width: 100%;

        display: grid;

        grid-template-columns:
            1fr 1fr;
    }

    .boton-principal,
    .boton-secundario {
        width: 100%;
        padding: 0 12px;
    }

    .facturacion-contenedor {
        padding: 25px 15px 45px;
    }

    .estadisticas {
        grid-template-columns: 1fr;

        gap: 12px;

        margin-bottom: 20px;
    }

    .estadistica {
        min-height: 95px;
        padding: 18px;
    }

    .estadistica strong {
        font-size: 25px;
    }

    .filtros {
        grid-template-columns: 1fr;

        gap: 15px;

        padding: 16px;

        margin-bottom: 20px;
    }

    .tabla-cabecera {
        padding: 16px;

        align-items: flex-start;

        gap: 10px;
    }

    .tabla-cabecera h2 {
        font-size: 17px;
    }

    .tabla-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

}


/* =========================================================
   MÓVIL PEQUEÑO
   ========================================================= */

@media (max-width: 450px) {

    .cabecera-acciones {
        grid-template-columns: 1fr;
    }

    .facturacion-contenedor {
        padding-left: 10px;
        padding-right: 10px;
    }

    .tabla-cabecera {
        flex-direction: column;
    }

}