

/*  CONTENEDOR PRINCIPAL DE CARDS */


.cards-totales {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
    padding: 0 8px;
    margin-bottom: 20px;
}



/*  CARD BASE*/


.card-total {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card-total:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}



/*  BARRA LATERAL DECORATIVA*/


.card-total::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 14px 0 0 14px;
}



/*  ICONO CIRCULAR */


.card-total-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}



/*  TEXTOS */


.card-total-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    opacity: 0.7;
}

.card-total-monto {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    color: #1a1a2e;
}



/*  DECORACIÓN DE FONDO (CÍRCULO SUTIL) */

.card-total::after {
    content: '';
    position: absolute;
    right: -15px;
    top: -15px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.06;
    z-index: 0;
}


/*  VARIANTE: FACTURADO (verde esmeralda) */


.card-total--facturado::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.card-total--facturado .card-total-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.card-total--facturado .card-total-label {
    color: #059669;
}

.card-total--facturado::after {
    background: #10b981;
}



/*  VARIANTE: PAGADO (azul) */


.card-total--pagado::before {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.card-total--pagado .card-total-icon {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.card-total--pagado .card-total-label {
    color: #2563eb;
}

.card-total--pagado::after {
    background: #3b82f6;
}


/*  VARIANTE: DEUDA (rojo/coral) */


.card-total--deuda::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.card-total--deuda .card-total-icon {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.card-total--deuda .card-total-label {
    color: #dc2626;
}

.card-total--deuda::after {
    background: #ef4444;
}



/*  VARIANTE: IVA (naranja/ámbar)  */


.card-total--iva::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.card-total--iva .card-total-icon {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.card-total--iva .card-total-label {
    color: #d97706;
}

.card-total--iva::after {
    background: #f59e0b;
}


/*  RESPONSIVE */


/* Tablets (2 columnas) */
@media (max-width: 992px) {
    .cards-totales {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

/* Móviles (1 columna) */
@media (max-width: 576px) {
    .cards-totales {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 4px;
    }

    .card-total {
        padding: 16px 18px;
        border-radius: 12px;
    }

    .card-total-monto {
        font-size: 20px;
    }

    .card-total-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-bottom: 10px;
    }
}

/* Pantallas grandes (más espaciado) */
@media (min-width: 1400px) {
    .cards-totales {
        gap: 20px;
    }

    .card-total {
        padding: 24px 26px;
    }

    .card-total-monto {
        font-size: 28px;
    }
}




/******************************************************************************/
/*                                                                            */
/*   FILTROS BAR - CSS reutilizable para barras de filtros                    */
/*   Usar con clase .filtros-bar en cualquier sección                         */
/*                                                                            */
/******************************************************************************/


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  CONTENEDOR PRINCIPAL                                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */

.filtros-bar {
    background: #fff;
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.filtros-bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #10b981, #059669);
    border-radius: 14px 0 0 14px;
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  VARIANTES DE COLOR PARA LA BARRA LATERAL                                 */
/*  Usar: <div class="filtros-bar filtros-bar--azul">                        */
/* ═══════════════════════════════════════════════════════════════════════════ */

.filtros-bar--azul::before {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.filtros-bar--azul .filtro-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.filtros-bar--azul .filtro-grupo select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filtros-bar--rojo::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.filtros-bar--rojo .filtro-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.filtros-bar--rojo .filtro-grupo select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.filtros-bar--naranja::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.filtros-bar--naranja .filtro-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.filtros-bar--naranja .filtro-grupo select:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.filtros-bar--violeta::before {
    background: linear-gradient(180deg, #8b5cf6, #7c3aed);
}

.filtros-bar--violeta .filtro-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.filtros-bar--violeta .filtro-grupo select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  GRUPO DE FILTRO (label + select/input)                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}

.filtro-grupo label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  SELECT PERSONALIZADO                                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */

.filtro-grupo select {
    padding: 9px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.filtro-grupo select:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.filtro-grupo select:hover {
    border-color: #cbd5e1;
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  INPUT DENTRO DE FILTROS (para fecha, texto, etc)                         */
/* ═══════════════════════════════════════════════════════════════════════════ */

.filtro-grupo input[type="text"],
.filtro-grupo input[type="date"],
.filtro-grupo input[type="number"] {
    padding: 9px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a2e;
    background: #f8fafc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filtro-grupo input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.filtro-grupo input:hover {
    border-color: #cbd5e1;
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  BOTÓN APLICAR                                                             */
/* ═══════════════════════════════════════════════════════════════════════════ */

.filtro-btn {
    padding: 9px 28px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.3px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
}

.filtro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.filtro-btn:active {
    transform: translateY(0);
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  BOTÓN SECUNDARIO (para acciones extra como "Limpiar", "Exportar")        */
/* ═══════════════════════════════════════════════════════════════════════════ */

.filtro-btn--secundario {
    background: transparent;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.filtro-btn--secundario:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: none;
    transform: translateY(-1px);
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/*  RESPONSIVE                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
    .filtros-bar {
        gap: 12px;
        padding: 16px 20px;
    }

    .filtro-grupo {
        min-width: 120px;
    }
}

@media (max-width: 576px) {
    .filtros-bar {
        padding: 16px 18px;
        flex-direction: column;
        align-items: stretch;
    }

    .filtro-grupo {
        min-width: 100%;
    }

    .filtro-btn {
        width: 100%;
        justify-content: center;
    }
}